brucemiller / LaTeXML

LaTeXML: a TeX and LaTeX to XML/HTML/ePub/MathML translator.
http://dlmf.nist.gov/LaTeXML/
Other
863 stars 93 forks source link

recognize \bgroup as an opener for readBalanced #2342

Closed dginev closed 2 months ago

dginev commented 2 months ago

Fixes #2335

Based on a small pdftex test, the current latexml behavior is correct. We are just emitting an extra error for the case where \bgroup was used as the opener for a balanced read with $require_open set to true.

```tex \def\foo#1{bar #1 baz} % does NOT treat \bgroup as { \foo\bgroup hello} % treats \bgroup as { T5.8: \expanded\bgroup\meaning\egroup} % also treats \bgroup as { \lowercase\bgroup SMALL} \bye ```

Recognizing tokens that were \let to { seems to be appropriate, even if I am not sure it matches 100% the original implementation.

I also updated the POD with slightly more recent information.

dginev commented 2 months ago

Background: I freshly reproduced this error in the Rust port, so decided to come back and understand the root cause better.