19 comments

[ 1.7 ms ] story [ 54.4 ms ] thread
This is cool. I could see myself using this for notes.
What exactly is the distinction between this and mathjax? At first glance it looks like this is a wrapper on top of mathjax, or is it something different?

I guess it’s just more “natural” and less latex like.

$$\sum_{i=0}^n i^2 = \frac{(n)}{2}$$

Vs

sum_(i=o)^n i^2=((n)/2)

It's too bad MathML never supported ASCII math. The web might be a different place if it did.
I use Typst a lot now (which this reminds me of), and the equation support is generally very good, but the thing that gives me pause is that I'm afraid that there's going to be something missing, or worse than the LaTeX equivalent.

LaTeX has been the industry standard for the mathematical world for decades and as a result it has had the most work adding new notation or making nicer formatting.

For example, I needed to do a proof tree recently. Typically I would use bussproofs in LaTeX but I was using Typst, and while there is a package for handling proof trees in Typst [1], I think they're not very pretty, and as a result I ended up porting the document over to Pandoc markdown and doing the rest of my work there (which is annoying because Typst renders around ~1000x faster and has better tooling).

[1] https://github.com/SkiFire13/typst-prooftree

I'm a big fan of AsciiMath and have been supporting it in my note taking program (MicroPad) since ~2016.

It was the key for me being able to write maths in a classroom/lecture theatre at the same speed (or faster) than those doing it by hand.

Great! Another LaTeX competitor, doubtless "better" for an obscure reason known only to its author. Especially appealing is the fact that, when embedded in a Web page, it must be translated into LaTeX syntax before rendering by MathJax.

The "AsciiMath" name reveals volumes, because prior to rendering, LaTeX code is already ASCII characters meant to represent math symbols. We just didn't call it that.

Oh well, a tempest in a teapot, soon to be forgotten. We can already tell a chatbot, "Show me the tensor equations of General Relativity, and render the result in LaTeX."

I close with the obligatory XKCD reference: https://xkcd.com/927/

Neat. Personally, I wasn't aware of mathjax, it's a bit of a revelation to learn you can do this. I like very much the fact that the ASCII side is highly readable - compared to say, LaTeX (to me, anyway!) - as something I could use in code comments.
What strange choices. For example, to express the sum from i=1 to n:

    sum_(i=1)^n
Why use the exponent sign to indicate the upper limit? Am I taking crazy pills here?

How about using some symmetry instead, e.g.

    sum(i=1)(n)    "Means: sum from i=1 to n"
The author of ConTeXt (a TeX format similar to LaTeX) has some interesting comments on AsciiMath [0] [1]. Its space handling looks especially problematic; the example given in [0]

  o ox x = xo
  a ax x = xa
  ooxx=xo
  aaxx=xa
  ac+sinx+xsqrtx+sinsqrtx+sinsqrt(x)
produces the following output

  o ⊗ x = x o
  a a x x = x a
  ∞ × = x o
  a a × = x a
  a c + sin x + x √x + sin √x + sin √x
Its handling of commas looks even worse, but it's tricky to demonstrate that in plain text.

[0]: https://tug.org/TUGboat/tb36-2/tb113hagen.pdf#page=3

[1]: https://github.com/contextgarden/context/blob/e9bd55ec/tex/c...

The amount of effort we are putting into transcribing doodles into pixel accurate text is astonishing. In my undergrad days I loved LaTeX and friends because it let me convert my notes to digital paper and websites without having to change how I thought.

Now that I'm older and wiser I think the whole thing is a waste of time and a perfect example of cargo culting. The current maths notation was largely invented by Euler so he could write to his contemporaries with parchment and quill, e.g. https://www.themorgan.org/blog/all-math-nerds-out-there

That we are still using his notation three centuries later on computers is both astonishing and saddening.

It's much better to use a sane and consistent notation that can be entered as ascii in the first place (or Unicode if you hate long names), viz. s-expressions.

    | TeX          | S-Expression                  |
    |--------------+-------------------------------|
    | 1 + 2        | (+ 1 2)                       |
    | 1 - 2        | (- 1 2)                       |
    | 1 \times 2   | (* 1 2)                       |
    | frac{1}{2}   | (/ 1 2)                       |
    | a_i          | (map a (range 0 n))           |
    | \sum_i a_i   | (apply + (map a (range 0 n))) |
    | \int x^2, dx | (integrate '(expt x 2) 'x)    |
Not only are the expressions consistent between all the normal mathematical operators, they force you to think about what you're doing. E.g. a sequence is a function from the nats to whatever objects you are enumerating and an indefinite integral is a symbolic operation - not a numerical one like the definite integral - both of those are something that everyone is aware of, the same way they are aware of a "Wet Paint" sign on a bench before they sit down.
> While HTML5 now includes MathML as an official recommendation, the remaining browsers do not appear to be implementing it

Who are the "remaining browsers" here? caniuse suggests support across all the usual suspects (albeit I think some implementations leave a lot to be desired on the formatting end of things)

I use Unicode to type math, which is the closest you can get in plain text to what you see in the rendered output. The latex package unicodemath is amazing. As a bonus you can paste the code in chat applications when communicating with peers.

    AAccAltccBinbbbR,cc|A|ltoo
It's not exactly easy to read, is it?