fred-wang / TeXZilla

LALR Javascript LaTeX-to-MathML converter compatible with Unicode
http://fred-wang.github.io/TeXZilla/
130 stars 21 forks source link

Do not introduce extra mstyle elements to set presentation attributes on token elements #61

Closed fred-wang closed 5 years ago

fred-wang commented 5 years ago

Follow-up of #10

For example the mathvariant or color attributes can just be set on token elements.

test: \mathfrak{a}

fred-wang commented 5 years ago

test: \mathfrak{a}

The basic case (single token) is now fixed. mstyle is still used for more complex markup e.g. \mathfrak{sl}, \mathfrak{x+y} or \mathfrak{\frac{x}{y}}. I guess a solution would require to do a top-to-bottom pass, but that might decrease the performance and might not be very useful in practice.

fred-wang commented 5 years ago

Cases like \mathfrak{sl} or \mathfrak{x+y} with multiple token element children no longer uses an mstyle.

More complex case like \mathfrak{\frac{x}{y}} are not. I'm not really sure they are worth an additional top-to-bottom pass. Leaving this issue opened in case that is desired. Maybe we can do like LaTeXML and introduce an option to force the mathvariant transforms everywhere.

fred-wang commented 5 years ago

Actually closing this and moving the remaining case to #62