Closed karlwessel closed 2 years ago
Thanks for reporting that.
tex_layout
works recursively. The general idea is
sqrt
or frac
)sqrt
or the denominator and numerator of a frac
) individually calling tex_layout
on their TeXExpr
(which all come from the parser).inkwidth
and inkheight
) available, we can use them to place the subelements themselves relative to each other and add any additonal one that are needed (e.g. the horizontal bar for sqrt
-- knowing the width and height of the content we can compute its position and length)Group
which has 3 parts
Group
, TeXChar
or HLine
)This may be a bit different from other systems, since each of the element is immutable and doesn't know its own position or scale, only its parent does.
This results in a deeply nested structure that is flatten at a latter point.
If you want to have another go at it and have any question, don't hesitate to ask.
Thanks for the explanation. I created a pull request with my first take on the implementation. Layout probably needs some fine tuning.
It would probably also be good to add your explanation to the source code, or maybe a file src/layout/readme.md
, similiar to parser.md.
Fixed by #80
It seems like the
\overline
command is not supported yet.I guess it would be rather simple adding it, since it basically does the same as the
\sqrt
command but without the actual root in front.I had a quick go on it myself but couldn't exactly understand everything that happens in the
tex_layout
method. Especially what it is supposed to return.