The speed of KaTeX is great, but the lack of support for diagrams (a la tikz-cd) is what makes KaTeX unsuitable for general adoption by mathematicians (e.g., mathoverflow.net and all online mathematical wikis I know use MathJax). KaTeX has some rudimentary support for diagrams though the {CD} environment, but something more fully fledged akin to tizk-cd or xymatrix is needed. There's been some discussion on their github (https://github.com/KaTeX/KaTeX/issues/219), but I wouldn't hold my breath.
Would you consider adding a web font with the proper OpenType features to render the MathML content? The Igalia work in Chrome is quite decent when the font is good, but for now it needs to be set via CSS (presumably Chrome does not feel like bundling a math font just yet).
This is amazing. Probably the final nail in the coffin of MathML; what’s the point of a non-human readable intermediary language that other higher-level languages get compiled to, that only works in certain browsers (and with browser-dependent rendering/implementation), when you can instead write directly in LaTeX and have KaTeX work identically everywhere?
MathML support in Chrome has been greatly enhanced just in January [1].
I don't have strong opinions, but I guess the advantage over TeX is, as always, that MathML is much better integrated with the web stack and markup such that you can target math formulas using CSS, that it has much better accessibility, internationalization, and search, that you can use JS/DOM access with MathML for educational and science presentation apps, etc.
It's not like TeX is uncontroversially better (eg Turing completeness, terse, lacking editor support, print-oriented, purely presentational, ...)
Edit: arguably MathML is excessive as well but at least its XMLism such as insistence on enclosing every operand in tags as the primary source of bloat and incomprehensibility in presentational math can be somewhat mitigated using SGML, as was already suggested with MathML's precursor in 1995 or so [2] for high school math and/or custom math fragments.
I don't understand MathML's intent; likely because I have a different design mentality or model.
I like to represent things like this in 3 forms:
#1: Rendered notation for reading; what all these tools produce for people reading the document
#2: A clean, well-documented API for writing. This is the Latex, Mathjax, katex syntax etc, replete with backslashes.
#3: A representation in a computing language used to create the rendered form from the API. Depends on the language, but ie something like a set of structs and enums that can be manipulated by a compiler.
MathML is none of these; it's neither readable, nor writable, nor manipulable natively by a programming language.
MathML is not just for presentation. It encodes a lot of semantic information that Latex leaves out, and that information can be useful for accessibility, computer algebra system interoperability, etc. That said, I don't think it's used much for those things. I had really high hopes for MathML when it was first announced, but the poor browser support and consequential lack of use has been really disappointing.
I am not that familiar with MathML, but I can imagine programmatically manipulate math expressions with MathML; can TeX math expressions be manipulated in the same way?
It is fast, I was previously using mathjax, and for a significant document I had to wait for a few seconds until the formulas were parsed and rendered. For the same document with katex, everything happens in less than a second.
I love the websites like katex.org - so useful while being static. If you take a look under the cover, you'll find that the website is built using Docusaurus - yet another cool project. So so useful. I want to live in the Web like that, without SEO noise, ads, cookie popups and all that nonsense.
Personally this is what I call Web 3.0 - fast, useful, mostly static websites.
I really like Katex. I used to use MathJax for my blog, but the page reflow was annoying. Now I use Katex with server-side rendering, and even pages with a lot of math load quickly and without reflow.
This is a bold claim. In theory any library that defers rendering to MathML should be faster (including my own MathUp https://runarberg.github.io/mathup/). Has anyone run benchmarks to test this claim?
Nice! I hadn't heard of this. I have a plainly coded blog that uses math notation. MathJax was previously the speed limfac. I replaced the mathjax script with the ones recommended on the Katex installation page; drop-in replacement.
This is also a great aid to learing LaTex. I wonder if anyone has ever tried to make an OCR system that generates the appropriate LaTex from an picture of an equation?
KeenWrite can produce web pages from Markdown with the TeX commands included as either as plain TeX macros (usable by JavaScript TeX renderers) or as pre-rendered SVG elements (no JavaScript required).
I am working on a project that needs to put latex in a browser. We are currently trying out different libraries, but so far Katex does seem the fastest.
[+] [-] giraj|2 years ago|reply
[+] [-] xeonmc|2 years ago|reply
[+] [-] lilgreenland|2 years ago|reply
[+] [-] mk12|2 years ago|reply
[+] [-] xworld21|2 years ago|reply
Would you consider adding a web font with the proper OpenType features to render the MathML content? The Igalia work in Chrome is quite decent when the font is good, but for now it needs to be set via CSS (presumably Chrome does not feel like bundling a math font just yet).
Some nice demos are at https://fred-wang.github.io/MathFonts/mozilla_mathml_test/ (with Latin Modern, the TeX Gyre's, FiraMath – other fonts are still glitchy).
[+] [-] runarberg|2 years ago|reply
[+] [-] Paul-Craft|2 years ago|reply
[+] [-] MontyCarloHall|2 years ago|reply
[+] [-] tannhaeuser|2 years ago|reply
I don't have strong opinions, but I guess the advantage over TeX is, as always, that MathML is much better integrated with the web stack and markup such that you can target math formulas using CSS, that it has much better accessibility, internationalization, and search, that you can use JS/DOM access with MathML for educational and science presentation apps, etc.
It's not like TeX is uncontroversially better (eg Turing completeness, terse, lacking editor support, print-oriented, purely presentational, ...)
[1]: https://mathml.igalia.com/news/2023/01/10/mathml-in-chromium...
Edit: arguably MathML is excessive as well but at least its XMLism such as insistence on enclosing every operand in tags as the primary source of bloat and incomprehensibility in presentational math can be somewhat mitigated using SGML, as was already suggested with MathML's precursor in 1995 or so [2] for high school math and/or custom math fragments.
[2]: https://www.w3.org/MarkUp/html3/maths.html
[+] [-] the__alchemist|2 years ago|reply
I like to represent things like this in 3 forms:
#1: Rendered notation for reading; what all these tools produce for people reading the document
#2: A clean, well-documented API for writing. This is the Latex, Mathjax, katex syntax etc, replete with backslashes.
#3: A representation in a computing language used to create the rendered form from the API. Depends on the language, but ie something like a set of structs and enums that can be manipulated by a compiler.
MathML is none of these; it's neither readable, nor writable, nor manipulable natively by a programming language.
[+] [-] mkl|2 years ago|reply
[+] [-] Georgelemental|2 years ago|reply
[+] [-] camdenreslink|2 years ago|reply
[+] [-] simplotek|2 years ago|reply
[+] [-] RyEgswuCsn|2 years ago|reply
[+] [-] mkl|2 years ago|reply
https://news.ycombinator.com/item?id=8320439 9 years ago, 98 comments.
https://news.ycombinator.com/item?id=19475273 4 years ago, 40 comments.
https://news.ycombinator.com/item?id=24742518 3 years ago, 87 comments.
[+] [-] nomemory|2 years ago|reply
[+] [-] garganzol|2 years ago|reply
Personally this is what I call Web 3.0 - fast, useful, mostly static websites.
[+] [-] gwgundersen|2 years ago|reply
[+] [-] ihodes|2 years ago|reply
[+] [-] kerkeslager|2 years ago|reply
I can probably figure it out but if anyone already knows how it would save me some time.
EDIT: Figured it out: https://unpkg.com/katex
[+] [-] Timon3|2 years ago|reply
[+] [-] runarberg|2 years ago|reply
[+] [-] universemaster|2 years ago|reply
[+] [-] xigoi|2 years ago|reply
Edit: It seems that Temml is a fork of KaTeX, so the difference compared to KaTeX's MathML rendering should be minimal?
[+] [-] the__alchemist|2 years ago|reply
[+] [-] keithalewis|2 years ago|reply
[+] [-] photochemsyn|2 years ago|reply
Turns out the answer is yes:
https://github.com/lukas-blecher/LaTeX-OCR
[+] [-] thangalin|2 years ago|reply
https://github.com/DaveJarvis/keentype
The following tutorial shows the real-time rendering speed of KeenType within my text editor, KeenWrite:
https://youtu.be/vgyYXwwF_lc?list=PLB-WIt1cZYLm1MMx2FBG9KWzP...
KeenWrite can produce web pages from Markdown with the TeX commands included as either as plain TeX macros (usable by JavaScript TeX renderers) or as pre-rendered SVG elements (no JavaScript required).
[+] [-] garbagecoder|2 years ago|reply
[+] [-] 3rd3|2 years ago|reply
[+] [-] mkl|2 years ago|reply
[+] [-] larodi|2 years ago|reply
[+] [-] rosebay|2 years ago|reply
[+] [-] vrglvrglvrgl|2 years ago|reply
[deleted]
[+] [-] smohare|2 years ago|reply
[deleted]