Skip to content

[Fix] Fix rendering for non-braced LaTeX subscripts and superscipts#499

Merged
OXY2DEV merged 1 commit intoOXY2DEV:mainfrom
nil0x9:main
May 3, 2026
Merged

[Fix] Fix rendering for non-braced LaTeX subscripts and superscipts#499
OXY2DEV merged 1 commit intoOXY2DEV:mainfrom
nil0x9:main

Conversation

@nil0x9
Copy link
Copy Markdown
Contributor

@nil0x9 nil0x9 commented May 3, 2026

Non-braced subscripts and superscripts such as _t and ^2 were not rendered
because their lookup conditions used item.text[1]:sub(3).

For inputs like _t or ^2, sub(3) returns an empty string, so the condition
fails even when the target character exists in symbols.subscripts or
symbols.superscripts. The actual render paths already use
item.text[1]:sub(2), which correctly extracts the character after _ or ^.

This change makes the lookup conditions use the same substring offset as the
render lookup, allowing expressions like M_t, G_t, and x^2 to render
consistently with braced forms like M_{t} and x^{2}.

LaTex command Before After
M_t = \beta M_{t-1} + (1-\beta)G_t image image
y^2 + y^2 \leq 1 image image

@nil0x9 nil0x9 changed the title [Fix] Fix rendering for non-braced LaTeX subscripts [Fix] Fix rendering for non-braced LaTeX subscripts and superscipts May 3, 2026
@OXY2DEV OXY2DEV merged commit dbf74b6 into OXY2DEV:main May 3, 2026
@OXY2DEV
Copy link
Copy Markdown
Owner

OXY2DEV commented May 3, 2026

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants