LuaMetaTeX accepts `;` as part of `\numexpr`, which breaks LaTeX3
Dear ConTeXt developers, since TeX Live 2024, LaTeX3 can no longer be used with LuaMetaTeX. [1] The issue seems to be that unlike e-TeX and LuaTeX, LuaMetaTeX accepts `;` as part of `\numexpr`. Since `;` is commonly used as a delimiter in LaTeX3, this is a significant issue. The issue would be best solved in LuaMetaTeX by sticking to just `%` like e-TeX and LuaTeX do. Would that be an option? [1]: https://github.com/latex3/latex3/issues/1518 Best, Vitek
On 11/5/2024 10:35 PM, Vítek Starý Novotný wrote:
Dear ConTeXt developers,
since TeX Live 2024, LaTeX3 can no longer be used with LuaMetaTeX. [1] The issue seems to be that unlike e-TeX and LuaTeX, LuaMetaTeX accepts `;` as part of `\numexpr`. Since `;` is commonly used as a delimiter in LaTeX3, this is a significant issue. The issue would be best solved in LuaMetaTeX by sticking to just `%` like e-TeX and LuaTeX do. Would that be an option?
I'm not sure what "just %" means here.
What does luametatex bring to the latex table? Anyway, today I'm not in the mood to ponder semi colons, as it's the least of my worries, 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 -----------------------------------------------------------------
Anyway, today I'm not in the mood to ponder semi colons, as it's the least of my worries,
I am very sorry to bother you and other ConTeXt devs with this. If it makes it feel any better, the LaTeX folks seem equally annoyed with me.
I'm not sure what "just %" means here.
These were Joseph Wright's words. I assume Joseph was referring to the fact that in e-TeX and LuaTeX, including a comment after a `\numexpr` causes the comment to be ignored by TeX, similarly to how in LuaLaTeX, including a semicolon causes parts of the following text to be ignored. Here is an example file named `example.tex`: ``` \starttext \the\numexpr 1 + 2; 3 + 4 \stoptext ``` Running `context example.tex` produces the text "7". By contrast, running `context --luatex example.tex` produces the text "3; 3 + 4". Ideally, the two commands would produce the same output.
What does luametatex bring to the latex table?
The expl3 programming language from LaTeX3 can be used in other formats as well, including plain TeX and ConTeXt with LuaTeX, among others. Packages (such as my Markdown package for TeX) use expl3 as a format-independent programming layer. However, since TeX Live 2024, expl3 can no longer be loaded, since LuaMetaTeX's `\numexpr` seems incompatible with e-TeX's and LuaTeX's `\numexpr`. This makes such packages unusable with ConTeXt LMTX, since loading expl3 with `\input expl3-generic` produces the following error: tex error on line 7696 in file expl3-code.tex: Missing number, treated as zero Joseph and I discuss this in https://github.com/latex3/latex3/issues/1518. Best, Vitek On Wed, Nov 06, 2024 at 11:36:24AM +0100, Hans Hagen wrote:
On 11/5/2024 10:35 PM, Vítek Starý Novotný wrote:
Dear ConTeXt developers,
since TeX Live 2024, LaTeX3 can no longer be used with LuaMetaTeX. [1] The issue seems to be that unlike e-TeX and LuaTeX, LuaMetaTeX accepts `;` as part of `\numexpr`. Since `;` is commonly used as a delimiter in LaTeX3, this is a significant issue. The issue would be best solved in LuaMetaTeX by sticking to just `%` like e-TeX and LuaTeX do. Would that be an option?
I'm not sure what "just %" means here.
What does luametatex bring to the latex table?
Anyway, today I'm not in the mood to ponder semi colons, as it's the least of my worries,
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 ----------------------------------------------------------------- _______________________________________________ dev-context mailing list -- dev-context@ntg.nl To unsubscribe send an email to dev-context-leave@ntg.nl
On 11/6/2024 12:37 PM, Vítek Starý Novotný wrote:
Anyway, today I'm not in the mood to ponder semi colons, as it's the least of my worries,
I am very sorry to bother you and other ConTeXt devs with this. If it makes it feel any better, the LaTeX folks seem equally annoyed with me.
I'm not sure what "just %" means here.
These were Joseph Wright's words. I assume Joseph was referring to the fact that in e-TeX and LuaTeX, including a comment after a `\numexpr` causes the comment to be ignored by TeX, similarly to how in LuaLaTeX, including a semicolon causes parts of the following text to be ignored.
Here is an example file named `example.tex`:
``` \starttext \the\numexpr 1 + 2; 3 + 4 \stoptext ```
Well, that's just numexpr then, but how about: \def\fool{\hskip10pt plus 0pt} oeps \fool me oeps \fool minus me This whole lookahead scanning is fragile by design and just like one should define \def\fool{\hskip10pt plus 0pt\relax} one should also make sure an expression doesn't scan ahead, if only because it will expand whats coming next; basically \relax or matching () should have been mandate and it's a design flaw.
Running `context example.tex` produces the text "7". By contrast, running `context --luatex example.tex` produces the text "3; 3 + 4".
Ideally, the two commands would produce the same output.
Sure, but that leaves \hskip \vskip \hrule \vrule and some more.
What does luametatex bring to the latex table?
The expl3 programming language from LaTeX3 can be used in other formats as well, including plain TeX and ConTeXt with LuaTeX, among others. Packages (such as my Markdown package for TeX) use expl3 as a format-independent programming layer.
So maybe it's (at least for now) good to stick to luatex/mkiv, also because if markdown is the input there is not that much to gain from luametatex
However, since TeX Live 2024, expl3 can no longer be loaded, since LuaMetaTeX's `\numexpr` seems incompatible with e-TeX's and LuaTeX's `\numexpr`. This makes such packages unusable with ConTeXt LMTX, since loading expl3 with `\input expl3-generic` produces the following error:
tex error on line 7696 in file expl3-code.tex: Missing number, treated as zero
Joseph and I discuss this in https://github.com/latex3/latex3/issues/1518.
As mentioned there, we also cleaned up some function names (or moved some to another namespace); there's a reason why luatex was frozen and luametatex was the follow up. I can add a \etexexprmode=1 % to please latex but I wonder if it solves all the issues you can run into (for instance what happens when overload protection is active) 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 -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Vítek Starý Novotný