mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-09 08:28:18 +00:00
RaTeX counts macro expansions (1,000) but not how large they grow, so a definition whose argument doubles on every call keeps the expander busy without bound. User macros have no use in an equation, so check_caps now refuses the definers (def, gdef, edef, xdef, let, futurelet, global, long, newcommand, renewcommand, providecommand) before RaTeX sees the source. The scan reads control words, verbatim text and comments the way RaTeX's lexer does. A matrix is laid out and written as rows times the widest row, so one long row in a tall matrix multiplied the output. check_caps now counts the padded cells of every environment from the source and refuses more than 2,500 in total; to_omml checks the parsed grid as well. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>