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.
<mover>
<mi>B</mi>
<mo stretchy="false" style="transform:scale(0.75) translate(10%, 30%);">→</mo>
</mover>
But the hat above n is: <mover>
<mi>n</mi>
<mo stretchy="false" style="math-style:normal;math-depth:0;">^</mo>
</mover>
Markdown is great, but I can always take the HTML produced by a Markdown→HTML converter and edit it by hand, since HTML is human-readable and human-editable. MathML is neither.The output of MathML is also uglier than KaTeX’s, with wonky spacing. In Firefox, there’s an ugly space after all \d's (derivative sign). It’s better in Edgium, but there is still an ugly space in \d\vec{l}.
If I need an intermediary tooling/format for math, I’d prefer beautiful LaTeX-esque output, and keep LaTeX code that wold be converted by KaTeX on the fly to whatever ugly HTML is required.
<mover accent="true">
<mi>B</mi>
<mo>→</mo>
</mover>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...
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.
No. The semantics of math are simpler than English prose.
To the substance: If one wants to argue that Semantic MathML ("SMML") will not be adopted, one would need to define a metric. Then we can model and forecast. I don't think the parent poster nor I have the time or interest to do this. I'll leave this heady analysis to the mysterious proprietary commercialized no-one-gets-fired wisdom of the Gartner Magic Quadrant [1].
Now we shift to utility. To argue SMML is not useful, you have to explain the costs and benefits of specific aspects.
* Of course markup has cost, but what are they specifically? It depends on many things, but the key ones seem to be the format/markup itself and tooling to help with it. Hopefully we can steer clear of holy wars here (aka the semantic analogue of the tabs versus spaces forever-war).
* And what are the benefits? I see three intertwined benefits: driving out ambiguity, easier categorization, and improved reasoning. Reasoning over mathematics can help find mistakes, prove theorems, connect previously disparate proofs and even fields, and lots more.
I haven't seen a convincing argument against the value of such benefits, other than arguing against their likelihood. But the latter seems hollow; such benefits can and do happen with human minds reasoning over mathematics. It is clear that computers can assist, at the very least, and perhaps even lead. I'm inclined to think that AI can scale up mathematical reasoning beyond human capabilities, even if the AI is quite far from human intelligence.
One might argue impossibility of one purported benefit of reasoning. Of course, this is downstream of the for what question, above. In sibling threads, I see what seems to be a false equivalence between formalization of mathematics and English. That argument seems to imply that formalization is "too costly" or "too difficult" or possibly even impossible. It offers shallow dismissals of the benefits at best. In summary, it doesn't make a convincing cost versus benefits argument.
[1] https://www.theinformation.com/articles/the-tech-tussle-over...
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.
Semantics means whether the / denotes eg division of real numbers or a group quotient. Semantic MathML basically wants you to provide a URI pointing to the definition of / you are using, eg. http://www.openmath.org/cd/arith1#divide. This is nonsense and about as likely as getting humans to mark up every word in your sentences with a URL for the numbered dictionary definition of the word you are using.
> Semantic MathML basically wants you to provide a URI pointing to the definition of / you are using, eg. http://www.openmath.org/cd/arith1#divide.
A better example, thanks.
> This is nonsense...
Could you clarify (dare I say markup) which sense of 'nonsense' do you mean?
1. spoken or written words that have no meaning or make no sense: he was talking absolute nonsense.
2. foolish or unacceptable behavior: put a stop to that nonsense, will you?
I'm not trying to just be pedantic: driving out ambiguity has value; even more so in mathematics.Whether a particular technical suggestion for reducing ambiguity seems practical to you is quite different from it being understandable from some point of view and/or having internal consistency; i.e. making sense.
Let's move away from squishy, vague notions comparing semantic math markup vs English markup. Let's talk about some objective differences:
* "who": audience: mathematicians appreciate and deal in formality orders of magnitude more than English-speakers in general (perhaps second only to lawyers and grammar teachers?)
* "what": First, dictionary size: 1600 in OpenMath vs ~600K English words.
* "how": For a particular math document, it is likely that each operators used tends to have a common semantic. So it would make sense to state a mapping from certain operators to their semantics up-front and reuse these definitions throughout the document. See the bottom of this comment for some ideas on how this might be done.
* "why" : computability / reasoning: If mathematical is sufficiently formalized, it can be reasoned over very effectively, limited only by the computational algorithms. Reasoning over English sentences is fraught because English is frightfully ambiguous.
Conclusion: the 'who', 'what', and 'why' differ substantially.
P.S. Regarding the "how" discussion, here is a conversation with ChatGPT 4.0:
> In Semantic MathML, what mechanisms (if any) exist so that one math document does not have to restate the semantics of a particular operator repeatedly?
> "In Semantic MathML, use the <csymbol> element and Content Dictionaries (CDs) to avoid restating the semantics of an operator multiple times in a document. The <csymbol> element refers to an operator in a CD, which provides the operator's semantics. This way, you can reuse the operator without redefining its semantics in the document."
> Please double check this.
> Apologies for the confusion earlier. In Semantic MathML, there isn't a built-in mechanism to globally define the semantics of an operator for the entire document. However, you can use XML entities to create a shorthand reference for operators, and their semantics can be defined using the <apply> and <ci> elements, which encapsulate the semantic content. This will help reduce redundancy while still preserving the semantics of the operators throughout the document.
I'll spare you the rest of the chat log; the syntax is not pretty.
> Given any positive integers r and k, there is some number N such that if the integers {1, 2, ..., N} are colored, each with one of r different colors, then there are at least k integers in arithmetic progression whose elements are of the same color.
The majority of the semantics of this statement are part of the prose. Even having perfect "semantic" information about the formulas gets you absolutely nothing. You cannot reason about this without being able to reason about human language in general like a human can, in which case you do not need the "machine-readable semantics" of MathML at all.
The division of math into "ambiguous" English and "formal" formulae/symbolism is semantically artificial. Both of these are human languages. There is not some fully marked up form which is mechanically unambiguous that you can produce if you try hard enough. Presentationally the distinction is that special typesetting facilities are needed for the appearance of mathematical formulae and this is why presentational MathML is useful, but the semantics flow from the same source that the semantics of all written language flow from. It is not fundamentally different than, say, an Egyptologist who requires special facilities to typeset hieroglyphics.
I'll grant the obvious: both are human languages. But what does this assumption prove? It certainly does not prove that math is not formal.
> The majority of the semantics of this statement are part of the prose.
The semantics can be expressed as prose if you like. They can also be expressed formally. As you know, 'color' is used here for the convenience of the reader. The underlying semantics works independently of the English notion of 'color'. You know this. What do you think is not formalizable about your example? "Given / assume": no problem. Introducing variables: no problem. Specifying variable types: no problem. Various mathematical structures (sets, sequences): no problem. "there are / there exits": no problem. "at least": no problem. And so on.
> Even having perfect "semantic" information about the formulas gets you absolutely nothing.
You have shared some good counterarguments, and I appreciate it, but "nothing" is an exaggeration here. It doesn't advance your argument.
> You cannot reason about this without being able to reason about human language in general like a human can
This is incorrect. You sound knowledgeable about mathematics, so I'm quite surprised you would make such a claim. Are your emotions (perhaps a loathing of Semantic MathML? -- your comments suggest this story) clouding your logic here? Deductive reasoning is well studied in computer science. To state a previous point again: there are many formal systems that can be reasoned over to various degrees. Such systems are still useful and quite different than English.
Earlier, you said it was both nonsense and unlikely to ever work. Now you say it is not useful. You are moving the goal posts. Your comments have had a mix of thoughtful examples (thanks) with some exaggeration and rant. I'm trying to tease these apart, but it isn't easy. I can see you have a strong negative reaction to Semantic MathML, but so far, your writing hasn't been persuasive.
https://www.igalia.com/2023/01/10/Igalia-Brings-MathML-Back-...
You're comparing real world working implementations based on mathml with your hopeful expectations of how you wish katex could work in an epub implementation.
It's good to have hopes and dreams and a positive outlook, but your perceived solution does not exist. It's hardly relevant to present it as a better alternative.
No hopes and dreams needed, just use PDF. But making epub work properly for math is not a problem in principle, just make katex work in an epub reader, problem solved.
And people who are satisfied with substandard solutions are actually part of the problem, not the solution.
"Just write a full JavaScript and DOM implementation for your resource-constrained e-ink device"
Not that anyone actually follows the standard…
For the vast majority of fiction a format constrained to bold, italicize, paragraph break, chapter heading, and chapter break allows a far superior user experience.
[1] https://magnoliamedianetwork.com/ebook-publishing-platforms/
Kindle books generally start their life as ePubs that Amazon then converts to their formats before they list them. They don't even let you publish in mobi anymore.
Kindle's lack of MathML support actually makes the user experience worse for everyone. Publishers often make 1 ePub they submit to multiple stores so rather than make a MathML version and a shitty image version for Kindle they just make a shitty image version and now you have a math textbook that's larger than the PDF would have been AND the equation text isn't resizable defeating the whole point of a reflowable ebook.
Morally speaking they start as Kindle ePubs that support a very very limited subset of the ePub standard.
Except there is no team, and people dream differently.
More often than not, open source creates problems for developers. See Rust's Actix framework.
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.
To start off, you already have posts in this very discussion rejecting your misconception.
Secondly, mathml works fine when we have an epub3 reader opening a epub3 doc created by epub3 generators from epub3+mathml input. If any of those requirements aren't met, you get issues. This happens with each and every single typesetting feature, not just mathml. Would you claim that epub fails to support tables if you open an epub doc with broken tables?
Thirdly, a typical implementation shortcut taken by epub readers is to reuse whatever WebView they pick. If your epub reader uses an outdated or shitty WebView implementation, you get shitty epub docs.
https://caniuse.com/?search=mathml
Why are you commenting on subjects you are clearly clueless about?