Re: [NTG-context] error calling font.getfont() on certain fonts
On 3/29/2013 5:36 PM, Philipp Gesang wrote: · On 3/29/2013 4:29 PM, Philipp Gesang wrote: I just read that in the manual: Note that at the moment, each access to the font.fonts or call to font.getfont creates a lua table for the whole font. This process can be quite slow. In a later version of LuaTEX, this interface will change (it will start using userdata objects instead of actual tables). even then it's of not much use for context as we have more data and keep that data at the lua end so font.getfont has no benefits then For my purpose the benefit is that I can access some info about the font with the same code in all three formats. ok, *.parameters probably carries the same info but for the rest you cannot assume that the context font handler (plus the derived generic one) will limit itself to that subset; in a similar fashion there is a difference between what context keeps track of and stores and the raw loaded otf font data (in other words: cross macro package has a limited meaning) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] error calling font.getfont() on certain fonts
· > On 3/29/2013 4:29 PM, Philipp Gesang wrote: > >I just read that in the manual: > > > > Note that at the moment, each access to the font.fonts or call > > to font.getfont creates a lua table for the whole font. This > > process can be quite slow. In a later version of LuaTEX, this > > interface will change (it will start using userdata objects > > instead of actual tables). > > even then it's of not much use for context as we have more data and > keep that data at the lua end so font.getfont has no benefits then For my purpose the benefit is that I can access some info about the font with the same code in all three formats. > >Compared to Plain, Context adds a lot to the “.parameters” table. > >Sadly, writing to it doesn’t appear to change anything … > > well, why would you .. the font is already passed to tex and you > cannot change that frozen state (imagine: what would a change in > width of a char mean halfway? it woul dnot work well with the > backend) ... what would you like to change? That wasn’t 100% serious. Just me experimenting. Best Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgp82wEaxRbmI.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] error calling font.getfont() on certain fonts
On 3/29/2013 4:29 PM, Philipp Gesang wrote: I just read that in the manual: Note that at the moment, each access to the font.fonts or call to font.getfont creates a lua table for the whole font. This process can be quite slow. In a later version of LuaTEX, this interface will change (it will start using userdata objects instead of actual tables). even then it's of not much use for context as we have more data and keep that data at the lua end so font.getfont has no benefits then Compared to Plain, Context adds a lot to the “.parameters” table. Sadly, writing to it doesn’t appear to change anything … well, why would you .. the font is already passed to tex and you cannot change that frozen state (imagine: what would a change in width of a char mean halfway? it woul dnot work well with the backend) ... what would you like to change? Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] error calling font.getfont() on certain fonts
· > On 3/28/2013 6:41 PM, Philipp Gesang wrote: > >Hi all, > > > >I get an error when I run this code: > > > > \ctxlua{font.getfont( font.current() )} > > > >(Complete example below.) Oddly, whether or not this fails > >depends on the font. The issue does occur with both today’s beta > >and Tex Live. The error message is > > > > error: .../context/tex/texmf-context/tex/context/base/node-inj.lua:97: > > attempt to perform arithmetic on local 'factor' (a nil value) > > > >At the same time, in Plain the equivalent code works fine for all > >fonts. Bug or feature? > > it's a side effect ... it looks like font.getfont operates on the > table passed to tex and when you request it it probably fills in > some data (like parameters) thereby overloading / wiping out > existing stuff so after that call the data structure as context uses > (and needs) it is messed up I just read that in the manual: Note that at the moment, each access to the font.fonts or call to font.getfont creates a lua table for the whole font. This process can be quite slow. In a later version of LuaTEX, this interface will change (it will start using userdata objects instead of actual tables). > add this after the definition of > definers.read(specification,size,id) and it will probably work ok > > function font.getfont(id) > return fontdata[id] -- otherwise issues > end > > (I'll add a similar overload someplace else.) Great! Looking forward to the next update. > in context you can try this: > > \startluacode > function font.getfont(id) > return fonts.hashes.identifiers[id] > end > \stopluacode > > \starttext > > foo > \ctxlua{inspect(font.getfont( font.current()).parameters )} > bar > \stoptext > > if you comment the function overload you see the difference Compared to Plain, Context adds a lot to the “.parameters” table. Sadly, writing to it doesn’t appear to change anything … Philipp -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgpNBXV1Ijhmi.pgp Description: PGP signature ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] error calling font.getfont() on certain fonts
On 3/28/2013 6:41 PM, Philipp Gesang wrote: Hi all, I get an error when I run this code: \ctxlua{font.getfont( font.current() )} (Complete example below.) Oddly, whether or not this fails depends on the font. The issue does occur with both today’s beta and Tex Live. The error message is error: .../context/tex/texmf-context/tex/context/base/node-inj.lua:97: attempt to perform arithmetic on local 'factor' (a nil value) At the same time, in Plain the equivalent code works fine for all fonts. Bug or feature? it's a side effect ... it looks like font.getfont operates on the table passed to tex and when you request it it probably fills in some data (like parameters) thereby overloading / wiping out existing stuff so after that call the data structure as context uses (and needs) it is messed up add this after the definition of definers.read(specification,size,id) and it will probably work ok function font.getfont(id) return fontdata[id] -- otherwise issues end (I'll add a similar overload someplace else.) Best regards Philipp %% working fonts: %\setupbodyfont[iwona] %\setupbodyfont[computer-modern-unicode] %\setupbodyfont[antykwa-poltawskiego] %% ... ? %% not working: \setupbodyfont[modern] %\setupbodyfont[antykwa] %\setupbodyfont[termes] %\setupbodyfont[pagella] %\setupbodyfont[bonum] %% ... ? \starttext foo \ctxlua{font.getfont( font.current() )} bar \stoptext in context you can try this: \startluacode function font.getfont(id) return fonts.hashes.identifiers[id] end \stopluacode \starttext foo \ctxlua{inspect(font.getfont( font.current()).parameters )} bar \stoptext if you comment the function overload you see the difference Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] [***SPAM***] Location of reference
On 3/29/2013 2:20 PM, hwit...@gmail.com wrote: I've looked through about five context documents and the wiki, but can't find any good usage documentation for the \setupnotation macro. I've found specific examples of use, but not a complete usage description such as below which explains what options are available. \setupnotation[...][...=...] I'd like read what parameters it covers. Just the same as descriptions. Deep down we have 'constructions' and descriptions, enumerations and notations run on top of that. So, you can just look at descriptions (and enumerations) as they share the rendering. descriptions == constructions enumerations == constructions + numbers notations== constructions + notes the last two also run on top of counters. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] [***SPAM***] Location of reference
I've looked through about five context documents and the wiki, but can't find any good usage documentation for the \setupnotation macro. I've found specific examples of use, but not a complete usage description such as below which explains what options are available. \setupnotation[...][...=...] I'd like read what parameters it covers. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] [***SPAM***] Re: Symbols for footnotes not working
Thank you both, Wolfgang and Hans for helping me be able to use user specified footnote bulltes. I am using it in a table which I encapsulate with localfootnotes. I call \setupnotation[footnote][numberconversion=fnsym] % change footnote symbols after the startlocal, and it works in the table, but the use of symbols persists after teh stoplocalfootnotes is issued. However if I undo, just before the end as \setupnotation[footnote][numberconversion=n] then all works well and the counts carry on correctly. Thank you. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Different Horizontal Lines with Tabulate
Dnia 2013-03-29, o godz. 20:49:36 Malte Stien napisał(a): > Are any of the above possible with tabulate? I could not find > anything to achieve any of those. I am quite used to tabulate as my > table framework, so I would prefer to use that. If that's not > possible however, I'd be happy to use something else. > > Any pointers would be much appreciated. Apart from the excellent (as usual) Wolfgang's answer, I have to say that I switched to \bTABLE ... \eTABLE and (if necessary) a Lua loop. Search the archives for a thread started by me about hiding columns in a table, for example. > Thank you, > Malte. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] [***SPAM***] Re: [***SPAM***] Symbols for footnotes not working
On 3/29/2013 10:07 AM, hwit...@gmail.com wrote: It didn't work. Either with texexec or with context. Here is a simpler test case start % basic test to change footnotes bullet to a symbol % basice test to change footnotes bullet to a symbol % \setupfootnotes[rule=off] % had no affect \defineconversion[fnsym]{ \dagger,*,**,***} % etc. \setupfootnotes[conversion=fnsym, numberconversion=fnsym] % Doesn't work \setupnotation[footnote][numberconversion=fnsym,alternative=text] % Doesn't work % conversion=set fnsym or conversion=fnsymdoes't work % numberconversion=fnsym or numberconversion=set fnsym doesn't work \starttext This is a footnote\footnote{a fnote}\\ And another for clarity\footnote{the 2nd footnote.} \stoptext end the above does not produce a dagger footnote bullet (only std numbers) \defineconversion[fnsym][\dagger,*,**,***] \setupnotation [footnote] [numberconversion=fnsym, alternative=text] % <<< wrong alternative \starttext \dorecurse {10} { This has note #1. \footnote{note #1} } \stoptext There is no alternative text. I've added an extra catch for that (fallback to 'left'). - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Different Horizontal Lines with Tabulate
Am 29.03.2013 um 10:49 schrieb Malte Stien : > Hello, > > I have a table in which I have to group a number of rows together. Let's say > I have a table with two columns, the first is an item ID and the second a > multi-line description for that item. Say I have ten items in the table and I > need to group Item 1 and 2, 3 and 4, 5 and 6 and so on. Due to the > description being quite lengthy in some cases, I would like to use some sort > of horizontal rule between items. It seems I have to following options: > > 1. Using horizontal rules of two different thicknesses (eg. thicker between > groups and thinner between items within the same group) > 2. Using horizontal rules of two different colour (eg. black between groups > and a light grey between items within the same group) > 3. Using horizontal rules of different lengths (that is, full length between > groups and only in the second column between items within the same group) > > Are any of the above possible with tabulate? I could not find anything to > achieve any of those. I am quite used to tabulate as my table framework, so I > would prefer to use that. If that's not possible however, I'd be happy to use > something else. > > Any pointers would be much appreciated. Use the optional argument for \HL or \HR, the number controls the thickness of the rule, the keywords are color names. \starttext \starttabulate[|l|l|] \HR[4] \NC Cell 1 \NC Cell 2 \NC\NR \HL[green] \NC Cell 3 \NC Cell 4 \NC\NR \HL[2,blue] \stoptabulate \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] [***SPAM***] Re: Symbols for footnotes not working
Am 29.03.2013 um 10:07 schrieb hwit...@gmail.com: > > It didn't work. Either with texexec or with context. > > Here is a simpler test case > start > % basic test to change footnotes bullet to a symbol > % basice test to change footnotes bullet to a symbol > % \setupfootnotes[rule=off] % had no affect > > \defineconversion[fnsym]{ \dagger,*,**,***} % etc. > > \setupfootnotes[conversion=fnsym, numberconversion=fnsym] % Doesn't > work > \setupnotation[footnote][numberconversion=fnsym,alternative=text] % Doesn't > work > % conversion=set fnsym or conversion=fnsymdoes't work > % numberconversion=fnsym or numberconversion=set fnsym doesn't work > > \starttext > This is a footnote\footnote{a fnote}\\ > And another for clarity\footnote{the 2nd footnote.} > \stoptext > > end the above does not produce a dagger footnote bullet (only > std numbers) > > It should be a simple thing to do, but I've tried a lot of combinations.. > Any help would be appreciated. 1. {} ≠ [], see \defineconversion 2. To end a paragraph use empty lines, \\ is wrong \defineconversion[fnsym][\m{\dagger},\m{*},\m{**},\m{***}] \setupnotation[footnote][numberconversion=fnsym] % change footnote symbols \setupnote[footnote][rule=off] % disbale the rule before the footnote block \starttext This is a footnote\footnote{a fnote} And another for clarity\footnote{the 2nd footnote.} \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Different Horizontal Lines with Tabulate
Hello, I have a table in which I have to group a number of rows together. Let's say I have a table with two columns, the first is an item ID and the second a multi-line description for that item. Say I have ten items in the table and I need to group Item 1 and 2, 3 and 4, 5 and 6 and so on. Due to the description being quite lengthy in some cases, I would like to use some sort of horizontal rule between items. It seems I have to following options: 1. Using horizontal rules of two different thicknesses (eg. thicker between groups and thinner between items within the same group) 2. Using horizontal rules of two different colour (eg. black between groups and a light grey between items within the same group) 3. Using horizontal rules of different lengths (that is, full length between groups and only in the second column between items within the same group) Are any of the above possible with tabulate? I could not find anything to achieve any of those. I am quite used to tabulate as my table framework, so I would prefer to use that. If that's not possible however, I'd be happy to use something else. Any pointers would be much appreciated. Thank you, Malte. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A thinner hrule for headers
On 3/28/2013 4:36 PM, Thomas Kreuzer wrote: Am 3/24/2013 20:43, schrieb Marcin Borkowski: If this \hrule is TeX's primitive \hrule, then you can (maybe) type [after={\hrule height 0.4pt\relax}] for the default (and change the height for other dimensions). That said, this is a low-level hack and not very ConTeXt-y (even if it works, which I don't know.) Best, Strangly, it DOES work for a value of 0.01pt (it looks like 0.2pt for framethickness), a value of 0.2pt doesn't make a noticable difference somehow. This is the most convenient solution for me, but it has a weird aftertaste, given that I do nut understand why I have to give it such a low parameter. In print or on screen? TeX is very precise but displays and printers can do rounding and snapping. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A thinner hrule for headers
Am 3/24/2013 20:43, schrieb Marcin Borkowski: If this \hrule is TeX's primitive \hrule, then you can (maybe) type [after={\hrule height 0.4pt\relax}] for the default (and change the height for other dimensions). That said, this is a low-level hack and not very ConTeXt-y (even if it works, which I don't know.) Best, Oddly enough, it works well, but somehow I had to use 0.01pt to make it noticable. regards! ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] A thinner hrule for headers
Am 3/24/2013 20:43, schrieb Marcin Borkowski: If this \hrule is TeX's primitive \hrule, then you can (maybe) type [after={\hrule height 0.4pt\relax}] for the default (and change the height for other dimensions). That said, this is a low-level hack and not very ConTeXt-y (even if it works, which I don't know.) Best, Strangly, it DOES work for a value of 0.01pt (it looks like 0.2pt for framethickness), a value of 0.2pt doesn't make a noticable difference somehow. This is the most convenient solution for me, but it has a weird aftertaste, given that I do nut understand why I have to give it such a low parameter. Thank you very much, Thomas ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] [***SPAM***] Re: [***SPAM***] Symbols for footnotes not working
It didn't work. Either with texexec or with context. Here is a simpler test case start % basic test to change footnotes bullet to a symbol % basice test to change footnotes bullet to a symbol % \setupfootnotes[rule=off] % had no affect \defineconversion[fnsym]{ \dagger,*,**,***} % etc. \setupfootnotes[conversion=fnsym, numberconversion=fnsym] % Doesn't work \setupnotation[footnote][numberconversion=fnsym,alternative=text] % Doesn't work % conversion=set fnsym or conversion=fnsymdoes't work % numberconversion=fnsym or numberconversion=set fnsym doesn't work \starttext This is a footnote\footnote{a fnote}\\ And another for clarity\footnote{the 2nd footnote.} \stoptext end the above does not produce a dagger footnote bullet (only std numbers) It should be a simple thing to do, but I've tried a lot of combinations.. Any help would be appreciated. > > Am 28.03.2013 um 07:07 schrieb hwit...@gmail.com: > > > > > From ConTeXt's Wiki Garden the below should work, but it isn't. > > How can this be accomlished. I want to use just \dagger for the symbol, > > but any symbol would do. > > > > \definesymbol[4]{\dagger] > > > > \starttext > > \defineconversion[dagger][{\dagger},{\dagger}] % use a \dagger for the > > footnote. > > \setupfootnotes[conversion=set dagger,location=text] > > This is the dagger, \dagger{}I want to use for reference\footnote{Will > > the dagger appear}. > > > > A second line here for robustness.\footnote{It's a number still.} > > \stoptext > > \setupnotation[footnote][numberconversion=dagger,alternative=text] > ... ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___