Re: [NTG-context] style option not working for headings
On 2/13/21 12:33 AM, Hans Hagen wrote: > On 2/13/2021 12:13 AM, Pablo Rodriguez wrote: >> Dear Hans, >> >> I’m afraid that style doesn’t work for headings in current latest >> (2021.02.12 18:49): >> [...] > can you check again? Many thanks for your fast fix, Hans. It works perfectly fine now. Pablo -- http://www.ousia.tk ___ 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] style option not working for headings
On 2/13/2021 12:13 AM, Pablo Rodriguez wrote: Dear Hans, I’m afraid that style doesn’t work for headings in current latest (2021.02.12 18:49): \setuphead[chapter][style=\it] \setuphead[section][style=\it] \starttext \chapter{Chapter} \section{Section} \input zapf \stoptext can you check again? - 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] style option not working for headings
On 2/13/21 12:13 AM, Pablo Rodriguez wrote: > Dear Hans, > > I’m afraid that style doesn’t work for headings in current latest > (2021.02.12 18:49): Hans, it might be that the style option doesn’t work in other commands (or at all): \setuphead[section][style=\it] \setuplist[section][style=\it] \starttext \completecontent \section{Section} \input zapf \stoptext Many thanks for your help, Pablo -- http://www.ousia.tk ___ 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] style option not working for headings
Dear Hans, I’m afraid that style doesn’t work for headings in current latest (2021.02.12 18:49): \setuphead[chapter][style=\it] \setuphead[section][style=\it] \starttext \chapter{Chapter} \section{Section} \input zapf \stoptext Many thanks for your help, Pablo -- http://www.ousia.tk ___ 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] yesterday’s version of luametatex needed
I need to reinstall luametatex version 2.08.13. Is there a page somewhere describing how to do this? 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Loop?
There's \processseparatedlist[][]\command with an arbitrary other than a comma... You should take a look at syst-aux.mkiv and syst-aux.mkxl to see more helpers: https://source.contextgarden.net/tex/context/base/mkiv/syst-aux.mkxl El vie, 12 de feb. de 2021 a la(s) 14:49, Angel M Alganza (a...@ugr.es) escribió: > Hi Jairo: > > On Fri, Feb 12, 2021 at 01:50:58PM -0500, Jairo A. del Rio wrote: > > > Hi, Ángel. Like this? > > > \def\mylist{Fulano,Mengano,Sutano} > > \def\mycommand#1{#1\blank{\red Something here}\blank} > > \starttext > > \processcommacommand[\mylist]\mycommand > > \stoptext > > Yes, exactly like this, thank you. Now, I have the names writen like: > > Family Name, Name > > So, is it possible to use a list separatd by something else than a > comma? A semicolon, for example? To test I've replaced those commas by > a colon and it works fine, but I'd rather have a comma, if possible. > > Again, thank you so much! > > Cheers, > Ángel > > ___ > 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] Loop?
Hi Jairo: On Fri, Feb 12, 2021 at 01:50:58PM -0500, Jairo A. del Rio wrote: Hi, Ángel. Like this? \def\mylist{Fulano,Mengano,Sutano} \def\mycommand#1{#1\blank{\red Something here}\blank} \starttext \processcommacommand[\mylist]\mycommand \stoptext Yes, exactly like this, thank you. Now, I have the names writen like: Family Name, Name So, is it possible to use a list separatd by something else than a comma? A semicolon, for example? To test I've replaced those commas by a colon and it works fine, but I'd rather have a comma, if possible. Again, thank you so much! Cheers, Ángel ___ 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] Loop?
Oh, I knew about the environment form, but I didn't know about \currentcommalistitem. Useful to avoid to define ad hoc commands :) As always, thank you very much for the lesson. Best regards, Jairo El vie, 12 de feb. de 2021 a la(s) 14:25, Wolfgang Schuster ( wolfgang.schuster.li...@gmail.com) escribió: > Jairo A. del Rio schrieb am 12.02.2021 um 19:50: > > Hi, Ángel. Like this? > > > > \def\mylist{Fulano,Mengano,Sutano} > > > > \def\mycommand#1{#1\blank{\red Something here}\blank} > > > > \starttext > > > > \processcommacommand[\mylist]\mycommand > > > > \stoptext > > > > There are better ways to deal with data in ConTeXt, but it's basically > > that way, I think. > > > You can use the commalist environment: > > \starttext > > \startprocesscommalist[One,Two,Three,Four] > Person Number \currentcommalistitem\par > \stopprocesscommalist > > \blank > > \defineexpandable\NameList{One,Two,Three,Four} > > \startprocesscommacommand[\NameList] > Person Number \currentcommalistitem\par > \stopprocesscommacommand > > \stoptext > > > Another way is to use the database module: > > \usemodule[database] > > \starttext > > \defineseparatedlist >[namelist] >[command=\NameEntry] > > \starttexdefinition unexpanded NameEntry #1 > Person Number #1\par > \stoptexdefinition > > \startseparatedlist[namelist] > One > Two > Three > Four > \stopseparatedlist > > \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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Loop?
Jairo A. del Rio schrieb am 12.02.2021 um 19:50: Hi, Ángel. Like this? \def\mylist{Fulano,Mengano,Sutano} \def\mycommand#1{#1\blank{\red Something here}\blank} \starttext \processcommacommand[\mylist]\mycommand \stoptext There are better ways to deal with data in ConTeXt, but it's basically that way, I think. You can use the commalist environment: \starttext \startprocesscommalist[One,Two,Three,Four] Person Number \currentcommalistitem\par \stopprocesscommalist \blank \defineexpandable\NameList{One,Two,Three,Four} \startprocesscommacommand[\NameList] Person Number \currentcommalistitem\par \stopprocesscommacommand \stoptext Another way is to use the database module: \usemodule[database] \starttext \defineseparatedlist [namelist] [command=\NameEntry] \starttexdefinition unexpanded NameEntry #1 Person Number #1\par \stoptexdefinition \startseparatedlist[namelist] One Two Three Four \stopseparatedlist \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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Loop?
Oops, it's "zutano". Sorry for the typo. Jairo :) El vie, 12 de feb. de 2021 a la(s) 13:50, Jairo A. del Rio ( jairoadelr...@gmail.com) escribió: > Hi, Ángel. Like this? > > \def\mylist{Fulano,Mengano,Sutano} > > \def\mycommand#1{#1\blank{\red Something here}\blank} > > \starttext > > \processcommacommand[\mylist]\mycommand > > \stoptext > > There are better ways to deal with data in ConTeXt, but it's basically > that way, I think. > > Jairo > > > > El vie, 12 de feb. de 2021 a la(s) 13:44, Angel M Alganza (a...@ugr.es) > escribió: > >> Hello: >> >> I am trying to print a list of names always followed by the same info >> (generated by a new command). At the moment, I have all the names >> followed by the command like so: >> >> Person Number One >> \mycommand >> Person Number Two >> \mycommand >> Person Number Three >> \mycommand >> Person Number Four >> \mycommand >> Person Number Five >> \mycommand >> . >> . >> . >> >> I'd rather have the list of people stored somewhere (a list? an array?) >> and loop through it and then inserting \mynewcommand at compilation >> time. That way, when I need to replace the list of people with a new >> one, I'd just do that instead of building the above structure again and >> again. >> >> Is it possible to do that with just ConTeXt or would I need to resort to >> Lua. I guess it should be possible both ways, but I haven't figure out >> how to do it. Any pointer, please? >> >> Thank you so much in advance. >> >> Cheers, >> Ángel >> >> ___ >> 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] Loop?
Hi, Ángel. Like this? \def\mylist{Fulano,Mengano,Sutano} \def\mycommand#1{#1\blank{\red Something here}\blank} \starttext \processcommacommand[\mylist]\mycommand \stoptext There are better ways to deal with data in ConTeXt, but it's basically that way, I think. Jairo El vie, 12 de feb. de 2021 a la(s) 13:44, Angel M Alganza (a...@ugr.es) escribió: > Hello: > > I am trying to print a list of names always followed by the same info > (generated by a new command). At the moment, I have all the names > followed by the command like so: > > Person Number One > \mycommand > Person Number Two > \mycommand > Person Number Three > \mycommand > Person Number Four > \mycommand > Person Number Five > \mycommand > . > . > . > > I'd rather have the list of people stored somewhere (a list? an array?) > and loop through it and then inserting \mynewcommand at compilation > time. That way, when I need to replace the list of people with a new > one, I'd just do that instead of building the above structure again and > again. > > Is it possible to do that with just ConTeXt or would I need to resort to > Lua. I guess it should be possible both ways, but I haven't figure out > how to do it. Any pointer, please? > > Thank you so much in advance. > > Cheers, > Ángel > > ___ > 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] Loop?
On 2/12/21 7:39 PM, Angel M Alganza wrote: Is it possible to do that with just ConTeXt or would I need to resort to Lua. I guess it should be possible both ways, but I haven't figure out how to do it. Any pointer, please? https://wiki.contextgarden.net/Processing_Lists which wasn't particularly difficult to find. 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Loop?
Hello: I am trying to print a list of names always followed by the same info (generated by a new command). At the moment, I have all the names followed by the command like so: Person Number One \mycommand Person Number Two \mycommand Person Number Three \mycommand Person Number Four \mycommand Person Number Five \mycommand . . . I'd rather have the list of people stored somewhere (a list? an array?) and loop through it and then inserting \mynewcommand at compilation time. That way, when I need to replace the list of people with a new one, I'd just do that instead of building the above structure again and again. Is it possible to do that with just ConTeXt or would I need to resort to Lua. I guess it should be possible both ways, but I haven't figure out how to do it. Any pointer, please? Thank you so much in advance. Cheers, Ángel ___ 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 upload
Hi, I uploaded a new version. I'v enow tagged all public macros (not that anyone will notice) as a step in the overload protection effort. If you want to get an idea about what we're talking of you can process s-system-macros.mkxl This file is mostly for Wolfgang and me when we update to lmtx, but it's used to identify 'todo's. We're talking tex as well as metapost here. In the process some orphan (mkii) stuff has been removed and a few small fixes applied (in code that probably no one ever encounters anyway). In lmtx I also updated the stixtwo fonts (new names again) and added libertinus (for Tomas Hala to test). Up to the next step, 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] Table of Content
On 2/12/2021 4:52 PM, Pablo Rodriguez wrote: On 2/12/21 4:40 PM, Hans Hagen wrote: On 2/12/2021 3:43 PM, Pablo Rodriguez wrote: [...] "\page\null\page" does the trick in your case. \page[left,empty,right] etc Hans, I never thought this were possible: \starttext \page[left,empty,right, left,empty,right, left,empty,right] \stoptext pretty old feature ... there are more options 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] LMTX bug? \completelistofabbreviations
Thanks, this does the job for me Kind Regards/Met vriendelijke groet, Bert Verbeek On 2/12/21 3:30 PM, Hans Hagen wrote: for now put this in cont-new.mkxl: \unprotect \let\strc_synonyms_place_list\placelistofsynonyms \protect - 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] Table of Content
On 2/12/21 4:40 PM, Hans Hagen wrote: > On 2/12/2021 3:43 PM, Pablo Rodriguez wrote: >> [...] >> "\page\null\page" does the trick in your case. > > \page[left,empty,right] etc Hans, I never thought this were possible: \starttext \page[left,empty,right, left,empty,right, left,empty,right] \stoptext Pablo -- http://www.ousia.tk ___ 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] issue printing with Acrobat?
Dear list, I have the following sample: \setuppapersize[A4, landscape] \setupinteractionscreen[option={landscape, paper}] \starttext \dorecurse{2} {\startmakeup[page][pagestate=start, align=middle] \dontleavehmode \scale[width=.8\textwidth]{middle} \stopmakeup} \stoptext Selecting paper in option from \setupinteractionscreen also sets (printing) orientation to auto. I couldn’t print the resulting PDF generated from the code above without having to set orientation to landscape (in Acrobat’s printing dialog). Otherwise, I was getting wrong orientation in printed pages. Printing was wrong in both printers I tried. Acrobat DC (reader) version is Acrobat DC (2021.001.20135). I was using both MkIV and latest LMTX. I think there might be a bug in latest Acrobat. Could anyone confirm whether the latest Acrobat DC is able to print the PDF document from the code above with the printing orientation set to automatic? -- http://www.ousia.tk ___ 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] Table of Content
On 2/11/21 12:11 PM, Ursula Hermann wrote: > Dear List! > > > I did this example, which works perfect. If i would like to take a new > page after the Table of Content, is \page the right way? Hi Ursula, "\page\null\page" does the trick in your case. "\setuppagenumber[alternative=doublesided]" is a much more consistent approach, but I don’t know what your requirements might be. Just in case it helps, Pablo -- http://www.ousia.tk ___ 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] LMTX bug? \completelistofabbreviations
On 2/12/2021 2:37 PM, Bert Verbeek wrote: Hello all, I've used ConTeXt MkIV for years to make technical reports. For a new computer I looked for updates of the software and discovered LMTX. I ran it on my latest report and found an error on \completelistofabbreviations, both on win-64 and linux. Context --luatex worked fine. A minimal file based on the wiki examples produced the same error on \completelistoftests: \definesynonyms[test][tests][\infull] \setupsynonyms[test][criterium=all] \test{ITU}{International Telecommunication Union} \test{MID}{Maritime Identification Digit} \test{Ch}{Switzerland} \starttext The \ITU\ is an organisation in \infull{Ch} % \subject{Short is nice} % \placelistoftests \completelistoftests \stoptext Did something change, or did I find a bug? for now put this in cont-new.mkxl: \unprotect \let\strc_synonyms_place_list\placelistofsynonyms \protect - 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] LMTX bug? \completelistofabbreviations
Hello all, I've used ConTeXt MkIV for years to make technical reports. For a new computer I looked for updates of the software and discovered LMTX. I ran it on my latest report and found an error on \completelistofabbreviations, both on win-64 and linux. Context --luatex worked fine. A minimal file based on the wiki examples produced the same error on \completelistoftests: \definesynonyms[test][tests][\infull] \setupsynonyms[test][criterium=all] \test{ITU}{International Telecommunication Union} \test{MID}{Maritime Identification Digit} \test{Ch}{Switzerland} \starttext The \ITU\ is an organisation in \infull{Ch} % \subject{Short is nice} % \placelistoftests \completelistoftests \stoptext Did something change, or did I find a bug? Bert ___ 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] vertical offset with "i" in position-command
On Fri, Feb 12 2021, Wolfgang Schuster wrote: > 2. Add \strut, e.g. \position(1, 1){\strut i} Ah, thanks. So the anchor is not the baseline, but the top-left corner of the content. Since "\setuppositioning[before=\strut]" does not work, I use this workaround now: \def\myPosition(#1, #2)#3{\position(#1, #2){\strut#3}} Would it make sense to add the "before" key to \setuppositioning? -- Peter ___ 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] vertical offset with "i" in position-command
Peter Münster schrieb am 12.02.2021 um 13:31: Hi, When I want to type an "i" in the position-command, there is some vertical offset: \starttext \startpositioning \position(1, 1){i} \position(2, 1){x} \position(1, 2){x} \position(2, 2){i} \position(1, 3){a} \position(2, 3){x} \position(1, 4){x} \position(2, 4){a} \stoppositioning \stoptext Why is it so, and how could I avoid that please? 1. Because the letters have different heights. \startTEXpage[offset=1ex] \processisolatedchars{aix}\ruledhbox \stopTEXpage 2. Add \strut, e.g. \position(1, 1){\strut i} 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] vertical offset with "i" in position-command
Hi, When I want to type an "i" in the position-command, there is some vertical offset: \starttext \startpositioning \position(1, 1){i} \position(2, 1){x} \position(1, 2){x} \position(2, 2){i} \position(1, 3){a} \position(2, 3){x} \position(1, 4){x} \position(2, 4){a} \stoppositioning \stoptext Why is it so, and how could I avoid that please? TIA for any hints, -- Peter ___ 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] [passing parameter into MPpage]
On 2/12/2021 12:42 PM, Floris van Manen wrote: What is the correct ways to pass parameters into a \startMPpage section? This does not produce a page (obviously if you know how it works) But how to get the intende output? \def\blz[#1][#2][#3]{ \startMPpage draw thefmttext(#1) shifted(10mm, 20mm); draw thefmttext(#2) shifted(10mm, 205m); draw thefmttext(#3) shifted(10mm, 30mm); \stopMPpage } \blz[01][02][AA] \blz[03][42][ZZ] whatever suits your purpose or taste, like \def\blz[#1]% {\begingroup \setvariables[blz][#1]% \startMPpage draw textext("\getvariable{blz}{a}") shifted(10mm, 10mm); draw textext("\getvariable{blz}{b}") shifted(10mm, 20mm); draw textext("\getvariable{blz}{c}") shifted(10mm, 30mm); \stopMPpage \endgroup} \blz[a=01,b=02,c=AA] - 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] parsing multi-valued parameters
Werner Hennrich schrieb am 12.02.2021 um 08:26: Hello everyone, please can you give me pointers on how to easiest parse multi-valued \dummyparameter{...} like in \something[...,weather={sunshine, rain, hail},...] so that I can test for e.g. rain, sunshine, wind, hail, mist, fog, storm etc, each if it is present or not? ...so I can keep my number of parameters down and my parameter list as simple as possible. I have no idea what to search for in the docs or (better) in the test cases / samples. Would be great if you could just let me know where to look or what to sarch for \starttext \def\something[#1]% {\getdummyparameters[weather=,#1]% \processallactionsinset [\dummyparameter{weather}] [sunshine=>Sunshine\endgraf, rain=>Rain\endgraf, hail=>Hail\endgraf]} \something[weather=sunshine] \blank \something[weather={sunshine,rain}] \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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] [passing parameter into MPpage]
What is the correct ways to pass parameters into a \startMPpage section? This does not produce a page (obviously if you know how it works) But how to get the intende output? \def\blz[#1][#2][#3]{ \startMPpage draw thefmttext(#1) shifted(10mm, 20mm); draw thefmttext(#2) shifted(10mm, 205m); draw thefmttext(#3) shifted(10mm, 30mm); \stopMPpage } \blz[01][02][AA] \blz[03][42][ZZ] ___ 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] Metapost: directionpoint gives unexpected point(?)
Hi, Like this: metapost.registerscript("scrutenized", function() local p = mp.scan.path() local r = math.round local d = 10^mp.scan.numeric() for i=1,#p do local pi = p[i] pi[1] = r(pi[1] * d) / d pi[2] = r(pi[2] * d) / d end local x1 = r(p[1][1]) local y1 = r(p[1][2]) local n = 1 local t = { p[1], cycle = p.cycle } for i=2,#p do local pi = p[i] local x2 = r(pi[1]) local y2 = r(pi[2]) if x1 ~= x2 or y1 ~= y2 then n = n + 1 t[n] = p[i] x1 = x2 y1 = y2 end end mp.inject.path(t) end) \stopluacode \startMPdefinitions{doublefun} newscriptindex mfid_scrutenized ; mfid_scrutenized := scriptindex "scrutenized" ; primarydef p scrutenized n = runscript mfid_scrutenized p n enddef ; \stopMPdefinitions and then p[1] := p[1] scrutenized 5 ; % 5 decimals p[2] := p[2] scrutenized 5 ; % 5 decimals 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] Metapost: directionpoint gives unexpected point(?)
> On 12 Feb 2021, at 10:31, Mikael Sundqvist wrote: > > Hi Taco, > > thanks, from your observation and the way I build the paths, I found > out that I can avoid the problem by shortening the paths I join just > slightly: > > cl := (fullcircle scaled 4u) shifted z0; > cl := cl cutbefore point (1/6+epsilon) along cl cutafter point > (2/6-epsilon) along cl; > cs := (fullcircle scaled 16u) shifted z1; > cs := cs cutafter point (1/6-epsilon) along cs; > > and indeed, it works here now, with different values of the scale u, > and it seems more stable. Here is a quick hack I wrote that does the cleanup in a postprocessing stage. It is not very generic or clever, but it works for your case: def clean_path(suffix p) = begingroup; save q,precontrols,postcontrols,points, skip, i,j; boolean skip; pair precontrols[],postcontrols[],points[] ; j := 0; for i = 0 upto length p: skip := false; if abs(xpart point i of p - xpart point i+1 of p)<0.01: if abs(ypart point i of p - ypart point i+1 of p)<0.01: skip := true; fi fi if not skip: points[j] := point i of p; postcontrols[j] := postcontrol i of p; precontrols[j+1] := precontrol i+1 of p; j := j + 1; fi endfor; if abs(xpart point 0 of p - xpart point length p of p)<0.01: if abs(ypart point 0 of p - ypart point length p of p)<0.01: j := j - 1; fi fi p := for i=0 upto j-1: points[i] .. controls postcontrols[i] and precontrols[i+1] .. endfor cycle; endgroup; enddef; show p0; clean_path(p0); show p0; > > PS I found out that eps and epsilon both worked, and I do not see in > the metafun manual if there is a difference. The original intent was for eps to be just a ’small enough value that a human will not notice it’ where epsilon is intended as ’the smallest representable value’. Neither really work that way because depending on how you use metapost eps can be quite visible (especially in non-scaled number systems) and (more importantly) in the new non-scaled number systems epsilon cannot really be the smallest representable value for numerical and practical reasons. So in reality, we always use these definitions: eps := .00049 ; % this is a pretty small positive number epsilon := 1/256/256 Best wishes, Taco — Taco Hoekwater E: t...@bittext.nl genderfluid (all pronouns) ___ 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] Metapost: directionpoint gives unexpected point(?)
On 2/12/2021 9:35 AM, Taco Hoekwater wrote: Hi, On 11 Feb 2021, at 17:41, Mikael Sundqvist wrote: Thanks for your investigation and extended example! So, if I understand it correctly, the problem occurs where the different circles are glued together with the .. construction. Took me a while to get it, but the problem is the definition of p0: p[0] := cs .. cl .. (cs rotated 120) .. (cl rotated 120) .. (cs rotated 240) .. (cl rotated 240) .. cycle; Here are cs and cl after your earlier definition: cs := (141.732246,-49.097491614210789) ..(75.312386775380347,111.25424516116959) ..(28.347427842053655,147.2925755432174); cl := (28.346108531095332,147.29283827977969) ..(0,154.88788322842163) ..(-28.346108531095332,147.29283827977969); Note how the last point of cs and the first point of cl are nearly the same. When you combine these bits into p0, p0 becomes a cyclic path with 18 points (where you really want/need only 12 points). The micro-segments between these nearly-identical paths are the problem. At smaller u values the differences between the points become zero, and the directionpoint of a path of length zero is mathematically undefined. I do not know a quick generic solution off hand, but that is what the issue is. Brilliant, as usual. So, now I can kick in with the dirty hackery (can be some proper thing but that's for later): \starttext \startluacode function mp.foo() local p = mp.scan.path() local r = math.round local d = 10 for i=1,#p do local pi = p[i] pi[1] = r(pi[1] * d) / d pi[2] = r(pi[2] * d) / d end local x1 = r(p[1][1]) local y1 = r(p[1][2]) local n = 1 local t = { p[1], cycle = p.cycle } for i=2,#p do local x2 = r(p[i][1]) local y2 = r(p[i][2]) if x1 ~= x2 or y1 ~= y2 then n = n + 1 t[n] = p[i] x1 = x2 y1 = y2 end end --inspect(t) mp.inject.path(t) end \stopluacode \startMPdefinitions{doublefun} def FOO(expr u) = path p[]; % This defines the reulleaux curves % p[0] is a "base" reulleaux curve path cl,cs,rl ; z0 = (0,6/sqrt(3)*u); z1 = z0 rotated 120; cl := (fullcircle scaled 4u) shifted z0; cl := cl cutbefore point 1/6 along cl cutafter point 2/6 along cl; cs := (fullcircle scaled 16u) shifted z1; cs := cs cutafter point 1/6 along cs; p[0] := cs .. cl .. (cs rotated 120) .. (cl rotated 120) .. (cs rotated 240) .. (cl rotated 240) .. cycle; % p[0] := runscript("mp.foo()") p[0]; % the first curve (darkyellow) % p[1] := p[0] rotated 27 shifted (-10u,2u); p[1] := p[0] rotated 27 shifted (-10u,2u); draw p1 withpen pencircle scaled 2bp withcolor darkyellow; % the second curve (darkblue) p[2] := p[1] rotated 180; draw p2 withpen pencircle scaled 2bp withcolor darkblue; if true : p[1] := runscript("mp.foo()") p[1]; p[2] := runscript("mp.foo()") p[2]; p3 := for phi=0 step 30 until 360: ((directionpoint dir(phi) of p1) shifted (directionpoint dir(phi) of p2)) .. endfor cycle; draw p3 withpen pencircle scaled 2bp withcolor darkred; else : drawarrow for phi=0 step 30 until 360: (directionpoint dir(phi) of p1) -- endfor cycle withpen pencircle scaled 1bp withcolor darkgreen; drawarrow for phi=0 step 30 until 360: (directionpoint dir(phi) of p2) -- endfor cycle withpen pencircle scaled 1bp withcolor darkmagenta; drawarrow for phi=0 step 30 until 360: ((directionpoint dir(phi) of p1) shifted (directionpoint dir(phi) of p2)) -- endfor cycle withpen pencircle scaled 1bp withcolor darkred; fi ; % We give one direction as example % These are merely here to show the construction of the curve % But they also show what is going wrong direx:=40; z11=directionpoint dir(direx) of p1; z22=directionpoint dir(direx) of p2; p4 = ((-u,0)--(u,0)) rotated direx; % These arrows should be tangent drawarrow p4 shifted z11; drawarrow p4 shifted z22; drawarrow p4 shifted (z11 shifted z22); % Draw the parallelogram. draw origin -- z11 dashed evenly; draw origin -- z22 dashed evenly; draw z11 -- (z11 shifted z22) dashed evenly; draw z22 -- (z11 shifted z22) dashed evenly; enddef ; \stopMPdefinitions \startMPpage[offset=4bp,instance=doublefun] FOO(1cm); \stopMPpage \startMPpage[offset=4bp,instance=doublefun] FOO(.8cm); \stopMPpage \startMPpage[offset=4bp,instance=doublefun] FOO(.5cm); \stopMPpage \startMPpage[offset=4bp,instance=doublefun] FOO(.2cm); \stopMPpage \stoptext - 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 wel
Re: [NTG-context] Metapost: directionpoint gives unexpected point(?)
Hi Taco, thanks, from your observation and the way I build the paths, I found out that I can avoid the problem by shortening the paths I join just slightly: cl := (fullcircle scaled 4u) shifted z0; cl := cl cutbefore point (1/6+epsilon) along cl cutafter point (2/6-epsilon) along cl; cs := (fullcircle scaled 16u) shifted z1; cs := cs cutafter point (1/6-epsilon) along cs; and indeed, it works here now, with different values of the scale u, and it seems more stable. /Mikael PS I found out that eps and epsilon both worked, and I do not see in the metafun manual if there is a difference. On Fri, Feb 12, 2021 at 9:35 AM Taco Hoekwater wrote: > > Hi, > > > On 11 Feb 2021, at 17:41, Mikael Sundqvist wrote: > > > > Thanks for your investigation and extended example! > > > > So, if I understand it correctly, the problem occurs where the > > different circles are glued together with the .. construction. > > Took me a while to get it, but the problem is the definition of p0: > > p[0] := cs .. cl .. (cs rotated 120) .. (cl rotated 120) .. (cs rotated 240) > .. (cl rotated 240) .. cycle; > > Here are cs and cl after your earlier definition: > > cs := (141.732246,-49.097491614210789) > ..(75.312386775380347,111.25424516116959) > ..(28.347427842053655,147.2925755432174); > > cl := (28.346108531095332,147.29283827977969) > ..(0,154.88788322842163) > ..(-28.346108531095332,147.29283827977969); > > Note how the last point of cs and the first point of cl are nearly the same. > When you combine these bits into p0, p0 becomes a cyclic path with 18 points > (where you really want/need only 12 points). > > The micro-segments between these nearly-identical paths are the problem. At > smaller u values the differences between the points become zero, and the > directionpoint of a path of length zero is mathematically undefined. > > I do not know a quick generic solution off hand, but that is what the issue > is. > > Best wishes, > Taco > > > ___ > 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] Metapost: directionpoint gives unexpected point(?)
Hi, > On 11 Feb 2021, at 17:41, Mikael Sundqvist wrote: > > Thanks for your investigation and extended example! > > So, if I understand it correctly, the problem occurs where the > different circles are glued together with the .. construction. Took me a while to get it, but the problem is the definition of p0: p[0] := cs .. cl .. (cs rotated 120) .. (cl rotated 120) .. (cs rotated 240) .. (cl rotated 240) .. cycle; Here are cs and cl after your earlier definition: cs := (141.732246,-49.097491614210789) ..(75.312386775380347,111.25424516116959) ..(28.347427842053655,147.2925755432174); cl := (28.346108531095332,147.29283827977969) ..(0,154.88788322842163) ..(-28.346108531095332,147.29283827977969); Note how the last point of cs and the first point of cl are nearly the same. When you combine these bits into p0, p0 becomes a cyclic path with 18 points (where you really want/need only 12 points). The micro-segments between these nearly-identical paths are the problem. At smaller u values the differences between the points become zero, and the directionpoint of a path of length zero is mathematically undefined. I do not know a quick generic solution off hand, but that is what the issue is. Best wishes, Taco ___ 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] parsing multi-valued parameters
a, so easy - thank you Hans! cheers, Werner Am 12.02.21 um 09:01 schrieb Hans Hagen: On 2/12/2021 8:26 AM, Werner Hennrich wrote: Hello everyone, please can you give me pointers on how to easiest parse multi-valued \dummyparameter{...} like in \something[...,weather={sunshine, rain, hail},...] so that I can test for e.g. rain, sunshine, wind, hail, mist, fog, storm etc, each if it is present or not? ...so I can keep my number of parameters down and my parameter list as simple as possible. I have no idea what to search for in the docs or (better) in the test cases / samples. Would be great if you could just let me know where to look or what to sarch for \setvariables[mynamespace][a=1,b=2,c={3,4,5}] \doifelseinset{4}{\getvariable{mynamespace}{c}}{FOUR}{OEPS} \setvariables[mynamespace][d={one,two,three,four}] \doifelseinset{4}{\getvariable{mynamespace}{c}}{FOUR}{OEPS} \doifelseinset{two}{\getvariable{mynamespace}{d}}{y}{n} of course when you need millions of (similar) checks you might go for another approach but this is still doable (0.02 sec per 10K on my machien so less on yours) 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] parsing multi-valued parameters
On 2/12/2021 8:26 AM, Werner Hennrich wrote: Hello everyone, please can you give me pointers on how to easiest parse multi-valued \dummyparameter{...} like in \something[...,weather={sunshine, rain, hail},...] so that I can test for e.g. rain, sunshine, wind, hail, mist, fog, storm etc, each if it is present or not? ...so I can keep my number of parameters down and my parameter list as simple as possible. I have no idea what to search for in the docs or (better) in the test cases / samples. Would be great if you could just let me know where to look or what to sarch for \setvariables[mynamespace][a=1,b=2,c={3,4,5}] \doifelseinset{4}{\getvariable{mynamespace}{c}}{FOUR}{OEPS} \setvariables[mynamespace][d={one,two,three,four}] \doifelseinset{4}{\getvariable{mynamespace}{c}}{FOUR}{OEPS} \doifelseinset{two}{\getvariable{mynamespace}{d}}{y}{n} of course when you need millions of (similar) checks you might go for another approach but this is still doable (0.02 sec per 10K on my machien so less on yours) 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 ___