SuzanneSoy / scribble-math

Integration of MathJax, KaTeX and Asymptote with scribble, to typeset math in Racket documentation
http://docs.racket-lang.org/scribble-math/
Other
17 stars 4 forks source link

Pre-process unicode chars in MathJax #7

Open SuzanneSoy opened 7 years ago

SuzanneSoy commented 7 years ago

We should replace a palette of known Unicode chars with their LaTeX equivalent where possible.

See https://github.com/mathjax/MathJax/issues/1801, the width of some characters is not correctly computed in the HTML-CSS mode (which we use for now to have as much compatibility as possible), and the does not look like _i anyway (it's a straight i, and does not use the math font).

SuzanneSoy commented 7 years ago

Partially done with (map katex-convert-unicode (flatten strs)), but this should also handle delayed scribble elements, and support more characters (I need to make my .XCompose database a bit more complete and export the LaTeX translations contained within)