[NTG-context] nbsp in XML (S01E01)
Dear list, first episode of series on nbsp of XML in lmtx. Unfortunately, not that catchy as Netflix. Used XML input has two types of non-breakable space: - unicode character - html entitity (in fact an ugly output of HTML editor) HTML is preprocessed with ctx preprocessor (great feature!) and substituted for unicode char nbsp or tilde. MWE shows unichar spaces are non-breakable (see end of the first lines), however they are not stretchable (see second line of the paragraphs). Does unicode nbsp have fixed with in ctx? When tilde is the replacement in preprocessor (uncomment first replacement in preprocessor), xmlfush will display tilde (which is, as character, non-breakable and unstretchable, no surprise). Why tilde is displayed? Replacing or adding nbsp (tilde) with finalizers have different results, see next episode after this one is understood. Thank you, Jano MWE (rather use attached file not to loose invisible characters): \startbuffer[doc] Temperature 20 °C 20 °C 20 °C 20 °C average. Altitude 6000nbsp;m 6000nbsp;m 6000nbsp;m 6000nbsp;m average. \stopbuffer \startluacode function lxml.preprocessor(data) -- data = string.gsub(data, "nbsp;", "~") -- replacement nbsp invisible in luacode data = string.gsub(data, "nbsp;", " ") return data end \stopluacode \startxmlsetups xml:name \xmlsetsetup{\xmldocument}{*}{-} \xmlsetsetup{\xmldocument}{document|p}{xml:name:*} \stopxmlsetups \xmlregistersetup{xml:name} \startxmlsetups xml:name:document \xmlflush{#1}\par \stopxmlsetups \startxmlsetups xml:name:p \parfillskip0pt\xmlflush{#1}\par \stopxmlsetups \startTEXpage[offset=5mm,width=60mm] \xmlprocessbuffer{xml:name}{doc}{} \stopTEXpage xml-and-space-preprocessor.tex Description: Binary data ___ 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 update: two experimental features
Hi, I uploaded a new version. There are two new features that are experimental. This time we attempt to deal with the more tricky things and artifacts of the otherwise nice tex machinery we need to get rid of. One can rightfully argue that they are not really issues as one can work around them (and so they are never brought to attention) but why not make things better (cleaner) if we can. (1) Languages: hyphenation normally uses a hyphen and the engine has some messy work-around-border-cases in the hyphenator. So, I wondered if we could improve that. First of all, there can now be more than one hyphen character so here is the way to deal with it (the hyphenchar code is like the other 'codes'): \hccode"002D = "002D \hccode"2010 = "2010 \hccode"2013 = "2013 \hccode"2014 = "2014 This makes all these four into (kind of) compound word seperators: \startTEXpage \hsize3mm firstpart\char"002D secondpart\blank firstpart\char"2010 secondpart\blank firstpart\char"2013 secondpart\blank firstpart\char"2014 secondpart \stopTEXpage will work ok. There are provisions for those characters being at the left and right edges. All is under low level (engine) option controls (compatibility and such) but currently I enable all. With a bit of definitions one can for the 002D and 2010 cases deal with pre/post variants .. the question is do we need that for more, if so, then I need to add some more code (doable). This feature relates to Denis collection of German compound words and ligature prevention data. Dutch has the same issue. (Denis: we can ditch the compound word entries now, the ones with -.) Also, this kind of automatism (keep in mind that normally tex won't hyphenate the first word in such a compound) is especially handy in cases where there is no control over the input as with xml (when we do have control you can use || as compound word marker). (I'm wondering if we should deal with the typical somewhat archaic tex -- and --- in a different manner, but I'll come back to that.) (2) Math: what is added is not so much an issue in traditional tex math usage which is for journals but as context is used for educational purposes and thereby has quite some tricks built in. Some of these jump through ugly hoops to get it done. Here I stick to color as example. Just try this (notice the spacing): \startTEXpage[offset=10pt] \showmakeup[mathglue]% \enableexperiments[simplegroups]% $ a = b \color[red]{=} c \startcolor[blue]=\stopcolor d $\par $ \sin \color[green]{(x)} = \sin {(x)} $\par \disableexperiments[simplegroups]% $ a = b \color[red]{=} c \startcolor[blue]=\stopcolor d $\par $ \sin \color[green]{(x)} = \sin {(x)}$\par \stopTEXpage The 'simplegroups' experiment enables a more hybrid grouping model but we (read: Wolfgang, Aditya and I, but input is welcome) need to check for side effects carefully. The 'mathglue' tracker is also new, and it exposes what actually goes on. It has to do with the fact that something grouped with { } creates a math list which enforces different spacing but in the case of color that is a side effect we don't want (of course it relates to how context implements the \color macro and one could work around it, but the problem is of a more general nature. 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] braces removed in url
Dear list, I have the following sample: \setupinteraction[state=start] \starttext \startTEXpage[offset=1em] \def\MyURL#1{\goto{\hyphenatedurl{#1}}[url(#1)]} \MyURL{a={b}}\\ \MyURL{a=\letterleftbrace b\letterrightbrace}\\ \asciimode\MyURL{a={b}}\\ \stopTEXpage \stoptext For all three options, destination is a=#b. Both with MkIV and MkXL. What am I missing to get the destination a={b}? 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] metafun / patterns
Hi, As I'm still in metafun (and svg) mode I decided to support patterns (that are already supported at the tex end) also in metafun. As there has never been demands I suppose it's not that interesting but it sort of fits in. There are some tricky aspectx involved so the interface might evolve a bit (some more control options) but here are some examples anyway: \starttext \startMPpage[offset=1cm] draw (fullcircle scaled 5cm shifted (0cm,0cm)) withpattern image (fill fullcircle scaled 1cm withcolor "darkblue" ;) withpatternscale (1/10,1/10) ; draw (fullcircle scaled 5cm shifted (5cm,0cm)) withpattern image (fill fullcircle scaled 5mm withcolor "darkred" ;) withpatternscale (1/20,1/20) ; draw (fullcircle scaled 5cm shifted (10cm,0cm)) withpattern image (fill fullcircle scaled 5mm withcolor "darkgreen" ;) withpatternscale (1/40,1/40) ; draw (fullcircle scaled 5cm shifted (0cm,5cm)) withpattern image (fill fullcircle scaled 1cm withcolor "darkcyan" ;) withpatternscale (1/10,1/20) ; draw (fullcircle scaled 5cm shifted (5cm,5cm)) withpattern image (fill fullcircle scaled 5mm withcolor "darkmagenta" ;) withpatternscale (1/20,1/40) ; draw (fullcircle scaled 5cm shifted (10cm,5cm)) withpattern image (fill fullcircle scaled 5mm withcolor "darkyellow" ;) withpatternscale (1/40,1/80) ; \stopMPpage \startMPpage[offset=1cm] fill fullcircle scaled 11cm withcolor "darkyellow" ; draw fullcircle scaled 10cm withpattern image (fill fullcircle scaled 1cm withcolor "darkblue" ;) ; draw fulldiamond scaled 8cm withpattern image (fill fulldiamond scaled 4mm withcolor "darkgreen" ;) rotated 15 ; draw fulltriangle scaled 9cm withpattern image (fill fulltriangle scaled 3mm withcolor "white" ;) rotated 45 ; draw fullcircle scaled 10cm withpattern image (draw textext("!") withcolor "middlegray" ;) rotated 45 ; draw fullcircle scaled 10cm withpen pencircle scaled 1mm withcolor "darkgray" ; \stopMPpage \startMPpage[instance=doublefun] draw closedcurve(unitsquare xyscaled (200,200) shifted (0,-200)) withpattern image (fill closedcurve((fullcircle scaled 40 shifted (25,-25))) withcolor "darkgray" withopacity .5) withpatternscale (1,1) ; draw closedcurve(unitsquare xyscaled (200,200) shifted (0,-200)) withpattern image (fill closedcurve((fullcircle scaled 40 shifted (25,-25))) withcolor "darkred" withopacity .5) withpatternscale (1/2,1/2) ; draw closedcurve(unitsquare xyscaled (200,200) shifted (0,-200)) withpattern image (fill closedcurve((fullcircle scaled 40 shifted (25,-25))) withcolor "darkgreen" withopacity .5) withpatternscale (1/3,1/3) ; draw closedcurve(unitsquare xyscaled (200,200) shifted (0,-200)) withpattern image (fill closedcurve((fullcircle scaled 40 shifted (25,-25))) withcolor "darkblue" withopacity .5) withpatternscale (1/4,1/4) ; \stopMPpage % \startTEXpage \page \startMPcode{doublefun} draw closedcurve(unitsquare xyscaled (200,200) shifted (0,-400)) withpattern image (fill closedcurve((fullcircle scaled 40 shifted (25,-25 withpatternscale (1/8,1/8) ; \stopMPcode \blank \startMPcode{doublefun} draw closedcurve(unitsquare xyscaled (200,200) shifted (0,-400)) withpattern image (fill closedcurve((fullcircle scaled 40 shifted (25,-25 withpatternfloat true withpatternscale (1/8,1/8) ; \stopMPcode \page % \stopTEXpage % \startMPpage[instance=doublefun] % draw closedcurve(unitsquare xyscaled (200,200) shifted (0,-200)) % withpattern image ( fill closedcurve(unitsquare xyscaled (50,50) shifted (0,-50)) withcolor svgcolor(0.529,0.808,0.922) ; fill closedcurve(unitsquare xyscaled (25,25) shifted (0,-25)) withshademethod "linear" % withshadecenteronefraction (0,1) % withshadecentertwofraction (0,0) % withshadestep ( withshadefraction 0.05 withshadecolors (svgcolor(1,0,0),svgcolor(1,0,0)) ) % withshadestep ( withshadefraction 0.95 withshadecolors (svgcolor(1,0,0),svgcolor(1,0.5,0)) ) ; fill closedcurve((fullcircle scaled 40 shifted (25,-25))) withshademethod "linear" % withshadestep ( withshadefraction 0.05 withshadecolors (svggray(1),svggray(1)) ) % withshadestep ( withshadefraction 0.95 withshadecolors (svggray(1),svgcolor(0,0,1)) ) withopacity 0.5 ; ) % withpatternscale(1/4,1/4) % ; % \stopMPpage % \startTEXpage % \externalfigure[te
Re: [NTG-context] Zero size kerns with latest LMTX beta 2020-03-17
On 3/19/21 10:11 PM, Joseph wrote: > Dear list, > > Following MWE aims to reproduce the issue, Hi Joseph, I’m afraid that kerning current latest from 2021.03.17 17:46 isn’t able to deal with the OpenType kern feature (which is enabled by default): \showfontkerns \starttext \startTEXpage[offset=1em] AV \stopTEXpage \stoptext Previous latest from 2021.03.13 11:22 has no problems with the kern feature. Many thanks for spotting the issue, 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] TEXpage does not fit \placetable & \recurselevel always zero
Dear list, thank you very much for the help so far. I have two problems understanding the output of the code below. I am using version 2021.02.23 17:47. (1) The TEXpage is cut off after ~40 lines. Normally, the page is extended to fit its content. It's probably related to \placetable which I only use here because I need a centered table. I can set the height of the page manually, but the whole purpose of using TEXpage was to avoid that. (2) \recurselevel is always zero in the output. Normally, it counts the iterations. This issue is not relevant for my actual use-case, but I found that when writing the MWE. Best wishes, Jacob Kauffmann \setupTEXpage[width=10cm] \startTEXpage \placetable[force,none]{}{% \starttabulate[|c|c|] \NC A \NC B \NC\NR \HL \dorecurse{50}{\NC \expanded{\recurselevel} \NC \recurselevel \NC\NR} \stoptabulate } \stopTEXpage \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] TEXpage does not fit \placetable & \recurselevel always zero
On 3/5/2021 3:44 PM, Jacob Kauffmann wrote: Dear list, thank you very much for the help so far. I have two problems understanding the output of the code below. I am using version 2021.02.23 17:47. (1) The TEXpage is cut off after ~40 lines. Normally, the page is extended to fit its content. It's probably related to \placetable which I only use here because I need a centered table. I can set the height of the page manually, but the whole purpose of using TEXpage was to avoid that. (2) \recurselevel is always zero in the output. Normally, it counts the iterations. This issue is not relevant for my actual use-case, but I found that when writing the MWE. Best wishes, Jacob Kauffmann \setupTEXpage[width=10cm] \startTEXpage \placetable[force,none]{}{% \starttabulate[|c|c|] \NC A \NC B \NC\NR \HL \dorecurse{50}{\NC \expanded{\recurselevel} \NC \recurselevel \NC\NR} \stoptabulate } \stopTEXpage \stoptext \startTEXpage[strut=no,offset=10pt] \starttabulate[|c|c|c|c|c|] \NC A \NC B \NC C \NC D \NC E \NC \NR \HL \dorecurse{50}{\NC ##1\NC ##1\NC ##1\NC ##1\NC ##1\NC\NR} \stoptabulate \stopTEXpage works ok here upto \starttext \startTEXpage[strut=no,offset=10pt] \starttabulate[|c|c|c|c|c|] \NC A \NC B \NC C \NC D \NC E \NC \NR \HL \dorecurse{1128}{\NC ##1\NC ##1\NC ##1\NC ##1\NC ##1\NC\NR} \stoptabulate \stopTEXpage \stoptext but you need a special printer for that anyway (don't use a place command inside a TEXpage) 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] Indenting on all TEXpages
Dear list, is it possible to enable indenting globally for TEXpage environments? Or is it recommended to create a separate environment for that purpose? Please find a MWE below. It seems to me that \setupindenting must be set explicitly for every page that needs indenting. Best, Jacob Kauffmann \setupTEXpage[width=10cm] \setupindenting[yes,medium] % not working \starttext \startTEXpage \input knuth \stopTEXpage % working \startTEXpage \setupindenting[yes,medium] \input knuth \stopTEXpage \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] Indenting on all TEXpages
On 2/28/2021 4:13 PM, Jacob Kauffmann wrote: Dear list, is it possible to enable indenting globally for TEXpage environments? Or is it recommended to create a separate environment for that purpose? Please find a MWE below. It seems to me that \setupindenting must be set explicitly for every page that needs indenting. Best, Jacob Kauffmann \setupTEXpage[width=10cm] \setupindenting[yes,medium] % not working \starttext \startTEXpage \input knuth \stopTEXpage % working ^^^ not working because you introduce a space: \startTEXpage \setupindenting[yes,medium]% add a percent here \input knuth \stopTEXpage \stoptext There's is often a way: \setupTEXpage[width=10cm,setups=whatever] \startsetups whatever \setupindenting[yes,medium] \stopsetups \starttext \startTEXpage \input knuth \stopTEXpage \startTEXpage \input knuth \stopTEXpage \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 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] looping an overlay
On 2/24/21 7:44 PM, Wolfgang Schuster wrote: > Pablo Rodriguez schrieb am 24.02.2021 um 19:23: >> [...] >>\starttext >> \startTEXpage[offset=1em] >>\startoverlay >> \dostepwiserecurse{25}{95}{5} >>{{\recurselevel\ }} >>\stopoverlay >> \stopTEXpage >>\stoptext >> >> Which is the right way to loop an overlay? > [...] > \startcollecting > \collect{\startoverlay} > \dostepwiserecurse{25}{95}{5}{\collectexpanded{{\recurselevel}}} > \collect{\stopoverlay} > \stopcollecting Many thanks for your fast reply, Wolfgang. This is exactly what I needed. 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 ___
Re: [NTG-context] looping an overlay
Pablo Rodriguez schrieb am 24.02.2021 um 19:23: Dear list, I have the following sample: \starttext \startTEXpage[offset=1em] \startoverlay \dostepwiserecurse{25}{95}{5} {{\recurselevel\ }} \stopoverlay \stopTEXpage \stoptext Which is the right way to loop an overlay? \starttext \startluacode context.startoverlay() for i=25,95,5 do context("{%d}",i) end context.stopoverlay() \stopluacode \blank \startcollecting \collect{\startoverlay} \dostepwiserecurse{25}{95}{5}{\collectexpanded{{\recurselevel}}} \collect{\stopoverlay} \stopcollecting \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] looping an overlay
Dear list, I have the following sample: \starttext \startTEXpage[offset=1em] \startoverlay \dostepwiserecurse{25}{95}{5} {{\recurselevel\ }} \stopoverlay \stopTEXpage \stoptext Which is the right way to loop an overlay? 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 ___
Re: [NTG-context] Arbitrary equation tags... again
I found a workaround for anyone interested: \setupinteraction[state=start,focus=standard] \starttext \startplaceformula[title=$\alpha$,reference=alpha] \startformula 1 + 1 = 2 \stopformula \stopplaceformula \dorecurse{20}{\samplefile{knuth}} I'm in \in{$\alpha$}[alpha] %so the reference is now visible \stoptext However, one has to manually write a label and a title independently, so I'm not sure that's a clean solution... Best regards, Jairo El lun, 22 de feb. de 2021 a la(s) 23:28, Jairo A. del Rio ( jairoadelr...@gmail.com) escribió: > Hi again. The following doesn't work (the tag is missing): > > \startTEXpage[offset=2bp] > \startplaceformula[title=A,reference=alpha] > \startformula > 1 + 1 = 2 > \stopformula > \stopplaceformula > I'm in \in[alpha] > \stopTEXpage > > Jairo > > El lun, 22 de feb. de 2021 a la(s) 09:00, Jairo A. del Rio ( > jairoadelr...@gmail.com) escribió: > >> Oh, dumb me, sorry for the noise and thank you very much. Not every day >> is a good one, sorry again. >> >> Jairo. >> >> El lun, 22 de feb. de 2021 a la(s) 08:51, Hans Hagen (j.ha...@xs4all.nl) >> escribió: >> >>> On 2/22/2021 2:05 PM, Jairo A. del Rio wrote: >>> > Hi. list. >>> > Is it possible to assign an arbitrary equation tag in ConTeXt? I've >>> seen >>> > solutions here; >>> > >>> > >>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text >>> > < >>> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text >>> > >>> > >>> > but none of them works as expected (either the formula counter is >>> still >>> > incrementing with arbitrary conversions or cross-references don't >>> work). >>> >>> Define 'expected' ... \eqno is something low level (a primitive) and we >>> have that nilled at the user level and only use it deep down. It was >>> never meant as user command. >>> >>> > I imagine some things have changed in 2021 and I hope a better >>> solution >>> > is feasible nowadays. >>> >>> \startTEXpage[offset=2bp] >>> \startplaceformula[title=A] >>> \startformula >>> 1 + 1 = 2 >>> \stopformula >>> \stopplaceformula >>> \stopTEXpage >>> >>> 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] Arbitrary equation tags... again
Hi again. The following doesn't work (the tag is missing): \startTEXpage[offset=2bp] \startplaceformula[title=A,reference=alpha] \startformula 1 + 1 = 2 \stopformula \stopplaceformula I'm in \in[alpha] \stopTEXpage Jairo El lun, 22 de feb. de 2021 a la(s) 09:00, Jairo A. del Rio ( jairoadelr...@gmail.com) escribió: > Oh, dumb me, sorry for the noise and thank you very much. Not every day is > a good one, sorry again. > > Jairo. > > El lun, 22 de feb. de 2021 a la(s) 08:51, Hans Hagen (j.ha...@xs4all.nl) > escribió: > >> On 2/22/2021 2:05 PM, Jairo A. del Rio wrote: >> > Hi. list. >> > Is it possible to assign an arbitrary equation tag in ConTeXt? I've >> seen >> > solutions here; >> > >> > >> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text >> > < >> https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text >> > >> > >> > but none of them works as expected (either the formula counter is still >> > incrementing with arbitrary conversions or cross-references don't work). >> >> Define 'expected' ... \eqno is something low level (a primitive) and we >> have that nilled at the user level and only use it deep down. It was >> never meant as user command. >> >> > I imagine some things have changed in 2021 and I hope a better solution >> > is feasible nowadays. >> >> \startTEXpage[offset=2bp] >> \startplaceformula[title=A] >> \startformula >> 1 + 1 = 2 >> \stopformula >> \stopplaceformula >> \stopTEXpage >> >> 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] Arbitrary equation tags... again
Oh, dumb me, sorry for the noise and thank you very much. Not every day is a good one, sorry again. Jairo. El lun, 22 de feb. de 2021 a la(s) 08:51, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 2/22/2021 2:05 PM, Jairo A. del Rio wrote: > > Hi. list. > > Is it possible to assign an arbitrary equation tag in ConTeXt? I've seen > > solutions here; > > > > > https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text > > < > https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text > > > > > > but none of them works as expected (either the formula counter is still > > incrementing with arbitrary conversions or cross-references don't work). > > Define 'expected' ... \eqno is something low level (a primitive) and we > have that nilled at the user level and only use it deep down. It was > never meant as user command. > > > I imagine some things have changed in 2021 and I hope a better solution > > is feasible nowadays. > > \startTEXpage[offset=2bp] > \startplaceformula[title=A] > \startformula > 1 + 1 = 2 > \stopformula > \stopplaceformula > \stopTEXpage > > 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] Arbitrary equation tags... again
On 2/22/2021 2:05 PM, Jairo A. del Rio wrote: Hi. list. Is it possible to assign an arbitrary equation tag in ConTeXt? I've seen solutions here; https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text <https://tex.stackexchange.com/questions/400257/tag-equation-in-context-with-arbitrary-text> but none of them works as expected (either the formula counter is still incrementing with arbitrary conversions or cross-references don't work). Define 'expected' ... \eqno is something low level (a primitive) and we have that nilled at the user level and only use it deep down. It was never meant as user command. I imagine some things have changed in 2021 and I hope a better solution is feasible nowadays. \startTEXpage[offset=2bp] \startplaceformula[title=A] \startformula 1 + 1 = 2 \stopformula \stopplaceformula \stopTEXpage 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] path in LuaMetaFun
On 2/20/2021 7:04 PM, Pablo Rodriguez wrote: On 2/20/21 1:28 PM, Hans Hagen wrote: On 2/20/2021 1:19 PM, Pablo Rodriguez wrote: [...] On the other side, I’m afraid that cycle has problems with lmt_followtext. could be, i'm playing a bit with the converter and introduced a issue but that will be fixed in the next upload Many thanks for your new upload, Hans. Another minor detail: \starttext \startTEXpage \startMPcode{doublefun} draw lmt_followtext [ text = "\feature[+][smallcaps]\bf\samplefile{zapf} ", path = ((0,0)..(3,3)..(9,-3)..(12,0)..(9,3)..(3,-3)..cycle), autoscaleup = "max", %~ reverse=true, ] xsized .75TextWidth ; \stopMPcode \stopTEXpage \stoptext One circle is bigger than the other one (reverse=true switches them). I guess this might be solved with struts, but I don’t know how to apply them there. You get what you ask for: different text ends up at the left or right edge depending on the reverse. 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] path in LuaMetaFun
On 2/20/21 1:28 PM, Hans Hagen wrote: > On 2/20/2021 1:19 PM, Pablo Rodriguez wrote: >> [...] >> On the other side, I’m afraid that cycle has problems with lmt_followtext. > could be, i'm playing a bit with the converter and introduced a issue > but that will be fixed in the next upload Many thanks for your new upload, Hans. Another minor detail: \starttext \startTEXpage \startMPcode{doublefun} draw lmt_followtext [ text = "\feature[+][smallcaps]\bf\samplefile{zapf} ", path = ((0,0)..(3,3)..(9,-3)..(12,0)..(9,3)..(3,-3)..cycle), autoscaleup = "max", %~ reverse=true, ] xsized .75TextWidth ; \stopMPcode \stopTEXpage \stoptext One circle is bigger than the other one (reverse=true switches them). I guess this might be solved with struts, but I don’t know how to apply them there. 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] issue with references
Hans, I have the following sample: \setuphead[chapter][sectionsegments=chapter] \setuphead[section][sectionsegments=section] \setupreferencestructureprefix [default] [prefixsegments=*:*] \starttext \startTEXpage[offset=1em] \chapter{Chapter} \section[sec]{Section} As told in \getreference[number][sec]. \getreference[title][sec].\\ As told in \in[sec]. \about[sec]. \stopTEXpage \stoptext \getreference[number] doesn’t follow \setupreferencestructureprefix. I don’t know whether this is intended, but I think it might be a bug. 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] lmtx
Hi, In the last couple of lmtx uploads \startTEXpage should work a bit better. These uploads also introduced a new option for alignments, which can be checked in: \def\DemoA#1{\vbox{\red \hsize#1\input tufte }} \def\DemoB#1{\vbox{\green \setupalign[always]\hsize#1\input tufte }} \def\DemoC#1{\startTEXpage[offset=10pt]\DemoA{#1pt}\blank\DemoB{#1pt}\blank#1pt\stopTEXpage} \starttext \dostepwiserecurse{300}{600}{10}{ \startTEXpage[offset=10pt] \startoverlay {\DemoA{#1pt}} {\DemoB{#1pt}} \stopoverlay \blank \the\dimexpr#1pt\relax \stopTEXpage } \DemoC{370} \DemoC{390} \DemoC{490} \DemoC{540} \DemoC{580} \stoptext I leave it to users to determine if the few cases where the results differ are better or worse but one can for instance use it to influence (as side effect) the last line. In general, tweaking the machinery can give different results and i guess that hardly any user can make consistent claims about what is better. It all depends on what one deals with. (The keyword is suboptimal, it kind of tells what happens but on the other obscurew what really goes on: always forcing a first hyphenation pass when breaking lines.) 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] set fallback in \definefont
Thanks for the quick response, Pablo. I already use typescripts (\definetypeface, \definefontsynonym and \definefontfallback): https://github.com/bateni/dabeer/tree/master/texmf-local/tex/context/fonts/mkiv By arbitrary style, I meant something like: \definefontfamily[myface][CUSTOM][TeX Gyre Pagella]] https://wiki.contextgarden.net/Font_Switching says fontstyle is rm, ss, tt, mm, hw, cg, ... Because the the three dots at the end, I thought it would be possible to define new fontstyles. But I get an error if I do so. So I usually use \definefont to set up one-off fonts for specific use-cases such as special headings or an artwork, etc. I was wondering if I can easily apply fontfallbacks for those. On Mon, Feb 15, 2021 at 3:52 PM Pablo Rodriguez wrote: > On 2/15/21 8:47 PM, Mohammad Hossein Bateni wrote: > > Hi, > > > > Is there a way to set the fallback for fonts when we define them not as > > a typescript but using \definefont? > > > > \definefont[MyFont][Font.otf*MyFeatures] > > > > Is there a default fallback one can specify? > > Is simplefonts module deprecated or discouraged now? > > Hi Mohammad, > > the simplefonts module has been deprecated, since it has been > implemented in the ConTeXt core (see below). > > \definefontfallback might be the command you are looking for. > > > When we define a font via typescript commands, we can specify rm, ss, > > tt, mm, hw and cg shapes for it. Can we add arbitrary styles? > > For example, I would use this for quotations, headings, etc. Currently, > > I either have to spare ss or use \definefont for such scenarios. > > The new commands are \definefallbackfamily and \definefontfamily. > > A sample document, in case it might help (GFS Heraklit at > https://greekfontsociety-gfs.gr/_assets/fonts/GFS_Heraklit.zip): > > \definefallbackfamily > [mainface] > [rm] > [GFS Heraklit] > [preset=range:greek, > force=yes] > > \definefontfamily > [mainface] > [rm] > [TeX Gyre Pagella] > > \setupbodyfont > [mainface] > > \starttext > \agr\input aristotle-grc > > \de\input aesop-de > \stoptext > > Sorry, but unless you provide a minimal sample, it isn’t easy to guess > what you might have in mind. > > I’m afraid that I’m not sure whether the following sample contains your > “arbitrary styles”. > > \setupinteractionscreen[option=max] > > \definefontfamily > [mainface] > [rm] > [TeX Gyre Pagella] > [it={TeX Gyre Cursor-Italic}, > bf={TeX Gyre Adventor-Bold}, > bi={TeX Gyre Termes-BoldItalic}] > > \setupbodyfontenvironment > [default] > [em=italic] > > \setupbodyfont[mainface] > > \starttext > \startTEXpage[offset=1em] > Roman font {\em & italic} > > {\bf Bold font \em & bold italic} > \stopTEXpage > \stoptext > > Feel free to explain what your needs are. > > I hope 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 > > ___ > ___ 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] set fallback in \definefont
On 2/15/21 8:47 PM, Mohammad Hossein Bateni wrote: > Hi, > > Is there a way to set the fallback for fonts when we define them not as > a typescript but using \definefont? > > \definefont[MyFont][Font.otf*MyFeatures] > > Is there a default fallback one can specify? > Is simplefonts module deprecated or discouraged now? Hi Mohammad, the simplefonts module has been deprecated, since it has been implemented in the ConTeXt core (see below). \definefontfallback might be the command you are looking for. > When we define a font via typescript commands, we can specify rm, ss, > tt, mm, hw and cg shapes for it. Can we add arbitrary styles? > For example, I would use this for quotations, headings, etc. Currently, > I either have to spare ss or use \definefont for such scenarios. The new commands are \definefallbackfamily and \definefontfamily. A sample document, in case it might help (GFS Heraklit at https://greekfontsociety-gfs.gr/_assets/fonts/GFS_Heraklit.zip): \definefallbackfamily [mainface] [rm] [GFS Heraklit] [preset=range:greek, force=yes] \definefontfamily [mainface] [rm] [TeX Gyre Pagella] \setupbodyfont [mainface] \starttext \agr\input aristotle-grc \de\input aesop-de \stoptext Sorry, but unless you provide a minimal sample, it isn’t easy to guess what you might have in mind. I’m afraid that I’m not sure whether the following sample contains your “arbitrary styles”. \setupinteractionscreen[option=max] \definefontfamily [mainface] [rm] [TeX Gyre Pagella] [it={TeX Gyre Cursor-Italic}, bf={TeX Gyre Adventor-Bold}, bi={TeX Gyre Termes-BoldItalic}] \setupbodyfontenvironment [default] [em=italic] \setupbodyfont[mainface] \starttext \startTEXpage[offset=1em] Roman font {\em & italic} {\bf Bold font \em & bold italic} \stopTEXpage \stoptext Feel free to explain what your needs are. I hope 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] [pagenumbers in pdf]
Floris van Manen schrieb am 13.02.2021 um 13:10: When I generate a serie of TEXpages, those pages end up with the same page number in the pdf. 1, 1, 1 \starttext \def\blz{\begingroup \startTEXpage 1 2 3 \stopTEXpage \endgroup} \blz \blz \blz \stoptext If I insert a \strut at the start, I get pagenumbering 1, 2, 3, 1 \starttext \def\blz{\begingroup \startTEXpage 1 2 3 \stopTEXpage \endgroup} \strut \blz \blz \blz \stoptext As in most software, there is a probable reason for that :-) But how to get the pages numbered 1, 2, 3 without an empty page at the start? You need pagestate=start: \starttext \dorecurse{3} {\startTEXpage[pagestate=start] Page #1 \stopTEXpage} \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] [pagenumbers in pdf]
When I generate a serie of TEXpages, those pages end up with the same page number in the pdf. 1, 1, 1 \starttext \def\blz{\begingroup \startTEXpage 1 2 3 \stopTEXpage \endgroup} \blz \blz \blz \stoptext If I insert a \strut at the start, I get pagenumbering 1, 2, 3, 1 \starttext \def\blz{\begingroup \startTEXpage 1 2 3 \stopTEXpage \endgroup} \strut \blz \blz \blz \stoptext As in most software, there is a probable reason for that :-) But how to get the pages numbered 1, 2, 3 without an empty page at the start? .F ___ 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 ___
Re: [NTG-context] TEXpage breaks \setupinteractionscreen in LMTX
On 2/9/21 7:30 PM, Hans Hagen wrote: > On 2/9/2021 7:15 PM, Pablo Rodriguez wrote: >> [...] >> Sorry, Hans, the original sample was different, but I removed the offset >> option in order to make it smaller: >> >>\setupinteractionscreen[option=max] >>\starttext >>\startTEXpage[offset=1em] >> \ConTeXt >>\stopTEXpage >>\stoptext >> >> I hope it is clearer now, > The question is: what do you expect? /PageMode /FullScreen in /Catalog. Right now, I get /PageMode /UseNone. 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] TEXpage breaks \setupinteractionscreen in LMTX
On 2/9/2021 7:15 PM, Pablo Rodriguez wrote: On 2/8/21 11:01 PM, Hans Hagen wrote: [...] LMTX doesn’t include full page. MkIV compiles it fine. If I remove the TEXpage, LMTX includes the full page mode. LMTX is more accurate as \null has zero dimensions an dit's a fitting page what you want is \startpagemakeup \stoppagemakeup Sorry, Hans, the original sample was different, but I removed the offset option in order to make it smaller: \setupinteractionscreen[option=max] \starttext \startTEXpage[offset=1em] \ConTeXt \stopTEXpage \stoptext I hope it is clearer now, The question is: what do you expect? 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] TEXpage breaks \setupinteractionscreen in LMTX
On 2/8/21 11:01 PM, Hans Hagen wrote: >> [...] >> LMTX doesn’t include full page. MkIV compiles it fine. >> >> If I remove the TEXpage, LMTX includes the full page mode. > LMTX is more accurate as \null has zero dimensions an dit's a fitting page > > what you want is > > \startpagemakeup > > \stoppagemakeup Sorry, Hans, the original sample was different, but I removed the offset option in order to make it smaller: \setupinteractionscreen[option=max] \starttext \startTEXpage[offset=1em] \ConTeXt \stopTEXpage \stoptext I hope it is clearer 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 ___
[NTG-context] TEXpage breaks \setupinteractionscreen in LMTX
Dear list, I have the following sample: \setupinteractionscreen[option=max] \starttext \startTEXpage \null \stopTEXpage \stoptext LMTX doesn’t include full page. MkIV compiles it fine. If I remove the TEXpage, LMTX includes the full page mode. I’m using latest version from 2021.02.08 17:03. Could anyone confirm the issue? 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] small lmtx update
Hi, In the perspective of fancyfying context I made an alternative rendering for missing glyphs (and in the process also made the visualization italic and bold aware which is of course feature creepifying). \replacemissingcharacters \startbuffer \startlines[before=,after=] \strut {\tf test \char 12345\ test \char 12346\ test} \strut {\bf test \char 12345\ test \char 12346\ test} \strut {\it test \char 12345\ test \char 12346\ test} \strut {\bi test \char 12345\ test \char 12346\ test} \strut {test ὀ ρ φ α ν ῖ ο ς test} \stoplines \stopbuffer \starttext \startTEXpage[offset=2pt,strut=no] \getbuffer \switchtobodyfont[pagella] \getbuffer \switchtobodyfont[dejavu] \getbuffer \stopTEXpage \stoptext This is dedicated to Jano who wants to be able to search and these are proper glyphs (so one can search, assuming a sane viewer). It also fits the "new mechanisms should reduce code" bill, 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] filter module / externalizing TikZ graphics
> Am 30.01.2021 um 00:13 schrieb Aditya Mahajan : > > For \processFILTER, t-filter does not even read the file... so it has to do > with how the filtercommand is defined. > >> Since this fails already, I don’t know if \processFILTERfile also uses >> bufferbefore/-after (it should). > > It does not. As I said, for processing external files, t-filter does not even > read the file and just takes care of caching the result. It is assumed that > the filter command can process the external file. A pity. I didn’t understand that from the documentation. That means I need to setup different filters for internal and external graphics with the same content. > I can see if it is possible to active before and after filters while > processing external files. That would solve this problem for me and would make the behavior of filter commands more consistent. OTOH I can understand you don’t want to bloat your module. > Another option is to write the external files as valid tex file (i.e., with a > \startTEXpage .. \stopTEXpage wrapper), and when defining the filtercommand, > use something like `context --environment=env filename`, where env is the > environment file with all the settings for fonts etc. I don’t see this as an option, as we try to avoid code duplication over hundreds of graphics snippets. The \start/stop environment, as well as external files, should just contain the TikZ commands. All common setup/teardown code belongs in extra files/buffers. >> (2) working directory >> >> Since ConTeXt can’t put generated (temporary) files into a directory and >> --result also only renames afterwards, the directory key doesn’t help, I had >> to add "mv" and "cd" to my filtercommand. >> I didn’t check yet if caching works. > > Caching should work if \definefilter is configured correctly. Thanks. > From the point of view of t-filter module, this is a bug in the external > program and you should contact upstream for a fix :-) Yes. There were already several requests about ConTeXt using work/temp directories and changing the behavior of "--result". > Most (all?) other programs are happy to write a file in any directory (modulo > write permissions, etc.). > I do not want to increase the complexity of the module to handle such corner > cases. I can understand that. I should probably let filter call an external script, or fork t-filter for my needs. >> If I use \starttikz[name=example], I get >> "JOBNAME-temp-tikzThick-example.tmp". >> I’d like to get something like "COMPONENTNAME-##-example.tmp" or a path like >> "COMPONENTNAME/example_##.tmp". >> Is there a configuration hook in the module to change name generation? > > No. I don't quite understand the concern. How do you plan to use a > `name=value` option? The current auto-generated file names are uncomfortably long, and I’d like to know which contains what. I’m not yet sure what would make the most sense for this project (at least sorting by chapter/component would), but I have an use case with LilyPond where I could save several LilyPond compile runs if I could influence the naming: I got ~500 songs in their own component files, and I use them in different songbooklets with the same layout. E.g. there’s one containing all the songs and several with a subject (e.g. winter & christmas, children, medieval & fantasy, some author...). They all use [name=\currentcomponent]. If I could avoid the JOBNAME part of the file name, all booklets would use the same note PDFs. Now, the temp directory contains literally thousands of files. Since this is just for fun, the additional space and compile time is just a bit annoying and doesn’t affect others, but I like to streamline my workflows... >> (4) subprocess parameters >> >> I’d like to forward some parameters from \starttikz to the temp buffer, e.g. >> \starttikz[name=example][mystyle=thick] >> (using the same syntax as \startsection with a second pair of brackets for >> custom parameters). >> And then have >> \starttikzpicture[\filterusersetupvariable{mystyle}] >> in the buffer. >> >> My workaround so far is a copy of the filter setup (tikz/tikzThick), since >> we have only a few different configurations. > > The code that I had posted already handles this, provided that the options > start on the line after \startfilter: Ah, I didn’t look closely enough. Thank you, that’s an usable workaround. Best, Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] filter module / externalizing TikZ graphics
On Thu, 28 Jan 2021, Henning Hraban Ramm wrote: > Still working on that. > I hope you can help me here, Aditya! > I’ll add these issues to the tracker of t-filter, if it makes sense. > > > Testing with: ConTeXt ver: 2021.01.24 16:07 LMTX fmt: 2021.1.25 > > The setup below works, but only with \starttikz ... \stoptikz so far, I don’t > like the output file names, and using the working directory is tricky. > > > (1) \processFILTERfile > > \processtikzfile{img/example.pgf} > can’t find the file: > > t-filter> cached output file 'tikztemp/example1.pgf.pdf' missing. > Rerunning filter > t-filter> file 'tikztemp/example1.pgf.pdf' cannot be found > t-filter> current filter : tikzThick > t-filter> base file : example1.pgf > t-filter> input file : img/example1.pgf > t-filter> output file : tikztemp/example1.pgf.pdf > ... > system > 13: filename=img/example1.pgf foundname=img/example1.pgf > fullname=.../img/example1.pgf usedmethod=direct > > Looks like ConTeXt can find the file, but the filter module cannot. > > --trackers=resolvers.schemes (or \enabletrackers) doesn’t change anything WRT > log/output. For \processFILTER, t-filter does not even read the file... so it has to do with how the filtercommand is defined. > Since this fails already, I don’t know if \processFILTERfile also uses > bufferbefore/-after (it should). It does not. As I said, for processing external files, t-filter does not even read the file and just takes care of caching the result. It is assumed that the filter command can process the external file. I can see if it is possible to active before and after filters while processing external files. Another option is to write the external files as valid tex file (i.e., with a \startTEXpage .. \stopTEXpage wrapper), and when defining the filtercommand, use something like `context --environment=env filename`, where env is the environment file with all the settings for fonts etc. > (2) working directory > > Since ConTeXt can’t put generated (temporary) files into a directory and > --result also only renames afterwards, the directory key doesn’t help, I had > to add "mv" and "cd" to my filtercommand. > I didn’t check yet if caching works. Caching should work if \definefilter is configured correctly. From the point of view of t-filter module, this is a bug in the external program and you should contact upstream for a fix :-) Most (all?) other programs are happy to write a file in any directory (modulo write permissions, etc.). I do not want to increase the complexity of the module to handle such corner cases. > (3) file names > > Using \processFILTERfile the original file name base is preserved, according > to the log entry above. > > If I use \starttikz[name=example], I get "JOBNAME-temp-tikzThick-example.tmp". > I’d like to get something like "COMPONENTNAME-##-example.tmp" or a path like > "COMPONENTNAME/example_##.tmp". > Is there a configuration hook in the module to change name generation? No. I don't quite understand the concern. How do you plan to use a `name=value` option? > (4) subprocess parameters > > I’d like to forward some parameters from \starttikz to the temp buffer, e.g. > \starttikz[name=example][mystyle=thick] > (using the same syntax as \startsection with a second pair of brackets for > custom parameters). > And then have > \starttikzpicture[\filterusersetupvariable{mystyle}] > in the buffer. > > My workaround so far is a copy of the filter setup (tikz/tikzThick), since we > have only a few different configurations. The code that I had posted already handles this, provided that the options start on the line after \startfilter: \usemodule[filter] \startbuffer[tikz-before] \usemodule[tikz] \startTEXpage \starttikzpicture \stopbuffer \startbuffer[tikz-after] \stoptikzpicture \stopTEXpage \stopbuffer \defineexternalfilter [externaltikz] [ bufferbefore=tikz-before, bufferafter=tikz-after, cache=yes, filtercommand={context --batchmode \externalfilterinputfile\space --purgeall --result=\externalfilteroutputfile}, output={\externalfilterbasefile.pdf}, readcommand=\readPDFfile, ] \define[1]\readPDFfile{\externalfigure[#1]} % width and height could be added \starttext \startexternaltikz [very thick, ->] \draw (0,0) -- (1,1); \stopexternaltikz \stoptext Aditya ___ 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] font fallback hook (alphabet suspects)
On 1/29/2021 8:29 PM, Jano Kula wrote: There are some Greek, Hebrew, etc. words used in the text. While proofreading, the editor would like to check these words separately (glyphs from different alphabets, unusual symbols, ...), so I'd like to typeset the warning (margin note), where these words are located. To avoid usual markup \greek{ὀρφανῖος} it could be useful to typeset a margin note whenever the defined fallback is called. The unfamiliar symbols could be in the main font and no fallback would be called then (one can still define the fallback with the main font as in the MWE, bold used for the illustration), but you might have a better ideas how to point out these suspects. The margin note is ment for searching PDF where one cannot search for color (basic viewer), which could be the other approach (also visible in print). I think, the color could be achieved with finalizers. One should also think of hyphenation and l2r/r2l direction, so in the end the usual approach might be the best way. You might use other approaches, how to deal with suspects of this type. Below the MWE for font fallbacks with distribution fonts. Not critical, just looking for ideas. Already there for ages ... testsuite goodies-002.tex + demo.lfg shows how to color your special characters ... one of the probably many unknown features -) There's also this: \enabletrackers[fonts.missing=replace] \startTEXpage Jano uses \char 12345. \stopTEXpage and of course you then watch the log ... (at the meeting Ton showed other proofing tricks). 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] filter module / externalizing TikZ graphics
Still working on that. I hope you can help me here, Aditya! I’ll add these issues to the tracker of t-filter, if it makes sense. Testing with: ConTeXt ver: 2021.01.24 16:07 LMTX fmt: 2021.1.25 The setup below works, but only with \starttikz ... \stoptikz so far, I don’t like the output file names, and using the working directory is tricky. (1) \processFILTERfile \processtikzfile{img/example.pgf} can’t find the file: t-filter> cached output file 'tikztemp/example1.pgf.pdf' missing. Rerunning filter t-filter> file 'tikztemp/example1.pgf.pdf' cannot be found t-filter> current filter : tikzThick t-filter> base file : example1.pgf t-filter> input file : img/example1.pgf t-filter> output file : tikztemp/example1.pgf.pdf ... system > 13: filename=img/example1.pgf foundname=img/example1.pgf fullname=.../img/example1.pgf usedmethod=direct Looks like ConTeXt can find the file, but the filter module cannot. --trackers=resolvers.schemes (or \enabletrackers) doesn’t change anything WRT log/output. Since this fails already, I don’t know if \processFILTERfile also uses bufferbefore/-after (it should). (2) working directory Since ConTeXt can’t put generated (temporary) files into a directory and --result also only renames afterwards, the directory key doesn’t help, I had to add "mv" and "cd" to my filtercommand. I didn’t check yet if caching works. (3) file names Using \processFILTERfile the original file name base is preserved, according to the log entry above. If I use \starttikz[name=example], I get "JOBNAME-temp-tikzThick-example.tmp". I’d like to get something like "COMPONENTNAME-##-example.tmp" or a path like "COMPONENTNAME/example_##.tmp". Is there a configuration hook in the module to change name generation? (4) subprocess parameters I’d like to forward some parameters from \starttikz to the temp buffer, e.g. \starttikz[name=example][mystyle=thick] (using the same syntax as \startsection with a second pair of brackets for custom parameters). And then have \starttikzpicture[\filterusersetupvariable{mystyle}] in the buffer. My workaround so far is a copy of the filter setup (tikz/tikzThick), since we have only a few different configurations. Best regards, Hraban """ % file: t-tikzfilter.tex \startmodule[tikzfilter] \usemodule[filter] % docs see https://github.com/adityam/filter \def\TIKZTEMP{tikztemp} % name of folder for TikZ/buffer files % normal setup \startbuffer[tikz::before] \environment env_world \environment env_TikZ \startTEXpage \starttikzpicture \stopbuffer % setup for graphics with thicker lines \startbuffer[tikzThick::before] \environment env_world \environment env_TikZ \startTEXpage \starttikzpicture[thick] % only difference \stopbuffer \startbuffer[tikz::after] \stoptikzpicture \stopTEXpage \stopbuffer \define[1]\ReadPDFFile% #1 is the name of the output file {\ctxlua{thirddata.readpdffile("#1")}} \startluacode thirddata = thirddata or {} local report_tikz = logs.reporter("tikzfilter") -- create temp folder if missing if not lfs.isdir("\TIKZTEMP") then lfs.mkdir("\TIKZTEMP") end function thirddata.readpdffile(name) -- name is like \TIKZTEMP/mainfile-temp-tikz-21.pdf report_tikz("name='%s'", name) % doesn’t work context("\\externalfigure[" .. name .. "]") end \stopluacode \defineexternalfilter[tikz][ cache=yes, % directory=\TIKZTEMP, % doesn’t work with ConTeXt bufferbefore={tikz::before}, bufferafter={tikz::after}, readcommand=\ReadPDFFile, output={\TIKZTEMP/\externalfilterbasefile.pdf}, filtercommand={mv \externalfilterbasefile.* \TIKZTEMP/ && cd \TIKZTEMP\space && context --batchmode --nodummy --once \externalfilterbasefile.tmp}, ] \defineexternalfilter[tikzThick][tikz][ bufferbefore={tikzThick::before}, ] \stopmodule """ """ % file: tikztest.tex \usemodule[t-tikzfilter] \usemodule[visual] \starttext \placefigure[margin,here][fig:example]{A box.} {\vskip1in\noindent% \starttikzThick[name=example0] \draw[fill=black!10] (0,4.75) rectangle (1.5,-4.75); \stoptikzThick } \fakewords{150}{200} \processtikzThickfile{tests/example1.pgf} \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] understanding \startTEXpage
On 1/27/2021 6:24 PM, Peter Münster wrote: Hi, According to https://wiki.contextgarden.net/Command/startTEXpage it "starts a page that fits its contents exactly". But it seems, that part of the content is cropped here: \startTEXpage X \hskip20cm X \stopTEXpage No problem with 10cm instead of 20cm... Is this a bug or expected behaviour? Yes. The problem is that in order for auto width to work we need to have some width to start with. Also, because we want TEXpage to be in vertical mode, we cannot assume it being horizontal. So, a chicken-egg problem. The good news is that you can control it, the bad news is that you have to update the wiki, \starttext \startTEXpage[align=normal,width=900pt,autowidth=force] \framed[width=800pt,frame=off]{\number\dimexpr800pt}\par \input tufte\par \stopTEXpage \startTEXpage[align=normal,width=100cm,autowidth=force] X \hskip20cm X \stopTEXpage \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 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] externalizing TikZ graphics
> Am 25.01.2021 um 20:08 schrieb Henning Hraban Ramm : > > """ > \startmodule[tikzfilter] > > \usemodule[filter] > % docs see https://github.com/adityam/filter > > \def\TIKZTEMP{tikztemp} % name of folder for TikZ/buffer files > > \startbuffer[tikz::before] > \environment env_world % contains font setup etc. > \environment env_TikZ % contains TikZ settings > > \startpagefigure Wrong, I need \startTEXpage > \starttikzpicture[thick,domain=-90:90]% TODO: make this configurable Now, how can I forward options from \starttix[anything] to this place? > \stopbuffer > > \startbuffer[tikz::after] > \stoptikzpicture > \stoppagefigure \stopTEXpage > \stopbuffer > > \define[1]\ParseTikZFile% #1 is the name of the output file > {\ctxlua{thirddata.parsetikzfile("#1")}} > > \startluacode > thirddata = thirddata or {} > > -- create temp folder if missing > if not lfs.isdir("\TIKZTEMP") then > lfs.mkdir("\TIKZTEMP") > end > > function thirddata.parsetikzfile(name) > -- name is like \TIKZTEMP/mainfile-temp-tikz-21.pdf > logs.report("TIKZFILTER","name='" .. name .. "'") > context("\\externalfigure[" .. name .. "]") > end > \stopluacode > > \defineexternalfilter[tikz][ > cache=yes, > purge=no, > directory=\TIKZTEMP, > bufferbefore={tikz::before}, > bufferafter={tikz::after}, > readcommand=\ParseTikZFile, > output={\externalfilterbasefile.pdf}, > % ConTeXt never writes results to other directories > filtercommand={context --batchmode --once --autopdf=auto > --result=\externalfilterbasefile\space \externalfilterinputfile\space && mv > \externalfilterbasefile.pdf\space \TIKZTEMP/}, > ] > > \stopmodule ___ 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] understanding \startTEXpage
Hi, According to https://wiki.contextgarden.net/Command/startTEXpage it "starts a page that fits its contents exactly". But it seems, that part of the content is cropped here: \startTEXpage X \hskip20cm X \stopTEXpage No problem with 10cm instead of 20cm... Is this a bug or expected behaviour? TIA, -- 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] externalizing TikZ graphics
On Mon, 25 Jan 2021, Henning Hraban Ramm wrote: > > > Am 25.01.2021 um 17:31 schrieb Hans Hagen : > > > >> If nobody has better advice, I’ll try to come up with a filter setup. That > >> would mean we’d avoid the tikz module, every TikZ diagram will get written > >> to a buffer of configurable name, and that (with preamble setup) will get > >> run through LaTeX. I read pgf had some restrictions in plain TeX mode, but > >> perhaps we can also use LuaTeX in plain mode to avoid the LaTeX dependency. > > In the following case the buffer only gets typeset when it changes: > > Thank you (and Henri)! But we’d need to include the same setup header every > time, so the filter module is probably really the best way. It is not only the tikz setup; you also need to copy the font setup etc. \typesetbuffer[setups,figure] or some variant of that should also work. But the filter module does make it easier to store the results in another directory so that they are out of sight. > There’s just a problem with labels, I guess, if I go the filter-LaTeX or > filter-TeX route. So filter-ConTeXt might make sense. > I think I understand now why integrating MetaPost made a lot of sense. Here is a simple example: \usemodule[filter] \startbuffer[tikz-before] \usemodule[tikz] \startTEXpage \starttikzpicture \stopbuffer \startbuffer[tikz-after] \stoptikzpicture \stopTEXpage \stopbuffer \defineexternalfilter [externaltikz] [ bufferbefore=tikz-before, bufferafter=tikz-after, cache=yes, filtercommand={context --batchmode \externalfilterinputfile\space --purgeall --result=\externalfilteroutputfile}, output={\externalfilterbasefile.pdf}, readcommand=\readPDFfile, ] \define[1]\readPDFfile{\externalfigure[#1]} % width and height could be added \starttext \startexternaltikz \draw (0,0) -- (1,1); \stopexternaltikz \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] externalizing TikZ graphics
On 1/25/2021 4:42 PM, Henning Hraban Ramm wrote: Hi, did anyone succeed in externalizing TikZ graphics with ConTeXt? It’s about a project with hundreds of diagrams that (in the current state) clutter the main directory with cryptically-named PDFs (at least sorted by component name) and that on each ConTeXt run take a lot of runtime (I guess also the many log lines slow the process). In 2013, Aditya said it wasn’t possible to externalize pgf/TikZ graphics as documented in the pgf manual, and "perhaps" it would make sense to use his filter module: https://mailman.ntg.nl/pipermail/ntg-context/2013/071162.html Did anyone try to do that? I didn’t find anything in this list’s archives. The original pgf way is two-pass, and you’d need to call LaTeX with the intended graphics name as --jobname; that’s far too much of a hassle for that many graphics. I generally like how the filter module works, as you can also define the name of every buffer, but my only experience with that is my LilyPond setup. If nobody has better advice, I’ll try to come up with a filter setup. That would mean we’d avoid the tikz module, every TikZ diagram will get written to a buffer of configurable name, and that (with preamble setup) will get run through LaTeX. I read pgf had some restrictions in plain TeX mode, but perhaps we can also use LuaTeX in plain mode to avoid the LaTeX dependency. In the following case the buffer only gets typeset when it changes: \starttext \startbuffer[foo] % maybe include a style / enviroment \usemodule[tikz] \usetikzlibrary[patterns] \startTEXpage \starttikzpicture \draw[pattern color=red,pattern=bricks] (0,0) circle (1cm); \stoptikzpicture \stopTEXpage \stopbuffer \framed[offset=overlay]{\typesetbuffer[foo]} \stoptext 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] new font trickery
Hi Jairo, (to the list for those who want to play with it) In addition to the metapost fotn subsystem I also made a tex variant. That one is currently based on setups. So, we now can use mp as well as tex to make fonts. Of course this is mostly for special purposes and for fun but both are quite efficient. \starttext \setupexternalfigure[directory={global,default}] \startsetups box:demo:103 \externalfigure[cow-brown.pdf][height=12pt] \stopsetups \startsetups box:demo:104 \externalfigure[cow-black.pdf][height=10pt] \stopsetups \startsetups box:demo:105 \externalfigure[mill.png][height=12pt] \stopsetups \startsetups box:demo:106 \externalfigure[hacker.jpg][height=12pt] \stopsetups \registerboxglyph category {demo} unicode 103 \relax % rather low level for now \registerboxglyph category {demo} unicode 104 \relax % rather low level for now \registerboxglyph category {demo} unicode 105 \relax % rather low level for now \registerboxglyph category {demo} unicode 106 \relax % rather low level for now \definefontfeature[whatever][box=demo] \definedfont[Serif*whatever] % \enabletrackers[fonts.collecting] \startTEXpage%[offset=0pt] %\hbox{g}% \hbox{\char103}% \hbox{\char104}% \stopTEXpage \startsetups box:demo:whatever \startMPcode picture p ; p := image (draw figure "hacker.jpg" ysized 10pt); fill boundingbox p enlarged .5pt randomized 2pt withcolor "darkgray" ; clip p to boundingbox p enlarged -1pt randomized 2pt ; draw p ; \stopMPcode \stopsetups % in current font! \iffontchar\font\privatecharactercode{demo:whatever}\else \setboxglyph { category {demo} name {demo:whatever} setups {box:demo:whatever} }% \fi \startTEXpage[offset=10pt] \char\privatecharactercode{demo:whatever}% \stopTEXpage \startTEXpage%[offset=0pt] \ruledhbox{\char103} \ruledhbox{\char104} \ruledhbox{\char105} \ruledhbox{\char106} \stopTEXpage \dorecurse{1000}{ \char 103\relax \space \char 104\relax \space \char 105\relax \space \char 106\relax \space } \page \setupalign[verytolerant,flushleft] \dorecurse{100}{ #1: \glyph yoffset -2pt `i\relax \glyph yoffset -3pt `j\relax\space } \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 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] demo-symbols not working with LMTX
On 1/19/2021 12:18 PM, Jairo A. del Rio wrote: Hi, list. I was looking for information about fonts in ConTeXt defined using MetaPost and I found demo-symbols.tex for an Unicode (?) character. However, it doesn't work. While LMTX just doesn't print the symbol, MkIV complains from the Lua side. Has something changed? i'll fix it for mkiv (has to be adapted to lua 5.3+) the lmtx example usage is like this: \showglyphs \startTEXpage[offset=10pt] \definemetafont[MyDemoA][demo-symbols][at 10pt]\MyDemoA\char9754 \definemetafont[MyDemoB][demo-symbols][at 30pt]\MyDemoB\char9754 \stopTEXpage (i'll add it to the test file) 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] lmtx upload
Hi, I uploaded a new lmtx. Nothing spectacular as I'm still playign with compact font support (as explained in previous mails). Most seem to work now. New magic: \startTEXpage[offset=10pt] \vl\glyph `M\vl\quad \vl\glyph raise 3pt`M\vl\quad \vl\glyph left 3pt`M\vl\quad \vl\glyphright 2pt`M\vl\quad \vl\glyph raise -4pt right 4pt`M\vl\quad \vl\glyph left -1pt right -1pt`M\vl \stopTEXpage This is part of some experiments with manipulating glyph dimensions instead of font kerns. These extensions will stay (who knows when it comes un handy) but we will probably stick to font kerns as default. \startTEXpage[offset=10pt] \showfontkerns \showglyphs \strut average\par \vskip-2ex \enabledirectives[fonts.injections.method=advance] {\red \strut average}\par \stopTEXpage Both methods have their pros and cons. 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] A not so short introduction to ConTeXt Mark IV
On 1/4/2021 5:32 PM, Joaquín Ataz López wrote: Really? I wouldn't see it this way. I wondered a bit about the number of primitives shown in the document of Joaquín, but that they are used certainly doesn't make context like plaintex. I have calculated the number of primitives from the list made in "TeX Reference Manual" by David Bausum (of which there is a web version at https://www.tug.org/utilities/plain/cseq.html). According to that text the number of primitives is exactly 326. In my document I rounded it to "approximately 300". That list is a bit old. In the meantime we got etex extensions, which adds a few more, and then pdftex ades some, as well as omega and after that of course luatex. In luametatex we dropped some, and added others, so there we currently have 770 primitives. The increase of number is partly due to the 166 extra math related primitives of which many deal with all kind of font related paraneters and inter-blob spacing. \starttext \startTEXpage[offset=2mm,width=30cm,align={verytolerant,nothyphenated,flushleft},foregroundstyle=\tttf] \startluacode local t = tex.primitives() table.sort(t) local n = 0 for i=1,#t do if string.find(t[i],"^U") then n =n + 1 end end context("%i / %i: % t",#t,n,t) \stopluacode \stopTEXpage \stoptext if yuou want to know if something is a primitive, say: \meaningfull\vskip \par \meaningfull\relax \par \meaningfull\framed\par and you get an idea (\meaningfull itself is a primitive, the more verbose \meaning, and there's also \meaningless which I let you figure out yourself; of course these add two primitives to the repertoire). 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] issue with defined font feature
Pablo Rodriguez schrieb am 26.12.2020 um 12:58: Dear list, I have the following sample: \definefontfeature [standarddigits] [lnum=yes, tlig=no] \definefontfamily [anothermpface] [rm] [Gabriola] [features={default}] \definefontfamily [anothermpface] [ss] [Gabriola] [features={default, standarddigits}] \definefontfamily [anothermpface] [tt] [Gabriola] [features={standarddigits}] \setupbodyfont[anothermpface] \starttext \startTEXpage[offset=1em] 123324234 --\\ \ss 12123 -- 123\\ \tt 12123 -- 123 \stopTEXpage \stoptext I’m not being able to get both lnum and no en-dashes: the defined font feature seems to require the default and I cannot get en-dashes disabled when the default font feature set is enabled. You need "script=auto" (or a valid argument for the script key) in your font features for the monospaced font. Another option is to use "features={always,standarddigits}" but this enables kerning and ligatures. 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] issue with defined font feature
Dear list, I have the following sample: \definefontfeature [standarddigits] [lnum=yes, tlig=no] \definefontfamily [anothermpface] [rm] [Gabriola] [features={default}] \definefontfamily [anothermpface] [ss] [Gabriola] [features={default, standarddigits}] \definefontfamily [anothermpface] [tt] [Gabriola] [features={standarddigits}] \setupbodyfont[anothermpface] \starttext \startTEXpage[offset=1em] 123324234 --\\ \ss 12123 -- 123\\ \tt 12123 -- 123 \stopTEXpage \stoptext I’m not being able to get both lnum and no en-dashes: the defined font feature seems to require the default and I cannot get en-dashes disabled when the default font feature set is enabled. Does anyone what I am doing wrong here? 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 ___
Re: [NTG-context] Ducks in ConTeXt
El jue, 24 de dic. de 2020 a la(s) 10:53, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 12/24/2020 3:18 PM, Jairo A. del Rio wrote: > > Hi everyone! > > > > I've recently ported TikZducks to ConTeXt and finally removed TIkZ along > > the way. So a new module was created. The module is called "metaducks" > > (lol) and it's essentially a \useMPgraphic{...} with a lot of options, > > most of them ported from TikZducks. For those not familiar with the > > package, it draws customized rubber ducks :) I want to include some > > more, so I'll gladly read any feedback, recommendations and suggestions. > > Eventually I want it to be a module on its own. The module is already in > > the ConTeXt Group: > > > > > https://modules.contextgarden.net/cgi-bin/module.cgi/action=details/id=105 > > < > https://modules.contextgarden.net/cgi-bin/module.cgi/action=details/id=105 > > > > > > in case anyone wants to give it a try. Here's a minimal example: > > > > \usemodule[metaducks] > > \starttext > > \ducks[santa=true,mug=true] > > \stoptext > > > > I wish the best for you all. Happy holidays! > Nice! > > You can add, at the end of the module: > > \continueifinputfile{t-metaducks.mkvi} > > \starttext > \dorecurse{100}{ > \startTEXpage > \randomducks % Why plural? > Because \duck is already taken by TikZducks :( > \stopTEXpage > } > \stoptext > > Which means that you run the module directly you get an example. > > Oh, that explains \continueifinputfile in some source files. Nice. I'll add my test example. > No need to add \endinput, so just after the \protect (actually in your > case there is no need for \unprotect \protect). > > I want to do some additional trickery later, so \unprotect ... \protect are fine there, I think :) > Thanks, > > Thanks to you! I enjoy typesetting with ConTeXt and I'm very happy with all their possibilities. > Hans > > (Who looks out over water where quite often ducks swim.) > > > Lucky you! We have a nice bay in Callao, but no ducks. I have to visit my mother's homeland to see them in the wild :D > > - >Hans Hagen | PRAGMA ADE >Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - > Best regards, Jairo :) ___ 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] Ducks in ConTeXt
On 12/24/2020 3:18 PM, Jairo A. del Rio wrote: Hi everyone! I've recently ported TikZducks to ConTeXt and finally removed TIkZ along the way. So a new module was created. The module is called "metaducks" (lol) and it's essentially a \useMPgraphic{...} with a lot of options, most of them ported from TikZducks. For those not familiar with the package, it draws customized rubber ducks :) I want to include some more, so I'll gladly read any feedback, recommendations and suggestions. Eventually I want it to be a module on its own. The module is already in the ConTeXt Group: https://modules.contextgarden.net/cgi-bin/module.cgi/action=details/id=105 <https://modules.contextgarden.net/cgi-bin/module.cgi/action=details/id=105> in case anyone wants to give it a try. Here's a minimal example: \usemodule[metaducks] \starttext \ducks[santa=true,mug=true] \stoptext I wish the best for you all. Happy holidays! Nice! You can add, at the end of the module: \continueifinputfile{t-metaducks.mkvi} \starttext \dorecurse{100}{ \startTEXpage \randomducks % Why plural? \stopTEXpage } \stoptext Which means that you run the module directly you get an example. No need to add \endinput, so just after the \protect (actually in your case there is no need for \unprotect \protect). Thanks, Hans (Who looks out over water where quite often ducks swim.) - 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] Concerning \startTEXpage ... \stopTEXpage... again
On 12/7/2020 10:03 AM, Jairo A. del Rio wrote: Understood. Sorry, I wasn't meant to be rude. In such cases, how should Regarding the the 'tagging' as 'bug' ... it's more that once a question mentions 'bug' it no longer serves as 'general question' with 'possible answer' for anyone. I proceed? Is there a better way? [align=] will make it a hbox just use similar k/v as with framed 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] Concerning \startTEXpage ... \stopTEXpage... again
Understood. Sorry, I wasn't meant to be rude. In such cases, how should I proceed? Is there a better way? Thank you in advance. Cordially, Jairo :) El lun, 7 de dic. de 2020 a la(s) 03:58, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 12/7/2020 6:15 AM, Jairo A. del Rio wrote: > > Hi. Thanks to Hans for the quick fixes. However, some examples are still > > misbehaving. > > See the following: > > > > \setupbodyfont[70pt] > > \starttext > > \startTEXpage > > \framed{$a >> n = \left\lfloor\frac{a}{2^n}\right\rfloor$} > > \stopTEXpage > > \stoptext > > > > It works in MkIV, but it has the right margin cut with LMTX. Also, both > > MkIV and LMTX give cropped formulas when \framed is absent in the > > example above. Thank you in advance for any feedback. > be careful with terms like 'bug' or 'misbehaving' ... in this case it's > what one expects > > (1) this mechanism creates / operates in a vbox (using a hbox might have > been nicer in retrospect but then you would have more issues unless > configured) > > (2) so, we need some default hsize to start with and this is the text > width by defalut unless you set one with the 'width' argument or when > you pass [align=] > > (3) cropping takes place after all has been typeset but happens within > the width, again, this could be made more tolerant but then other cases > will fail > > with mechanisms like there is always a catch: handle this well and > something else will fail (when it works as expected it's seen as a > feature and otherwise it's considered a bug) > > 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] Concerning \startTEXpage ... \stopTEXpage... again
On 12/7/2020 6:15 AM, Jairo A. del Rio wrote: Hi. Thanks to Hans for the quick fixes. However, some examples are still misbehaving. See the following: \setupbodyfont[70pt] \starttext \startTEXpage \framed{$a >> n = \left\lfloor\frac{a}{2^n}\right\rfloor$} \stopTEXpage \stoptext It works in MkIV, but it has the right margin cut with LMTX. Also, both MkIV and LMTX give cropped formulas when \framed is absent in the example above. Thank you in advance for any feedback. be careful with terms like 'bug' or 'misbehaving' ... in this case it's what one expects (1) this mechanism creates / operates in a vbox (using a hbox might have been nicer in retrospect but then you would have more issues unless configured) (2) so, we need some default hsize to start with and this is the text width by defalut unless you set one with the 'width' argument or when you pass [align=] (3) cropping takes place after all has been typeset but happens within the width, again, this could be made more tolerant but then other cases will fail with mechanisms like there is always a catch: handle this well and something else will fail (when it works as expected it's seen as a feature and otherwise it's considered a bug) 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] Concerning \startTEXpage ... \stopTEXpage... again
Hi. Thanks to Hans for the quick fixes. However, some examples are still misbehaving. See the following: \setupbodyfont[70pt] \starttext \startTEXpage \framed{$a >> n = \left\lfloor\frac{a}{2^n}\right\rfloor$} \stopTEXpage \stoptext It works in MkIV, but it has the right margin cut with LMTX. Also, both MkIV and LMTX give cropped formulas when \framed is absent in the example above. Thank you in advance for any feedback. Best regards, Jairo :) ___ 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] Bugs using \startTEXpage ... \stopTEXpage, Metapost and text
On 12/6/20 3:29 PM, Jairo A. del Rio wrote: > [...] > gives a normal output in MkIV, but buggy output in LMTX. It seems only > TeX commands in Metapost (textext, thetextext, etc.) are affected. Am I > missing something? Hi Jairo, the sample can be much simpler: \starttext \startMPcode draw textext("some text"); \stopMPcode \stoptext This might be related to the issue that I reported about text scaling in lmt_followtext (https://mailman.ntg.nl/pipermail/ntg-context/2020/100573.html). 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 ___
[NTG-context] Bugs using \startTEXpage ... \stopTEXpage, Metapost and text
Hi. The following: \starttext %Using \startMPpage instead doesn't help \startTEXpage[width=1920px,height=1080px,margin=1em] \startplacefigure[location=force,number=no] \startMPcode draw textext("some text"); \stopMPcode \stopplacefigure \stopTEXpage \stoptext gives a normal output in MkIV, but buggy output in LMTX. It seems only TeX commands in Metapost (textext, thetextext, etc.) are affected. Am I missing something? Thank you in advance. Regards, Jairo :) ___ 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] Problem with word not hyphenating
Pablo Rodriguez schrieb am 30.11.2020 um 17:16: On 11/30/20 4:48 PM, Bruce Horrocks wrote: The word "re-implementation" refuses to hyphenate and consequently stick outs into the right margin. I've tried using \hyphenation but it makes no difference. [...] Any suggestions, please? Hi Bruce, here you have a sample: \setuphyphenation[method=traditional] \registerhyphenationexception[en][re-im-ple-men-ta-tion] \starttext \startTEXpage[offset=1em] \hyphenatedword{re-implementation}\\ \hyphenatedword{re||implementation}\\ \hyphenatedword{re--implementation}\\ \hyphenatedword{reimplementation} \stopTEXpage \stoptext If you comment the first line, only "||" allows hyphenation. Another option is to add \setbreakpoints[compound] to the document. 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] Problem with word not hyphenating
On 11/30/20 4:48 PM, Bruce Horrocks wrote: > The word "re-implementation" refuses to hyphenate and consequently > stick outs into the right margin. > > I've tried using \hyphenation but it makes no difference. > [...] > Any suggestions, please? Hi Bruce, here you have a sample: \setuphyphenation[method=traditional] \registerhyphenationexception[en][re-im-ple-men-ta-tion] \starttext \startTEXpage[offset=1em] \hyphenatedword{re-implementation}\\ \hyphenatedword{re||implementation}\\ \hyphenatedword{re--implementation}\\ \hyphenatedword{reimplementation} \stopTEXpage \stoptext If you comment the first line, only "||" allows hyphenation. I hope 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] Testing for LMTX
Pablo, Jairo, Thank you very much. > Le 26 nov. 2020 à 21:01, Pablo Rodriguez a écrit : > > On 11/26/20 8:06 PM, Jean-Philippe Rey wrote: >> [...] >> Do you know a way to distinguish between LMTX and MkIV ? > > Hi Jean-Philippe, > > I guess this is what you are looking for: > > \starttext > \startTEXpage[offset=1em] > \startlmtxmode LMTX\stoplmtxmode > \startmkivmode MkIV\stopmkivmode > \stopTEXpage > \stoptext > > Just in case it helps, > > Pablo -- Jean-Philippe Rey jean-philippe@centralesupelec.fr <mailto:jean-philippe@centralesupelec.fr> 91192 Gif-sur-Yvette Cedex - France Empreinte PGP : 807A 5B2C 69E4 D4B5 783A 428A 1B5E E83E 261B BF51 ___ 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] Testing for LMTX
On 11/26/20 8:06 PM, Jean-Philippe Rey wrote: > [...] > Do you know a way to distinguish between LMTX and MkIV ? Hi Jean-Philippe, I guess this is what you are looking for: \starttext \startTEXpage[offset=1em] \startlmtxmode LMTX\stoplmtxmode \startmkivmode MkIV\stopmkivmode \stopTEXpage \stoptext 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 ___
[NTG-context] flushleft nbsp with unequal width
Hello, with \setupalign[flushleft] non-breakable space has different width than regular space. With pure \rightskip0pt plus 1fill all spaces are equal. Is this wanted behaviour or do I miss additional settings? \showmakeup[glue] \startTEXpage[width=80mm,offset=5mm] \rightskip0pt plus 1fill woo woo woo woo woo woo woo woo woo woo \blank \setupalign[flushleft] woo woo woo woo woo woo woo woo woo woo \stopTEXpage MWE also in the attachment to preserve nbsp. Regards, Jano flushleft-nbsp.tex Description: TeX 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] Problem with setupcharacterspacing and comma
On 11/21/2020 04:46, Hans Hagen wrote: On 11/21/2020 4:57 AM, Rik Kabel wrote: Hello all, Playing with define/setup/set characterspacing, I have come across some odd, perhaps buggy, behavior. This applies to both MkIV 2020.11.19 11:23 and LMTX 2020.11.19 11:28. The problem is that character spacing is not effected for the left side of the comma character. It is handled as expected for other characters that I have tested, but I have not performed extensive tests. Example code: \definecharacterspacing[Test] \setupcharacterspacing [Test] ["002C] [left =.25,right=1,alternative=1] % , \setupcharacterspacing [Test] ["0065] [left=0.5,right=1,alternative=1] % e \setupcharacterspacing [Test] ["003B] [left=0.5,right=1,alternative=1] % e \startTEXpage[offset=1em] abc; def, g \setcharacterspacing[Test]abc; def, g \stopTEXpage remove the space between "left" and "=" I should have know better than to copy as I did from the source code without analyzing it sufficiently! In typo-spa.mkiv I found: \setupcharacterspacing [frenchpunctuation] ["003A] [\c!left =.25,\c!alternative=1] % : ... I see (now) that the space disappears when the \c!left macro is processed. Mea culpa. I owe you a beer. -- Rik ___ 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] Problem with setupcharacterspacing and comma
On 11/21/2020 4:57 AM, Rik Kabel wrote: Hello all, Playing with define/setup/set characterspacing, I have come across some odd, perhaps buggy, behavior. This applies to both MkIV 2020.11.19 11:23 and LMTX 2020.11.19 11:28. The problem is that character spacing is not effected for the left side of the comma character. It is handled as expected for other characters that I have tested, but I have not performed extensive tests. Example code: \definecharacterspacing[Test] \setupcharacterspacing [Test] ["002C] [left =.25,right=1,alternative=1] % , \setupcharacterspacing [Test] ["0065] [left=0.5,right=1,alternative=1] % e \setupcharacterspacing [Test] ["003B] [left=0.5,right=1,alternative=1] % e \startTEXpage[offset=1em] abc; def, g \setcharacterspacing[Test]abc; def, g \stopTEXpage remove the space between "left" and "=" - 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] Problem with setupcharacterspacing and comma
Hello all, Playing with define/setup/set characterspacing, I have come across some odd, perhaps buggy, behavior. This applies to both MkIV 2020.11.19 11:23 and LMTX 2020.11.19 11:28. The problem is that character spacing is not effected for the left side of the comma character. It is handled as expected for other characters that I have tested, but I have not performed extensive tests. Example code: \definecharacterspacing[Test] \setupcharacterspacing [Test] ["002C] [left =.25,right=1,alternative=1] % , \setupcharacterspacing [Test] ["0065] [left=0.5,right=1,alternative=1] % e \setupcharacterspacing [Test] ["003B] [left=0.5,right=1,alternative=1] % e \startTEXpage[offset=1em] abc; def, g \setcharacterspacing[Test]abc; def, g \stopTEXpage Output: -- Rik ___ 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] UTF-8 characters being dropped from typefile
Pablo Rodriguez schrieb am 11.11.2020 um 16:37: On 11/11/20 10:08 AM, n...@scorecrow.com wrote: Sorry for this really, really basic question but... I have the following 3 line source file: \starttext \typefile{test-listing.txt} \stoptext Hi Bruce, a MWE that shows your problem would be: \setupbodyfont[cursor] \starttext \startTEXpage[offset=1em] a ▸ \stopTEXpage \stoptext Which explains why the character is being dropped. What I don't understand is why is LMMono12-Regular being used? I thought I had read somewhere that TeX Gyre fonts were now the default (I'm on ConTeXt ver: 2020.11.05 23:01 LMTX) ? Latin Modern are the default fonts in ConTeXt. BTW, TeX Gyre Cursor doesn’t seem to contain the character you mention. DejaVu has the symbol and can be a option either as main font or just as fallback (but this can break the alignment) for another font. \setupbodyfont [dejavu] \starttext \rm Triangle: ▸ \ss Triangle: ▸ \tt Triangle: ▸ \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] problems with signature fields
Hans, I have the following sample: \setupinteraction[state=start] \starttext \startTEXpage[offset=1em] \definefield[x][signature] \field[x] \stopTEXpage \stoptext I can only use Acrobat to sign PDF documents with signature fields generated by ConTeXt. Other tools sign the PDF document not producing a valid signature (Acrobat cannot read or validate it). From the source, signature has two objects (copied from the sample above): 2 0 obj << /DA (/rmtf 11.9552 Tf 1.1955 Ts 0 0 0 rg 0 0 0 RG) /DV /F 4 /FT /Sig /Ff 0 /Kids 1 0 R /MaxLen 1024 /Q 0 /Subtype /Widget /T /V >> endobj 4 0 obj << /Type /Annot /DA (/rmtf 11.9552 Tf 1.1955 Ts 0 0 0 rg 0 0 0 RG) /F 4 /Parent 2 0 R /Q 0 /Subtype /Widget /Rect [ 14.033054 14.033054 70.40415 25.08072 ] >> endobj One of the tools that has issues with two objects for the signature field is the latest version (1.18) from mupdf-gl. mupdf-gl adds the signature value to the child (object 4) and not to its parent (object 2). I’m afraid this is also the same issue that AutoFirma (a e-signing tool developed by the Spanish government [https://firmaelectronica.gob.es/Home/Descargas.html]) has with these signature fields. When both objects are merged in one (as Acrobat Reader does when saving a copy), both tools generate documents contaning signatures totally unproblematic to be read validated by Acrobat. I suggested merging both objects back in 2017. You told me that simplifyng this would introduce too much complexity in ConTeXt only to save some bytes. Back then, I thought it was an minor improvement. Now I realized that this two objects for signature fiels are only valid for Acrobat. I wonder whether this improvement might be also easier to make in LMTX. Would it be possible that signature fields may have only one object, so that mupdf-gl and other tools have no problem signing fields PDF documents generated by ConTeXt? 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 ___
Re: [NTG-context] UTF-8 characters being dropped from typefile
On 11/11/20 10:08 AM, n...@scorecrow.com wrote: > Sorry for this really, really basic question but... > > I have the following 3 line source file: > > \starttext > \typefile{test-listing.txt} > \stoptext Hi Bruce, a MWE that shows your problem would be: \setupbodyfont[cursor] \starttext \startTEXpage[offset=1em] a ▸ \stopTEXpage \stoptext > Which explains why the character is being dropped. What I don't > understand is why is LMMono12-Regular being used? I thought I had > read somewhere that TeX Gyre fonts were now the default (I'm on > ConTeXt ver: 2020.11.05 23:01 LMTX) ? Latin Modern are the default fonts in ConTeXt. BTW, TeX Gyre Cursor doesn’t seem to contain the character you mention. > If not, is there an installation level config setting to make them > the default or do I need to work out the relevant \start ... > \stoptypescript commands? I think the first line in the sample above shows a simple approach. I hope 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 ___
[NTG-context] Bug in overprint? (was: how to set overprint)
Hello, may I ask someone, who understands knockout and overprint in the printing press, to check test cases in the attached file from the test suite, if overprint is working or not in Mark IV, please? Regards, Jano On Fri, 30 Oct 2020 at 11:02, Jano Kula wrote: > > > On Thu, 29 Oct 2020 at 23:12, Jano Kula wrote: > >> Hello, >> >> whatever I try, I cannot get the overprinting right (checked in Output >> Preview of Acrobat). Even overprint-001.tex from the test suite >> (2020-09-19) doesn't seem to have it right (latest beta). What I'm missing >> here? >> >> \setupcolors[intent=overprint] >> \startTEXpage[offset=10mm] >> \framed[frame=on,offset=10mm, >> background=color,backgroundcolor=darkgreen]{ >> % \startcolorintent[overprint] >> \startoverprint >> text in black >> \stopoverprint >> % \stopcolorintent >> } >> \stopTEXpage >> >> Thank you, >> Jano >> > > Forgot to say, I've also tried to add > \setupcolors[state=start,rgb=no,cmyk=yes] > though I think, at least state=start isn't needed anymore. > It doesn't change the overprint issue. > > Jano > overprint-001.tex Description: TeX 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 ___
[NTG-context] store data in the first run for later runs?
Dear list, I have the following sample: \starttext \startTEXpage[offset=1em] \startmode[*first] \startluacode io.write(" What’s your name?") document.user_name = io.read() document_data = { "\\def\\UserName{" .. document.user_name .. "}" } io.savedata(tex.jobname.."_document-tmp-data.txt", document_data) \stopluacode \stopmode \input{\jobname_document-tmp-data.txt} \UserName, nice to meet you. \stopTEXpage \stoptext This prompts user input on the first run, but I have to save to an external file to be able to read it in next runs. Just in case you might wonder, the actual code requires "--purgeall". Is there no way to save that in the .tuc file for later runs? I have tried https://wiki.contextgarden.net/System_Macros/Key_Value_Assignments#Multi-pass_data (as Aditya suggested to me), but runs after the first one see to empty the data in the Lua table. Adapting a sample from the wiki: \starttext \definedataset[somedataset] \startmode[*first] \setdataset[somedataset][wantscake=yes, wantsdeath=no] \stopmode Do you want cake? \datasetvariable{somedataset}{1}{wantscake}.\\ BTW, do you want death? \datasetvariable{somedataset}{1}{wantsdeath}. \stoptext I wonder whether there is no cleaner way to do this. 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 ___
Re: [NTG-context] how to set overprint
On Thu, 29 Oct 2020 at 23:12, Jano Kula wrote: > Hello, > > whatever I try, I cannot get the overprinting right (checked in Output > Preview of Acrobat). Even overprint-001.tex from the test suite > (2020-09-19) doesn't seem to have it right (latest beta). What I'm missing > here? > > \setupcolors[intent=overprint] > \startTEXpage[offset=10mm] > \framed[frame=on,offset=10mm, > background=color,backgroundcolor=darkgreen]{ > % \startcolorintent[overprint] > \startoverprint > text in black > \stopoverprint > % \stopcolorintent > } > \stopTEXpage > > Thank you, > Jano > Forgot to say, I've also tried to add \setupcolors[state=start,rgb=no,cmyk=yes] though I think, at least state=start isn't needed anymore. It doesn't change the overprint issue. Jano ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] how to set overprint
Hello, whatever I try, I cannot get the overprinting right (checked in Output Preview of Acrobat). Even overprint-001.tex from the test suite (2020-09-19) doesn't seem to have it right (latest beta). What I'm missing here? \setupcolors[intent=overprint] \startTEXpage[offset=10mm] \framed[frame=on,offset=10mm, background=color,backgroundcolor=darkgreen]{ % \startcolorintent[overprint] \startoverprint text in black \stopoverprint % \stopcolorintent } \stopTEXpage Thank you, Jano ___ 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] invoking ConTeXt from .bat file in Win7
On 10/28/20 5:44 PM, Aditya Mahajan wrote: > On Wed, 28 Oct 2020, Pablo Rodriguez wrote: >>> [...] >> I’d really appreciate to know how to request an extra pass in ConTeXt. > > As the manual says, "This mode is set if the last run in a session > is taking place. Normally this is not known in advance, unless one has > asked for an additional imposition pass." > > Why do you want to use the last mode for this? The new information > can lead to an extra line-break or extra page-break, which might then need > an extra run to resolve correctly. So, it might be better to ask the > information in the first run and save it in the tuc file using the two > pass mechanism: > > https://wiki.contextgarden.net/Command/datasetvariable Many thanks for your reply, Aditya. Your approach is really interesting, but I don’t know how to mix it with the first run mode. \startmode[*first] \startluacode io.write("\n\n Document URL?") document.url_address = io.read() \stopluacode \definedataset[document_data] \setdataset[document_data] [url=\cldcontext{document.url_address}] \stopmode \starttext \startTEXpage[offset=1em] \datasetvariable{document_data}{1}{url} \stopTEXpage \stoptext How could I make this sample or a similar approach work? What I need it to avoid entering the same address more than once. 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 ___
Re: [NTG-context] numbering pages included by \copypages
After further testing guided by Hans’ suggestion, I now have \setupexternalfigures[location=default] \setuplayer[preset=rightbottom, method=overlay]{} \setuppagenumbering[color=darkmagenta] \starttext \getfiguredimensions[HannahBW.pdf] \dorecurse{\noffigurepages}{ \startTEXpage[pagestate=start] \layeredtext[] [boffset=3pc, roffset=3pc] {\darkmagenta\subpagenumber} {\externalfigure[HannahBW.pdf][page=#1]} \stopTEXpage } \stoptext which works, though it would arguably be better if there is a way to prevent the subpage number on the first page of every included file. Alan On Fri, Sep 25, 2020 at 6:12 AM Hans Hagen wrote: > On 9/25/2020 5:53 AM, Aditya Mahajan wrote: > > On Fri, 25 Sep 2020, Wolfgang Schuster wrote: > > > >> Aditya Mahajan schrieb am 24.09.2020 um 23:48: > >>> On Thu, 24 Sep 2020, Alan Bowen wrote: > >>>> Any suggestions or pointers will be most welcome. > >>> > >>> See if this gives you any ideas > >>> > >>> https://adityam.github.io/context-blog/post/include-multi-page-pdf/ > >> > >> When both document have the same size you can replace TeXpage with a > "page" > >> layout. > >> > >> \startlayout[page] > >> \dorecurse{\noffigurepages}{\externalfigure[...][page=\recurselevel]} > >> \stoplayout > > > > Thanks for the comment (also I didn't know about \startlayout .. > \stoplayout). Unfortunately, in my use case, the paper sizes may not be the > same.. I am typically attaching published journal articles and some are > published on letter paper and some on A4. > > \setupexternalfigures[location=default] > > \starttext > > \dorecurse {5} {Before #1\page} > > \getfiguredimensions[oeps.pdf] > > \startsetups SomeNumber > \vbox to \overlayheight \bgroup > \vss > \hbox to \overlaywidth \bgroup > \hss > \bfd \red You can figure it out: \pagenumber > \hss > \egroup > \vss > \egroup > \stopsetups > > \defineoverlay[SomeNumber][\setups{SomeNumber}] > > \dorecurse {\noffigurepages} { > \startTEXpage[pagestate=start] > \externalfigure[oeps.pdf][page=#1,background=SomeNumber]% > \stopTEXpage > } > > \dorecurse {5} {After #1\page} > > \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 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] numbering pages included by \copypages
On 9/25/2020 5:53 AM, Aditya Mahajan wrote: On Fri, 25 Sep 2020, Wolfgang Schuster wrote: Aditya Mahajan schrieb am 24.09.2020 um 23:48: On Thu, 24 Sep 2020, Alan Bowen wrote: Any suggestions or pointers will be most welcome. See if this gives you any ideas https://adityam.github.io/context-blog/post/include-multi-page-pdf/ When both document have the same size you can replace TeXpage with a "page" layout. \startlayout[page] \dorecurse{\noffigurepages}{\externalfigure[...][page=\recurselevel]} \stoplayout Thanks for the comment (also I didn't know about \startlayout .. \stoplayout). Unfortunately, in my use case, the paper sizes may not be the same.. I am typically attaching published journal articles and some are published on letter paper and some on A4. \setupexternalfigures[location=default] \starttext \dorecurse {5} {Before #1\page} \getfiguredimensions[oeps.pdf] \startsetups SomeNumber \vbox to \overlayheight \bgroup \vss \hbox to \overlaywidth \bgroup \hss \bfd \red You can figure it out: \pagenumber \hss \egroup \vss \egroup \stopsetups \defineoverlay[SomeNumber][\setups{SomeNumber}] \dorecurse {\noffigurepages} { \startTEXpage[pagestate=start] \externalfigure[oeps.pdf][page=#1,background=SomeNumber]% \stopTEXpage } \dorecurse {5} {After #1\page} \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 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] french translation of ConTeXt interface - progress (v3)
On 7/19/20 8:27 PM, Garulfo wrote: > Thanks a lot !! > > I'm beginning to be able to typeset some simple example without any > struggle. > > https://wiki.contextgarden.net/File:modele_bonjour_le_monde.pdf > > The input file is attached in this mail. Congratulation for your excellent work, Garulfo. Your translation is really amazing. > I have only one remaining issue with this example: the indentation. > Despite \setupindenting[medium, yes], the paragraphs are not > systematically indented, and I don't really understand the pattern > behind it. The default is "indentnext=no" for \setupheads and \setupfloats. The pattern is clear: see what comes before the unindented paragraph. BTW, I don’t understand this: \langueprincipale[fr] \langue[fr] Is \mainlanguage not enough? (This would also set \language.) \mainlanguage[fr] \starttext \startTEXpage[offset=2em] mainlanguage: {\tt\currentmainlanguage} language: {\tt\currentlanguage} \stopTEXpage \stoptext I hope 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] Space after Round bracket before Punctuation
Thank you Hans, this was very helpful. I found that the following worked (apart from in two or three cases): \startluacode fonts.handlers.otf.addfeature { name = "iebpkerns", type = "kern", data = { [")"] = { [","] = -80, ["."] = -80, [":"] = -80, [";"] = -80, [")"] = -80, ["]"] = -80, }, ["]"] = { [","] = -80, ["."] = -80, [":"] = -80, [";"] = -80, [")"] = -80, ["]"] = -80, }, }, } \stopluacode Best, Richard -Original Message- From: Hans Hagen To: mailing list for ConTeXt users , Richard Mahoney | Indica et Buddhica Subject: Re: [NTG-context] Space after Round bracket before Punctuation Date: Thu, 9 Jul 2020 12:21:02 +0200 Mailer: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 X-Spam-Score: 0.0 On 7/9/2020 11:59 AM, Richard Mahoney | Indica et Buddhica wrote: > I'm typesetting some proceedings which include a good number of > roundbrackets followed by punctuation. This often occurs in the body > of thetext, but also in the hand coded bibliographies, e.g.: > ) plus . , ; : > The trouble is that excessive space is often introduced between > thebracket and the punctuation. I can control the excessive space > thatsometimes occurs between ) and . by using )\periods[1], although > thisruins the protrusion if it occurs at the end of a line. > Does anyone know how I might be able to somehow "tie" ) to . , ; : > sothat the distance remains reasonable, and so that protrusion > stillworks? you first have to make an MWE that demonstrates how protrusion works here ... then we can see how we can best deal with it Anyway, often tricks for this can be found in the test suite of font manual(s) ... here is a variant ... \startluacode fonts.handlers.otf.addfeature { name = "mykerns", type = "kern", data = { [")"] = { [","] = -300, ["."] = -300, [":"] = -250, [";"] = -250, [")"] = -100, }, }, }\stopluacode \definefontfeature[default][default][mykerns=true] \setupbodyfont [dejavu,12pt] \startTEXpage[offset=10pt] whatever), whatever): whatever) ; whatever). whatever))\stopTEXpage Hans --- -- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlandstel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - -- Richard Mahoney | Indica et Buddhica Littledene Bay Road Oxford NZT: +64 3 312 1699 M: +64 210 640 216IM: @rmahoney https://t.me/rmahoneyrmaho...@indica-et-buddhica.org https://indica-et-buddhica.org/ ___ 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] Space after Round bracket before Punctuation
On 7/9/2020 11:59 AM, Richard Mahoney | Indica et Buddhica wrote: I'm typesetting some proceedings which include a good number of round brackets followed by punctuation. This often occurs in the body of the text, but also in the hand coded bibliographies, e.g.: ) plus . , ; : The trouble is that excessive space is often introduced between the bracket and the punctuation. I can control the excessive space that sometimes occurs between ) and . by using )\periods[1], although this ruins the protrusion if it occurs at the end of a line. Does anyone know how I might be able to somehow "tie" ) to . , ; : so that the distance remains reasonable, and so that protrusion still works? you first have to make an MWE that demonstrates how protrusion works here ... then we can see how we can best deal with it Anyway, often tricks for this can be found in the test suite of font manual(s) ... here is a variant ... \startluacode fonts.handlers.otf.addfeature { name = "mykerns", type = "kern", data = { [")"] = { [","] = -300, ["."] = -300, [":"] = -250, [";"] = -250, [")"] = -100, }, }, } \stopluacode \definefontfeature[default][default][mykerns=true] \setupbodyfont [dejavu,12pt] \startTEXpage[offset=10pt] whatever), whatever): whatever); whatever). whatever)) \stopTEXpage 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] Fwd: Continued fractions in ConTeXt
I've just tested it and it looks w a y better than before (thanks!). Btw, where could I read about key-value pairs for ConTeXt fractions (\definemathfraction)? I've seen keys like "threshold" and other weird ones in the command list, so I ask about a reference (maybe somewhere in a manual; the Garden doesn't say a lot about it). Thank you very much. Sincerely, Jairo :) El lun., 29 de jun. de 2020 a la(s) 09:51, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 6/28/2020 6:06 PM, Jairo A. del Rio wrote: > > |Hi list! I've tried adapting the following code for continued > fractions:| > > || > > > > |% > https://tex.stackexchange.com/questions/73195/how-to-typeset-a-continued-fraction-in-the-following-format > > > \documentclass{article}\usepackage{amsmath}\begin{document}\newcommand*{\cofrac}[2]{%{%\rlap{$\dfrac{1}{\phantom{#1}}$}%\genfrac{}{}{0pt}{0}{}{#1+#2}%}%}\[a_0 > > > + > > > \cofrac{a_1}{\cofrac{a_2}{\cofrac{a_3}{\genfrac{}{}{0pt}{0}{}{\ddots\]\end{document} > > > > | > > > > |As I could read from the mailing list, ConTeXt no longer supports > > \genfrac, so I've tried > > | > > > > |the following using \definemathfraction > > > > \definemathfraction[gefrac][cfrac] > > \setupmathfraction[gefrac][rule=no] > > \def\cofrac#1#2{% > >{% > > \rlap{\cfrac{1}{\displaystyle\phantom{#1}}}% > > \gefrac{}{\displaystyle\gefrac{#1+}{}#2}% > >}% > > } > > \def\cofracnorule#1#2{% > > {% > > \rlap{\gefrac{\displaystyle\phantom{1}}{\displaystyle\phantom{#1}}}% > > \gefrac{}{\displaystyle\gefrac{#1}{}#2}% > > }% > > } > > \def\endfrac#1{\cofracnorule{#1}{\phantom{1}}} > > \startTEXpage > > \startplacefigure[location=force,number=no] > > \externalfigure[cofrac.png] > > \stopplacefigure > > \startformula > > \alpha + > > > \cofrac{\alpha'}{\cofrac{\alpha''}{\cofrac{\alpha'''}{{\endfrac{\ddots} > > \frac{1}{\alpha'''} > > \stopformula > > \stopTEXpage > > > > | > > > > |Mmm, superscripts and fraction rules superpose, so indeed something is > > wrong. Any ideas or references to a better result? > > | > In the next version this will look okay: > > \definemathfraction >[gefrac] >[d:frac] > > \setupmathfraction >[gefrac] >[mathstyle=display, > alternative=inner, > rule=hidden] > > \unexpanded\def\cofrac#1#2{% > \rlap{\cfrac{1}{\phantom{#1}}}% > \gefrac{}{\gefrac{#1+}{}#2}% > } > > \unexpanded\def\endfrac#1{% > \rlap{\phantom{\cfrac{1}{#1}}}% > \gefrac{}{#1}% > } > > \starttext > > \startTEXpage > \startformula \showmakeup[kern] > \alpha > + > \cofrac {\alpha'} > {\cofrac {\alpha''} > {\cofrac {\alpha'''} > {\endfrac {\ddots > + > \frac{1}{\alpha'''} > \stopformula > \stopTEXpage > > \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 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] Fwd: Continued fractions in ConTeXt
On 6/28/2020 6:06 PM, Jairo A. del Rio wrote: |Hi list! I've tried adapting the following code for continued fractions:| || |%https://tex.stackexchange.com/questions/73195/how-to-typeset-a-continued-fraction-in-the-following-format \documentclass{article}\usepackage{amsmath}\begin{document}\newcommand*{\cofrac}[2]{%{%\rlap{$\dfrac{1}{\phantom{#1}}$}%\genfrac{}{}{0pt}{0}{}{#1+#2}%}%}\[a_0 + \cofrac{a_1}{\cofrac{a_2}{\cofrac{a_3}{\genfrac{}{}{0pt}{0}{}{\ddots\]\end{document} | |As I could read from the mailing list, ConTeXt no longer supports \genfrac, so I've tried | |the following using \definemathfraction \definemathfraction[gefrac][cfrac] \setupmathfraction[gefrac][rule=no] \def\cofrac#1#2{% {% \rlap{\cfrac{1}{\displaystyle\phantom{#1}}}% \gefrac{}{\displaystyle\gefrac{#1+}{}#2}% }% } \def\cofracnorule#1#2{% {% \rlap{\gefrac{\displaystyle\phantom{1}}{\displaystyle\phantom{#1}}}% \gefrac{}{\displaystyle\gefrac{#1}{}#2}% }% } \def\endfrac#1{\cofracnorule{#1}{\phantom{1}}} \startTEXpage \startplacefigure[location=force,number=no] \externalfigure[cofrac.png] \stopplacefigure \startformula \alpha + \cofrac{\alpha'}{\cofrac{\alpha''}{\cofrac{\alpha'''}{{\endfrac{\ddots} \frac{1}{\alpha'''} \stopformula \stopTEXpage | |Mmm, superscripts and fraction rules superpose, so indeed something is wrong. Any ideas or references to a better result? | In the next version this will look okay: \definemathfraction [gefrac] [d:frac] \setupmathfraction [gefrac] [mathstyle=display, alternative=inner, rule=hidden] \unexpanded\def\cofrac#1#2{% \rlap{\cfrac{1}{\phantom{#1}}}% \gefrac{}{\gefrac{#1+}{}#2}% } \unexpanded\def\endfrac#1{% \rlap{\phantom{\cfrac{1}{#1}}}% \gefrac{}{#1}% } \starttext \startTEXpage \startformula \showmakeup[kern] \alpha + \cofrac {\alpha'} {\cofrac {\alpha''} {\cofrac {\alpha'''} {\endfrac {\ddots + \frac{1}{\alpha'''} \stopformula \stopTEXpage \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 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] Fwd: Continued fractions in ConTeXt
Hi list! I've tried adapting the following code for continued fractions: %https://tex.stackexchange.com/questions/73195/how-to-typeset-a-continued-fraction-in-the-following-format \documentclass{article}\usepackage{amsmath} \begin{document}\newcommand*{\cofrac}[2]{% {% \rlap{$\dfrac{1}{\phantom{#1}}$}% \genfrac{}{}{0pt}{0}{}{#1+#2}% }%}\[ a_0 + \cofrac{a_1}{ \cofrac{a_2}{ \cofrac{a_3}{ \genfrac{}{}{0pt}{0}{}{\ddots} }}}\]\end{document} As I could read from the mailing list, ConTeXt no longer supports \genfrac, so I've tried the following using \definemathfraction \definemathfraction[gefrac][cfrac] \setupmathfraction[gefrac][rule=no] \def\cofrac#1#2{% {% \rlap{\cfrac{1}{\displaystyle\phantom{#1}}}% \gefrac{}{\displaystyle\gefrac{#1+}{}#2}% }% } \def\cofracnorule#1#2{% {% \rlap{\gefrac{\displaystyle\phantom{1}}{\displaystyle\phantom{#1}}}% \gefrac{}{\displaystyle\gefrac{#1}{}#2}% }% } \def\endfrac#1{\cofracnorule{#1}{\phantom{1}}} \startTEXpage \startplacefigure[location=force,number=no] \externalfigure[cofrac.png] \stopplacefigure \startformula \alpha + \cofrac{\alpha'}{\cofrac{\alpha''}{\cofrac{\alpha'''}{{\endfrac{\ddots} \frac{1}{\alpha'''} \stopformula \stopTEXpage Mmm, superscripts and fraction rules superpose, so indeed something is wrong. Any ideas or references to a better result? I've attached the expected result (it's from Legendre's Théorie des nombres) and a normal fraction for comparison. Thank you very much. Jairo :) fraccioncontinualegendre.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 ___
[NTG-context] Extra space when \setcharacterkerning is used in enumeration
Hi, I noticed an extra space in an enumeration when using \setcharacterkerning in the \headstyle parameter. The extra space appears before the first word "Sats", and in my case it is unwanted (In the example I want the word Sats to align with a), b), ...). The space was not there a year ago, with the same code. In the test file below (sorry for its length), the environment sats is having the problem, while SATS does not. The only difference is in the \headstyle parameter. Am I missing something obvious? /Mikael PS I use the version of today, where the curious problems with sizes inside square roots and fractions seem to be gone. % Testfile starts here \setupbodyfont[stixtwo,10bp] \definemeasure[myitemwidth][26bp] \definemeasure[myindent][12bp] \setupindenting[yes,\measure{myindent}] \definecharacterkerning[sats][factor=0.1] \define[1]\vakuum{\hskip\measure{myindent}#1.} \defineenumeration[sats][ text={Sats}, style={\em}, title=yes, titlestyle=, width=fit, headstyle={\smallcaps\setcharacterkerning[sats]}, headcommand={\vakuum}, number=yes, alternative=serried, indenting={yes,\measure{myindent}}, ] \defineenumeration[SATS][sats][ headstyle=\smallcaps,%It is this setting that kills the space. ] \defineitemgroup[delab] \setupitemgroup[delab][each][a,intro,intext][ stopper=, right=), left={\hskip\measure{myindent}}, width=\measure{myitemwidth}, inbetween=, before={\blank[none,samepage]}, after=, style={\tf}, ] \starttext \startTEXpage[offset=3bp] \samplefile{ward} \startsats[title={Räkneregler för gränsvärden}] Antag att $c$ är ett tal, och att $a_k\to A$ och $b_k\to B$ då $k\to+\infty$. Då gäller det, när $k\to+\infty$, att \startdelab \item $a_k+b_k\to A+B$, \item $c\cdot a_k\to cA$, \item $a_kb_k\to AB$, \item $1/a_k\to 1/A$ (om $a_k\neq 0$ för alla $k$ och $A\neq 0$). \stopdelab \stopsats \samplefile{ward} \startSATS[title={Räkneregler för gränsvärden}] Antag att $c$ är ett tal, och att $a_k\to A$ och $b_k\to B$ då $k\to+\infty$. Då gäller det, när $k\to+\infty$, att \startdelab \item $a_k+b_k\to A+B$, \item $c\cdot a_k\to cA$, \item $a_kb_k\to AB$, \item $1/a_k\to 1/A$ (om $a_k\neq 0$ för alla $k$ och $A\neq 0$). \stopdelab \stopSATS \samplefile{ward} \stopTEXpage \stoptext %%% spaceprob.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] More funny numbers
On 6/12/2020 4:35 AM, Jairo A. del Rio wrote: Hi everyone! The following example shows that numerators of fractions inside math alignment environments appear with a funny size: \startTEXpage \startformula \startmathalignment[n=1,align=middle] \NC \frac{1351}{780}>\sqrt{3}>\frac{265}{153}, 3013 \frac{3}{4}>\sqrt{9082321}, \quad 1838 \frac{9}{17}>\sqrt{3380929} \NR \NC 1009 \frac{1}{6}>\sqrt{1018405}, \quad 2017 \frac{1}{4}>\sqrt{4069284} \frac{1}{38}, \quad 591 \frac{1}{8}<\sqrt{349450} \NR \NC 1172 \frac{1}{8}<\sqrt{1373943\frac{84}{33}}, 2339 \frac{1}{4}<\sqrt{5472132 \frac{1}{16}} \NR \stopmathalignment \stopformula \stopTEXpage It's actually nice to find those bugs when one makes heavy use of math environments. For comparison, LuaTeX prints the correct output. i uploaded a new version that should fix the spacing - 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] About Mongolian script
On 6/11/2020 2:38 PM, Jairo A. del Rio wrote: \definefontfeature[fea][default] [mode=base,language=dflt,script=mong, ccmp=yes,stch=yes,locl=yes,isol=yes,fina=yes, medi=yes,init=yes,rlig=yes,rclt=yes,calt=yes, liga=yes,dlig=yes,cswh=yes,mset=yes, curs=yes,kern=yes,mark=yes,mkmk=yes, ] \definefontfamily[main][serif][notosansmongolian][features=fea] \setupbodyfont[main] \startTEXpage ᠮᠠᠨᠵᡠ \stopTEXpage in the last upload(s) it should work with feature set 'mongolian' 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] More funny numbers
Hi everyone! The following example shows that numerators of fractions inside math alignment environments appear with a funny size: \startTEXpage \startformula \startmathalignment[n=1,align=middle] \NC \frac{1351}{780}>\sqrt{3}>\frac{265}{153}, 3013 \frac{3}{4}>\sqrt{9082321}, \quad 1838 \frac{9}{17}>\sqrt{3380929} \NR \NC 1009 \frac{1}{6}>\sqrt{1018405}, \quad 2017 \frac{1}{4}>\sqrt{4069284} \frac{1}{38}, \quad 591 \frac{1}{8}<\sqrt{349450} \NR \NC 1172 \frac{1}{8}<\sqrt{1373943\frac{84}{33}}, 2339 \frac{1}{4}<\sqrt{5472132 \frac{1}{16}} \NR \stopmathalignment \stopformula \stopTEXpage It's actually nice to find those bugs when one makes heavy use of math environments. For comparison, LuaTeX prints the correct output. Jairo :) ___ 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] Funny radicals in LMTX
On 6/11/2020 2:50 PM, Mikael Sundqvist wrote: Hi, I can confirm. The same problem goes with $\sqrt{\frac{2}{3}}$. put this in cont-new.mkiv: \unexpanded\def\styledrootradical#1#2% {\normalexpanded{\rootradical {\normalunexpanded{#1}}% {\noexpand\triggermathstyle{\number\normalmathstyle}% \normalunexpanded{#2 but next upload test again (as i'm experimenting with it a bit just for the sake of cleaner code). Hans /Mikael On Thu, Jun 11, 2020 at 1:53 PM Jairo A. del Rio mailto:jairoadelr...@gmail.com>> wrote: Hi list! Nesting radicals in LMTX give a funny font size compared with LuaTeX, which gives the correct output. I cleaned the cache, just in case. I attach code and outputs. Thank you in advance. \startTEXpage \startformula a_{2n} = \sqrt{2-\sqrt{4-a_{2n}}} \stopformula \stopTEXpage Jairo :D ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl <mailto: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 ___ -- - 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] Funny radicals in LMTX
Hi, I can confirm. The same problem goes with $\sqrt{\frac{2}{3}}$. /Mikael On Thu, Jun 11, 2020 at 1:53 PM Jairo A. del Rio wrote: > Hi list! Nesting radicals in LMTX give a funny font size compared with > LuaTeX, which gives the correct output. I cleaned the cache, just in case. > I attach code and outputs. Thank you in advance. > > \startTEXpage > \startformula > a_{2n} = \sqrt{2-\sqrt{4-a_{2n}}} > \stopformula > \stopTEXpage > > Jairo :D > > ___ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Funny radicals in LMTX
Hi list! Nesting radicals in LMTX give a funny font size compared with LuaTeX, which gives the correct output. I cleaned the cache, just in case. I attach code and outputs. Thank you in advance. \startTEXpage \startformula a_{2n} = \sqrt{2-\sqrt{4-a_{2n}}} \stopformula \stopTEXpage Jairo :D luametatextest.pdf Description: Adobe PDF document luatextest.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] problem with counters (page)
Alan Bowen schrieb am 10.06.2020 um 17:04: Thanks, Taco! That works in my mwe. I added way=bytext in my env file and the output is just what I need. Why don't you use sub pages? \starttext %\setupsubpagenumber[start=5]\resetsubpagenumber \setcounter[subpage][5] \startTEXpage \samplefile{ward} \blank \midaligned{\subpagenumber} \stopTEXpage \startTEXpage \samplefile{ward} \blank \midaligned{\subpagenumber} \stopTEXpage \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] problem with counters (page)
Thanks, Taco! That works in my mwe. I added way=bytext in my env file and the output is just what I need. Best, Alan On Wed, Jun 10, 2020 at 9:44 AM Taco Hoekwater wrote: > Hi Alan, > > Sorry, I should have actually tried your MWE. You do *not* want > way=bypage here, as that resets the counter to one at the start > of the next page (it is useful for footnotes that are numbered > per-page, but not for actual page counters). > > > \definecounter[volpage][type=page] > \starttext > \setcounter[volpage][5] > \dorecurse{3}{\startTEXpage[offset=2pc] > \input ward > \blank[medium] > > \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]} > \stopTEXpage} > \stoptext > > > > On 10 Jun 2020, at 15:05, Alan Bowen wrote: > > > > Hi, Taco— > > > > Thanks for the suggestion. I have tried it with \incrementcounter before > and after the TEXpage. Sadly, neither worked. > > > > This mwe is an attempt to capture the failure of the following in > processing a product with numerous components: > > > > \definecounter[volpage][type=page, way=bypage] > > \setupfootertexts[text] > > [] > > [{\centerline{\raise\NumberRaise\hbox{\rawcounter[volpage]}} > > \incrementcounter[volpage]}] > > [{\centerline{\raise\NumberRaise\hbox{\rawcounter[volpage]}} > > \incrementcounter[volpage]}] > > [] > > > > If your suggestion had worked, I would have had difficulty in applying > it. > > > > Alan > > > > On Wed, Jun 10, 2020 at 3:14 AM Taco Hoekwater > wrote: > > Hi, > > > > Incrementing the counter outside of the TEXpage should work. > > > > Best wishes, > > Taco > > > > > On 9 Jun 2020, at 23:34, Alan Bowen wrote: > > > > > > My efforts to set up a new page counter in the footertexts of a book > are not proving successful. The following code shows the nature of the > problem. > > > > > > \definecounter[volpage][type=page, way=bypage] > > > \starttext > > > \setcounter[volpage][5] > > > \dorecurse{3}{\startTEXpage[offset=2pc] > > > \input ward > > > \blank[medium] > > > > \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]} > > > \stopTEXpage} > > > \stoptext > > > > > > As you will see, the counter is not incremented on pages 2 and 3. > > > > > > I expect that I have missed something important. But what? > > > > > > 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 > > > > ___ > > > > 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 > > > ___ > > Taco Hoekwater > Elvenkind BV > > > > > > ___ > If your question is of interest to others as well, please add an entry to > the
Re: [NTG-context] problem with counters (page)
Hi Alan, Sorry, I should have actually tried your MWE. You do *not* want way=bypage here, as that resets the counter to one at the start of the next page (it is useful for footnotes that are numbered per-page, but not for actual page counters). \definecounter[volpage][type=page] \starttext \setcounter[volpage][5] \dorecurse{3}{\startTEXpage[offset=2pc] \input ward \blank[medium] \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]} \stopTEXpage} \stoptext > On 10 Jun 2020, at 15:05, Alan Bowen wrote: > > Hi, Taco— > > Thanks for the suggestion. I have tried it with \incrementcounter before and > after the TEXpage. Sadly, neither worked. > > This mwe is an attempt to capture the failure of the following in processing > a product with numerous components: > > \definecounter[volpage][type=page, way=bypage] > \setupfootertexts[text] > [] > [{\centerline{\raise\NumberRaise\hbox{\rawcounter[volpage]}} > \incrementcounter[volpage]}] > [{\centerline{\raise\NumberRaise\hbox{\rawcounter[volpage]}} > \incrementcounter[volpage]}] > [] > > If your suggestion had worked, I would have had difficulty in applying it. > > Alan > > On Wed, Jun 10, 2020 at 3:14 AM Taco Hoekwater wrote: > Hi, > > Incrementing the counter outside of the TEXpage should work. > > Best wishes, > Taco > > > On 9 Jun 2020, at 23:34, Alan Bowen wrote: > > > > My efforts to set up a new page counter in the footertexts of a book are > > not proving successful. The following code shows the nature of the problem. > > > > \definecounter[volpage][type=page, way=bypage] > > \starttext > > \setcounter[volpage][5] > > \dorecurse{3}{\startTEXpage[offset=2pc] > > \input ward > > \blank[medium] > > > > \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]} > > \stopTEXpage} > > \stoptext > > > > As you will see, the counter is not incremented on pages 2 and 3. > > > > I expect that I have missed something important. But what? > > > > 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 > > ___ > > 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 > ___ 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] problem with counters (page)
Hi, Taco— Thanks for the suggestion. I have tried it with \incrementcounter before and after the TEXpage. Sadly, neither worked. This mwe is an attempt to capture the failure of the following in processing a product with numerous components: \definecounter[volpage][type=page, way=bypage] \setupfootertexts[text] [] [{\centerline{\raise\NumberRaise\hbox{\rawcounter[volpage]}} \incrementcounter[volpage]}] [{\centerline{\raise\NumberRaise\hbox{\rawcounter[volpage]}} \incrementcounter[volpage]}] [] If your suggestion had worked, I would have had difficulty in applying it. Alan On Wed, Jun 10, 2020 at 3:14 AM Taco Hoekwater wrote: > Hi, > > Incrementing the counter outside of the TEXpage should work. > > Best wishes, > Taco > > > On 9 Jun 2020, at 23:34, Alan Bowen wrote: > > > > My efforts to set up a new page counter in the footertexts of a book are > not proving successful. The following code shows the nature of the problem. > > > > \definecounter[volpage][type=page, way=bypage] > > \starttext > > \setcounter[volpage][5] > > \dorecurse{3}{\startTEXpage[offset=2pc] > > \input ward > > \blank[medium] > > > \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]} > > \stopTEXpage} > > \stoptext > > > > As you will see, the counter is not incremented on pages 2 and 3. > > > > I expect that I have missed something important. But what? > > > > 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 > > > ___ > > 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] problem with counters (page)
Hi, Incrementing the counter outside of the TEXpage should work. Best wishes, Taco > On 9 Jun 2020, at 23:34, Alan Bowen wrote: > > My efforts to set up a new page counter in the footertexts of a book are not > proving successful. The following code shows the nature of the problem. > > \definecounter[volpage][type=page, way=bypage] > \starttext > \setcounter[volpage][5] > \dorecurse{3}{\startTEXpage[offset=2pc] > \input ward > \blank[medium] > > \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]} > \stopTEXpage} > \stoptext > > As you will see, the counter is not incremented on pages 2 and 3. > > I expect that I have missed something important. But what? > > 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 > ___ 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 ___
[NTG-context] problem with counters (page)
My efforts to set up a new page counter in the footertexts of a book are not proving successful. The following code shows the nature of the problem. \definecounter[volpage][type=page, way=bypage] \starttext \setcounter[volpage][5] \dorecurse{3}{\startTEXpage[offset=2pc] \input ward \blank[medium] \centerline{\red\tfa\rawcounter[volpage]\incrementcounter[volpage]} \stopTEXpage} \stoptext As you will see, the counter is not incremented on pages 2 and 3. I expect that I have missed something important. But what? 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] Let chapter start on odd page and make the even page before show an image
Jan U. Hasecke schrieb am 29.05.2020 um 15:10: Am 29.05.20 um 12:45 schrieb Wolfgang Schuster: juh schrieb am 29.05.2020 um 10:29: Dear all, with your help I can colorize the empty even page right before a chapter starts on the odd page. The mwe below shows it. Now I would like to redefine the contents of the left page on the fly in the text so that I could place images on this page. I thought that I could get a simple solution by inserting a TEXpage as even page, but this does not work for several reasons. First a TEXpage is not counted correctly like a normal page. And secondly I found now way to put it on the even page. So what I really want to achieve is a way to redefine this setups at some point in the text to insert eg. a picture on the even page before a chapter. \startsetups [chapter:before] \doifoddpageelse {} {\pushbackground[page] \setupbackgrounds[page][background=color,backgroundcolor=blue,] \page[empty,right] \popbackground} \stopsetups As you see the image is not in the right place and of course the pagenumbering is wrong. Use \startTEXpage[pagestate=start] to increase the page number with TEX pages. Thanks for this hint. I want that one of these blue pages shows an image. Is this possible? Yes but there are different ways for different requirements. - Do you you have a picture before *every* chapter? No, the additional image page shall appear only if the last chapter ends on an odd page. Then I need the image page to push the new chapter to the next odd page. - Do you use full page images? - Are the images cropped to fit the page dimension, stretched or centered with margins? For this usecase images are blown up and cropped to fit the page dimension including the bleed. \setuppagenumbering [alternative=doublesided] \setupexternalfigures [location=default] \definedataset [chapter] \startsetups [chapter:before] \page[yes] \doglobal\increment\ChapterCounter \doifoddpageelse {} {\doifsomething {\datasetvariable{chapter}{\ChapterCounter}{image}} {\startlayout[page] \centerbox{\externalfigure [\datasetvariable{chapter}{\ChapterCounter}{image}][factor=min]} \stoplayout}} \stopsetups \setuphead [chapter] [page=, beforesection=\directsetup{chapter:before}, insidesection={\setdataset[chapter][\ChapterCounter][image=\structureuservariable{image}]}] \setupexternalfigure[location=default] \starttext \startchapter [title={Tufte}] [image=cow] \dorecurse{4}{\samplefile{tufte}} \stopchapter \startchapter [title={Knuth}] [image=mill] \dorecurse{8}{\samplefile{knuth}} \stopchapter \startchapter [title={Zapf}] [image=hacker] \dorecurse{6}{\samplefile{zapf}} \stopchapter \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] Let chapter start on odd page and make the even page before show an image
Am 29.05.20 um 12:45 schrieb Wolfgang Schuster: > juh schrieb am 29.05.2020 um 10:29: >> Dear all, >> >> with your help I can colorize the empty even page right before a >> chapter starts >> on the odd page. The mwe below shows it. >> >> Now I would like to redefine the contents of the left page on the fly >> in the text >> so that I could place images on this page. >> >> I thought that I could get a simple solution by inserting a TEXpage as >> even >> page, but this does not work for several reasons. First a TEXpage is >> not counted >> correctly like a normal page. And secondly I found now way to put it >> on the >> even page. >> >> So what I really want to achieve is a way to redefine this setups at >> some point >> in the text to insert eg. a picture on the even page before a chapter. >> >> \startsetups [chapter:before] >> \doifoddpageelse >> {} >> {\pushbackground[page] >> \setupbackgrounds[page][background=color,backgroundcolor=blue,] >> \page[empty,right] >> \popbackground} >> \stopsetups >> >> As you see the image is not in the right place and of course the >> pagenumbering >> is wrong. > Use \startTEXpage[pagestate=start] to increase the page number with TEX > pages. Thanks for this hint. >> I want that one of these blue pages shows an image. Is this possible? > Yes but there are different ways for different requirements. > > - Do you you have a picture before *every* chapter? No, the additional image page shall appear only if the last chapter ends on an odd page. Then I need the image page to push the new chapter to the next odd page. > - Do you use full page images? > - Are the images cropped to fit the page dimension, stretched or > centered with margins? For this usecase images are blown up and cropped to fit the page dimension including the bleed. juh ___ 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] Let chapter start on odd page and make the even page before show an image
juh schrieb am 29.05.2020 um 10:29: Dear all, with your help I can colorize the empty even page right before a chapter starts on the odd page. The mwe below shows it. Now I would like to redefine the contents of the left page on the fly in the text so that I could place images on this page. I thought that I could get a simple solution by inserting a TEXpage as even page, but this does not work for several reasons. First a TEXpage is not counted correctly like a normal page. And secondly I found now way to put it on the even page. So what I really want to achieve is a way to redefine this setups at some point in the text to insert eg. a picture on the even page before a chapter. \startsetups [chapter:before] \doifoddpageelse {} {\pushbackground[page] \setupbackgrounds[page][background=color,backgroundcolor=blue,] \page[empty,right] \popbackground} \stopsetups Here comes the not so mwe: %% start mwe \setuplayout [ location=doublesided ] \setuppagenumbering[alternative=doublesided] \definepagebreak [chapter] [footer,yes,header,footer,right] \startsetups [chapter:before] \doifoddpageelse {} {\pushbackground[page] \setupbackgrounds[page][background=color,backgroundcolor=blue,] \page[empty,right] \popbackground} \stopsetups \setuphead [chapter] [ page=yes, before=\directsetup{chapter:before}, ] \setupexternalfigure[location=default] \starttext \startchapter [title={foo}] \dorecurse{2}{\input tufte \par} \stopchapter \startchapter [title={foo2}] \dorecurse{6}{\input tufte \par} \stopchapter \startchapter [title={bar}] \input knuth \startTEXpage \externalfigure[cow.pdf][height=\paperheight,width=\paperwidth] \stopTEXpage \stopchapter \startchapter [title={baz}] \input knuth \stopchapter \stoptext %% stop mwe As you see the image is not in the right place and of course the pagenumbering is wrong. Use \startTEXpage[pagestate=start] to increase the page number with TEX pages. I want that one of these blue pages shows an image. Is this possible? Yes but there are different ways for different requirements. - Do you you have a picture before *every* chapter? - Do you use full page images? - Are the images cropped to fit the page dimension, stretched or centered with margins? - ... 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] Let chapter start on odd page and make the even page before show an image
Dear all, with your help I can colorize the empty even page right before a chapter starts on the odd page. The mwe below shows it. Now I would like to redefine the contents of the left page on the fly in the text so that I could place images on this page. I thought that I could get a simple solution by inserting a TEXpage as even page, but this does not work for several reasons. First a TEXpage is not counted correctly like a normal page. And secondly I found now way to put it on the even page. So what I really want to achieve is a way to redefine this setups at some point in the text to insert eg. a picture on the even page before a chapter. \startsetups [chapter:before] \doifoddpageelse {} {\pushbackground[page] \setupbackgrounds[page][background=color,backgroundcolor=blue,] \page[empty,right] \popbackground} \stopsetups Here comes the not so mwe: %% start mwe \setuplayout [ location=doublesided ] \setuppagenumbering[alternative=doublesided] \definepagebreak [chapter] [footer,yes,header,footer,right] \startsetups [chapter:before] \doifoddpageelse {} {\pushbackground[page] \setupbackgrounds[page][background=color,backgroundcolor=blue,] \page[empty,right] \popbackground} \stopsetups \setuphead [chapter] [ page=yes, before=\directsetup{chapter:before}, ] \setupexternalfigure[location=default] \starttext \startchapter [title={foo}] \dorecurse{2}{\input tufte \par} \stopchapter \startchapter [title={foo2}] \dorecurse{6}{\input tufte \par} \stopchapter \startchapter [title={bar}] \input knuth \startTEXpage \externalfigure[cow.pdf][height=\paperheight,width=\paperwidth] \stopTEXpage \stopchapter \startchapter [title={baz}] \input knuth \stopchapter \stoptext %% stop mwe As you see the image is not in the right place and of course the pagenumbering is wrong. I want that one of these blue pages shows an image. Is this possible? Thanks for your help. juh -- Autoren-Homepage: . http://literatur.hasecke.com Satiren & Essays: . http://www.sudelbuch.de Privater Blog: http://www.hasecke.eu Netzliteratur-Projekt: http://www.generationenprojekt.de signature.asc Description: PGP signature ___ 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] bug in \doifinset
On 5/27/20 11:58 PM, luigi scarso wrote: >> On Wed, May 27, 2020 at 11:28 PM Pablo Rodriguez wrote: >> Without commas, lists are harder both to read and to write (at least, to me). > > what about > > \starttext > \startTEXpage[offset=1em] > \doifinsetelse{i7}{% > i4,% > i5,% > i7,% > } > {yes}{no} > \stopTEXpage > \stoptext > > here seems to work. Many thanks for your reply, Luigi. This is a better approach for me. Many thanks for 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 ___
Re: [NTG-context] bug in \doifinset
On 5/27/2020 10:39 PM, Wolfgang Schuster wrote: Pablo Rodriguez schrieb am 27.05.2020 um 22:31: Hi Hans, the following sample: \starttext \startTEXpage[offset=1em] \doifinsetelse{i7}{i4, i5, i7} {yes}{no} \stopTEXpage \stoptext outputs "yes" with latest from 2020.05.18 16:50, but "no" with latest from 2020.05.25 23:39. I think this may be a bug, since the sample above would only get "yes" with { i7}. No spaces are allowed in these lists. Older versions of the command removed the spaces before the entries but the current version is stricter. we can use the old one, so only the raw variants then ignore the space; best to be downward compatible, even if this was never the formal spec (more a side effect) it's only 20% slower and internally we we often use the raw one 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] bug in \doifinset
On Wed, May 27, 2020 at 11:28 PM Pablo Rodriguez wrote: > > Without commas, lists are harder both to read and to write (at least, to > me). > > what about \starttext \startTEXpage[offset=1em] \doifinsetelse{i7}{% i4,% i5,% i7,% } {yes}{no} \stopTEXpage \stoptext here seems to work. -- luigi ___ 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] bug in \doifinset
Pablo Rodriguez schrieb am 27.05.2020 um 22:31: Hi Hans, the following sample: \starttext \startTEXpage[offset=1em] \doifinsetelse{i7}{i4, i5, i7} {yes}{no} \stopTEXpage \stoptext outputs "yes" with latest from 2020.05.18 16:50, but "no" with latest from 2020.05.25 23:39. I think this may be a bug, since the sample above would only get "yes" with { i7}. No spaces are allowed in these lists. Older versions of the command removed the spaces before the entries but the current version is stricter. 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] bug in \doifinset
Hi Hans, the following sample: \starttext \startTEXpage[offset=1em] \doifinsetelse{i7}{i4, i5, i7} {yes}{no} \stopTEXpage \stoptext outputs "yes" with latest from 2020.05.18 16:50, but "no" with latest from 2020.05.25 23:39. I think this may be a bug, since the sample above would only get "yes" with { i7}. 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 ___
Re: [NTG-context] two superscript versions with Garamond Libre
On 5/18/2020 5:18 PM, Pablo Rodriguez wrote: Dear list, I’m accesing superscript glyphs for Garamond Libre with the OT feature and the character with the following sample: \definefontfeature[sups][script=latn, sups=yes] \definefontfamily[twoface][rm][GaramondLibre] \definefontfamily[mainface][rm][EB Garamond 12] \setupbodyfont[mainface] \starttext \startTEXpage[offset=1ex] {\feature[+][sups]1}¹{\feature[+][sups]2}²{\feature[+][sups]3}³% {\feature[+][sups]8}⁸{\feature[+][sups]9}⁹{\feature[+][sups]0}⁰\\ \setupbodyfont[twoface] {\feature[+][sups]1}¹{\feature[+][sups]2}²{\feature[+][sups]3}³% {\feature[+][sups]8}⁸{\feature[+][sups]9}⁹{\feature[+][sups]0}⁰\\ \stopTEXpage \stoptext Typeface is available at https://github.com/dbenjaminmiller/garamond-libre/releases/latest. Sorry, but I’m a bit thick now. Does anyone know why characters and OT sups provide differently sized glyphs? I think there might be a bug in the typeface, but I need to know first what to report. designers decisions ... i guess ... features are just tags and afaik nothing really prescribes how to implement them (relative to each other) 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 ___