NanoMichael / MicroTeX

A dynamic, cross-platform, and embeddable LaTeX rendering library
MIT License
435 stars 74 forks source link

BoxTree does not consider brackets #134

Closed Godricly closed 2 years ago

Godricly commented 2 years ago

Hi, I'm trying to dump out the char boxes of math formula. But I find that box tree generation does not consider the bracket case. Given a formula (x+y)^3, the exponential term was only attached to ), not the (x+y). How can get this fix this parsing order. Thx.

0 HBox 1 ├── CharBox ( 1 ├── GlueBox 1 ├── CharBox x 1 ├── GlueBox 1 ├── CharBox + 1 ├── GlueBox 1 ├── CharBox y 1 ├── GlueBox 1 └── HBox 2 ├── CharBox ) 2 ├── HBox 3 │ ├── CharBox 3 3 │ └── StrutBox 2 └── StrutBox

Godricly commented 2 years ago

the formula should be written as {(x + y)}^3.