Re: [NTG-context] issue with scite module

2022-06-02 Thread Max Chernoff via ntg-context
For the sake of consistency (with buff-imp-xml.lua), I think the patch should read > [...] +local alsoname = lpatterns.utf8two + lpatterns.utf8three + lpatterns.utf8four I think that that pattern is a little too broad, since it will match any non-ASCII Unicode character. Things like

Re: [NTG-context] Compiling a large metapost document

2022-06-01 Thread Max Chernoff via ntg-context
On 2022-06-01 8:00 p.m., Stefan Nedeljkovic wrote: Thank you very much Max! It works indeed! One more question. How would I import the eps file back into MPpage, so I could do trickery with text. Convert the PostScript file into PDF with either "ps2pdf" or GhostScript, then you can import the

Re: [NTG-context] Compiling a large metapost document

2022-06-01 Thread Max Chernoff via ntg-context
I have a large .tex file with metapost embedded in it and want to compile it, but it fails. Do you know of a way to compile it? Just use plain MetaPost: diff --git a/belgrade_gm.tex b/belgrade_gm.mp index 3281754..d536b64 100644 --- a/belgrade_gm.tex +++ b/belgrade_gm.mp @@

Re: [NTG-context] issue with scite module

2022-06-01 Thread Max Chernoff via ntg-context
Now, I still don’t understand LPEG and don’t know if there’s a general “character” class that doesn’t need a list... Well looking through the XML spec https://www.w3.org/TR/REC-xml/#NT-NameChar you'd think that we'd want a pattern like this: local name = (R("az","AZ","09",

Re: [NTG-context] issue in Lua syntax formatting

2022-05-31 Thread Max Chernoff via ntg-context
the formatting of Lua multi-line strings messes up the source structure, in the following MWE, the "one" is displayed after "[[": \starttext \startLUA words = [[ one two three ]] \stopLUA \stoptext I can reproduce this. As a workaround, you can insert a non-breaking space (U+00A0)

Re: [NTG-context] Changing font and font size inside textex

2022-05-31 Thread Max Chernoff via ntg-context
Thanks Max that works perfectly! But It would still be useful if I could change families inside a MPpage. Sure, but you'll need to store the x-heights first: \starttexdefinition storexheight [#1] % Placing the first use of \switchtobodyfont inside a group messes % with the

Re: [NTG-context] Changing font and font size inside textex

2022-05-30 Thread Max Chernoff via ntg-context
I'm using the following macro to set the font size via h-height: \starttexdefinition setxheight [#1][#2] \switchtobodyfont[#1, 12pt] \scratchdimen=\dimexpr#2\relax \switchtobodyfont[#1, \cldcontext{tex.dimen.scratchdimen / tex.sp"1ex" * tex.sp"1em" .. "sp"}] \stoptexdefinition But I

Re: [NTG-context] How to install the ConTeXt-SBL module?

2022-05-29 Thread Max Chernoff via ntg-context
> What is the correct way to install an unofficial ConTeXt module Right now with LMTX, the only way to install modules is to manually copy files. I believe that the typical location to store module files is "TEXMFMODULES", but "TEXMFLOCAL" or "TEXMFHOME" should also work. To get the folder

Re: [NTG-context] Specifying font size as x-height

2022-05-28 Thread Max Chernoff via ntg-context
On 2022-05-28 2:27 a.m., Stefan Nedeljkovic wrote: One slight problem is when I use 2\measured{xheight} as the font size I get an error. \measure works fine though. The old version expected direct input, not a \dimen. Try this: \starttexdefinition setxheight [#1][#2]

Re: [NTG-context] Specifying font size as x-height

2022-05-28 Thread Max Chernoff via ntg-context
How would one specify the font size in LMTX, but via x-height? You could try this: \starttexdefinition setxheight [#1][#2] \switchtobodyfont[#1, 12pt] \switchtobodyfont[#1, \cldcontext{tex.sp"#2" / tex.sp"1ex" * tex.sp"1em" .. "sp"}] \stoptexdefinition Demo:

Re: [NTG-context] Callbacks (and nodes) in LuaMetaTeX

2022-05-25 Thread Max Chernoff via ntg-context
Hi list, I haven't had any luck solving any of the issues from my previous email: [NTG-context] Callbacks in LuaMetaTeX https://mailman.ntg.nl/pipermail/ntg-context/2022/105566.html Admittedly, my problems are fairly obscure (and likely self-inflicted), but any suggestions would be

Re: [NTG-context] lua-widow-control module error in LMTX

2022-05-14 Thread Max Chernoff via ntg-context
Hi all, I've pushed lwc v2.1.0 to CTAN and the Garden Modules site. This new version fully supports the ConTeXt grid snapping (MkIV/MkXL), and it also adds some improved logging. You can download this directly at https://modules.contextgarden.net/dl/lua-widow-control-v2.1.0.zip I

[NTG-context] Callbacks in LuaMetaTeX

2022-05-01 Thread Max Chernoff via ntg-context
Hi list, I've been playing around with some of the Lua callbacks in LuaMetaTeX, and I have a few questions/comments. Context: I'm writing a Plain/LaTeX/ConTeXt module called "lua-widow-control" that uses Lua callbacks to automatically remove widows and orphans from documents. The relevant Lua

Re: [NTG-context] lua-widow-control module error in LMTX

2022-04-28 Thread Max Chernoff via ntg-context
On 2022-04-28 3:30 a.m., Henning Hraban Ramm wrote: I’m afraid the above release introduced a bug; while the offical release ran through, I now get: module  > lua-widow-control > Widow/orphan detected. Attempting to remove. lua error   > lua error on line 112 in file

Re: [NTG-context] lua-widow-control module error in LMTX

2022-04-28 Thread Max Chernoff via ntg-context
On 2022-04-27 3:59 p.m., Eduardo Bohoyo wrote: When I uncomment grid=yes in my \setuplayout, lwc makes its real appearance on the scene. So it looks like lwc was broken with grid snapping. This surprised me -- I originally wrote lwc *specifically* to use with grid snapping -- but it looks like

Re: [NTG-context] lua-widow-control module error in LMTX

2022-04-27 Thread Max Chernoff via ntg-context
Quick question before I begin: are you using any especially "interesting" ConTeXt features? By "interesting" I mean things like grid typesetting, pagecolumns, bidirectional text, etc. I haven't tested lwc with every possible ConTeXt feature, so there may be some adverse interaction. If you are

Re: [NTG-context] lua-widow-control module error in LMTX

2022-04-25 Thread Max Chernoff via ntg-context
On 2022-04-25 6:51 p.m., Eduardo Bohoyo wrote: First things first.  I want to acknowledge and thank you for the tough mission that surely involves maintaining this module for the benefit of the TeX community and, most especially, for LMTX in particular, due to the very reasons you have just

Re: [NTG-context] lua-widow-control module error in LMTX

2022-04-25 Thread Max Chernoff via ntg-context
(Please keep me CC'd as I'm not subscribed to the list) Hi, I'm the lua-widow-control author. > lua error > lua error on line 74 in file > /opt/luametatex/texmf-modules/tex/context/third/lua-widow-control/t-lua-widow-control.mkxl > > The odd thing is that line 75 of the t-lua-widow-control

<    1   2