Re: [NTG-context] Documentation about CTX installation on MacOS X
Thank you very much for your quick answer to you both Fabrice and Henning ! It seems there is no detailed documentation about peculiar aspects of CTX on MacOS. For instance, the use of fonts database on unix-like and MacOS are a bit different (but not quite a lot) and this command : mtxrun --script fonts —reload Works fine with this one based on fontconfig : fc-cache -v -f There is some adaptation in the transition from Linux to MacOS, because one has to play and to look for the fonts paths which are a bit different with Mac than the Unix paths … > Le 2 janv. 2022 à 11:54, Henning Hraban Ramm via ntg-context > a écrit : > > Am 03.01.22 um 03:26 schrieb Jean-Pierre Delange via ntg-context: >> Now my question : I want to try CTX (ConTeXtver: 2021.12.30) on MacOS X >> (currently 10.13 High Sierra), while I was formerly working with old >> versions on Linux and Windows based systems. Among other difficulties (like >> how to export OSFONDIR permanently), I don’t find the clever command . >> setuptex, which made possible a bunch of other commands (like context —make >> and context —generate). Even if a lot of things on MacOS X seem to share >> with Unix-like systems, I am looking for detailed documentation concerning a >> well done installation of CTX on MacOS X. > > You can install LMTX the usual Unix way > (https://wiki.contextgarden.net/Installation); setuptex doesn’t exist any > more. > > And then you can install modules: > https://wiki.contextgarden.net/Modules#ConTeXt_LMTX > > Hraban > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Documentation about CTX installation on MacOS X
Am 03.01.22 um 03:26 schrieb Jean-Pierre Delange via ntg-context: Now my question : I want to try CTX (ConTeXtver: 2021.12.30) on MacOS X (currently 10.13 High Sierra), while I was formerly working with old versions on Linux and Windows based systems. Among other difficulties (like how to export OSFONDIR permanently), I don’t find the clever command . setuptex, which made possible a bunch of other commands (like context —make and context —generate). Even if a lot of things on MacOS X seem to share with Unix-like systems, I am looking for detailed documentation concerning a well done installation of CTX on MacOS X. You can install LMTX the usual Unix way (https://wiki.contextgarden.net/Installation); setuptex doesn’t exist any more. And then you can install modules: https://wiki.contextgarden.net/Modules#ConTeXt_LMTX Hraban ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Dynamic document variables from metadata
Thank you, Hans. Updates are in place: https://github.com/DaveJarvis/keenwrite/releases https://github.com/DaveJarvis/keenwrite-themes/releases On Sun, Jan 2, 2022 at 3:11 AM Hans Hagen wrote: > On 1/2/2022 2:54 AM, Thangalin via ntg-context wrote: > > Happy New Year! > > > > How would you implement a mechanism that takes arbitrary XHTML > > tags and produces document variables? Consider: > > > > > > > > After running XML setups, the following would write "Nature": > > > > \documentvariable{journal} > > > > The tricky part is doing this without pre-defining them. Here's a short, > > self-contained example to help demonstrate: > > > > |\startbuffer[xdoc]> name="author"/> > > \stopbuffer \startxmlsetups xml:xhtml > > \xmlsetsetup{\xmldocument}{*}{-} > > \xmlsetsetup{\xmldocument}{html|body}{xml:*} > > \xmlsetsetup{\xmldocument}{head}{xml:meta} \stopxmlsetups > > \xmlregistersetup{xml:xhtml} \startxmlsetups xml:html > > % "author" is a special setup, not generalized > > \xmlfilter{#1}{/head/meta[@name='author']/command(xml:author)} % What > > goes here to make this dynamic? > > %\xmlfilter{#1}{/head/meta[@name='journal']/command(xml:journal)} > > \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:author > > \setupdocument[author={\xmlatt{#1}{content}}] > > \setupdocument[metadata:author={\xmlatt{#1}{content}}] > > \setupinteraction[author={\documentvariable{author}}] \stopxmlsetups % > > How can this be generalized? %\startxmlsetups xml:journal > > %\setupdocument[journal={\xmlatt{#1}{content}}] %\stopxmlsetups > > \startxmlsetups xml:body \startdocument Author: > > \documentvariable{author} \par Journal: \documentvariable{journal} > > \stopdocument \stopxmlsetups \xmlprocessbuffer{main}{xdoc}{}| > \startxmlsetups xml:setdocumentvariable >\setupdocument[\xmlatt{#1}{name}={\xmlatt{#1}{content}}] > \stopxmlsetups > > \startxmlsetups xml:author >\setupdocument[author={\xmlatt{#1}{content}}] >\setupdocument[metadata:author={\xmlatt{#1}{content}}] >\setupinteraction[author={\documentvariable{author}}] > \stopxmlsetups > > \startxmlsetups xml:html >\xmlfilter{#1}{/head/meta/command(xml:setdocumentvariable)} >\xmlfilter{#1}{/head/meta[@name='author']/command(xml:author)} >\startdocument >\xmlflush{#1} >\stopdocument > \stopxmlsetups > > > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Documentation about CTX installation on MacOS X
Hi, > Le 2 janv. 2022 à 21:26, Jean-Pierre Delange via ntg-context > a écrit : > > First of all : Happy New Year everybody (despite some difficulties due to > public policies against the epidemic ! > > Now my question : I want to try CTX (ConTeXt ver: 2021.12.30) on MacOS X > (currently 10.13 High Sierra), while I was formerly working with old > versions on Linux and Windows based systems. Among other difficulties (like > how to export OSFONDIR permanently), I don’t find the clever command . > setuptex, which made possible a bunch of other commands (like context —make > and context —generate). Even if a lot of things on MacOS X seem to share with > Unix-like systems, I am looking for detailed documentation concerning a well > done installation of CTX on MacOS X. > Thank you very much for your help ! > JP On MacOS, I usually follow with success this page of the wiki : https://wiki.contextgarden.net/Installing_ConTeXt_LMTX_on_MacOS Regarding modules, on MacOS, the script described here (again on the wiki) works well for me: https://wiki.contextgarden.net/Modules#ConTeXt_LMTX Finally, I use TexPad as my context/metafun editor, and if you need some help to set it up, I can describe my setup in details. Fabrice. > > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Documentation about CTX installation on MacOS X
First of all : Happy New Year everybody (despite some difficulties due to public policies against the epidemic ! Now my question : I want to try CTX (ConTeXt ver: 2021.12.30) on MacOS X (currently 10.13 High Sierra), while I was formerly working with old versions on Linux and Windows based systems. Among other difficulties (like how to export OSFONDIR permanently), I don’t find the clever command . setuptex, which made possible a bunch of other commands (like context —make and context —generate). Even if a lot of things on MacOS X seem to share with Unix-like systems, I am looking for detailed documentation concerning a well done installation of CTX on MacOS X. Thank you very much for your help ! JP ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
Great! Thanks Hans, now it works. I replaced the "draw externalfigure" commands by draw externalfigure "./skysprite.png" xsized 4u ysized 5u shifted (0u,-0u); draw externalfigure "./sandsprite.png" xsized 4u ysized 5u shifted (0u,-5u); Best regards On Sun, Jan 2, 2022 at 3:36 PM Hans Hagen wrote: > On 1/2/2022 3:12 PM, Alfredo Catalina via ntg-context wrote: > > I'm trying to use ConTeXt with Metafun to produce a map of a videogame I > > am working on. In fact I did it 9 years ago but it seems that now it > > doesn't work. > > > > I have two 32 pixels wide by 40 pixels high sprites. They are saved in > > the skysprite.png and sandsprite.png files. Since 32 = 4 x 8 and 40 = 5 > > x 8, the width/height ratio is 4/5. > > > > This should produce a page with a sky sprite and a sand sprite, one > > below the other. It worked in the past. Each sprite should be 4 x 0.095 > > cm = 0,38 cm wide and 5 x 0.095 cm = 0.475 cm high: > > > > \starttext > > \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,8pt]}] > > \startuseMPgraphic{mapa} > > u:=.095cm; > > draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted > > (0u,-0u); > > draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted > > (0u,-5u); > > \stopuseMPgraphic > > \useMPgraphic{mapa} > > \stoptext > > > > But instead I got two huge sprites of 2.8 cm x 4.4 cm. > > > > Am I forgetting something? > Originally that worked because the image was always 'included' at 1 bp > and then scaled but that was (1) inaccurate and (2) a bit depending on > the image and (3) could overflow metapost. > > Use xsized and ysized instead (absolute measures instead of scaling the > unknown) > > Hans > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument
Uff, this is indeed deep tex. Thanks a lot for the example, Hans! I still need to learn a lot. After a walk and a bit of fresh air, I found another (much easier) way around my problem. This works since I don't need to deal with #2 in any special way: \tolerant\def\startMyCommand[#1]% { \startallbeautifulcontextcommands % whatever #1 does } \tolerant\def\stopMyCommand% { \stopallbeautifulcontextcommands } Then one can do in the main files: \startMyCommand \beginMyBuffer bla bla \endMyBuffer \stopMycommand > On Jan 2, 2022, at 14:43, Hans Hagen wrote: > > On 1/2/2022 2:14 PM, Benjamin Buchmuller wrote: >> Thanks, Hans, for the answer, but I'm not sure if I get the point. >> While this is possible in ConTeXt: >> \startsection[title={My Title}] >> \beginMyBlock >> bla bla >> \endMyBlock >> \stopsection >> The following won't work (end of file error): >> \startMyCommand[optional={Maybe}] >> \beginMyBlock >> bla bla >> \endMyBlock >> \stopMyCommand >> I had hoped for a simple command/modifier like >> \pleaseacceptblocks\def\startMyCommand[#1]#2\stopMyCommand to have #2 work >> in a similar way. >> But maybe, as Wolfgang stated here >> (https://www.mail-archive.com/ntg-context@ntg.nl/msg73956.html), buffers and >> blocks can't be used in commands. (To add: Even when passed as arguments >> during compilation?) > > You can bet that WS is right. > > You really have to go dirty tex for this kind of magic: > > \defineblock[MyBlock] > \keepblocks[MyBlock] > > \starttext > > \tolerant\def\startMyCommand[#1]% > {\begingroup > \setcatcodetable\notcatcodes > \dostartMyCommand[#1]} > > \let\stopMyCommand\relax > > \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\expandtoken\notcatcodes92 > stopMyCommand}% > {\endgroup > % whatever #1 does > \setbuffer[foo]#2\endbuffer > \typebuffer[foo] > \getbuffer[foo]} > > or > > \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\retokenized\notcatcodes > {\stopMyCommand}}% > {\endgroup > % whatever #1 does > \setbuffer[foo]#2\endbuffer > \typebuffer[foo] > \getbuffer[foo]} > > \startMyCommand[optional={Maybe}] > > \beginMyBlock > bla bla > \endMyBlock > > \stopMyCommand > > \stoptext > > and then of course further nesting mess ... > > Hans > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
On 1/2/2022 3:12 PM, Alfredo Catalina via ntg-context wrote: I'm trying to use ConTeXt with Metafun to produce a map of a videogame I am working on. In fact I did it 9 years ago but it seems that now it doesn't work. I have two 32 pixels wide by 40 pixels high sprites. They are saved in the skysprite.png and sandsprite.png files. Since 32 = 4 x 8 and 40 = 5 x 8, the width/height ratio is 4/5. This should produce a page with a sky sprite and a sand sprite, one below the other. It worked in the past. Each sprite should be 4 x 0.095 cm = 0,38 cm wide and 5 x 0.095 cm = 0.475 cm high: \starttext \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,8pt]}] \startuseMPgraphic{mapa} u:=.095cm; draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted (0u,-0u); draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted (0u,-5u); \stopuseMPgraphic \useMPgraphic{mapa} \stoptext But instead I got two huge sprites of 2.8 cm x 4.4 cm. Am I forgetting something? Originally that worked because the image was always 'included' at 1 bp and then scaled but that was (1) inaccurate and (2) a bit depending on the image and (3) could overflow metapost. Use xsized and ysized instead (absolute measures instead of scaling the unknown) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Laundry symbols (now: altered picture)
I'm trying to use ConTeXt with Metafun to produce a map of a videogame I am working on. In fact I did it 9 years ago but it seems that now it doesn't work. I have two 32 pixels wide by 40 pixels high sprites. They are saved in the skysprite.png and sandsprite.png files. Since 32 = 4 x 8 and 40 = 5 x 8, the width/height ratio is 4/5. This should produce a page with a sky sprite and a sand sprite, one below the other. It worked in the past. Each sprite should be 4 x 0.095 cm = 0,38 cm wide and 5 x 0.095 cm = 0.475 cm high: \starttext \setupMPinstance[metafun][textstyle={\switchtobodyfont[termes,8pt]}] \startuseMPgraphic{mapa} u:=.095cm; draw externalfigure "./skysprite.png" xscaled 4u yscaled 5u shifted (0u,-0u); draw externalfigure "./sandsprite.png" xscaled 4u yscaled 5u shifted (0u,-5u); \stopuseMPgraphic \useMPgraphic{mapa} \stoptext But instead I got two huge sprites of 2.8 cm x 4.4 cm. Am I forgetting something? Thanks ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument
On 1/2/2022 2:14 PM, Benjamin Buchmuller wrote: Thanks, Hans, for the answer, but I'm not sure if I get the point. While this is possible in ConTeXt: \startsection[title={My Title}] \beginMyBlock bla bla \endMyBlock \stopsection The following won't work (end of file error): \startMyCommand[optional={Maybe}] \beginMyBlock bla bla \endMyBlock \stopMyCommand I had hoped for a simple command/modifier like \pleaseacceptblocks\def\startMyCommand[#1]#2\stopMyCommand to have #2 work in a similar way. But maybe, as Wolfgang stated here (https://www.mail-archive.com/ntg-context@ntg.nl/msg73956.html), buffers and blocks can't be used in commands. (To add: Even when passed as arguments during compilation?) You can bet that WS is right. You really have to go dirty tex for this kind of magic: \defineblock[MyBlock] \keepblocks[MyBlock] \starttext \tolerant\def\startMyCommand[#1]% {\begingroup \setcatcodetable\notcatcodes \dostartMyCommand[#1]} \let\stopMyCommand\relax \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\expandtoken\notcatcodes92 stopMyCommand}% {\endgroup % whatever #1 does \setbuffer[foo]#2\endbuffer \typebuffer[foo] \getbuffer[foo]} or \normalexpanded{\def\noexpand\dostartMyCommand[#1]#2\retokenized\notcatcodes {\stopMyCommand}}% {\endgroup % whatever #1 does \setbuffer[foo]#2\endbuffer \typebuffer[foo] \getbuffer[foo]} \startMyCommand[optional={Maybe}] \beginMyBlock bla bla \endMyBlock \stopMyCommand \stoptext and then of course further nesting mess ... Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument
Thanks, Hans, for the answer, but I'm not sure if I get the point. While this is possible in ConTeXt: \startsection[title={My Title}] \beginMyBlock bla bla \endMyBlock \stopsection The following won't work (end of file error): \startMyCommand[optional={Maybe}] \beginMyBlock bla bla \endMyBlock \stopMyCommand I had hoped for a simple command/modifier like \pleaseacceptblocks\def\startMyCommand[#1]#2\stopMyCommand to have #2 work in a similar way. But maybe, as Wolfgang stated here (https://www.mail-archive.com/ntg-context@ntg.nl/msg73956.html), buffers and blocks can't be used in commands. (To add: Even when passed as arguments during compilation?) Many Thanks again! Benjamin > On Jan 2, 2022, at 12:19, Hans Hagen wrote: > > On 1/2/2022 11:47 AM, Benjamin Buchmuller via ntg-context wrote: >> Hi list, >> I'm playing around with blocks and buffers again, realizing that I cannot >> use them inbetween a \start...\stop that I defined myself. Apparently, they >> work between \startsection...\stopsection and the like, so I was wondering >> how I should define or expand #2 in the MWE below to make TeX happily accept >> these useful features? > buffers are stored as-is so no catcode magic stored, contrary to macros > > you can use \setbuffer but that doesn't solve the argument passing > > however, you can nest buffers so you can make other \start\stop commands > buffers too and then do some at the start and (look for \defiebuffer) but it > quickly becomes messy i think > > Hans > > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Dangerous bends symbol in manfnt.afm accidentally chopped by LMTX?
On 1/2/2022 11:30 AM, Benjamin Buchmuller via ntg-context wrote: Hi list, using this example from the wiki, the dbend symbol appears cropped on the left side on my machine (ConTeXt ver: 2021.12.10 11:41 LMTX fmt: 2021.12.14), but not on the ConTeXt live server? Any possible reasons? \definefontsynonym [bends] [file:manfnt.afm] \startsymbolset [Dangerous Bends] \definesymbol [dbend] [\resolvedglyphdirect{bends}{n:char_7e}] \definesymbol [lhdbend] [\resolvedglyphdirect{bends}{n:char_7f}] \stopsymbolset \setupsymbolset [Dangerous Bends] \starttext \symbol{dbend}\quad \symbol{lhdbend} \stoptext The lhdbend renders funny anyway. Maybe Taco is willing to have a look at it. It might actually make sense to make an opentype font and get rid of the afm/pfb here. Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] fonts.compact produces compact initials
On 1/2/2022 3:01 AM, Rik Kabel via ntg-context wrote: Enabling compact fonts results in incorrect initials. \enableexperiments[fonts.compact] \starttext \placeinitial Tested with \luatexbanner and \ConTeXt\ \contextversion \stoptext Produces (approximately): ested with LuaMetaTeX, Version 2.09.35 and ConTEXt 2021.12.30 19:03 *T* fixed in next upload (there might be a few more places that need adapting to compact) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] How to make \def accept block or buffer as part of (long) command argument
On 1/2/2022 11:47 AM, Benjamin Buchmuller via ntg-context wrote: Hi list, I'm playing around with blocks and buffers again, realizing that I cannot use them inbetween a \start...\stop that I defined myself. Apparently, they work between \startsection...\stopsection and the like, so I was wondering how I should define or expand #2 in the MWE below to make TeX happily accept these useful features? buffers are stored as-is so no catcode magic stored, contrary to macros you can use \setbuffer but that doesn't solve the argument passing however, you can nest buffers so you can make other \start\stop commands buffers too and then do some at the start and (look for \defiebuffer) but it quickly becomes messy i think Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Dynamic document variables from metadata
On 1/2/2022 2:54 AM, Thangalin via ntg-context wrote: Happy New Year! How would you implement a mechanism that takes arbitrary XHTML tags and produces document variables? Consider: After running XML setups, the following would write "Nature": \documentvariable{journal} The tricky part is doing this without pre-defining them. Here's a short, self-contained example to help demonstrate: |\startbuffer[xdoc] name="author"/> \stopbuffer \startxmlsetups xml:xhtml \xmlsetsetup{\xmldocument}{*}{-} \xmlsetsetup{\xmldocument}{html|body}{xml:*} \xmlsetsetup{\xmldocument}{head}{xml:meta} \stopxmlsetups \xmlregistersetup{xml:xhtml} \startxmlsetups xml:html % "author" is a special setup, not generalized \xmlfilter{#1}{/head/meta[@name='author']/command(xml:author)} % What goes here to make this dynamic? %\xmlfilter{#1}{/head/meta[@name='journal']/command(xml:journal)} \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:author \setupdocument[author={\xmlatt{#1}{content}}] \setupdocument[metadata:author={\xmlatt{#1}{content}}] \setupinteraction[author={\documentvariable{author}}] \stopxmlsetups % How can this be generalized? %\startxmlsetups xml:journal %\setupdocument[journal={\xmlatt{#1}{content}}] %\stopxmlsetups \startxmlsetups xml:body \startdocument Author: \documentvariable{author} \par Journal: \documentvariable{journal} \stopdocument \stopxmlsetups \xmlprocessbuffer{main}{xdoc}{}| \startxmlsetups xml:setdocumentvariable \setupdocument[\xmlatt{#1}{name}={\xmlatt{#1}{content}}] \stopxmlsetups \startxmlsetups xml:author \setupdocument[author={\xmlatt{#1}{content}}] \setupdocument[metadata:author={\xmlatt{#1}{content}}] \setupinteraction[author={\documentvariable{author}}] \stopxmlsetups \startxmlsetups xml:html \xmlfilter{#1}{/head/meta/command(xml:setdocumentvariable)} \xmlfilter{#1}{/head/meta[@name='author']/command(xml:author)} \startdocument \xmlflush{#1} \stopdocument \stopxmlsetups - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] New Year / meetup
Hi everybody, my best wishes for a healthy, successful and generally happy new year! (We need it.) The next online meetup will be on Tuesday, Jan. 11th. I’ll send a reminder. Hraban ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] aligning Malayalam horizontally across column
On 1/2/2022 8:08 AM, Ajith R via ntg-context wrote: Thanks for this. But, I changed to natural tables as suggested by Kausika and that solved my problems. if it's only text, \starttabulate works ok too (and often better) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] How to make \def accept block or buffer as part of (long) command argument
Hi list, I'm playing around with blocks and buffers again, realizing that I cannot use them inbetween a \start...\stop that I defined myself. Apparently, they work between \startsection...\stopsection and the like, so I was wondering how I should define or expand #2 in the MWE below to make TeX happily accept these useful features? Thanks a lot Benjamin \starttext \let\stopMyCommand\relax \tolerant\protected\def\startMyCommand[#1]#2\stopMyCommand{ Optional argument #1 Content #2 } \bf Here we test the command: Works \tf \startMyCommand[is optional] gets processed! \stopMyCommand \bf Here we test the block: Works \tf \defineblock[MyBlock] \beginMyBlock Block for something else. \endMyBlock \useblocks[MyBlock][criterium=text] \bf Here we test the block inside command: Fails \tf % UNCOMMENT BELOW FAILS: tex error > runaway error: end of file encountered % % \startMyCommand[is optional] % Still? % % \beginMyBlock % Block for something else. % \endMyBlock % \stopMyCommand \definebuffer[MyBuffer] \bf Here we test the buffer: Works \tf \startbuffer[MyBuffer] Buffer for something else. \stopbuffer \getbuffer[MyBuffer] \bf Here we test the buffer inside command: Fails \tf % UNCOMMENT BELOW FAILS: tex error > runaway error: end of file encountered % % \startMyCommand[is optional] % Still? % % \startbuffer[MyBuffer] % Buffer for something else. % \endbuffer % \stopMyCommand \stoptext ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Dangerous bends symbol in manfnt.afm accidentally chopped by LMTX?
Hi list, using this example from the wiki, the dbend symbol appears cropped on the left side on my machine (ConTeXt ver: 2021.12.10 11:41 LMTX fmt: 2021.12.14), but not on the ConTeXt live server? Any possible reasons? \definefontsynonym [bends] [file:manfnt.afm] \startsymbolset [Dangerous Bends] \definesymbol [dbend] [\resolvedglyphdirect{bends}{n:char_7e}] \definesymbol [lhdbend] [\resolvedglyphdirect{bends}{n:char_7f}] \stopsymbolset \setupsymbolset [Dangerous Bends] \starttext \symbol{dbend}\quad \symbol{lhdbend} \stoptext Thanks Benjamin ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___