Re: [NTG-context] Placing a section ending depending on odd/even sectionnumber
Willi Egger schrieb am 04.08.2020 um 18:56: Hi, now I have another hurdle to be taken :-) — Depending on the odd or even number of the section I have to place an ornament at the end of the section. I have sofar the following setup: [...] However the the evaluation of the sectionnumber results always in “false”, having therefore always odd as a sectionending. You have two problem: 1. To get the current value for \currentheadnumber you have use \determineheadnumber[section] before you use it but the example below shows a better method. 2. What you do with \doifelse{...}{even} is to compare the numeric value of the section with the string "even" which is always false. To check whether the value is odd or even you have to use the \ifodd command. What to change in order to get the desired result? begin example \startsetups [section:odd] \vfill \bold {End of odd numbered section} \stopsetups \startsetups [section:even] \vfill \bold {End of even numbered section} \stopsetups \startsetups [section:end] \ifodd\namedheadnumber{section} \directsetup{section:odd} \else \directsetup{section:even} \fi \stopsetups \setuphead [section] [aftersection=\directsetup{section:end}] \starttext \startsection[title=Ward] \input ward \stopsection \page \startsection[title=Knuth] \input knuth \stopsection \stoptext end example 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] Placing a section ending depending on odd/even sectionnumber
Hi, now I have another hurdle to be taken :-) — Depending on the odd or even number of the section I have to place an ornament at the end of the section. I have sofar the following setup: \define\stopmysection {\setups{endsection}} \startsetups endsection \doifelse {\currentheadnumber} %{\headnumber[section][current]}{odd} {even} {\vfil {\bf End of even numbered section} \stopsection% } {\vfil {\bf End of odd numbered section} \stopsection% } \stopsetups \starttext \startsection[title=Ward] \setuppagenumbering[conversion=romannumerals] \input ward \stopmysection \startsection[title=Knuth] \setuppagenumbering[conversion=numbers] \input knuth \stopmysection \stoptext However the the evaluation of the sectionnumber results always in “false”, having therefore always odd as a sectionending. What to change in order to get the desired result? Kind regards Willi ___ 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 vertical typesetting in ConTeXt
Thank you a lot, Hans. Indeed, the second solution seems to correctly put text into a vertical flow. However, a serious issue with Mongolian script is the horizontal direction: unlike CJK vertical typesetting, the text columns go from left to right, and the following almost works (\definefont gives no ligatures in my computer so I've used \definefontfamily instead) %\definefont does not work as expected \definefontfamily[main][serif][mongolianwhite][features=mongolian] \setupbodyfont[main,24pt] \defineframed [vertical] [ offset=none, align=flushleft, anchoring=left, foregroundstyle={\setupinterlinespace[40pt]}] \starttext %\MyFont \startframed[vertical] ᠣᠢᠷᠠ ᠵᠢᠨ ᠡᠳᠦᠷ᠂ ᠦᠪᠦᠷ ᠮᠣᠩᠭᠣᠯ ᠦᠨ ᠰᠢᠯᠢ ᠵᠢᠨ ᠭᠣᠣᠯ ᠠᠢᠮᠠᠭ ᠦᠨ ᠰᠢᠯᠣᠭᠣᠨ ᠬᠦᠬᠡ ᠬᠣᠰᠢᠭᠣᠨ ᠦ ᠰᠢᠭᠦᠬᠦ ᠬᠣᠷᠢᠶᠠ ᠨᠢᠭᠡᠨ ᠬᠦᠴᠦᠷᠬᠡᠭᠯᠡᠨ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠠᠯᠠᠲᠣ ᠬᠡᠷᠡᠭ ᠲᠦ ᠰᠢᠭᠦᠯᠲᠡ ᠬᠢᠪᠡ᠃ ᠰᠢᠭᠦᠨ ᠲᠠᠰᠣᠯᠣᠯᠳᠠ ᠪᠠᠷ᠂ ᠵᠠᠭᠠᠯᠳᠣᠭᠳᠠᠭᠴᠢ ᠡᠷᠬᠢᠮᠲᠦ ᠵᠢ ᠬᠦᠴᠦᠷᠭᠡᠭᠯᠡᠨ᠂ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠡᠯᠡ ᠪᠡᠷ ᠭᠣᠷᠪᠠᠨ ᠵᠢᠯ ᠦᠨ ᠬᠣᠭᠣᠴᠠᠭᠠ ᠲᠠᠢ ᠬᠣᠷᠢᠬᠣ ᠡᠷᠡᠭᠦᠦ ᠪᠡᠷ ᠰᠢᠳᠬᠡᠭᠰᠡᠨ ᠪᠠᠢᠨᠠ᠃ \stopframed \stoptext I've attached two files: the ConTeXt output (results so far) and the expected result (done via LuaLaTeX). As it can be seen, the text lines should go "upwards". I'd just use LuaLaTeX for this specific case, but ConTeXt is too cute... Thank you again, Hans. Sincerely, Jairo. El mar., 4 de ago. de 2020 a la(s) 07:52, Hans Hagen (j.ha...@xs4all.nl) escribió: > On 8/4/2020 2:42 PM, Hans Hagen wrote: > > On 8/4/2020 10:32 AM, Jairo A. del Rio wrote: > > > >> http://www.mongolfont.com/en/font/mnglwhiteotf.html > > let me be fast in providing an easier solution (I bet WS would correct > me otherwise): > > \defineframed >[vertical] >[offset=none, > align=flushleft, > anchoring=left, > foregroundstyle={\MyFont\setupinterlinespace[40pt]}] > > \startframed[vertical] > ᠣᠢᠷᠠ ᠵᠢᠨ ᠡᠳᠦᠷ᠂ ᠦᠪᠦᠷ ᠮᠣᠩᠭᠣᠯ ᠦᠨ ᠰᠢᠯᠢ ᠵᠢᠨ ᠭᠣᠣᠯ ᠠᠢᠮᠠᠭ ᠦᠨ ᠰᠢᠯᠣᠭᠣᠨ ᠬᠦᠬᠡ > ᠬᠣᠰᠢᠭᠣᠨ ᠦ ᠰᠢᠭᠦᠬᠦ ᠬᠣᠷᠢᠶᠠ ᠨᠢᠭᠡᠨ ᠬᠦᠴᠦᠷᠬᠡᠭᠯᠡᠨ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠠᠯᠠᠲᠣ ᠬᠡᠷᠡᠭ ᠲᠦ > ᠰᠢᠭᠦᠯᠲᠡ ᠬᠢᠪᠡ᠃ ᠰᠢᠭᠦᠨ ᠲᠠᠰᠣᠯᠣᠯᠳᠠ ᠪᠠᠷ᠂ ᠵᠠᠭᠠᠯᠳᠣᠭᠳᠠᠭᠴᠢ ᠡᠷᠬᠢᠮᠲᠦ ᠵᠢ ᠬᠦᠴᠦᠷᠭᠡᠭᠯᠡᠨ᠂ > ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠡᠯᠡ ᠪᠡᠷ ᠭᠣᠷᠪᠠᠨ ᠵᠢᠯ ᠦᠨ ᠬᠣᠭᠣᠴᠠᠭᠠ ᠲᠠᠢ ᠬᠣᠷᠢᠬᠣ ᠡᠷᠡᠭᠦᠦ ᠪᠡᠷ > ᠰᠢᠳᠬᠡᠭᠰᠡᠨ ᠪᠠᠢᠨᠠ᠃ > \stopframed > > I realized that I already added the anchoring features long ago ... > > Hans > > > hm, only for testing, not for use > > > >> I can rotate boxes in ConTeXt using other methods than those used in > >> LaTeX. However, my main concern is about "translating" the Lua(La)TeX > >> piece to be used in ConTeXt. I've read about "finalizers" in the CLD > >> manual and somewhere online, but I don't know how to access to > >> node.subtype("pdf_literal"). I'll be happy to know about a better > >> solution if ConTeXt offers it so it is accessible to other users. > >> Thank you in advance. > > The problem (or challenge) as usual is not in the coding but in what is > > a reasonable user interface. So, what are the use cases. Her eis one > > solution: > > > > \protected\def\startvertical > >{\dosingleempty\dostartvertical} > > > > \def\dostartvertical[#1]% > >{\begingroup > > \getdummyparameters[width=\textwidth,height=\textheight,#1]% > > \vbox > > orientation 1 > > \doifelsedimension{\dummyparameter{width}}{to > > \dummyparameter{width}}{}% > > \bgroup > > \doifelsedimension{\dummyparameter{height}}{\hsize > > \dummyparameter{height}}{}} > > > > \protected\def\stopvertical > >{\vfill > > \egroup > > \endgroup} > > > > % test > > > > \starttext > > > > \definefont > >[MyFont] > >[file:mnglwhiteotf.ttf*default,mongolian @ 24pt] > > > > \showframe > > > > \startvertical > > \MyFont > > \setupalign[stretch,tolerant,stretch] > > \setupinterlinespace[40pt]% > > ᠣᠢᠷᠠ ᠵᠢᠨ ᠡᠳᠦᠷ᠂ ᠦᠪᠦᠷ ᠮᠣᠩᠭᠣᠯ ᠦᠨ ᠰᠢᠯᠢ ᠵᠢᠨ ᠭᠣᠣᠯ ᠠᠢᠮᠠᠭ ᠦᠨ ᠰᠢᠯᠣᠭᠣᠨ ᠬᠦᠬᠡ > > ᠬᠣᠰᠢᠭᠣᠨ ᠦ ᠰᠢᠭᠦᠬᠦ ᠬᠣᠷᠢᠶᠠ ᠨᠢᠭᠡᠨ ᠬᠦᠴᠦᠷᠬᠡᠭᠯᠡᠨ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠠᠯᠠᠲᠣ ᠬᠡᠷᠡᠭ ᠲᠦ > > ᠰᠢᠭᠦᠯᠲᠡ ᠬᠢᠪᠡ᠃ ᠰᠢᠭᠦᠨ ᠲᠠᠰᠣᠯᠣᠯᠳᠠ ᠪᠠᠷ᠂ ᠵᠠᠭᠠᠯᠳᠣᠭᠳᠠᠭᠴᠢ ᠡᠷᠬᠢᠮᠲᠦ ᠵᠢ ᠬᠦᠴᠦᠷᠭᠡᠭᠯᠡᠨ᠂ > > ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠡᠯᠡ ᠪᠡᠷ ᠭᠣᠷᠪᠠᠨ ᠵᠢᠯ ᠦᠨ ᠬᠣᠭᠣᠴᠠᠭᠠ ᠲᠠᠢ ᠬᠣᠷᠢᠬᠣ ᠡᠷᠡᠭᠦᠦ ᠪᠡᠷ > > ᠰᠢᠳᠬᠡᠭᠰᠡᠨ ᠪᠠᠢᠨᠠ᠃ > > \stopvertical > > > > \page > > > > \startvertical[height=.75\textheight] > > \MyFont > > \setupalign[flushleft] > > \setupinterlinespace[40pt]% > > ᠣᠢᠷᠠ ᠵᠢᠨ ᠡᠳᠦᠷ᠂ ᠦᠪᠦᠷ ᠮᠣᠩᠭᠣᠯ ᠦᠨ ᠰᠢᠯᠢ ᠵᠢᠨ ᠭᠣᠣᠯ ᠠᠢᠮᠠᠭ ᠦᠨ ᠰᠢᠯᠣᠭᠣᠨ ᠬᠦᠬᠡ > > ᠬᠣᠰᠢᠭᠣᠨ ᠦ ᠰᠢᠭᠦᠬᠦ ᠬᠣᠷᠢᠶᠠ ᠨᠢᠭᠡᠨ ᠬᠦᠴᠦᠷᠬᠡᠭᠯᠡᠨ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠠᠯᠠᠲᠣ ᠬᠡᠷᠡᠭ ᠲᠦ > > ᠰᠢᠭᠦᠯᠲᠡ ᠬᠢᠪᠡ᠃ ᠰᠢᠭᠦᠨ ᠲᠠᠰᠣᠯᠣᠯᠳᠠ ᠪᠠᠷ᠂ ᠵᠠᠭᠠᠯᠳᠣᠭᠳᠠᠭᠴᠢ ᠡᠷᠬᠢᠮᠲᠦ ᠵᠢ ᠬᠦᠴᠦᠷᠭᠡᠭᠯᠡᠨ᠂ > > ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠡᠯᠡ ᠪᠡᠷ ᠭᠣᠷᠪᠠᠨ ᠵᠢᠯ ᠦᠨ ᠬᠣᠭᠣᠴᠠᠭᠠ ᠲᠠᠢ ᠬᠣᠷᠢᠬᠣ ᠡᠷᠡᠭᠦᠦ ᠪᠡᠷ > > ᠰᠢᠳᠬᠡᠭᠰᠡᠨ ᠪᠠᠢᠨᠠ᠃ > > \stopvertical > > > > \stoptext > > > > But it's kind of a quick hack interface. We can have alignment, > > interlinespace etc parameters to. Maybe definable verticals and so. > > > > Hans > > > > ps. for chinese one would probably kick in an extra feature > > > > % \definefontfeature > > % [vertical] > > % [vertical={% > > % orientation=3,% > > % down=.1,% > > % right=.1,% > > % ranges={% > > % cjkcompatibility,% > > % cjkcompatibilityforms,% > > % cjkcompatibilityideographs,% > > % cjkcompatibilityi
Re: [NTG-context] About vertical typesetting in ConTeXt
On 8/4/2020 10:32 AM, Jairo A. del Rio wrote: http://www.mongolfont.com/en/font/mnglwhiteotf.html hm, only for testing, not for use I can rotate boxes in ConTeXt using other methods than those used in LaTeX. However, my main concern is about "translating" the Lua(La)TeX piece to be used in ConTeXt. I've read about "finalizers" in the CLD manual and somewhere online, but I don't know how to access to node.subtype("pdf_literal"). I'll be happy to know about a better solution if ConTeXt offers it so it is accessible to other users. Thank you in advance. The problem (or challenge) as usual is not in the coding but in what is a reasonable user interface. So, what are the use cases. Her eis one solution: \protected\def\startvertical {\dosingleempty\dostartvertical} \def\dostartvertical[#1]% {\begingroup \getdummyparameters[width=\textwidth,height=\textheight,#1]% \vbox orientation 1 \doifelsedimension{\dummyparameter{width}}{to \dummyparameter{width}}{}% \bgroup \doifelsedimension{\dummyparameter{height}}{\hsize \dummyparameter{height}}{}} \protected\def\stopvertical {\vfill \egroup \endgroup} % test \starttext \definefont [MyFont] [file:mnglwhiteotf.ttf*default,mongolian @ 24pt] \showframe \startvertical \MyFont \setupalign[stretch,tolerant,stretch] \setupinterlinespace[40pt]% ᠣᠢᠷᠠ ᠵᠢᠨ ᠡᠳᠦᠷ᠂ ᠦᠪᠦᠷ ᠮᠣᠩᠭᠣᠯ ᠦᠨ ᠰᠢᠯᠢ ᠵᠢᠨ ᠭᠣᠣᠯ ᠠᠢᠮᠠᠭ ᠦᠨ ᠰᠢᠯᠣᠭᠣᠨ ᠬᠦᠬᠡ ᠬᠣᠰᠢᠭᠣᠨ ᠦ ᠰᠢᠭᠦᠬᠦ ᠬᠣᠷᠢᠶᠠ ᠨᠢᠭᠡᠨ ᠬᠦᠴᠦᠷᠬᠡᠭᠯᠡᠨ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠠᠯᠠᠲᠣ ᠬᠡᠷᠡᠭ ᠲᠦ ᠰᠢᠭᠦᠯᠲᠡ ᠬᠢᠪᠡ᠃ ᠰᠢᠭᠦᠨ ᠲᠠᠰᠣᠯᠣᠯᠳᠠ ᠪᠠᠷ᠂ ᠵᠠᠭᠠᠯᠳᠣᠭᠳᠠᠭᠴᠢ ᠡᠷᠬᠢᠮᠲᠦ ᠵᠢ ᠬᠦᠴᠦᠷᠭᠡᠭᠯᠡᠨ᠂ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠡᠯᠡ ᠪᠡᠷ ᠭᠣᠷᠪᠠᠨ ᠵᠢᠯ ᠦᠨ ᠬᠣᠭᠣᠴᠠᠭᠠ ᠲᠠᠢ ᠬᠣᠷᠢᠬᠣ ᠡᠷᠡᠭᠦᠦ ᠪᠡᠷ ᠰᠢᠳᠬᠡᠭᠰᠡᠨ ᠪᠠᠢᠨᠠ᠃ \stopvertical \page \startvertical[height=.75\textheight] \MyFont \setupalign[flushleft] \setupinterlinespace[40pt]% ᠣᠢᠷᠠ ᠵᠢᠨ ᠡᠳᠦᠷ᠂ ᠦᠪᠦᠷ ᠮᠣᠩᠭᠣᠯ ᠦᠨ ᠰᠢᠯᠢ ᠵᠢᠨ ᠭᠣᠣᠯ ᠠᠢᠮᠠᠭ ᠦᠨ ᠰᠢᠯᠣᠭᠣᠨ ᠬᠦᠬᠡ ᠬᠣᠰᠢᠭᠣᠨ ᠦ ᠰᠢᠭᠦᠬᠦ ᠬᠣᠷᠢᠶᠠ ᠨᠢᠭᠡᠨ ᠬᠦᠴᠦᠷᠬᠡᠭᠯᠡᠨ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠠᠯᠠᠲᠣ ᠬᠡᠷᠡᠭ ᠲᠦ ᠰᠢᠭᠦᠯᠲᠡ ᠬᠢᠪᠡ᠃ ᠰᠢᠭᠦᠨ ᠲᠠᠰᠣᠯᠣᠯᠳᠠ ᠪᠠᠷ᠂ ᠵᠠᠭᠠᠯᠳᠣᠭᠳᠠᠭᠴᠢ ᠡᠷᠬᠢᠮᠲᠦ ᠵᠢ ᠬᠦᠴᠦᠷᠭᠡᠭᠯᠡᠨ᠂ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠡᠯᠡ ᠪᠡᠷ ᠭᠣᠷᠪᠠᠨ ᠵᠢᠯ ᠦᠨ ᠬᠣᠭᠣᠴᠠᠭᠠ ᠲᠠᠢ ᠬᠣᠷᠢᠬᠣ ᠡᠷᠡᠭᠦᠦ ᠪᠡᠷ ᠰᠢᠳᠬᠡᠭᠰᠡᠨ ᠪᠠᠢᠨᠠ᠃ \stopvertical \stoptext But it's kind of a quick hack interface. We can have alignment, interlinespace etc parameters to. Maybe definable verticals and so. Hans ps. for chinese one would probably kick in an extra feature % \definefontfeature % [vertical] % [vertical={% % orientation=3,% % down=.1,% % right=.1,% % ranges={% % cjkcompatibility,% % cjkcompatibilityforms,% % cjkcompatibilityideographs,% % cjkcompatibilityideographssupplement,% % cjkradicalssupplement,% % % cjkstrokes,% % cjksymbolsandpunctuation,% % cjkunifiedideographs,% % cjkunifiedideographsextensiona,% % cjkunifiedideographsextensionb,% % cjkunifiedideographsextensionc,% % cjkunifiedideographsextensiond,% % cjkunifiedideographsextensione,% % cjkunifiedideographsextensionf,% % }% % }] and maybe some extreme hz would work out well too. - 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] Installing VSCode extension?
On Thu, Jul 30, 2020 at 12:25 PM Henning Hraban Ramm wrote: > > > Am 30.07.2020 um 07:52 schrieb Jeong Dal : > > > > Dear Alasdair McAndrew, > > > > I am using vscode in iMac, so my setting may not work for you. > > > > > > > > 1. First, find files for vscode in your TeX folder. > > > > In my case, > > > > > /ConTeXt-homefolder/tex/texmf-context/context/data/vacode/extensions/context/*.* > > > > 2. In a homefolder, there is a hidden folder “.vacode”. > > > > Copy context/*.* to ./vscode/extensions/context/*.* > > > > 3. Open vscode and enable context-extension. > > > > Since it was long time ago, my memory may not be correct. > > However, I hope that it may give you an idea. > > It might make sense to not copy the files but symlink the folder (then it > automatically receives updates). > i.e. > ln -s $TEXROOT/texmf-context/context/data/vacode/extensions/context > ~/.vscode/extensions/ > > Don’t know how symlinking in Windows works, though. > > HR > > ___ > 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 > > ___ > Hi! To make a symlink worked well here, in the sense that I got a context extension in vs code, and when opening a context file it was recognized as such. I could go into the extension settings and enable color syntax. Questions: 1) Is there a way to get autocompletion on all context commands (not only the ones I have in the document)? If so, how? 2) Is there a nice way to compile the tex file from within vs code? As of now, I opened a terminal and compiled from that, but that feels like the wrong way of doing it. I'm on linux and with the latest standalone (lmtx if that matters). /Mikael ___ 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] check if inside footnote
On 8/4/2020 1:47 PM, Henning Hraban Ramm wrote: Am 04.08.2020 um 13:20 schrieb Hans Hagen : On 8/4/2020 11:04 AM, Henning Hraban Ramm wrote: Hi, me again... Is there a check if a macro is called from inside of a footnote, like a system mode *footnote? (Same with captions?) In my current project, index entries should get italic page numbers if they occurr inside of a footnote (or a caption, but that is rare). I’m using different shortcuts for both cases (that call \index with or without processor), but some paragraphs are very confusing (many long footnotes, or footnotes within footnotes), and I could avoid manually analyzing the structure if my macro could determine on its own if it’s called from a footnote. Not-working example: \setupinteraction[state=start] \defineprocessor[kursiv][style=italicface] \define[1]\Idx{\doifmodeelse{*footnote}{\index{#1}}{\index[kursiv->]{kursiv->#1}}#1} \starttext Text --- \index[C]{A}{B}\footnote{Inside\index{FN}}\index{BF} --- \placeregister[index][criterium=all] \stoptext bad MWE ... took me more time to se that \Idx was not used than this: Ouch, sorry! That means I didn’t even check if that mode existed before; I also swapped the if/else brackets. \appendtoks \setsystemmode\currentnote \to \everysynchronizenote can you check if that works ok? Yes, that works. Thank you very much! i.e. MWE = \setupinteraction[state=start] \defineprocessor[kursiv][style=italicface] \define[1]\Idx{\doifmodeelse{*footnote}{\index[kursiv->]{kursiv->#1}}{\index{#1}}#1} \appendtoks \setsystemmode\currentnote \to \everysynchronizenote Ok, so when no one sees a problem I'll add it. \starttext Text --- \index[C]{A}{B}\footnote{Inside\Idx{FN}}\Idx{BF} --- \placeregister[index][criterium=all] \stoptext 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 ___ -- - 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 with \wordright in LMTX version 2020-08-03 14:25
Hi Hans, Thanks for the hint which consists in adding an \ifmmode to the definition of \qed. However, as you suggest, one needs some other mechanism in math mode, since with your new definition of \qed the alignment of the formula changes when one adds this close symbol: begin-example-qed.tex \definesymbol[Fin][\mathematics{\square}] \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi} \starttext \startformula a^2 + b^2 = c^2. \stopformula \startformula a^2 + b^2 = c^2. \qed \stopformula One sees that\type{\qed} in the formula changes the alignment of the formula. \qed \stoptext end-example-qed.tex Thanks a lot for everything: Otared > On 4 Aug 2020, at 13:24, Hans Hagen wrote: > > On 8/4/2020 11:17 AM, Otared Kavian wrote: >> Thanks Hans for your explanations. >> The problem I encountered is that, the command \qed is used dozens of time >> in my text without any issue because it was preceded by something on th >> eline, but the only place where it was alone after a formula resulted in the >> error and it was not easy for me to isolate the issue… >> By the way, in mkii it was possible to add \qed on the last line of a math >> formula, but that does not work anymore: >> \definesymbol[Fin][\mathematics{\square}] >> \def\qed{\strut\wordright{\symbol[Fin]}} >> \starttext >> \startformula >> a^2 + b^2 = c^2. \qed >> \stopformula >> The above formula does not show the close symbol.\qed >> \stoptext >> Is there a way to have something like \qed work in math formulas? > because that's now hwpo wordright works ... > > \def\qed{\ifmmode\quad\symbol[Fin]\else\strut\wordright{\symbol[Fin]}\fi} > > but we probably need something different, something that hooks into display > math > > 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] check if inside footnote
> Am 04.08.2020 um 13:20 schrieb Hans Hagen : > > On 8/4/2020 11:04 AM, Henning Hraban Ramm wrote: >> Hi, me again... >> Is there a check if a macro is called from inside of a footnote, like a >> system mode *footnote? >> (Same with captions?) >> In my current project, index entries should get italic page numbers if they >> occurr inside of a footnote (or a caption, but that is rare). >> I’m using different shortcuts for both cases (that call \index with or >> without processor), but some paragraphs are very confusing (many long >> footnotes, or footnotes within footnotes), and I could avoid manually >> analyzing the structure if my macro could determine on its own if it’s >> called from a footnote. >> Not-working example: >> \setupinteraction[state=start] >> \defineprocessor[kursiv][style=italicface] >> \define[1]\Idx{\doifmodeelse{*footnote}{\index{#1}}{\index[kursiv->]{kursiv->#1}}#1} >> \starttext >> Text >> --- >> \index[C]{A}{B}\footnote{Inside\index{FN}}\index{BF} >> --- >> \placeregister[index][criterium=all] >> \stoptext > bad MWE ... took me more time to se that \Idx was not used than this: Ouch, sorry! That means I didn’t even check if that mode existed before; I also swapped the if/else brackets. > \appendtoks >\setsystemmode\currentnote > \to \everysynchronizenote > > can you check if that works ok? Yes, that works. Thank you very much! i.e. MWE = \setupinteraction[state=start] \defineprocessor[kursiv][style=italicface] \define[1]\Idx{\doifmodeelse{*footnote}{\index[kursiv->]{kursiv->#1}}{\index{#1}}#1} \appendtoks \setsystemmode\currentnote \to \everysynchronizenote \starttext Text --- \index[C]{A}{B}\footnote{Inside\Idx{FN}}\Idx{BF} --- \placeregister[index][criterium=all] \stoptext 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] check if inside footnote
On 8/4/2020 11:04 AM, Henning Hraban Ramm wrote: Hi, me again... Is there a check if a macro is called from inside of a footnote, like a system mode *footnote? (Same with captions?) In my current project, index entries should get italic page numbers if they occurr inside of a footnote (or a caption, but that is rare). I’m using different shortcuts for both cases (that call \index with or without processor), but some paragraphs are very confusing (many long footnotes, or footnotes within footnotes), and I could avoid manually analyzing the structure if my macro could determine on its own if it’s called from a footnote. Not-working example: \setupinteraction[state=start] \defineprocessor[kursiv][style=italicface] \define[1]\Idx{\doifmodeelse{*footnote}{\index{#1}}{\index[kursiv->]{kursiv->#1}}#1} \starttext Text --- \index[C]{A}{B}\footnote{Inside\index{FN}}\index{BF} --- \placeregister[index][criterium=all] \stoptext bad MWE ... took me more time to se that \Idx was not used than this: \appendtoks \setsystemmode\currentnote \to \everysynchronizenote can you check if that works ok? 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] \emph not working in LMTX (bug?)
On 8/4/2020 5:48 AM, Wolfgang Schuster wrote: Yes and it was already reported by Pablo but don't hesitate report future bugs. Indeed. I really appreciate the fast testing of context lmtx updates because that way we can move on fast and in steps. https://www.mail-archive.com/ntg-context@ntg.nl/msg95268.html There was a file missing in the lmtx setup. New upload. I pruned some 15 year old stub code (from the early luatex dev times, it was still around; probably more such old code can go), so hopefully all generates well. Happy testing, 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] check if inside footnote
Hi, me again... Is there a check if a macro is called from inside of a footnote, like a system mode *footnote? (Same with captions?) In my current project, index entries should get italic page numbers if they occurr inside of a footnote (or a caption, but that is rare). I’m using different shortcuts for both cases (that call \index with or without processor), but some paragraphs are very confusing (many long footnotes, or footnotes within footnotes), and I could avoid manually analyzing the structure if my macro could determine on its own if it’s called from a footnote. Not-working example: \setupinteraction[state=start] \defineprocessor[kursiv][style=italicface] \define[1]\Idx{\doifmodeelse{*footnote}{\index{#1}}{\index[kursiv->]{kursiv->#1}}#1} \starttext Text --- \index[C]{A}{B}\footnote{Inside\index{FN}}\index{BF} --- \placeregister[index][criterium=all] \stoptext This also shows the text-running-into-footnotes problem with both of my ConTeXt versions: ConTeXt ver: 2020.01.30 14:13 MKIV beta fmt: 2020.4.12 ConTeXt ver: 2020.07.27 16:30 LMTX fmt: 2020.7.28 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] About vertical typesetting in ConTeXt
Hi, list. I've found a (sort of) way to do LTL typesetting in Lua(La)TeX based on "chickenize", a LuaTeX package. The font used is available here; http://www.mongolfont.com/en/font/mnglwhiteotf.html %Just for testing in LaTeX \documentclass{article} \usepackage{luacode} \usepackage{fontspec} \setmainfont{Mongolian White}[Renderer=Harfbuzz,Script=Mongolian] \begin{luacode*} -- How do I do this in ConTeXt? userdata = userdata or {} userdata.mongolian = function(head) --Ugly hackish line rotation rot = node.new(node.id("whatsit"),node.subtype("pdf_literal")) rot2 = node.new(node.id("whatsit"),node.subtype("pdf_literal")) for line in node.traverse_id(0,head) do w = line.width/65536*0.99625 rot.data = "-1 0 0 -1 "..w.." 0 cm" rot2.data = "-1 0 0 -1 "..-w.." 0 cm" line.head = node.insert_before(line.head,line.head,node.copy(rot)) node.insert_after(line.head,node.tail(line.head),node.copy(rot2)) end return head end \end{luacode*} \def\startmongolian{\directlua{luatexbase.add_to_callback("post_linebreak_filter", userdata.mongolian, "mongolian")}} \def\stopmongolian{% \par\directlua{luatexbase.remove_from_callback("post_linebreak_filter", "mongolian")}% } \usepackage{graphicx} \begin{document} \rotatebox{90}{% \parbox{8cm}{% \startmongolian \begin{flushleft} ᠣᠢᠷᠠ ᠵᠢᠨ ᠡᠳᠦᠷ᠂ ᠦᠪᠦᠷ ᠮᠣᠩᠭᠣᠯ ᠦᠨ ᠰᠢᠯᠢ ᠵᠢᠨ ᠭᠣᠣᠯ ᠠᠢᠮᠠᠭ ᠦᠨ ᠰᠢᠯᠣᠭᠣᠨ ᠬᠦᠬᠡ ᠬᠣᠰᠢᠭᠣᠨ ᠦ ᠰᠢᠭᠦᠬᠦ ᠬᠣᠷᠢᠶᠠ ᠨᠢᠭᠡᠨ ᠬᠦᠴᠦᠷᠬᠡᠭᠯᠡᠨ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠠᠯᠠᠲᠣ ᠬᠡᠷᠡᠭ ᠲᠦ ᠰᠢᠭᠦᠯᠲᠡ ᠬᠢᠪᠡ᠃ ᠰᠢᠭᠦᠨ ᠲᠠᠰᠣᠯᠣᠯᠳᠠ ᠪᠠᠷ᠂ ᠵᠠᠭᠠᠯᠳᠣᠭᠳᠠᠭᠴᠢ ᠡᠷᠬᠢᠮᠲᠦ ᠵᠢ ᠬᠦᠴᠦᠷᠭᠡᠭᠯᠡᠨ᠂ ᠨᠦᠵᠢᠳᠯᠡᠭᠰᠡᠨ ᠶᠡᠯᠡ ᠪᠡᠷ ᠭᠣᠷᠪᠠᠨ ᠵᠢᠯ ᠦᠨ ᠬᠣᠭᠣᠴᠠᠭᠠ ᠲᠠᠢ ᠬᠣᠷᠢᠬᠣ ᠡᠷᠡᠭᠦᠦ ᠪᠡᠷ ᠰᠢᠳᠬᠡᠭᠰᠡᠨ ᠪᠠᠢᠨᠠ᠃ \end{flushleft} \stopmongolian } } \end{document} I can rotate boxes in ConTeXt using other methods than those used in LaTeX. However, my main concern is about "translating" the Lua(La)TeX piece to be used in ConTeXt. I've read about "finalizers" in the CLD manual and somewhere online, but I don't know how to access to node.subtype("pdf_literal"). I'll be happy to know about a better solution if ConTeXt offers it so it is accessible to other users. Thank you in advance. Regards, Jairo El mié., 10 de jun. de 2020 a la(s) 03:11, Jairo A. del Rio ( jairoadelr...@gmail.com) escribió: > I totally ignored this document until now. As it looks really promising > (to me), I'll make some attempts first. In my almost-one-year experience > with ConTeXt, a manual or a discussion in the list usually foreshadows a > solution. ConTeXt never ceases to amaze me with its tricks and quirks. > Thank you very much, Hans. > > Jairo :) > > El mié., 10 de jun. de 2020 a la(s) 02:30, Hans Hagen (j.ha...@xs4all.nl) > escribió: > >> On 6/10/2020 7:49 AM, Jairo A. del Rio wrote: >> > Hi list! I'm curious about vertical typesetting in ConTeXt. As far as I >> > know, LuaTeX supports four text directions, but LTL is broken for >> Manchu >> > script (letters are displayed unjoined in LTL mode) and LuaMetaTeX does >> > not support vertical directions anymore, at least as primitives. >> > >> > I found the following solution: >> > >> > https://tex.stackexchange.com/a/140972/193767 >> > I reproduce the code (in XeLaTeX), just in case >> > >> > |% !TEX TS-program = >> > >> xelatex\documentclass{scrartcl}\usepackage{fontspec}\newfontfamily{\dcw}[]{DaicingWhite}%\begin{document}\noindentLine >> >> > above\\% to demonstrate that the lines are being stacked as >> > normal\rotatebox{-90}{%\XeTeXupwardsmode1\\% successive lines will be >> > stacked upwards instead of downwards\begin{minipage}{4em}% this will be >> > the vertical length of the Mongolian section{\dcw% Font: Daicing White1 >> > ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ\\% direct Unicode input of Manchu letters2 ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ }% >> > End font\end{minipage}\XeTeXupwardsmode0 }% End rotatebox\noindentLine >> > underneath \end{document}| >> > >> > >> > and I see XeTeX uses the primitive |\XeTeXupwardsmodeand some other >> > tricks to get the proper display of Manchu text, so maybe MKII can do >> > the magic using XeTeX as an engine. How would one use ConTeXt MKIV for >> > this task? Is it possible to emulate \XeTeXupwardsmode in ConTeXt as a >> > first step? Thank you very much. >> I admit that I have no clue about what xetex does in that departmentbut >> you're right that in lmtx the vertical directions are not supported. The >> main reason is that it didn't really integrates well in the way pages >> are constructed. >> >> Vertical typesetting (afaiks) involves two things: one character wide >> columns and rotated glyphs. The first can be handled by the macro >> package and the second by a combination of engine and macro package. >> >> Already for quite a while there are the basics for a more advanced >> vertical subsystem but it's typically one of these things that I explore >> and then set aside till some users show up who need it and are willing >> to spend time on discussing and testing intertfaces. After all, most of >> this tex stuff is kind of a hobby and it's easy to find new interesting >> experiments. >> >> Anyway, you can get some ideas in chapter 6 of: >> >>h
Re: [NTG-context] bug in current latest (2019.10.11 15:57)?
On 8/3/2020 7:26 PM, Wolfgang Schuster wrote: Pablo Rodriguez schrieb am 03.08.2020 um 19:06: Hi Hans, the following sample complains about an undefined command with ConTeXt latest (2019.10.11 15:57): \starttext {\em æb} \stoptext I think this might be a bug in LMTX. The following two constants are missing from syst-ini.mkxl (\semisimplegroupcode is needed for \triggergroupedcommand): \chardef\aligngroupcode = 6 \chardef\semisimplegroupcode = 14 hm, they are set someplace else (will tell you off list) 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] \fontdimen in LuaMetaTeX
On 8/3/2020 7:57 PM, Marcel Fabian Krüger wrote: Hi, recent LuaMetaTeX versions no longer automatically resize the fontdimen arrays on assignments. indeed, using font dimens for other purposes than fonts is pre-etex hackery that (c|sh)ould have been abandoned decades ago Is there a way to manually resize them or is it necessary to reload a patched font you want more fontdimens? no (tex uses the first 7 in text mode and some more in traditional math fonts but even those get remapped) ... if a font needs more then it's probably at the lua end and one then can deal with additional properties differently Also, there is an issue with the error message (I guess) for font.setfontdimen: \starttext \directlua{font.setfontdimen(0, 8, 0)} \stoptext gives token call, execute: invalid option '%i' to 'lua_pushfstring' stack traceback: [C]: in function 'font.setfontdimen' [ctxlua]:1: in main chunk 1 \starttext 2 >> \directlua{font.setfontdimen(0, 8, 0)} 3 \stoptext 4 ok, lua only handles %d, so i'll fix that, but all that code is in flux anyway, definitely undocumented 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] \emph not working in LMTX (bug?)
On 8/4/2020 3:37 AM, Jairo A. del Rio wrote: The following crashes with LMTX (current version: 2020.08.03 14:25): \starttext \emph{Hola} \stoptext Log: \emphasiscorrection ->\ifhmode \ifnum \currentgrouptype =\aligngroupcode looks like some mismatch between the format and the engine as it works ok here i'll make a new distribuition later today 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 with \wordright in LMTX version 2020-08-03 14:25
On 8/3/2020 10:10 PM, Otared Kavian wrote: Hi Hans, A file which used to be typeset correctly with the previous versions of lmtx, now produces an error. Despite the error message being extremely cryptic: Error ! Missing number, treated as zero I could guess the origin of the bug, which seems to be \wordright, but although the following minimal example shows a bug it does not produce the same ERROR output page: the square ''end of proof'' \definesymbol[Fin][\mathematics{\square}] \def\qed{\wordright{\symbol[Fin]}} \starttext \startformula a^2 + b^2 = c^2 \stopformula \qed % the problem is here \stoptext In the above example if one adds something before \qed, then the square end-of-proof appears. However in my real file ConTeXt ouputs an error page and says: Error ! Missing number, treated as zero. One can debate if the old behavior was ok ... wordright is meant for adding something at the end of a paragraph and you have none here. You can add a \strut in your definition to force a line. The lmtx implementation actually permit this: \definesymbol[Fin][\mathematics{\square}] \def\qed{\strut\wordright{\symbol[Fin1]}\wordright{\symbol[Fin2]}\wordright{\symbol[Fin3]}} \starttext \startformula a^2 + b^2 = c^2 \stopformula \qed % the problem is here \stoptext i'm still exploring this but it has to do with collecting stuff, as in: \wordright{before} test \par test \wordright{before} \par (i'll look at the number issue which indeed looks a like a bug) - 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 ___