Re: [NTG-context] \unit parser ignoring case, in some cases.
On Mon, 13 Mar 2023 15:55:50 -0600 Gavin via ntg-context wrote: > > you can look at phys-dim and see plenty of short and long keys and > > making all case insensitive is asking for troubles > > Indeed, I would like to make NONE of them case insensitive. But > currently, when I register an upper case key (C=coulomb) it messes up > the lower case prefix (“cm" gets typeset as C•m). I was expecting the > parser to distinguish between the “C” and “c”, but it doesn’t. Is > that intended? Indeed, \unit{} should allow (and presently does not) K, C, etc. Alan ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] How to extend an existing macro to take optional parameters?
Designating "optional" parameters within [...] is a LaTeX notion. ConTeXt handles parameters differently. Alan > > and I'd like to be able to extend it so that any of the following > > can be used: > > > >\mycommand{aa}{bb}{cc} > >\mycommand{aa}{bb}{cc}{dd} > >\mycommand{aa}{bb}{cc}{dd}[ee] > > > > or > > > >\mycommand[ee]{aa}{bb}{cc}{dd} % if this is more the ConTeXt way > > > > where {dd} is the optional extra parameter and, if it is present, > > then [ee] can also be optionally added (because it controls how > > {dd} is printed). ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] \unit parser ignoring case, in some cases.
> On Mar 13, 2023, at 3:44 PM, Hans Hagen via ntg-context > wrote: > > On 3/9/2023 2:04 PM, Gavin via ntg-context wrote: >> \startformula >> \unit{3 meter} \qquad >> \unit{6 Meter} \qquad >> \unit{3 mEtEr} \qquad >> \stopformula >> Units with lowercase prefixes (c, k, n). >> \startformula >> \unit{3cm} \qquad >> \unit{6kg} \qquad >> \unit{3ns} \qquad >> \stopformula >> Units with capital letters, called with names (coulomb, kelvin, newton). >> \startformula >> \unit{3 coulomb} \qquad >> \unit{6 kelvin} \qquad >> \unit{3 newton} \qquad >> \stopformula > > you can look at phys-dim and see plenty of short and long keys and making all > case insensitive is asking for troubles Indeed, I would like to make NONE of them case insensitive. But currently, when I register an upper case key (C=coulomb) it messes up the lower case prefix (“cm" gets typeset as C•m). I was expecting the parser to distinguish between the “C” and “c”, but it doesn’t. Is that intended? Gavin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] \unit parser ignoring case, in some cases.
On 3/9/2023 2:04 PM, Gavin via ntg-context wrote: \startformula \unit{3 meter} \qquad \unit{6 Meter} \qquad \unit{3 mEtEr} \qquad \stopformula Units with lowercase prefixes (c, k, n). \startformula \unit{3cm} \qquad \unit{6kg} \qquad \unit{3ns} \qquad \stopformula Units with capital letters, called with names (coulomb, kelvin, newton). \startformula \unit{3 coulomb} \qquad \unit{6 kelvin} \qquad \unit{3 newton} \qquad \stopformula you can look at phys-dim and see plenty of short and long keys and making all case insensitive is asking for troubles 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] How to extend an existing macro to take optional parameters?
On 3/12/2023 2:24 PM, Bruce Horrocks via ntg-context wrote: I have an existing macro that I'd like to extend. The current definition is \define[3]\mycommand{...} which I'd like to extend to take an optional 4th parameter plus an optional setup parameter. Thus I currently invoke it as: \mycommand{aa}{bb}{cc} and I'd like to be able to extend it so that any of the following can be used: \mycommand{aa}{bb}{cc} \mycommand{aa}{bb}{cc}{dd} \mycommand{aa}{bb}{cc}{dd}[ee] or \mycommand[ee]{aa}{bb}{cc}{dd} % if this is more the ConTeXt way where {dd} is the optional extra parameter and, if it is present, then [ee] can also be optionally added (because it controls how {dd} is printed). If it helps, the actual body of the macro can easily be a call to Lua so it's fine if the function takes 5 params where 4 and 5 can be nil or empty strings. I've trawled through syst-aux.mkiv but it only covers optional numbers of [ ] or { } but not combinations of both (which given the vast numbers of combinations is perhaps not surprising!). Have I missed something obvious that would help me? So, four optional with mandate {} plus a fallback to an optional [] \starttext \tolerant\def\mycommand#=#=#=#=#:[#5]% {\ifparameter#1\or(1:#1)\fi \ifparameter#2\or(2:#2)\fi \ifparameter#3\or(3:#3)\fi \ifparameter#4\or(4:#4)\fi \ifparameter#5\or[5:#5]\fi} \startbuffer \mycommand{aa}{bb}{cc} \mycommand{aa}{bb}{cc}{dd} \mycommand{aa}{bb}{cc}{dd}[ee] \mycommand{aa}{bb}{cc} \mycommand{aa}{bb}{cc}{dd} \mycommand{aa}{bb}{cc}{dd}[ee] \stopbuffer \typebuffer \startlines \getbuffer \stoplines \stoptext I'm not saying that it's the best solution, you can add \protected in front of the \def if needed. 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] extra lines in PDF annotations
On 3/13/2023 4:22 PM, Pablo Rodriguez via ntg-context wrote: On 3/13/23 16:06, Pablo Rodriguez via ntg-context wrote: Dear list, using current latest from 2023.03.10 12:18, I have this XML sample: I apologize, XML source doesn’t have lines inside, such as in: I hope EOLs are fine now. dunno ... no full example so ... 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Did dotless i disappear ?
Hi Pablo, Hans, Wolfgang, Indeed, thanks to you I see that in ConTeXt there exist plenty of solutions for the problem I reported. That’s really impressive ! Best regards : Otared > On 13 Mar 2023, at 20:19, Hans Hagen via ntg-context > wrote: > > On 3/13/2023 4:28 PM, Otared Kavian via ntg-context wrote: >> Hi Hans, >> I just noticed that the dotless i « \i » is not anymore recognized in >> ConTeXt. Of course one can nowadays find other ways to have it typeset, but >> in old documents which are included as inputs one has to correct this >> manually (for instance in French « connaître » was typed as « conn\^{\i}tre >> »). >> Here is an example. >> \starttext >> Bío Bío (works fine…) >> B\'{\i}o B\'{\i}o % this gives an error >> \stoptext > I'll add checking for the \i too. It's all part of a parser. Think > > \chr {e acute} > \chr {i circumflex} > \^{i} \^i \^{\i} > \^{a} \"{a} > \withcircumflex{a} > \withdiaeresis{a} > > a bit messy code due to reuse of all kin dof mechanisms. > > 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 / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ Otared Kavian e-mail: ota...@gmail.com Phone: +33 6 88 26 70 95 ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Did dotless i disappear ?
On 3/13/2023 4:28 PM, Otared Kavian via ntg-context wrote: Hi Hans, I just noticed that the dotless i « \i » is not anymore recognized in ConTeXt. Of course one can nowadays find other ways to have it typeset, but in old documents which are included as inputs one has to correct this manually (for instance in French « connaître » was typed as « conn\^{\i}tre »). Here is an example. \starttext Bío Bío (works fine…) B\'{\i}o B\'{\i}o % this gives an error \stoptext I'll add checking for the \i too. It's all part of a parser. Think \chr {e acute} \chr {i circumflex} \^{i} \^i \^{\i} \^{a} \"{a} \withcircumflex{a} \withdiaeresis{a} a bit messy code due to reuse of all kin dof mechanisms. 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Did dotless i disappear ?
Otared Kavian via ntg-context schrieb am 13.03.2023 um 16:28: Hi Hans, I just noticed that the dotless i « \i » is not anymore recognized in ConTeXt. Of course one can nowadays find other ways to have it typeset, but in old documents which are included as inputs one has to correct this manually (for instance in French « connaître » was typed as « conn\^{\i}tre »). Here is an example. \starttext Bío Bío (works fine…) B\'{\i}o B\'{\i}o % this gives an error \stoptext \setupbodyfont[pagella] \starttext conna\withcircumflex{\dotlessi}tre connaître B\withacute{\dotlessi}o Bío \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Did dotless i disappear ?
On 3/13/23 16:28, Otared Kavian via ntg-context wrote: > Hi Hans, > > I just noticed that the dotless i « \i » is not anymore recognized in > ConTeXt. Of course one can nowadays find other ways to have it > typeset, but in old documents which are included as inputs one has to > correct this manually (for instance in French « connaître » was typed > as « conn\^{\i}tre »). Hi Otared I think what doesn’t work is the dotless i as combining character for i + diacritical mark. It seems that standard i may combine fine: \setupinteractionscreen[option=max] \starttext \startTEXpage[offset=1ex] %\i %\'{\i} %\^{\i} \'{i} \^{i} \stopTEXpage \stoptext And \i outputs a dotless i. Just in case it helps, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Did dotless i disappear ?
Hi Hans, I just noticed that the dotless i « \i » is not anymore recognized in ConTeXt. Of course one can nowadays find other ways to have it typeset, but in old documents which are included as inputs one has to correct this manually (for instance in French « connaître » was typed as « conn\^{\i}tre »). Here is an example. \starttext Bío Bío (works fine…) B\'{\i}o B\'{\i}o % this gives an error \stoptext Best regards: Otared ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] extra lines in PDF annotations
On 3/13/23 16:06, Pablo Rodriguez via ntg-context wrote: > Dear list, > > using current latest from 2023.03.10 12:18, I have this XML sample: > > > > > > I apologize, XML source doesn’t have lines inside, such as in: I hope EOLs are fine now. Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] extra lines in PDF annotations
Dear list, using current latest from 2023.03.10 12:18, I have this XML sample: And the following environment: \setupinteraction[state=start] \startxmlsetups xml:text \xmlsetsetup{\xmldocument} {pre} {xml:copy:html} \stopxmlsetups \xmlregistersetup{xml:text} \startxmlsetups xml:copy:html \xmltobuffer{#1}{.}{text} \comment[location=inmargin,buffer=text]{} \attachment[method=hidden, name=attach.xml, buffer=text] \null \stopxmlsetups If I save the XML file with Windows EOL chars (CR LF), I get extra blank lines in the PDF annotation. Everything is fine, if XML has Unix line endings (LF char). Attachment contains the proper line ending in each case. Could anyone confirm what appears to be a tricky issue? Many thanks for your help, Pablo ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Table
Dear Mikael! Many thanks, that works great! Uschi Von: ntg-context Im Auftrag von Mikael Sundqvist via ntg-context Gesendet: Montag, 13. März 2023 14:16 An: mailing list for ConTeXt users Cc: Mikael Sundqvist Betreff: Re: [NTG-context] Table Hi Uschi, On Mon, Mar 13, 2023 at 1:03 PM Ursula Hermann via ntg-context mailto:ntg-context@ntg.nl>> wrote: I’d like to do a Table lik this one [enter image description here] I have no example. How can I do that? Many thanks Uschi There are probably better ways, but this seems to give something like what you look for: \starttext \setupTABLE[c][align=middle] \setupTABLE[c][odd][width=2em] \setupTABLE[c][even][width=1mm] \setupTABLE[r][2][height=1mm] \setupTABLE[c][1][leftframe=off] \setupTABLE[c][5][rightframe=off] \bTABLE \bTR \bTD 1 \eTD \bTD \eTD \bTD 2 \eTD \bTD \eTD \bTD 3 \eTD \eTR \bTR \bTD \eTD \bTD \eTD \bTD \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTD 4 \eTD \bTD \eTD \bTD 5 \eTD \bTD \eTD \bTD 6 \eTD \eTR \bTR \bTD 7 \eTD \bTD \eTD \bTD 8 \eTD \bTD \eTD \bTD 9 \eTD \eTR \eTABLE \stoptext /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Table
Hi Uschi, On Mon, Mar 13, 2023 at 1:03 PM Ursula Hermann via ntg-context < ntg-context@ntg.nl> wrote: > I’d like to do a Table lik this one > > [image: enter image description here] > > I have no example. How can I do that? > > > > Many thanks > > Uschi > There are probably better ways, but this seems to give something like what you look for: \starttext \setupTABLE[c][align=middle] \setupTABLE[c][odd][width=2em] \setupTABLE[c][even][width=1mm] \setupTABLE[r][2][height=1mm] \setupTABLE[c][1][leftframe=off] \setupTABLE[c][5][rightframe=off] \bTABLE \bTR \bTD 1 \eTD \bTD \eTD \bTD 2 \eTD \bTD \eTD \bTD 3 \eTD \eTR \bTR \bTD \eTD \bTD \eTD \bTD \eTD \bTD \eTD \bTD \eTD \eTR \bTR \bTD 4 \eTD \bTD \eTD \bTD 5 \eTD \bTD \eTD \bTD 6 \eTD \eTR \bTR \bTD 7 \eTD \bTD \eTD \bTD 8 \eTD \bTD \eTD \bTD 9 \eTD \eTR \eTABLE \stoptext /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Table
I'd like to do a Table lik this one [enter image description here] I have no example. How can I do that? Many thanks Uschi ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___