237 points · by jayhoon · 3y ago · 123 comments
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).
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.
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.
With MathML you can write your equations e.g. in libreOffice or pick a library like MathJax or TeXZilla.
In fact I wrote a library my self which compiles a AsciiMath derived language to MathML, it was my first time writing a compiler, and it was an absolute joy targeting MathML. The mapping between DOM nodes and XML nodes is a perfect fit for the web as it allows my to implement DOM as a direct target (`mathup(expression).toString()` vs. `mathup(expression).toDOM()` and even `mathup(expression).updateDOM(parentNode)`.
The documentation for MathML on MDN if fine actually, good enough for me to write a compiler. The structure of the language is much easier to compile to than LaTeX by nature of actually having a standard (as opposed to an implementation which functions as a standard).
MathML is a unique fit for what it was intended to do, which is a targeting language which browsers understand.
No. There are situations where a semantic interpretation is beneficial. A simple example is ‘(x + y) / z’. The best rendering (inline or full line) depends on the context.
People can discuss the tradeoffs without exaggerations and calling names. Let’s try.
I understand the parent's sentiment though. Every few years when I need to use Tex for something it always take me a second to remember that it is not a computer algebra system, just a rendering engine hyper focused on rendering 2D math notation that predates web rendering engines by about two decades. For some reason it surprises me that CSS did not grow to eat the publication rendering use case. I get that Tex has solved that problem quite well, but it seems like the sheer number of people who used CSS would mean that those capabilities would be ported to the language. But no, didn't happen. So we still have the two rendering languages.
That sounds completely doable with modern NLP like GPT-4. Maybe we should start doing more design experiments with how one could exploit such semantics? There's no reason to think that syntax-free writing ought to be ideal, any more than space-free and punctuation-free writing was the ideal form of writing which could not be improved...
No. The semantics of math are simpler than English prose.
https://www.igalia.com/2023/01/10/Igalia-Brings-MathML-Back-...
Wrong. MathML is a part of the Epub3 specification. All e-reader implementations that comply with the epub3 specs get you proper typesetting in books published in epub3 format.
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.
Personally this is what I call Web 3.0 - fast, useful, mostly static websites.
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
Edit: It seems that Temml is a fork of KaTeX, so the difference compared to KaTeX's MathML rendering should be minimal?
Turns out the answer is yes:
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).
MathJax for example eats ASCIImath, I don't know if KaTeX can do that.
That said, if you have a concrete proposal for a slicker alternative, I’m sure lots of folks would be curious.
Being able to render latex super fast is very important for us as we use it for live tutoring.
Shameless plug: We currently offer 2 free tutoring for Fractions and Calculus. Perfect to revise or even learn those topics. The cool thing is, Amy will find knowledge gaps from previous years/subjects as well. (No account need to try it out)
Fractions: https://learn.amy.app?inviteCode=f2d7h Calculus: https://learn.amy.app?inviteCode=zkjus
Your comment serves you, not the general audience here. Every action of the kind above degrades the core purpose of HN.*
* It is not even necessary to appeal to the “if everyone did X” argument.