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 use the mathvariant attribute #62

Open fred-wang opened 5 years ago

fred-wang commented 5 years ago

It can be replaced with direct use of the transformed character. #10 (and maybe #61) might help here.

fred-wang commented 5 years ago

In practice (e.g. \mathfrak{sl}(n, \mathbb{F}) = \left\{ A \in \mathscr{M}_n(\mathbb{F}) : \operatorname{Tr}(A) = 0 \right\}), the mathvariant attribute is generally no longer used.

However it is still possible to use complex nested expressions like \mathfrak{\frac{x}{y}} and in that case an mstyle with a mathvariant attribute is introduced. Applying the mathvariant transform to the token descendants would require to do an additional top-to-bottom pass which might decrease the performance for a not very important use case. Maybe we can do like LaTeXML and introduce an option to force that top-to-bottom pass if that's really what users want.