MathML is a failed web standard (2016)
peterkrautzberger.org
peterkrautzberger.org
- As a syntax/language for mathematics, it's the actual standard. Do you think Terry Tao will bother learning some other language for his blog? You might as well argue that English is poorly-specified and the web should switch to Lojban.
- As a layout engine, it encodes all the damn typographical conventions that are in every single research article, academic journal and textbook. In the world.
Trying to replace TeX is so quixotic it makes Urbit sound pragmatic and down-to-earth. It's this whole scorched earth tradition. There just isn't any mathematics out there that uses anything but TeX.
So, yes, in a vacuum I think that math notation in LaTeX works really, really well. However, for a larger document, there's a lot of other features that would be nice to have and they're difficult to implement in TeX.
I suspect I don't recall having those issues because I avoided them in the first place. LaTeX requires thinking about the whole document before you start it. It isn't easy to work with if you don't approach it that way. Before pressing any keys, think about the document in its entirety.
In my case, I took shorthand notes on paper, did the outline, and then began working on it. It requires a holistic view, and should be envisioned before even pressing a single key. It sounds more like you're fighting it, instead of thinking within it.
These were some of the first things taught to us in the intro to LaTeX class. I realize this is a horribly generic response, but I'd suggest you take an intro to LaTeX class to go back to learning the basics.
LaTeX is pretty versatile and I can't see any reason to replace it. It just means you'll have to learn something new, so you might just as well master the tools you already have.
Again, I realize this is a very generic reply. You're not self-taught with LaTeX, are you? If you are, then I really would like to stress the value of a good professional class. You can do an intro class in just a single semester and there's almost certainly something adequate locally.
There are probably some acceptable online courses but you may have to unlearn some stuff and I suspect a classroom will be easier for that. I strongly suspect I don't recall having those problems because I never encountere them. Of all the classes I took, the intro to LaTeX was one of the more valuable.
Heck, it has been so long that I should probably take it again. It is one of those use it or lose it things and I haven't used it for well over a decade.
In fact, I ended up writing my thesis in plain TeX, and was able to write some nifty macros to solve exactly the kinds of "code reuse" problems you mention.
Anyway, the whole exercise turned TeX from "arcane and painful" to "quirky but powerful" for me. I kind of enjoy hacking around on TeX now.
Plain TeX library support is also surprisingly good. I used amstex for the document style and eplain for some commutative diagram and indexing stuff.
I did kind of a roll-your-own publishing system (focusing on ePub) in an experimental fashion and it worked okay but I didn't spend too much time on it as I had other concerns. I did a writeup on that here (http://theheratik.net/books/tech-epub/), not that it matters much.
In any case, yes, I think that pandoc may work well. Right now, the two approaches that I'd like to experiment with more are the pandoc/markdown/latex toolchain as well as LuaTex.
Thanks to ubiquitous MathJax and so on much of the TeX-like out there is already some subset that hasn't got the standard programming features of TeX. There's already some core behavioural standard that is arguably better (at what it does) than HTML/CSS as an universal document language.
And: we're starting to talk about massively transpiling to JavaScript rather than adopting a better language for remote applications. JavaScript isn't even that ensconced -- it's much easier to get programmers to change.
Maybe the entire LaTeX document model, based on the idea that the ordinary user doesn't get to do layout, needs to be scrapped. Maybe people want MS Word where you paste your figures where it well damn pleases you.
But even Word has taken to letting you type equations in TeX-like.
i think semantic macros really help with that, but they are not a silver bullet. i'd really like to see editor plugins that convert LaTeX commands to actual symbols (for example, as soon as you write the space after the q in "\neq ", it gets converted to a "=/=", and when you type backspace to erase the "=/=" you get "\ne"). that has been already implemented for languages like agda, and in a simple form is present in text editors that support fonts with ligatures.
i know that what i'm proposing more on the "wysiwyg" side (which some LaTeX fundamentalists might dislike), but i think it would be a very nice thing to have when editing complicated formulas or diagrams.
You also want to be able to define subexpressions and reuse them as needed. Is that correct? And you don't want to define those ahead of time? This sounds like the math equivalent of a lazy programmer that wants to use goto and highly unstructured coding practices. You want to write arbitrary expressions and then pull parts of them into other areas of the document without defining them individually. At least that's what I got from your comment.
How about a nice math-document editor with a mode where expressions can be seen as an assembly of previously defined items. Then you could right-click on one and select "go to definition" from a popup menu. That's how the software people do things these days. But if you want to use non-math aware text editors for writing math papers I fear you're never going to get what you want.
TL;DR my impression is that poster wants a very sophisticated math-aware document creating program that has a sort of development mode and display mode. I like it, but am not aware of such. I could also have totally misinterpreted the comment.
1. LaTeX document
2. Ability to define macros locally and more easily. For me, a macro is most of the time just easy textual substitution. However, there are times when I want to generate a piece of text repeatedly with some mild variations.
And, look, LaTeX does most of these things, but there's a huge amount of redundancy when writing up a math document. We sort of get away with things by labeling equations with numbers and referring back to them, but this is largely a remnant from the physical typesetting days when repeatedly typesetting the same expression was laborious and error prone. When we build up a completed theorem from a discussion, I don't want to refer back to old expressions, I want to repeat everything I have there. It creates a contained presentation for the reader. It's easier for everyone, including me, to refer back to later. I should not have to retype everything to do this. TeX is basically a programming language. I should be able to locally define functions and call them when I need them. My complaint with TeX is that it doesn't make this usage all that easy to accomplish and it's, frankly, not all that much to ask for.
--- Edit 1 ---
One concrete example that I'm typing up now: I'm currently typing up some circuit equations from some project. We have a three-phase inverter, so we used a dq0 transformation to simplify things. The equations been the d and q axis are basically the same except for some differences in the subscripts (some are d, some are q, sometimes we reverse things.) In a reasonable programming language, I could just write a function to swap back and forth and code the equations once. When I implement things, that's what I do. When I type them in LaTeX, I type them twice. I shouldn't have to.
The challenge is then picking the subset of LaTeX. Then maybe someday someone would write a web-LaTeX preprocessor with macros and the like.
I guess one more wouldn’t hurt.
I do not encounter TeX users who write their own macros often.
But they use packages that they got off CTAN that were written by someone who is not at central office (not that there is a central office, but one would be needed if you stripped out the ability to write serious macros since there would have to be someone adding approved features).
If you mean something else, please elaborate :)
1. Accessibility, especially regarding screen readers. There are so many different ways to parse TeX and generate the "same" equation, that there would be no way for a screen reader to produce something understandable for those users that need one. Presentation MathML is just as bad, but the best way to solve this is to move closer to existing web content, not to rely on pre-HTML tech.
2. Text Styling that browsers rely on is incompatible with TeX. I'm not really big on CSS, but it's a standard that works, which can't be said for MathML or TeX. The solution we currently have is to basically implement a js or server side TeX parser that outputs span + css/svg to position the text into a readable equation. It would be much better to have a solution that is compatible with browsers natively. Especially one that would allow web developers to use a different font than Computer Modern.
3. Searchability. Because of the flexibility of TeX/LaTeX, you can have many different ways to render the same mathematical equation. This is okay if your goal is print/PDF, but it doesn't work as well for search on the web. Especially if that search engine is expecting something human native, rather than a string of curly bracers and backslashes.
Note that all of these were designed for stand-alone static documents.
Just develop a standard based on MathJax, godamit.
For example, when I've got a final answer I have a macro that I've named "fa", which will insert double underline. This is an attempt on my part to give semantic meaning to the final answer. However, since that macro is mine and not standard it doesn't help much in the grander scheme of things.
LaTeX should have had an absolute separation of style and content.
I read this complaint on the old thread and I think we had 3.. 4 of those "semantic web" standards by now? But here we are, everything is a bunch of divs and extracting meaning from web sites is a task for deep learning neural networks.
One issue that I had with LaTeX formulas was exactly the thing that parent poster was pointing out: You really had to describe the layout of the formula; not just its expression ("... and have at it, layout engine"). It is/was really just a kludge around the box model of TeX in the worst possible way.
Yes, you could produce the most beautiful formulas of them all, but that's just because you spent a huge amount of time learning (La)TeX and tweaking the exact expression of each individual formula[1]. Don't get me wrong, it's was still miles better than the competition at the time if you cared about the quality of the output -- not to mention the severe resource constrains -- but surely we can do better these days? Surely?!?
Btw, I don't think parent poster was talking "semantic web" at all, as I read it at least.
[1] Same deal with pseudocode. Oh god, the amount of time I spent tweaking pseodocode in my university years.
Correct.
Oh and if you don't include at least some LaTeX then anyone used to LaTeX (which is pretty much everyone using TeX) will be annoyed.
Consider that, as of Feb 14 2017, the "MathML support" issue was the #8 top starred issue for Blink, Google finally seem to be paying a little bit of attention to this.
https://bugs.chromium.org/p/chromium/issues/detail?id=6606
We (layout team and igalia) have a tentative plan to build a MathML implementation on top of LayoutNG and Custom Layout. I've marked this as blocked on CSS Custom Layout and LayoutNG.
I would argue that this holds true for (La)TeX, most sites use JS implementations of it and show the raw (La)TeX code as a fallback (or in an image form) if the user has JS disabled.
I might be unaware of something, though.
MathML isn't perfect, but I much prefer it to anything else on the web at the moment. I'd almost rather see an updated MathML spec than something new, especially one js-based.
KaTeX can work as a preprocessor (but has less coverage of special environments and macros), and looks very promising to me. (And as long as you keep the original text in an attribute or hidden element, you can always migrate to something else later.)
The fidelity of MathML that I've seen has been terrible. The only people I've seen make it work is Apple, and there it's only working for their proprietary iBooks files. They render parts of the equation in SVG on top of the MathML, and they've got a special XML file that's tweaking a bunch of MathML layout parameters. I've tried copy/pasting the MathML into an epub, and it looks completely different, even when viewed in the iBooks app.
No I am no JavaScript fan, and would be very glad if mathse were supported natively in web rendering toolkits. But at least mathjax does gives some sort of workable solution: wehere "workable" means "users can read it" and "authors can write it".
MathML, being unsupported by Chrome fails first thing, and MathML fails the second thing by design, because it was never really meant to be human editable.
Besides, once MathJax is cached, it loads pretty fast.
For the most part, it's good enough for the professional mathematicians on mathoverflow.net, where the math can get quite hairy. (I was active there many years ago, and even then the render speed was better than acceptable)
To think about how Unicode combining characters could work, just look at what Mathematica can do with just a few shotkeys: like ctrl-2, ctrl-- (ctrl-5), ctrl-6, ctrl-7 etc.
The matching Unicode combination characters would respectively be: place under a square root, put a something to the right below (and above), put an exponent, put something over.
With these 6 combining characters, you could already solve a large part of the problem and write 90% of the equations: for ex, if you want to type the sum of i=1 to 10 of the square root of alpha to the k bar power:
Type: 𝚺 (ctrl--) i=1 (ctrl-5) 10 (ctrl-2) α (ctrl-6) k (ctrl-7) _
With a proper keymap or shortcuts support, you could write (and render) equations just as fast as you write them by hand. I know, because I take all my notes with Mathematica and the only "magic" I use beside Mathematica combining shortkeys is a third level Unicode mapping for greek letters and some mathematical symbol like infinity, so that AltGr a gives me alpha, AltGr 0 gives me infinity etc.
Also, unlike what you read above, where only sigma and alpha stand out, it would show up in your browser, and you could copy-paste that in any email or text forum -- like HN or reddit!! No need for MathML support, that would be implemented straight in the Unicode rendering engine with the next batch of Unicode changes.
I have been trying to get some people involved, to try to submit a Unicode Math proposal. Nobody seems interested. Maybe with MathML dead, proper Unicode math combining characters will have a better chance.
(NB: in the above, I do not use a combining over bar for k, even if that is possible at the moment with what I think is called a macron. The idea is more general - what if you want to write a letter instead of just a bar over k? we have a few exponents like numbers and latin letters, but what if you want to write greek letters to the top right corner?)
Your matrix example below is a good example of the can of worms that opens: there’s an explosion of internal state in the layout engine and a lot of things that Unicode has at least some success in defining (like “are these strings the same except for case” or “when is a set of codepoints a single character”) would become even harder and the set of badly handled corner cases would explode. It’s also unlikely you’d want to have it map that closely to Mathematica’s key bindings since those are designed to let you do things out of order and/or change things.
In the end you’ll just be shifting who ends up refusing to implement your standard from the browser engine to a lower level.
How would you implement, amongst others: vectors and matrices, matched auto-sizing delimiters (\left and \right) \operatorname, \limits, \displaystyle, \textstyle? In my line of work, every other line of maths I write requires at least one of these LaTeX features.
Also: \underset / \overset, \underbracket / \overbracket
For matrices, here is how you can do it Mathematica style : a (ctrl-enter) b will put b vertically under a, "matrix style". Do it a few times if you need a few rows. (ctrl-), creates additional columns. You need a grammar, with say separators of records, but it wouldn't be hard to defie, and there are already characters for that.
FYI, if you want a above b, but for the fraction a/b, use (ctrl-/) : it will likewise put one above the other, but separated by a bar
This isn't rocket science. It already works in Mathematica. It just requires defining combining characters and a grammar -- or instead of reinventing the wheel, we could reuse something like Mathematica's grammar, which is already quite efficient at that.
Of course, for more complex math, more combining characters will be needed. I just wanted to show here how it would be possible to support most of the casual math notation with a dozen Unicode combining characters.
Math is a language, and right now probably the worst supported language in unicode (of those that have been added at all.) Philosophically, this really seems like the right place to put it.
There's actually some work on that.
W_δ₁ρ₁σ₂^3β = U_δ₁ρ₁^3β+1/8π^2 ∫_α₁^α₂dα'₂ [(U_δ₁ρ₁^2β-α'₂U_ρ₁σ₂^1β)/U_ρ₁σ₂^0β]
Now imagine that same example with the few combining characters I proposed: W_δ₁ρ₁σ₂^3β becomes W (ctrl--) δ₁ρ₁σ₂ (ctrl-5) 3β and it would render much more nicely.
I believe that such a standard would be extremely non-extensible.