[NTG-context] Access current element in xmlsetsetup via xml.expressions
Hello, I'm trying to build an xmlsetsetup with an own lua function. XML in MKIV says on pg. 33: You can also use normal Lua functions as long as you make sure that you pass the right arguments. There are a few predefined variables available inside such functions. list table the list of matches l number the current index in the list of matches ll element the current element that matched order number the position of the root of the path But I can't figure out how to get access to list, ll etc. My MWE (only for testing the access, is always true): \startbuffer[text] Dies ist ein xxxzwei noch ein sup Testsub \stopbuffer %\enabletrackers[xml.parse,xml.path] \startluacode function xml.expressions.nextnodeatt(e) inspect(e) inspect(ll) return('sub') end \stopluacode \startxmlsetups xml:textsetups \xmlsetsetup{#1}{*}{+} \xmlsetsetup{#1}{para}{xml:*} \xmlsetsetup{#1}{inline[@style='sup'][xml.expressions.nextnodeatt(ll)=='sub' ]}{xml:sub} \stopxmlsetups \xmlregistersetup{xml:textsetups} \startxmlsetups xml:para \xmlflush{#1}\par \stopxmlsetups \startxmlsetups xml:sub \color[red]{\xmlflush{#1}} \stopxmlsetups \starttext \xmlprocessbuffer{main}{text}{} \stoptext Thanks in advance, Achim ___ 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] circuitikz meters
On 10/1/2019 7:42 PM, Martin Althoff wrote: Thanks for that Henri. I didn't expect a simple thing like that. As I had some similar "glitches" before, I'll have a look through the module. If there are more such commands we can add them to the tikz module loader. Just collect them. All the best, Martin On Tue, 2019-10-01 at 14:03 +1300, Henri Menke wrote: Circuitikz uses \textbf inside, which is a LaTeX macro. Unfortunately, this is hardcoded within the ammeter and voltmeter nodes, so you can't easily change it. Instead you can simply provide a macro that does the correct thing. \usemodule[circuitikz] \let\textbf\bold % <--- \starttext \starttikzpicture \draw (0,0)to[ammeter, t=A, i=$i$] ++(3,0); \draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ; \draw (0,2) to[voltmeter, l=$U$] (++3,2); \stoptikzpicture \stoptext Cheers, Henri ___ 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 ___ -- - 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] circuitikz meters
Thanks for that Henri. I didn't expect a simple thing like that. As I had some similar "glitches" before, I'll have a look through the module. All the best, Martin On Tue, 2019-10-01 at 14:03 +1300, Henri Menke wrote: > Circuitikz uses \textbf inside, which is a LaTeX macro. Unfortunately, this > is > hardcoded within the ammeter and voltmeter nodes, so you can't easily change > it. Instead you can simply provide a macro that does the correct thing. > > \usemodule[circuitikz] > \let\textbf\bold % <--- > \starttext > \starttikzpicture > \draw (0,0)to[ammeter, t=A, i=$i$] ++(3,0); > \draw (0,4) to[rmeter, t=V, v>=$v$] ++(3,0) ; > \draw (0,2) to[voltmeter, l=$U$] (++3,2); > \stoptikzpicture > \stoptext > > Cheers, Henri > ___ 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] Multi-letter words/identifiers in math
On 10/1/2019 6:52 PM, Shuxian Wang wrote: Thanks Hans! Your suggestion does partially solve the problem, but it seems that `\mfunction` internally called `\rm` to set upright Roman font in math mode. Does achieving the same effects (text-like kerning) for italics and bold style still requires custom fonts? It depends on the font. A proper opentype math font should have at least the basic latin characters for test and these then if needed will have kerns and such. 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] Column sets (span) & unwanted vertical gap
Procházka Lukáš Ing. schrieb am 01.10.2019 um 14:51: Hello, the code bellow produces unwanted vertical gap between the bottom border of the figure and the following title "A" in the first column (marked by red arrows "<->" in the PDF attached). Note that in the second column there is no such gap. I tried to play with "before", "inbetween", "beforesection" and other keys of \setuphead to remove the gap but without success. Is there a way to avoid the vertical gap? https://www.mail-archive.com/ntg-context@ntg.nl/msg89563.html 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Column sets (span) & unwanted vertical gap
Hello, the code bellow produces unwanted vertical gap between the bottom border of the figure and the following title "A" in the first column (marked by red arrows "<->" in the PDF attached). Note that in the second column there is no such gap. I tried to play with "before", "inbetween", "beforesection" and other keys of \setuphead to remove the gap but without success. Is there a way to avoid the vertical gap? My code so far: \setuppapersize[A3,landscape] \setuplayout [topspace=10mm,header=5mm,headerdistance=5mm,height=270mm, backspace=20mm,width=380mm, ] \setupheadertexts[] \setupfootertexts[] \definecolumnset[example][n=3,balancing=no] \definecolumnsetspan[wide][n=2] \setupexternalfigures[location=default] \setupindenting[no] \setupwhitespace[none] \setuplayout[grid=yes] \definehead[MyTit][title] \setuphead[MyTit] [style=\bf,color=MyBlue, before={\blank[none]},after={\blank[none]},inbetween={\blank[none]},beforesection={BS},aftersection={AS}, page=no,%grid=yes, ] % %\showframe %\showboxes %\showlayout % \starttext \startcolumnset[example] \startcolumnsetspan[wide] \externalfigure[cow][height=120mm,frame=on] %\vbox to120mm{} \stopcolumnsetspan \MyTit{A} \input knuth \MyTit{B} \input knuth \stopcolumnset \stoptext Best regards, Lukas -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Mob.: +420 702 033 396 t6.mkiv Description: Binary data t6~~.pdf Description: Adobe PDF document ___ 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] About \textrule [ ]
Thank you for your suggestions, Fabrice Le mar. 1 oct. 2019 à 11:35, Taco Hoekwater a écrit : > > > > On 1 Oct 2019, at 11:09, Fabrice Couvreur > wrote: > > > > Hello, > > The top line is in the text, how to fix this problem ? > > % alternative=serried, > inbetween=, > > Best wishes, > Taco > > > Thank you. > > Fabrice > > > > \setuptextrules[width=0.5cm] > > > > \define[1]\ProprieteHeadcommand > > {\textrule[top]{#1}} > > > > \defineenumeration > > [propriete] > > [text=Propriété, > >title=yes, > >headstyle={bold}, > >alternative=serried, > >style=italic, > >number=no, > >headcommand=\ProprieteHeadcommand, > >numbercommand=\groupedcommand{}{\nbsp}, > >after=\textrule] > > > > \starttext > > \startpropriete > > \input ward > > \stoppropriete > > \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 > > > ___ > > Taco Hoekwater > Elvenkind BV > > > > > > ___ > 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] About \textrule [ ]
> On 1 Oct 2019, at 11:09, Fabrice Couvreur wrote: > > Hello, > The top line is in the text, how to fix this problem ? % alternative=serried, inbetween=, Best wishes, Taco > Thank you. > Fabrice > > \setuptextrules[width=0.5cm] > > \define[1]\ProprieteHeadcommand > {\textrule[top]{#1}} > > \defineenumeration > [propriete] > [text=Propriété, >title=yes, >headstyle={bold}, >alternative=serried, >style=italic, >number=no, >headcommand=\ProprieteHeadcommand, >numbercommand=\groupedcommand{}{\nbsp}, >after=\textrule] > > \starttext > \startpropriete > \input ward > \stoppropriete > \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 > ___ Taco Hoekwater Elvenkind BV ___ 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] About \textrule [ ]
Hi Fabrice, Is this what you are looking for? Best regards: OK \setuptextrules[width=.5cm] \define[1]\ProprieteHeadcommand {\textrule[top]{Propriété}} \defineenumeration[propriete] [headstyle={bold}, style=italic, number=no, headcommand=\ProprieteHeadcommand, numbercommand=\groupedcommand{}{\nbsp}, after=\textrule] \starttext \startpropriete \input ward \stoppropriete \stoptext > On 1 Oct 2019, at 11:09, Fabrice Couvreur wrote: > > Hello, > The top line is in the text, how to fix this problem ? > Thank you. > Fabrice > > \setuptextrules[width=0.5cm] > > \define[1]\ProprieteHeadcommand > {\textrule[top]{#1}} > > \defineenumeration > [propriete] > [text=Propriété, >title=yes, >headstyle={bold}, >alternative=serried, >style=italic, >number=no, >headcommand=\ProprieteHeadcommand, >numbercommand=\groupedcommand{}{\nbsp}, >after=\textrule] > > \starttext > \startpropriete > \input ward > \stoppropriete > \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 > ___ ___ 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] Mkiv, fonts in text and math mode, with \definebodyfont
On 9/30/2019 7:32 PM, Stefano Sanguinetti wrote: Hello, I am trying to understand something more about fonts in text and math mode, in Mkiv Context. I would like to be able to change things at the "define body fonts" level. I tried the following, in order to have rsfs fonts : \setupbodyfont[12pt] \definebodyfont[12pt][rm][tf=rsfs10 sa *] \starttext \tf ABCD \tfa ABCD \stoptext The \tfa ABCD is displayed as rsfs as I wanted, but the \tf ABCD is displayed as default fonts. Why ? What could I change in order to have \tf ABCD in rsfs ? In math mode, I am not able to have rsfs fonts : \setupbodyfont[12pt] \definebodyfont[12pt][mm][mr=rsfs10 sa *,ex=rsfs10 sa *,mi=rsfs10 sa *,sy=rsfs10 sa *,ma=rsfs10 sa *,mb=rsfs10 sa *] \starttext $ABCD$ \stoptext That gives ABCD in default math mode fonts. Is there a simple way to do it with the \definebodyfont command ? Thank you in advance for your comments. In mkiv we use a different model. If you want to use traditional type 1 fonts you need to define a virtual (unicode) math font. You can look into px-math.lfg to see how that is done. (Maybe I should remove these old family models from mkiv/lmtx. probably no one would object.) 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] About \textrule [ ]
Hello, The top line is in the text, how to fix this problem ? Thank you. Fabrice \setuptextrules[width=0.5cm] \define[1]\ProprieteHeadcommand {\textrule[top]{#1}} \defineenumeration [propriete] [text=Propriété, title=yes, headstyle={bold}, alternative=serried, style=italic, number=no, headcommand=\ProprieteHeadcommand, numbercommand=\groupedcommand{}{\nbsp}, after=\textrule] \starttext \startpropriete \input ward \stoppropriete \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 ___
Re: [NTG-context] Error during installation of LMTX
On 9/30/2019 8:26 PM, Mojca Miklavec wrote: On Mon, 30 Sep 2019 at 20:04, Jan U. Hasecke wrote: I tried to update or install LMTX today and get this error: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /home/juh/context-linux-64/bin/mtxrun) I am running debian 10 buster. This could be related to Hans updating the Ubuntu version on WSL on his computer recently (if that's the source of the distributed binaries). for linux it still is (as it also populates some other places) We do have binaries on http://dl.contextgarden.net/build/luametatex/x86_64-linux/ which should work on Debian 9 (cmake on Debian 8 is too old and it would require a bit more tricks to support the version that old), but I'm not sure what you need to do to use them as a drop-in replacement during "bootstrapping" phase. This should probably be answered by Hans. so i need to pick up bins from the farm (need to set that up here) ... i tried to make a static which bumps the binary to 14 MB and then tried lto which takes a while to finish but then bring it down to 6MB ... (so maybe some day we need an extra static tree for linuxes of all kind) 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] Column(set)s & overlapping lines
Hello, thank you for quick response - I didn't notice such question. I added some info to wiki: https://wiki.contextgarden.net/Command/startcolumnset#Note Best, Lukas On Tue, 01 Oct 2019 08:24:19 +0200, Henri Menke wrote: This has been asked many times. Columnsets need grid. \setuplayout[grid=yes] Cheers, Henri On 10/1/19 7:16 PM, Procházka Lukáš Ing. wrote: Hello, I have the following code: \definecolumnset[example][n=3,balancing=no] \definecolumnsetspan[wide][n=2] \setupexternalfigures[location=default] % \starttext \startcolumnset[example] \startcolumnsetspan[wide] %\externalfigure[hacker][width=120mm] % Produces overlapping last two lines in the first column, too \vbox to80mm{} \stopcolumnsetspan \input knuth \stopcolumnset \stoptext The last two lines in the first column overlap (it seems that the last line is typeset a bit higher than the pre-last line) - how to avoid it? Best regards, Lukas ___ 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 ___ -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Mob.: +420 702 033 396 ___ 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] Column(set)s & overlapping lines
This has been asked many times. Columnsets need grid. \setuplayout[grid=yes] Cheers, Henri On 10/1/19 7:16 PM, Procházka Lukáš Ing. wrote: > Hello, > > I have the following code: > > > \definecolumnset[example][n=3,balancing=no] > \definecolumnsetspan[wide][n=2] > > \setupexternalfigures[location=default] > > % > > \starttext >\startcolumnset[example] > \startcolumnsetspan[wide] >%\externalfigure[hacker][width=120mm] % Produces overlapping last two > lines in the first column, too >\vbox to80mm{} > \stopcolumnsetspan > > \input knuth >\stopcolumnset > \stoptext > > > The last two lines in the first column overlap (it seems that the last line > is typeset a bit higher than the pre-last line) - how to avoid it? > > Best regards, > > Lukas > > ___ 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] Column(set)s & overlapping lines
Hello, I have the following code: \definecolumnset[example][n=3,balancing=no] \definecolumnsetspan[wide][n=2] \setupexternalfigures[location=default] % \starttext \startcolumnset[example] \startcolumnsetspan[wide] %\externalfigure[hacker][width=120mm] % Produces overlapping last two lines in the first column, too \vbox to80mm{} \stopcolumnsetspan \input knuth \stopcolumnset \stoptext The last two lines in the first column overlap (it seems that the last line is typeset a bit higher than the pre-last line) - how to avoid it? Best regards, Lukas -- Ing. Lukáš Procházka | mailto:l...@pontex.cz Pontex s. r. o. | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn Bezová 1658 147 14 Praha 4 Mob.: +420 702 033 396 ___ 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 ___