4 ms·
I am a MathJax/KaTeX user, not developer, so some of what I say could be incorrect. I was under the impression that KaTeX does _no_ horizontal measurement to sp
by joppy 7y ago
I am a MathJax/KaTeX user, not developer, so some of what I say could be incorrect. I was under the impression that KaTeX does _no_ horizontal measurement to speak of, deferring it instead into CSS and styling calculations carried out by the browser. This is why at the moment KaTeX cannot write to a canvas / SVG representation, only to HTML. On the other hand, I think MathJax takes the more fundamental approach of knowing how to absolutely position every single glyph (although for HTML output, some of these absolute positions are perhaps replaced by more KaTeX-style rules).
This means that at the moment it would be fairly annoying to create a library which renders a commutative diagram such as [1] in KaTeX, as one would have to render each part of the diagram in the browser to calculate sizes, and only then compute positions for arrows - in particular this could only be done ahead-of-time by firing up some headless browser, taking measurements, and then hoping for the best (the client isn't using different font sizes, for example). MathJax seems more suitable for that application due to knowing the sizes of things.
[1]: https://en.wikipedia.org/wiki/Monoid_(category_theory)#/media/File:Monoid_multiplication.svg https://en.wikipedia.org/wiki/Monoid_(category_theory)#/medi...
- svat 7y agoAh that's interesting, thank you. Looks like an interesting design choice, and would explain how it manages to be so fast.