Skip to content

Instantly share code, notes, and snippets.

@dginev
Created November 1, 2023 15:20
Show Gist options
  • Save dginev/85e50aacdabfbc9ba22ef0f9ee43483b to your computer and use it in GitHub Desktop.
Save dginev/85e50aacdabfbc9ba22ef0f9ee43483b to your computer and use it in GitHub Desktop.
A simple XMath example
<Math mode="inline" tex="x_{i+j}" text="x _ (i + j)">
<XMath>
<XMApp>
<XMTok role="SUBSCRIPTOP" scriptpos="post1"/>
<XMTok font="italic" role="UNKNOWN">x</XMTok>
<XMApp>
<XMTok fontsize="70%" meaning="plus" role="ADDOP">+</XMTok>
<XMTok font="italic" fontsize="70%" role="UNKNOWN">i</XMTok>
<XMTok font="italic" fontsize="70%" role="UNKNOWN">j</XMTok>
</XMApp>
</XMApp>
</XMath>
</Math>
<Math mode="inline" tex="x_{i+j}">
<XMath>
<XMTok font="italic" role="UNKNOWN">x</XMTok>
<XMApp role="POSTSUBSCRIPT" scriptpos="1">
<XMArg rule="Subscript">
<XMTok font="italic" fontsize="70%" role="UNKNOWN">i</XMTok>
<XMTok fontsize="70%" meaning="plus" role="ADDOP">+</XMTok>
<XMTok font="italic" fontsize="70%" role="UNKNOWN">j</XMTok>
</XMArg>
</XMApp>
</XMath>
</Math>
@dginev
Copy link
Author

dginev commented Nov 1, 2023

These are the two XML trees generated for the TeX x_{i+j} in latexml's internal XMath schema: before and after the recdescent grammar parsing stage.

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