Re: [NTG-context] underbar aligns badly
On 8/27/2022 8:46 AM, Jan Ulrich Hasecke via ntg-context wrote: Hi all, can nobody confirm this bug? in: \protected\def\node_rules_direct#1% {\groupedcommand {\dontleavehmode % this should not be needed but it is in \bTD \node_rules_set{#1}% add a % after that line and remake the format Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] underbar aligns badly
Hi all, can nobody confirm this bug? juh Am Thu, Aug 25, 2022 at 09:19:40AM +0200 schrieb juh+ntg-context--- via ntg-context: > > Dear all, > > I fear I hit a bug or missed a change. > > \starttext > \underbar{First line}\\ > Second line. > \stoptext > > With lmtx from 2022.07.24 the lines align fine. > > With current lmtx the first line has a small indent. > > > Ciao! > juh > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ -- 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Textadept no longer supported?
Sorry for the noise. I found Textadept files in the GitHub repo. However, it would be nice to have them in the distribution. Have a nice day. Cordially, Jairo El vie, 26 ago 2022 a la(s) 19:01, Jairo A. del Rio (jairoadelr...@gmail.com) escribió: > Hi, list. > > Last time I installed my ConTeXt distribution from scratch, I've noticed > Textadept files are no longer in the distribution. I've tried SciTE but > it's broken in Ubuntu as code highlighting just doesn't work. Has something > changed? Is it possible to get those files from an older version? Thanks in > advance. > > 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Textadept no longer supported?
Hi, list. Last time I installed my ConTeXt distribution from scratch, I've noticed Textadept files are no longer in the distribution. I've tried SciTE but it's broken in Ubuntu as code highlighting just doesn't work. Has something changed? Is it possible to get those files from an older version? Thanks in advance. 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 / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Understanding font errors
Am 26.08.22 um 22:22 schrieb Denis Maier via ntg-context: On 8/26/2022 10:07 PM, Denis Maier via ntg-context wrote: Hi, I've just noticed I'm getting error messages related to fonts: %% fonts > checking > char G (U+00047) in font '' with id 0: missing fonts > checking > char r (U+00072) in font '' with id 0: missing fonts > checking > char a (U+00061) in font '' with id 0: missing fonts > checking > char f (U+00066) in font '' with id 0: missing fonts > checking > char i (U+00069) in font '' with id 0: missing fonts > checking > char k (U+0006B) in font '' with id 0: missing %% What exactly is that supposed to mean? There does not seem to be a problem in the resulting PDFs. What should I do to debug this? you probably have that text before you load a font (so it's nullfont) search for that text ... "grafik " Thanks. I've done that already ... but apparently in the wrong file. "grafik" does not appear in file containing the text, which is why I was confused. But it appears in the environment file in a line that should be a comment. Yes, that’s usually the cause of this error – some text in the preamble or environment that’s not intended for output. Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Parallel texts: verse with blanks between stanzas via tabulate
Am 26.08.22 um 22:00 schrieb Denis Maier via ntg-context: Hi, I need to typeset two poems side by side. Usually, I use the tabulate environment for typesetting parallel texts. However, for poems this does not quite work as tabulate does not seem to allow blanks between the stanzas. See MWE below. Am I missing someting? Is there a better way to achieve this? How about columnsets or paragraphs? \definecolumnset[Zwei][n=2] \startcolumnset[Zwei] \startlines Starlight, star bright, first star I see tonight; \stoplines \column \startlines I wish I may, I wish I might have the wish I wish tonight. \stoplines \stopcolumnset \defineparagraphs[Zwei][n=2] \setupparagraphs[Zwei][1][ width=.45\textwidth, distance=2em, align={verytolerant,stretch}] % width of 2nd column is calculated automatically \startZwei ... \nextZwei ... \stopZwei Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Understanding font errors
> -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von Hans Hagen > via ntg-context > Gesendet: Freitag, 26. August 2022 22:11 > An: ntg-context@ntg.nl > Cc: Hans Hagen > Betreff: Re: [NTG-context] Understanding font errors > > On 8/26/2022 10:07 PM, Denis Maier via ntg-context wrote: > > Hi, > > I've just noticed I'm getting error messages related to fonts: > > > > %% > > fonts > checking > char G (U+00047) in font '' with id 0: missing > > fonts > checking > char r (U+00072) in font '' with id 0: missing > > fonts > checking > char a (U+00061) in font '' with id 0: missing > > fonts > checking > char f (U+00066) in font '' with id 0: missing > > fonts > checking > char i (U+00069) in font '' with id 0: missing > > fonts > checking > char k (U+0006B) in font '' with id 0: missing > > fonts > checking > char [space] in font '' with id 0: missing > > fonts > checking > char m (U+0006D) in font '' with id 0: missing > > fonts > checking > char t (U+00074) in font '' with id 0: missing > > fonts > checking > char L (U+0004C) in font '' with id 0: missing > > fonts > checking > char b (U+00062) in font '' with id 0: missing > > fonts > checking > char e (U+00065) in font '' with id 0: missing > > fonts > checking > char l (U+0006C) in font '' with id 0: missing > > %% > > > > What exactly is that supposed to mean? There does not seem to be a > problem in the resulting PDFs. What should I do to debug this? > you probably have that text before you load a font (so it's nullfont) > > search for that text ... "grafik " Thanks. I've done that already ... but apparently in the wrong file. "grafik" does not appear in file containing the text, which is why I was confused. But it appears in the environment file in a line that should be a comment. Thanks again, Denis ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Understanding font errors
On 8/26/2022 10:07 PM, Denis Maier via ntg-context wrote: Hi, I've just noticed I'm getting error messages related to fonts: %% fonts > checking > char G (U+00047) in font '' with id 0: missing fonts > checking > char r (U+00072) in font '' with id 0: missing fonts > checking > char a (U+00061) in font '' with id 0: missing fonts > checking > char f (U+00066) in font '' with id 0: missing fonts > checking > char i (U+00069) in font '' with id 0: missing fonts > checking > char k (U+0006B) in font '' with id 0: missing fonts > checking > char [space] in font '' with id 0: missing fonts > checking > char m (U+0006D) in font '' with id 0: missing fonts > checking > char t (U+00074) in font '' with id 0: missing fonts > checking > char L (U+0004C) in font '' with id 0: missing fonts > checking > char b (U+00062) in font '' with id 0: missing fonts > checking > char e (U+00065) in font '' with id 0: missing fonts > checking > char l (U+0006C) in font '' with id 0: missing %% What exactly is that supposed to mean? There does not seem to be a problem in the resulting PDFs. What should I do to debug this? you probably have that text before you load a font (so it's nullfont) search for that text ... "grafik " - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Understanding font errors
Hi, I've just noticed I'm getting error messages related to fonts: %% fonts > checking > char G (U+00047) in font '' with id 0: missing fonts > checking > char r (U+00072) in font '' with id 0: missing fonts > checking > char a (U+00061) in font '' with id 0: missing fonts > checking > char f (U+00066) in font '' with id 0: missing fonts > checking > char i (U+00069) in font '' with id 0: missing fonts > checking > char k (U+0006B) in font '' with id 0: missing fonts > checking > char [space] in font '' with id 0: missing fonts > checking > char m (U+0006D) in font '' with id 0: missing fonts > checking > char t (U+00074) in font '' with id 0: missing fonts > checking > char L (U+0004C) in font '' with id 0: missing fonts > checking > char b (U+00062) in font '' with id 0: missing fonts > checking > char e (U+00065) in font '' with id 0: missing fonts > checking > char l (U+0006C) in font '' with id 0: missing %% What exactly is that supposed to mean? There does not seem to be a problem in the resulting PDFs. What should I do to debug this? Best, Denis ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Parallel texts: verse with blanks between stanzas via tabulate
Hi, I need to typeset two poems side by side. Usually, I use the tabulate environment for typesetting parallel texts. However, for poems this does not quite work as tabulate does not seem to allow blanks between the stanzas. See MWE below. Am I missing someting? Is there a better way to achieve this? Best, Denis %%% \startbuffer[lines] \startlines[after={\blank}] this is a poem with two stanzas \stoplines \stopbuffer \starttext With a blank between the stanzas: \getbuffer[lines] Without a blank between the stanzas: \starttabulate[|p|p|] \NC \getbuffer[lines] \NC \getbuffer[lines] \NC\NR \stoptabulate \stoptext %%% ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] No error when loading a non-existent module
On 8/26/2022 3:00 AM, Max Chernoff wrote: Hi Hans, On Thu, 2022-08-25 at 08:57 +0200, Hans Hagen wrote: On 8/25/2022 2:19 AM, Max Chernoff via ntg-context wrote: But ... you can already do \enabledirectives[logs.errors=*] or \enabledirectives[logs.errors=missing modules] Didn't know about that, thanks. However, this still continues processing the document and produces a PDF at the end. All that that seems to do is make ConTeXt exit with a non- zero status code, which is fairly easy to ignore if you're not paying attention. Is there a way to make this produce a nice little "error" PDF as soon as the error occurs just like using "\undefined" does? I added logs.quitonerror as alternative: % \enabledirectives[logs.errors=*] \enabledirectives[logs.quitonerror=missing modules] \starttext \usemodule[crapcrap] TEST \stoptext error logging > start possible issues modules > start missing modules modules > *-crapcrap modules > stop missing modules error logging > error marked as fatal mtx-context | fatal error: return code: 1 That has to do, no default, Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] String substitution using regular expressions and backreferences
On 8/25/2022 9:44 PM, Thangalin via ntg-context wrote: I've attempted to apply Wolfgang's subtle suggestion of using Lua to parse the input document using a regular expression via lpeg.replacer. The replacement itself works fine; however, in doing so the XML document structure is converted to text, which means that it is no longer possible to "flush" the XML for further processing as XML. The result is that any unresolved XML tags are written verbatim to the PDF: https://i.stack.imgur.com/9ZFND.png There are two other issues with this approach. First is efficiency. Second is that the processing function would have to be called for every XML element to capture the replacement. My original post asked about applying regex word substitution in a ConTeXt way, such as: \definereplacement[SubstMac][ match={Mc([A-Z].*)}, replace={\Mac \\1} ] \definereplacement[SubstPostmeridian][ match={[Pp]\\.[Mm]\\.}, replace={\cap{pm}} ] That seems like the cleanest approach because it would work on top of XML or any other source document. Nevertheless, here is what I tried, which partially works: \startbuffer[main] “Mr. McAnulty, I presume?” Regular text. Irregular text. \stopbuffer \startxmlsetups xml:xhtml \xmlsetsetup{\xmldocument}{*}{-} \xmlsetsetup{\xmldocument}{html|p|em}{xml:*}\stopxmlsetups \startxmlsetups xml:html \startdocument \xmlflush{#1} \stopdocument\stopxmlsetups % Paragraphs are followed by a paragraph break, but only if not nested.\startxmlsetups xml:p \xmlfunction{#1}{p} \par\stopxmlsetups \startxmlsetups xml:em \dontleavehmode{\em\xmlflush{#1}}\stopxmlsetups \startluacode function xml.functions.p( t ) rep = { [1] = { "McAnulty", "\\Mac Anulty" } } x = lpeg.replacer( rep ):match( tostring( xml.text( t ) ) ) buffers.assign( "p", context( x ) ) context.getbuffer{ "p" } end\stopluacode \xmlregistersetup{xml:xhtml} \def\Mac{% % Determine the sizes of 'M' and 'c'. \newbox\MacMBox% \setbox\MacMBox\hbox{M}% \newbox\MacCBox% \setbox\MacCBox\hbox{c}% % % Cheat to dynamically derive the kerning size by putting Mc in a box. % \newbox\MacKernBox% \setbox\MacKernBox\hbox{\inframed[offset=\zeropoint, width=fit]{Mc}}% \def\MacDelta{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}% \def\MacUWidth{\dimexpr\wd\MacCBox-.75\MacDelta\relax}% \def\MacRule{\vrule width \MacUWidth height .04em depth \zeropoint \relax}% \def\MacKern{\dimexpr\wd\MacKernBox-\wd\MacMBox-\wd\MacCBox\relax}% \def\MacHeight{\dimexpr\ht\MacMBox-\ht\MacCBox\relax}% % % Write Mc, where c has a macron, to the document. % M{% \dontleavehmode{\raisebox{\MacHeight}\hbox{c}}% \kern-1.04\MacUWidth \MacRule \kern.08\MacUWidth }% }% \xmlprocessbuffer{main}{main}{} As shown in the screen shot, this doesn't correctly handle nested XML elements. Any ideas on what approach to take to perform a string replacement in ConTeXt? Best stay at the xml end ... \startbuffer[main] “Mr. McAnulty, I presume?” Regular text. Irregular text. \stopbuffer \startxmlsetups xml:xhtml \xmlsetsetup{\xmldocument}{*}{-} \xmlsetsetup{\xmldocument}{html|p|em}{xml:*} \stopxmlsetups \startxmlsetups xml:html \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:p \xmlfunction{#1}{p} \xmlcontext{#1} \par \stopxmlsetups \startxmlsetups xml:em \dontleavehmode{\em\xmlflush{#1}} \stopxmlsetups \startluacode local rep = lpeg.replacer { [1] = { "McAnulty", "\\Mac Anulty" } } function xml.functions.p(t) local dt = t.dt for i=1,#dt do local di = dt[i] if type(di) == "string" then dt[i] = lpeg.match(rep,di) end end end \stopluacode \xmlregistersetup{xml:xhtml} \startdocument \xmlprocessbuffer{main}{main}{} \stopdocument But this is more fun and probably also more reliable: \startbuffer[main] “Mr. McAnulty, I presume?” Regular text. Irregular text. \stopbuffer \startxmlsetups xml:xhtml \xmlsetsetup{\xmldocument}{*}{-} \xmlsetsetup{\xmldocument}{html|p|em}{xml:*} \stopxmlsetups \startxmlsetups xml:html \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:p \xmlcontext{#1} \par \stopxmlsetups \startxmlsetups xml:em \dontleavehmode{\em\xmlflush{#1}} \stopxmlsetups \xmlregistersetup{xml:xhtml} \usemodule[gimmicks] % in latest uploads \chardef\MacAnulty = \getprivateglyphslot{MacAnulty} \startsetups [box:mcanulty:\number\MacAnulty] \Mac Anulty \stopsetups \registerboxglyph category {mcanulty} unicode \MacAnulty \relax \startluacode fonts.handlers.otf.addfeature { name= "mcanulty", type= "ligature", nocheck = true, data= { [fonts.constructors.privateslots.MacAnulty] = { "M", "c", "A", "n", "u", "l", "t", "y", }, } } \stopluacode \definefontfeature[default][default][box=mcanulty,mcanulty=yes] \startdocument \xmlproce
[NTG-context] Fwd: No error when loading a non-existent module
Forwarded Message Subject: Re: [NTG-context] No error when loading a non-existent module Date: Fri, 26 Aug 2022 09:22:24 +0200 From: Hans Hagen To: Max Chernoff On 8/26/2022 8:45 AM, Max Chernoff wrote: On Fri, 2022-08-26 at 07:40 +0200, Hans Hagen wrote: On 8/26/2022 3:00 AM, Max Chernoff wrote: Is there a way to make this produce a nice little "error" PDF as soon as the error occurs just like using "\undefined" does? Only If I add it as option (directive driven, must find some good name for it). You already have errors and warnings as an option, so a good name might be "fatal"? i'll put it on the 'to do' Most modules add commands and that shows immediately. Modules that kick in without some command that needs to enable something are sort of not-done or rare and experimental only and comparable to when some module patches or overloads core functionality withoutr mentioning it. Here I'm mainly thinking about my lua-widow-control module, which produces a visual effect, although it can be quite subtle if you're not paying very close attention. but i assuem that one has to explcitly enable that feature via a command as with any such feature so then one would get an undefined command when the module is not loaded Not seeing anything on the Wiki about either of those. I guess that means I'm volunteering myself :) guess so, i think it's in some (old) manual Similarly to "cont-loc.mkxl", is there some local file that is only read during format generation? Some of my documents use pgf/TikZ and expl3, and loading these during format generation can save quite a bit of time when compiling. I know that I can just modify "cont-en.mkxl" or "context.mkxl", but those can be overwritten by updates. no, these files are always read runtime (when present); personally i only use cont-loc fdor things like this: \enablemode[atpragma] \enablemode[*allfonts] \enabletrackers[pages.timing] % \enabletrackers[system.usage=summary] and there is very little in cont-new while in cont-exp i only have some features or optimizations enabled that i run for a while before they become default we're not going to add features that preloads extra stuff. i don't even want to think about possible interference because who knows what those systems set and do, and there's also order involved; i can even imagine that one then has to bump token memory. also, from the perspective of support it is handy to know that a standardized format is used normally loading files is fast enough once the os has them cached and afaiks tikz is not the fastest subsystem anyway so that probably impacts runtime anyway Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___