chirun-ncl / chirun

A Python package providing the command line interface for building flexible and accessible content with Chirun.
https://chirun.org.uk/
Other
29 stars 4 forks source link

LaTeX: when you don't put curly braces around the argument to \input, loaded macros aren't applied #156

Closed christianp closed 1 year ago

christianp commented 1 year ago

Here's a minimal example.

The document uses two macros, \clp and \twopi, which sohuld be straight substitutions. The macro \clp in text mode seems to just disappear, while \twopi in math mode isn't replaced with its definition so MathJax gives an "undefined command" error.

It looks like the names of macros are loaded, so that they don't throw an error when used, but the definitions aren't. I can't think how this could happen.

christianp commented 1 year ago

This problem occurs in plain plasTeX too.

christianp commented 1 year ago

I think I've worked it out: without the curly braces, the command is equivalent to \input{d}ef.tex, i.e. read the file d. That doesn't exist, so the macros aren't loaded. plastex silently ignores undefined macros, but pdflatex doesn't.