Re: [NTG-context] thousand separator space
Am 21.11.22 um 23:08 schrieb Max Chernoff via ntg-context: The TeXbook recommends that you wrap the comma in curly braces $x = 1{,}000$ but there's probably a ConTeXt \setupxxx command that would have the same effect. Use \digits: https://wiki.contextgarden.net/Command/digits Hraban ___ 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] Font expansion enabled by default with the latest upload
Hi Hans, > what you observe is likely a side effect of an increase in accuracy > which gives a bit less drift in the pdf; expansion is turned off (it > would increase runtime if turned on) It's not just in the PDF though, I can also see the change from Lua. Using this document: \showframe % \definefontfeature[default][default][expansion=quality] % \usetypescript[modern-base] % \setupbodyfont[reset,modern] % \setupalign[hz] \startluacode function userdata.test(head) local last_line = node.tail(head) local i = 1 for n in node.traverse(node.tail(last_line.list), true) do print(n) if n.id == node.id("glue") then print(node.effectiveglue(n, last_line) / 65536) elseif n.width then print(n.width / 65536) end if i >= 6 then break else i = i + 1 end end return head end nodes.tasks.appendaction("finalizers", "after", "userdata.test") nodes.tasks.enableaction("finalizers", "userdata.test") \stopluacode \starttext Hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello.% \ctxlua{nodes.tasks.enableaction("finalizers", "userdata.test")} \ctxlua{nodes.tasks.disableaction("finalizers", "userdata.test")} \stoptext (A) With the expansion lines commented/default on ConTeXt "2022.11.18 13:22" I get: nil : glue righthangskip> 0.0 13299 : glue rightskip> 0.0 13263 : glue parfillskip> 0.0 12877 : penalty linepenalty> 1687 : glyph unset> 3.3341674804688 12850 : glyph unset> 5.9967041015625 (B) With the expansion lines uncommented/enabled on ConTeXt "2022.11.18 13:22" I get: nil : glue righthangskip> 0.0 13992 : glue rightskip> 0.0 13956 : glue parfillskip> 0.046096801757812 12877 : penalty linepenalty> 1687 : glyph unset> 3.3341674804688 12850 : glyph unset> 5.9967041015625 (C) With the expansion lines commented/default live.contextgarden.net I get: nil : glue righthangskip> 0.0 10943 : glue rightskip> 0.0 10909 : glue parfillskip> 6.6463470458984 10138 : penalty linepenalty> 524 : glyph 32768> 3.26220703125 10119 : glyph 32768> 5.8767700195312 (D) And with the expansion lines uncommented/enabled on live.contextgarden.net I get: nil : glue righthangskip> 0.0 11195 : glue rightskip> 0.0 11161 : glue parfillskip> 0.046096801757812 10138 : penalty linepenalty> 524 : glyph 32768> 3.3341674804688 10119 : glyph 32768> 5.9967041015625 A, B, and D all have almost the same \parfillskip widths, and the exact same "." and "o" widths. But comparing A/B/D to C, there's a 6.6pt difference in the \parfillskip values and a 0.12pt difference between the "o" widths. Maybe it's just a coincidence, but it seems odd that enabling expansion makes no difference with the latest version (A/B) and that latest with no expansion (A) gives identical results to the old version with expansion (D). Plus, a 6.6pt difference in glue lengths seems like a lot for an accuracy change. I could very easily be wrong here, but something seems off to me. Thanks, -- Max ___ 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] thousand separator space
Hi Jan, > Why is there an additional space after the thousand separator in math mode? Because something like ${\mathbb N} = \{1,2,3,4,\dots\}$ would look quite bad without any space between the numbers. (The technical reason is that commas have the math class \mathpunct, meaning that TeX automatically adds a space after them. Adding the braces converts it to \mathord, which doesn't add any spaces.) > And what can I do to get rid of the additional space? The TeXbook recommends that you wrap the comma in curly braces $x = 1{,}000$ but there's probably a ConTeXt \setupxxx command that would have the same effect. Many European languages use the comma as a decimal separator, so I'd generally recommend using a thinspace (\,) instead of a comma as a thousands separator to avoid confusion. Thanks, -- Max ___ 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] Horizontal spacing
Hi Steffen, > But how can I adjust in general the horizontal distance between glyphs > (I don't mean \kern, I am looking for a general setup)? You probably want \definecharacterkerning. See https://www.pragma-ade.nl/general/manuals/fonts-mkiv.pdf#page=171 for details on how to use it. -- Max ___ 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] thousand separator space
Dear list, Two silly short questions. Why is there an additional space after the thousand separator in math mode? And what can I do to get rid of the additional space? \starttext 1,000 \blank $1,000$ \stoptext Kind regards, Jan Willem Flamma ___ 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] Horizontal spacing
Hi, these line can modify the space between words: \installtolerancemethod {horizontal} {MySpace} {\spaceskip2.75pt plus1.60pt minus1.10pt\relax} \setupalign[line,block]\setfalse\raggedonelinerstate% kein hz=expansion mehr? \setuptolerance[MySpace] But how can I adjust in general the horizontal distance between glyphs (I don't mean \kern, I am looking for a general setup)? Steffen ___ 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] Margin figure in itemize
Dear list, With the following MWE I end up with big gaps between margin figures in an itemized list. Is there a way to remove that space in the text and place the figures in the margin one below the other the best one can? \setuppagenumbering [alternative=doublesided, location=margin] \setuplayout [header=0pt, margin=4cm, footerdistance=.5cm, topspace=1cm, backspace=1cm, cutspace=2cm, width=fit, height=\dimexpr \paperheight-\topspace+\footerheight+\footerdistance-4cm\relax] % \showframe \definefloat [marginfigure] [figure] \setupfloat [marginfigure] [outermargindistance=-\outermargintotal, default={outermargin,height,high,low,none}] \starttext \startstaticMPfigure{square} draw fullsquare scaled 3cm; \stopstaticMPfigure \startitemize \placemarginfigure{}{\usestaticMPfigure[square]} \item bla \item bla \placemarginfigure{}{\usestaticMPfigure[square]} \item bla \stopitemize \stoptext Thanks in advance, Alex ___ 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] Font expansion enabled by default with the latest upload
On 11/21/2022 10:20 AM, Max Chernoff via ntg-context wrote: Hi Hans, Font expansion (hz) seems to be enabled by default with the latest upload. If I compile this document locally with ConTeXt "2022.11.18 13:22": \showframe % \definefontfeature[default][default][expansion=quality] % \usetypescript[modern-base] % \setupbodyfont[reset,modern] % \setupalign[hz] \starttext Hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello. \stoptext I get slightly different spacing than I do when I compile the same document on live.contextgarden.net. If I compile the document with the lines uncommitted on live.contextgarden.net, I get the same results as I do on my local installation with the lines commented. Personally, I think that enabling hz expansion by default is probably a good thing, but this change will affect a very large number of documents and you never mentioned it in the announcement email, so I suspect that it was accidentally added when you added the math hz. what you observe is likely a side effect of an increase in accuracy which gives a bit less drift in the pdf; expansion is turned off (it would increase runtime if turned on) (increased accuracy was indeed a side effect of math but more to get rid of an annoyance at extreme resolutions) 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 ___
[NTG-context] Font expansion enabled by default with the latest upload
Hi Hans, Font expansion (hz) seems to be enabled by default with the latest upload. If I compile this document locally with ConTeXt "2022.11.18 13:22": \showframe % \definefontfeature[default][default][expansion=quality] % \usetypescript[modern-base] % \setupbodyfont[reset,modern] % \setupalign[hz] \starttext Hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello. \stoptext I get slightly different spacing than I do when I compile the same document on live.contextgarden.net. If I compile the document with the lines uncommitted on live.contextgarden.net, I get the same results as I do on my local installation with the lines commented. Personally, I think that enabling hz expansion by default is probably a good thing, but this change will affect a very large number of documents and you never mentioned it in the announcement email, so I suspect that it was accidentally added when you added the math hz. Thanks, -- Max ___ 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] Xml filtering in Lua
On 11/20/22 19:19, Thomas A. Schmitz via ntg-context wrote: I load data from an external xml file (not the one I'm processing) and store some of it in a lua table. local examples = lxml.load ("my_examples", "examples.xml") Replying to myself, and sorry for the noise (this was fairly easy, should have seen it earlier): instead of loading the file "examples.xml," I simply include it via xmlinclude into the tree; this way the proper setups are applied. All best Thomas ___ 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 ___