I'm curious - is there any mathjax/mathml/latex/whatever equivalent to Markdown?
Because every math extension seems to fail the one great feature of markdown: that when I view Markdown as plain text, it's still really legible and the amount of noise added by the markup is minimal, especially if you use the "underline with hyphens" syntax for headings.
Like, every time I see backslashes they're just distracting if I'm trying to read it raw.
Like is there any math format where the Quadratic Formula is just
-b ± √(b² - 4ac)
x = ----------------
2a
Obviously I'd expect something like this to be the output after running the text file through a formatter, just like how in Markdown it's common to reformat things as you go because they're hard to type manually.
Like with Markdown Tables.
Tables are extremely difficult to type in MD, and should never be done manually, right?
I wonder if that would limit you to the very simplest of math.
LaTeX notation lets you type math without the ambiguity of parsing text. And you can render a lot of it in Unicode
(See Unicodeit.net).
I would not want to type math in markdown notation due to loss of fidelity. Also LaTeX is like SQL: it’s there, everybody knows it, and it works. Any effort to displace it will end up reinventing it badly imho.
I think you could say literally all the exact same things about Markdown and HTML.
> I wonder if that would limit you to the very simplest of ~~math~~markup.
> ~~LaTeX~~HTML notation lets you type ~~math~~markup without the ambiguity of parsing text.
> I would not want to type ~~math~~markup in markdown notation due to loss of fidelity. Also ~~LaTeX~~HTML is like SQL: it’s there, everybody knows it, and it works. Any effort to displace it will end up reinventing it badly imho.
I mean the lack of Unicode support for superscripts would basically make this futile, but then you could say the same about the extreme limitations of Markdown tables.
edit: I forgot that HN doesn't support markdown strikethroughs. You get the idea.
Shameless plug. I wrote a library called MathUp with the purpose of having an quick to write and easy to read syntax and compiles to MathML. It is whitespace aware (unlike asciimath) so you can group sub-expressions together in a really readable way.
x = -b +- sqrt(-b-4ac) / 2a
would actually put the -b ± part in front of the fraction:
x = -b+-sqrt(-b-4ac) / 2a
works as intended, as does:
x = (-b +- sqrt(-b-4ac)) / 2a
I haven’t touched it for a minute and it is does not fully support MathML 4, meaning there are expressions which cannot be read properly by chrome. I was always going to revist this at some point but time is hard to find.
I'm a Typst fan, although I don't use it much, and I don't really use it for math.
If you're not much of a Unicode person, you can write this:
$ x = (-b plus.minus sqrt(b^2 - 4 a c))/(2a) $
If you're more of a Unicode person, you can write this, and it means the same thing AFAICT:
$ x = (-b ± √(b^2 - 4 a c))/(2a) $
You can also put newlines in this, and it works just fine:
$ x =
(-b ± √(b² - 4 a c))
/
(2a)
$
Both ± and √ have been on Mac keyboards, if you hold down the Option key, since probably 1984. Using ² instead of ^2 doesn't give me the same output, though.
A Typst Unicoderator could make this transformation for you, but I don't think one's been written yet. An automatic linebreaker à la Prettier sounds like an even more difficult challenge.
There are latex to unicode convertors [1], that understandably only convert a very limited subset of latex to unicode. They are not very clever at the moment, and I imagine could be improved to actually process \frac in your way.
Yes, and if you're able to use HTML tables then you should. HackerNews implements a particularly spartan flavour of MarkDown, so the 'ASCII art' approach is the only one available here.
This is similar to how pre-wrapped text often looks terrible on mobile. This is an issue with plaintext email, for instance. [0]
It doesn't fulfill the pretty-formatting part, but I created Heine with the purpose of being more writable and readable than LaTeX: https://xigoi.srht.site/heine/
But they should have been Unicode MINUS SIGNs '−'!
Anyway, if you like the idea of using way too much Unicode, I've been working on an esoteric document format proposal, 'Utext', for using exclusively Unicode in text files for complicated typography. Seems like Unicode is so enormous these days that you can do quite a lot: https://gwern.net/utext
Because every math extension seems to fail the one great feature of markdown: that when I view Markdown as plain text, it's still really legible and the amount of noise added by the markup is minimal, especially if you use the "underline with hyphens" syntax for headings.
Like, every time I see backslashes they're just distracting if I'm trying to read it raw.
Like is there any math format where the Quadratic Formula is just
Obviously I'd expect something like this to be the output after running the text file through a formatter, just like how in Markdown it's common to reformat things as you go because they're hard to type manually.Like with Markdown Tables.
Tables are extremely difficult to type in MD, and should never be done manually, right?
Basically, here's how you do tables in markdown:
First, you do them the wrong way, half-assed.
which looks like crap, right?then you run them through a formatter and you get
which looks nice, right?And then it becomes a real table when you convert your Markdown into Html/Pdf/Docx/whatever.
That's what I was wondering if there's anything similar for math.
Like, the way I'd type the Quadratic Formula would be
but when I run it through the code formatter, I'd expect to get cleaned up the same way my table did.