Re: [NTG-context] Broken Nightly?
On 26-6-2012 06:36, Kip Warner wrote: On Tue, 2012-06-26 at 05:27 +0200, Wolfgang Schuster wrote: grph-epd.mkiv (untested): \startsetups system:graphics:epdf %\ctxlua{figures.mergegoodies("\@@efinteraction")}% \ctxlua{figures.mergegoodies("\externalfiguresparameter\c!interaction")}% \reference[\figurereference]{}% todo: dest area \stopsetups and \appendtoks \iflocation %\doif\figurefiletype{pdf}{\doifnot\@@efinteraction\v!none\grph_epdf_add_overlay}% \doif\figurefiletype{pdf}{\doifnot{\externalfiguresparameter\c!interaction}\v!none\grph_epdf_add_overlay}% \fi \to \externalfigurepostprocessors Hey Wolfgang. Thanks for your expeditious reply. I patched grph-epd.mkiv as directed and got the following error on the same file / line (Handbook.tex:42), ! Undefined control sequence. \@@efinteraction fixed in next beta - 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] Typing of Indian texts.
On 25-6-2012 23:48, Jaroslav Hajtmar wrote: Hello ConTeXist. During the discussion in CSTeX maillist fell a question about possibility typing of Indian texts with use ConTeXt. (using of Indian OpenType fonts), which is not yet in LuaTEX. Is somewhere any information available on this issue? I rate myself with no experience of exotic texts. I want get answer for my colleague in CsTeX conference, who wants to start ConTeXt use for these purposes.. it is more related to specific script support than to opentype and until now indian scripts have not been dealt with (contrary to cjk and arabic) 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] [callbacks] proper registration, node subtypes
On 25-6-2012 16:50, Philipp Gesang wrote: · On 25-6-2012 15:39, Philipp Gesang wrote: - Does the difference wrt node subtype matter assuming I only (a) copy glyph nodes and (b) manipulate their .char field? not that much, it's just a state signal for font processing Good to know. Any insights on this matter would be greatly appreciated. Regards Philipp it all depends on what you want to do Traverse the node list of a paragraph before line break from head to tail in sequential order, recursing into sublists where they appear. The callback removes and inserts nodes: which ones depends on the nodes already processed (has a state). Using the previous example code, \startfoo a\hbox{b}c \stopfoo should result in the traversal , , . \starttext \startluacode local function processnestedlist(head,n) local current, done = head, false while current do local id = current.id if id == nodes.nodecodes.hlist or id == nodes.nodecodes.vlist then local _, d = processnestedlist(current.list,n) if d then done = true end elseif id == nodes.nodecodes.hglue_code and current.leader then local _, d = processnestedlist(current.leader,n) if d then done = true end elseif id == nodes.nodecodes.glyph then -- todo: dics nodes n = n + 1 print(n,utf.char(current.char)) end current = current.next end return head, done, n end thirddata = thirddata or {} thirddata.test = thirddata.test or { } thirddata.test.one = function(head) local head, done, n = processnestedlist(head,0) print("n of glyphs",n) return head, done end nodes.tasks.appendaction ("processors","before","thirddata.test.one") \stopluacode \ruledhbox to 10cm {\strut hello \ruledhbox{brave new} world \cleaders\hbox{!}\hfil} \stoptext - 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] [callbacks] proper registration, node subtypes
· > On 25-6-2012 16:50, Philipp Gesang wrote: > >· > > > >>On 25-6-2012 15:39, Philipp Gesang wrote: > >> > >>> - Does the difference wrt node subtype matter assuming I only > >>> (a) copy glyph nodes and (b) manipulate their .char field? > >> > >>not that much, it's just a state signal for font processing > > > >Good to know. > > > >>>Any insights on this matter would be greatly appreciated. Regards > >>>Philipp > >> > >>it all depends on what you want to do > > > >Traverse the node list of a paragraph before line break from head > >to tail in sequential order, recursing into sublists where they > >appear. The callback removes and inserts nodes: which ones > >depends on the nodes already processed (has a state). > > > >Using the previous example code, > > > > \startfoo > > a\hbox{b}c > > \stopfoo > > > >should result in the traversal , , . > > \starttext > > \startluacode > > local function processnestedlist(head,n) > local current, done = head, false > while current do > local id = current.id > if id == nodes.nodecodes.hlist or id == nodes.nodecodes.vlist then > local _, d = processnestedlist(current.list,n) > if d then > done = true > end > elseif id == nodes.nodecodes.hglue_code and current.leader then > local _, d = processnestedlist(current.leader,n) > if d then > done = true > end > elseif id == nodes.nodecodes.glyph then -- todo: dics nodes > n = n + 1 > print(n,utf.char(current.char)) > end > current = current.next > end > return head, done, n > end > > > thirddata = thirddata or {} > thirddata.test = thirddata.test or { } > > thirddata.test.one = function(head) > local head, done, n = processnestedlist(head,0) > print("n of glyphs",n) > return head, done > end > > nodes.tasks.appendaction ("processors","before","thirddata.test.one") > > \stopluacode > > \ruledhbox to 10cm {\strut hello \ruledhbox{brave new} world > \cleaders\hbox{!}\hfil} > > \stoptext First of all, thanks for the snippet. It’s insightful already wrt to the fact that nodes.installattributehandler is considered unnecessary. But the problem persists. With the code a\hbox{b}c I get the following output: 1 b n of glyphs 1 1 a 2 b 2 c n of glyphs 2 So the sequence is , , , where it should be , , --- the hbox is still processed first, which I was attempting to avoid. (Also, the invisible string “context” follows if the callback is active until the end of file.) Regards Philipp > > - > 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 > ___ -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments pgp6BMUpkkmdU.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] [callbacks] proper registration, node subtypes
On 26-6-2012 14:08, Philipp Gesang wrote: · On 25-6-2012 16:50, Philipp Gesang wrote: · On 25-6-2012 15:39, Philipp Gesang wrote: - Does the difference wrt node subtype matter assuming I only (a) copy glyph nodes and (b) manipulate their .char field? not that much, it's just a state signal for font processing Good to know. Any insights on this matter would be greatly appreciated. Regards Philipp it all depends on what you want to do Traverse the node list of a paragraph before line break from head to tail in sequential order, recursing into sublists where they appear. The callback removes and inserts nodes: which ones depends on the nodes already processed (has a state). Using the previous example code, \startfoo a\hbox{b}c \stopfoo should result in the traversal , , . \starttext \startluacode local function processnestedlist(head,n) local current, done = head, false while current do local id = current.id if id == nodes.nodecodes.hlist or id == nodes.nodecodes.vlist then local _, d = processnestedlist(current.list,n) if d then done = true end elseif id == nodes.nodecodes.hglue_code and current.leader then local _, d = processnestedlist(current.leader,n) if d then done = true end elseif id == nodes.nodecodes.glyph then -- todo: dics nodes n = n + 1 print(n,utf.char(current.char)) end current = current.next end return head, done, n end thirddata = thirddata or {} thirddata.test = thirddata.test or { } thirddata.test.one = function(head) local head, done, n = processnestedlist(head,0) print("n of glyphs",n) return head, done end nodes.tasks.appendaction ("processors","before","thirddata.test.one") \stopluacode \ruledhbox to 10cm {\strut hello \ruledhbox{brave new} world \cleaders\hbox{!}\hfil} \stoptext First of all, thanks for the snippet. It’s insightful already wrt to the fact that nodes.installattributehandler is considered unnecessary. But the problem persists. With the code a\hbox{b}c I get the following output: 1 b n of glyphs 1 1 a 2 b 2 c n of glyphs 2 So the sequence is , , , where it should be , , --- the hbox is still processed first, which I was attempting to avoid. (Also, the invisible string “context” follows if the callback is active until the end of file.) it all depends on what callback you use ... you can try a finalizer instead of a processor as processors normally are called once - 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] Broken Nightly?
On Tue, 2012-06-26 at 10:57 +0200, Hans Hagen wrote: > fixed in next beta Thanks Hans. Nice work. Will let you know if it works. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com signature.asc Description: This is a digitally signed message part ___ 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] A problem with modes
Hello, this doesn't work for me: \definestartstop[amode][before={\startmode[a]}, after={\stopmode}] \starttext All modes. \startamode ``A'' mode. \stopamode \stoptext Can I use \startmode with \definestartstop? Or is there a better way to do something like this? TIA -- Marcin Borkowski http://mbork.pl ___ 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] \placeregister[index]—preventing page break before
I have been experimenting for a while with \placeregister and \setupregister and can find no way no prevent page breaks before a register. Simply inserting \page[no] does not seem to work. So can anyone suggest a way to do this in MKII? Alan ___ 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 problem with modes
On 2012-06-26, at 10:12 PM, Marcin Borkowski wrote: > Hello, > > this doesn't work for me: > > \definestartstop[amode][before={\startmode[a]}, >after={\stopmode}] > > \starttext > > All modes. > \startamode > ``A'' mode. > \stopamode > > \stoptext > > Can I use \startmode with \definestartstop? Or is there a better way > to do something like this? > (Untested): try the \doifmodeelse version. Aditya ___ 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 problem with modes
Am 26.06.2012 um 22:12 schrieb Marcin Borkowski: > Hello, > > this doesn't work for me: > > \definestartstop[amode][before={\startmode[a]}, >after={\stopmode}] > > \starttext > > All modes. > \startamode > ``A'' mode. > \stopamode > > \stoptext > > Can I use \startmode with \definestartstop? No you can’t. > Or is there a better way to do something like this? It depends on what you want to do. You can create a buffer command: \def\startamode{\grabbufferdata[amode][startamode][stopamode]} %\def\stopamode {\getbuffer[amode]} \starttext All modes. \startamode “A” mode. \stopamode \stoptext or you use my annotation module: \usemodule[annotation] \defineannotation[amode][alternative=text] %\defineannotation[amode][alternative=none] \starttext All modes. \startamode “A” mode. \stopamode \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 ___
Re: [NTG-context] A problem with modes
Dnia 2012-06-26, o godz. 22:44:40 Wolfgang Schuster napisał(a): > > Am 26.06.2012 um 22:12 schrieb Marcin Borkowski: > > > Hello, > > > > this doesn't work for me: > > > > \definestartstop[amode][before={\startmode[a]}, > >after={\stopmode}] > > > > \starttext > > > > All modes. > > \startamode > > ``A'' mode. > > \stopamode > > > > \stoptext > > > > Can I use \startmode with \definestartstop? > > No you can’t. I was afraid of this... > > Or is there a better way to do something like this? > > It depends on what you want to do. You can create a buffer command: > > \def\startamode{\grabbufferdata[amode][startamode][stopamode]} > %\def\stopamode {\getbuffer[amode]} > > \starttext > > All modes. > \startamode > “A” mode. > \stopamode > > \stoptext Thanks, it worked. One question: is there any difference between \def\starta{...} \def\stopa{...} and \definestartstop[a][before={...},after={...}] ? > Wolfgang Best, -- Marcin Borkowski http://mbork.pl ___ 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] How to obtain a Polish en-dash?
Hello, in Polish we usually use "--" as a dash (between different parts of a sequence, for instance), but we surround it by thin spaces (and the left one is "hard", like "~"). Is there a way in ConTeXt (MkIV) to obtain this behavior using some "tricky" syntax (like |--| or just -- surrounded by spaces) or is it better to define a custom command, like \def\Polishdash{\unskip\kern 0.2em--\hskip 0.2em\ignorespaces} (this is more or less taken from LaTeX's suite for Polish typesetting)? Best, -- Marcin Borkowski http://mbork.pl ___ 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 problem with modes
Am 26.06.2012 um 23:25 schrieb Marcin Borkowski: >>> Or is there a better way to do something like this? >> >> It depends on what you want to do. You can create a buffer command: >> >> \def\startamode{\grabbufferdata[amode][startamode][stopamode]} >> %\def\stopamode {\getbuffer[amode]} >> >> \starttext >> >> All modes. >> \startamode >> “A” mode. >> \stopamode >> >> \stoptext > > Thanks, it worked. One question: is there any difference between > > \def\starta{...} > \def\stopa{...} > > and > > \definestartstop[a][before={...},after={…}] Yes because in my definition for \startamode I start a buffer which reads everything untill the delimiting \stopamode and stores it in memory, afterwards you can access the stored content with \getbuffer[…]. When you use \definestartstop to create the environment you have only two commands which perform a few things at the begin and end of the environment but you can do much with the content itself, the only way to gobble the content is to store it in a box but than the buffer method is easier. 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 ___