Skip to content

Map the comparison signs to their math commands, not to themselves - #30

Merged
Paebbels merged 1 commit into
devfrom
claude/selfreferential-unicodechars
Sep 16, 2026
Merged

Paebbels merged 1 commit into
devfrom
claude/selfreferential-unicodechars

Conversation

@pytooling-claude

Copy link
Copy Markdown

newunicodechar makes a character active, so its replacement text is read again. Two mappings replaced the character with itself:

\newunicodechar{≤}{\ensuremath{≤}}  % \le
\newunicodechar{≥}{\ensuremath{≥}}  % \ge

Every expansion re-inserts the active character, so a document containing one of them ends in TeX capacity exceeded, sorry [input stack size=10000].

Bug Fixes

  • pytooling.sty: U+2264 and U+2265 are mapped to \le and \ge, which the trailing comments already named. The other 82 mappings are unaffected - they replace the character with a command (\dots, \leftarrow, …) or wrap it in \emoji, which typesets it through \emojifont instead of re-reading it as an active character; example/lualatex/document.tex uses such icons and builds.

Others

  • Found while investigating a Sphinx PDF build of pyTooling/Actions, whose documentation contains U+2264 twelve times. That build currently fails earlier, in a tabulary table, so this defect is the one after it.

'newunicodechar' makes a character active, so its replacement text is expanded
again. U+2264 and U+2265 replaced themselves:

    \newunicodechar{≤}{\ensuremath{≤}}  % \le
    \newunicodechar{≥}{\ensuremath{≥}}  % \ge

Each expansion re-inserts the active character, which ends in
"TeX capacity exceeded, sorry [input stack size=10000]". The trailing comments
name what was meant - '\le' and '\ge' - and they are used now.

The other 82 mappings are not affected: they replace the character with a
command ('\dots', '\leftarrow', ...) or wrap it in '\emoji', which typesets it
through '\emojifont' rather than re-reading it as an active character. MiKTeX's
own 'example/lualatex/document.tex' uses such icons and builds.

Found in a Sphinx PDF build of 'pyTooling/Actions', whose documentation
contains U+2264 twelve times.

Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
@pytooling-claude pytooling-claude Bot added Problem Report Something isn't as expected. Processor: LuaLaTeX LaTeX Processor LuaLaTeX (with unicode support). Unicode Related to Unicode support. labels Sep 16, 2026
@Paebbels
Paebbels merged commit 139aef8 into dev Sep 16, 2026
13 checks passed
@Paebbels
Paebbels deleted the claude/selfreferential-unicodechars branch September 16, 2026 21:15
@pytooling-claude pytooling-claude Bot mentioned this pull request Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Problem Report Something isn't as expected. Processor: LuaLaTeX LaTeX Processor LuaLaTeX (with unicode support). Unicode Related to Unicode support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants