
AsciiMath – An easy-to-write markup language for mathematics - mintplant
http://asciimath.org/
======
jwmerrill
To everyone who says "why do we need this when we have LaTeX?" I ask the
question "why do we need Markdown when we have HTML?"

The nice thing about Markdown is that it's quite legible in its source form,
which makes it less distracting to edit. Same deal with AsciiMath and LaTeX:
AsciiMath is more legible in its source form which means that it has lower
overhead during editing.

One of these is more legible than the other:

    
    
      (f'(x^2+y^2)^2)/(g'(x^2+y^2)^2)
      \frac{f'\left(x^2+y^2\right)}{g'\left(x^2+y^2\right)^2}
    

In my experience, most people who learn LaTeX don't do so until sometime
around the middle or end of their undergrad career (certainly in Physics--
maybe mathematicians learn it sooner). Earlier than that, people struggle with
junk like the Microsoft equation editor. No big deal?

~~~
paulddraper
I like MS equation editor.

I think it does a pretty great job at being a WYSIWYG editor.

~~~
jwmerrill
I wonder if it's gotten better since 2002-2004, which is when I used it a lot.

I'd be curious to hear what you think about the equation editor in Desmos[1]
(full disclosure, my employer).

We use an open source WYSIWYG typesetting library called MathQuill[2]. The
keystrokes you use are very similar to AsciiMath, but the result is direct
editing of the typeset math. E.g. you type '_' to move into a subscript, '^'
to move into a superscript, '/' to create a fraction, 'sqrt' to create a
radical, etc.

I believe that I can edit much faster with this interface than with Microsoft
Equation Editor, and that it's approximately similar difficulty to learn. But
I'm biased.

[1] [https://www.desmos.com/calculator](https://www.desmos.com/calculator)

[2] [http://mathquill.com/](http://mathquill.com/)

~~~
paulddraper
I've used mathquill. Thanks so so much for open-sourcing it.

I think I remember MS being better in some edge cases. OTOH, I haven't used it
in so long maybe that speaks for itself.

~~~
jwmerrill
It was open source before we started using it, but we're friends with the
creators, so I can pass on the compliment.

------
techwizrd
I don't know about other math departments, but most of the students and
professors I knew during my math degree knew LaTeX.

From my cursory glance over the page, this isn't much simpler than LaTeX and
it mostly just reduces a number of backslashes. It doesn't save me much time
when typesetting equations. Nowadays, I mostly type LaTeX for MathJax or
Jupyter notebook. Adding asciimath to Jupyter seems to be on the backlog[0],
and it's dependent on CommonMark coming up with an extension system.

0:
[https://github.com/jupyter/notebook/issues/1918](https://github.com/jupyter/notebook/issues/1918)

~~~
dmvaldman
Notice the subtlety. The first example on the site is:

sum_(i=1)^n i^3=((n(n+1))/2)^2

To render this in LateX as it is shown would be

\sum_{i = 0}^n i^3 = \bigg( \frac{n(n+1)}{2} \bigg)^2

No fracts, just "/", no parenthesis enlarging with "\bigg", no slashes or
brackets.

Looks pretty nice :-)

~~~
Smaug123
One may use \left( and \right) to get automatically-sized brackets.

~~~
andrepd
What's more, you can use a package like \usepackage{physics} which includes
several convenience macros like \qty( [...] ) as a shorthand to \left( [...]
\right). To go yet another step further, define something like
\newcommand{\p}{\qty} to shorten the notation to simply dropping a \p before
your delimiters to autosize them.

------
tarjei
AsciiMath has one large benefit over Latex: It fits how you would write math
in an email.

AsciiMath is perfect for users who do not know Latex (or code for that matter)
but needs to use mathematical notation on a daily basis.

I applaud that AsciiMath has resurfaced. I've used it in combination with
Katex a cuple of times with great results.

~~~
arcanus
Hmm, in all my correspondence with engineers and mathematicians, we just paste
or write latex directly in the email.

Knowledge of latex is assumed, and honestly I (and my colleagues) are able to
parse thus natively.

~~~
dTal
Which is, in a nutshell, why it's important for a formal language to be easy
to read and write, and why eliminating overly verbose notation matters. It's
not just for computers...

~~~
semi-extrinsic
In this respect I think AsciiMath doesn't go far enough, precisely because of
the Ascii part. Especially for super- and subscripts, why not use the
corresponding Unicode characters?

At least on my keyboard, "x^2" is one keystroke more than "x²", and the latter
is _much_ more redable.

~~~
JumpCrisscross
AsciiMath optimises for ease of use in both reading _and_ writing. Fewer
people know how to write x² than x^2, yet virtually everyone will read them
equivalently. That's not true for n/2 versus \frac{n}{2}.

~~~
semi-extrinsic
Isn't x^2 typed <x><^><space><2>, while x² is the same minus the <space>, on
most keyboards?

~~~
thaumasiotes
I've never knowingly seen a keyboard that would allow you to type ² at all.
So, no.

~~~
ziotom78
On my Linux Mint 18 KDE system, ² can be typeset by typing AltGr-2 (I can get
½ by pressing AltGr-5). I am using an Italian keyboard, but I bet this works
with US keyboards as well.

Recently I used Windows 10 quite a bit, and the number of AltGr combinations
available on Linux has been the thing I missed the most!

~~~
thaumasiotes
I wouldn't want to make that bet, considering a US keyboard has no AltGr key.

It might work with a US keyboard as long as your computer was configured for
an Italian keyboard, though.
[https://en.wikipedia.org/wiki/AltGr_key](https://en.wikipedia.org/wiki/AltGr_key)
suggests that from the _keyboard 's_ perspective, AltGr and right Alt are the
same thing. Really, no keyboard allows any character -- they just send key
codes (and modifier codes), and it's on your software to interpret those. But
typing ² is not part of the normal, expected functioning of a US keyboard.

Edit: it occurs to me that perhaps I should gloss "it's on your software to
interpret those" as "it is the responsibility of your software to interpret
those".

~~~
ziotom78
You're right, US keyboards do not support AltGr! I have always used european
keyboards and every one of them supports AltGr, so I assumed that US keyboards
did the same.

Just for testing, I installed a few new keyboards on my KDE desktop, and I can
confirm that French, German, Spanish, and Greek keyboards have support for
AltGr combinations to get superscripts/fractions/other characters.

I've never required that a keyboard could allow any character. However, this
is indeed possible today, as Shift+Ctrl+u+HexNumber allows to quickly insert
any Unicode character. (This works under Xfce and KDE, and probably other
DEs.)

Nevertheless, I think that a 100-and-more-keys keyboard should support a
subset of the most useful ones. I am a physicist and an Italian, so having
quick keyboard combinations for exponents, fractions, and the euro sign € is
extremely handy for my everyday activities.

~~~
untoreh
I think what you are looking for is the us international keyboard layout,
which has support for altgr combinations

------
jostylr
This is about a decade old before MathJax and back when its predecessor,
jsMath, was still pretty new. It was targeting students the most, not those
who use latex professionally. I used it to create TidlyWiki notebooks for my
students and it was something they actually did!

The goal was also about being translated into MathML. LaTeX is not necessarily
concerned with mathematical sense while MathML (sometimes) is. I think this
was also a motivation.

And, quite frankly, replacing \frac{a}{b} with a/b is a huge win for ease of
writing basic math.

~~~
TheGorramBatman
MathJax integrated asciimath long time ago:
[http://docs.mathjax.org/en/latest/asciimath.html](http://docs.mathjax.org/en/latest/asciimath.html)

~~~
Animats
The site has no date information, but says "currently this only works in
Firefox 3+ and Safari 5.1+", so this goes back many years.

~~~
amathprof
The original native AsciiMath script was limited in support, but AsciiMath via
MathJax has wide browser support. We maintain the original script still, but
most people use AsciiMath through MathJax.

------
TheRealPomax
I'm curious who the audience is for this. If it's people who actually care
about maths, then this doesn't have any real value, because they already know
LaTeX and will most likely appreciate the higher precision that offers (I
personally fall in that category). If it's people who normally don't really
need to write mathematics, then for the few times they need to, LaTeX might
still make more sense due to convenient quickly-googled online LaTeX creators
like
[https://www.codecogs.com/latex/eqneditor.php](https://www.codecogs.com/latex/eqneditor.php)

If there's a demographic between those two groups, then I might simply have a
blind spot, but... whose problem does this solve, and what is that problem?
Because just saying "LaTeX is too much effort", the immediate counter-question
is "for whom, exactly?" because it won't be people who already use LaTeX, or
need reliable maths typesetting on a daily basis, and it probably isn't for
people who need to use maths maybe a handful of times a year. So who's left,
and what problem do they have where asciimath makes life easier?

~~~
flogic
As someone who would "need" this only once or twice every few years at best. I
vastly prefer the idea of using this. I will likely never care about nitty
gritty typesetting details. Getting things to "remotely legible" is more than
enough for me.

------
harmonium1729
Despite knowing LaTeX, this is much more intuitive for me when communicating
in plaintext. It just matches how I'd write it anyway. In an email I'd always
use 1/2 or (f(x+h)-f(x))/h over their LaTeX alternatives.

If, however, the goal is to more easily edit LaTeX -- especially for folks who
are less confident with LaTeX -- I suspect WYSIWYG is frequently a better
option. MathQuill (mathquill.com), for example, is a fantastic open-source
WISYWIG editor for LaTeX.

Disclosure: we use MathQuill heavily at desmos.com, where I work, and have
contributed to its development.

------
davesque
It's probably worth somebody investigating a more short-hand notation for this
kind of task. However, I feel compelled to say that I've never found the
syntax which is commonly used to typeset equations with LaTeX to be all that
complicated. When I was first learning it, I remember repeatedly thinking to
myself, "This is it? This really isn't so bad!" Furthermore, the thing I like
about LaTeX is that the syntax is very extensible. You can easily add more
directives or macros and there are really only a few syntactic constructs that
you can use to represent them. If I'm not mistaken, AsciiMath's approach
requires that more specialized syntax would be needed when adding more
features.

------
Aardwolf
This is pretty nice and intuitive! What is odd is how you don't need spaces
between string identifiers

intintint does the same as int int int, 3 integrals

del becomes a del symbol, delt becomes a del symbol plus a t, delta becomes a
delta symbol

rhoint: will it become rh + oint (circular integral), or rho + int? It happens
to become rho + int here, but does it specify that in its specification?

deltau: will it become del + tau, or delta + u? it happens to become delta + u
here. Opposite of the rhoint case about where it chose to make both things a
rendered symbol

So it's inconsistent parsing rules, simply requiring spaces between textual
identifiers would make it more logical :)

Also, what is now => and lArr could make more sense as ==> and <==. Also sad
that <\- or <\-- doesn't work for left arrow.

------
andrepd
What about this is so much different than LaTeX? It seems to have the same
basic syntax but the commands don't start with a backslash. Also the symbol
list seems severely limited.

------
lilgreenland
After using MathJax to render LaTex on my website I switched to KaTeX and saw
a dramatic decrease in load times. I hope that asciiMath doesn't also suffer
from the same speed issues from MathJax.

[https://github.com/Khan/KaTeX](https://github.com/Khan/KaTeX)

------
devereaux
That's nice, but we are in 2017. It may be better to support unicode. I mean I
prefer to write things like:

∀α,β ∈ ℝ², √ϕ=αβ, ...

∃ a⃗ + b⃗ ≥ ...

What I think is needed are generic 2d composition diacritics for unicode, to
have text above/below/to the upper left/UR/LL/LR angle -- I mean, some more
generic version to write things like Ψ̂⁹⁻¹=Ψ⁸, ρ₁₂ with composition characters
instead of the dedicated numbers, or letters.

I don't like LaTeX because I want WYSIWYG, which is what unicode is for. Even
in the body of an email. Even in a reply on YN.

~~~
thomasahle
I don't know how you would type those characters though, other than auto
complete from the TeX commands?

~~~
amathprof
Yeah, the original design philosophy of AsciiMath was to make that input
symbol something in ASCII that looks kind of like the desired symbol. The idea
of supporting Unicode as an alternative is reasonable idea and probably one we
should look at (feel free to make a pull request).

~~~
devereaux
I see unicode as both an alternative rendering for text based devices, and an
alternative input (because on my keyboard, the right Alt key followed by a
gives me α, which is faster than typing alpha)

------
runarberg
One of my earlier programming experience was writing a more expressive
alternative to ascii math [1]. I learned later that this was also the first
compiler that I ever write. It fixes some of the shortcomings of asciiMath,
like you should never have to resort to latex like syntax, you can enter
Unicode characters directly, and it has a nice mapping to MathML.

1:
[https://runarberg.github.io/ascii2mathml/](https://runarberg.github.io/ascii2mathml/)

------
lenkite
AsciiMath is more readable than Latex for just about everyone except perhaps
professional mathematicians. Simplicity versus power.

------
a3_nm
This looks nice, with a much more legible syntax than LaTeX. I'd love to use
this, e.g., on my blog. The reasons why I won't:

\- No server-side rendering. I don't want to burden my reader's browser with
Javascript. (With MathJax, you can do it server-side, I explained how here:
[https://a3nm.net/blog/selfhost_mathjax.html](https://a3nm.net/blog/selfhost_mathjax.html))

\- The project looks dead:
[https://github.com/asciimath/asciimathml/pulse/monthly](https://github.com/asciimath/asciimathml/pulse/monthly)

~~~
amathprof
The project isn't exactly dead (I'm one of the maintainers). The direct-to-
MathML version is somewhat dead, but the AsciiMath syntax rendered via MathJax
is still widely used. The syntax is pretty mature at over 10 years old, hence
the lack of commit activity.

~~~
a3_nm
Thanks for explaining this! I wasn't implying at all that the project was not
being used. I understand that the syntax may be mature, but the lack of commit
activity does not explain why there are still so many pending issues in the
repository. :)

------
throwaway7645
Not that this and Latex aren't great, but I wonder if there is a more outside
the box solution. APL can represent mathematics very well using Iverson
Notation as the design and it is executable to boot. I haven't spent a ton of
time with it, so I'm not sure if I could read complex equations as easily with
it or not once suitably trained. Other benfits of APL's notation is no order
of operations and all you need is the character set which is really easy to
deal with I would guess. If it hasn't become popular after 1/2 century,
perhaps there really is something to the critical mass of our current
notation.

------
polm23
Anyone remember eqn?

[https://en.wikipedia.org/wiki/Eqn](https://en.wikipedia.org/wiki/Eqn)

I've enjoyed the part of this interview with Linda Cherry, one of its
creators, talking about it in comparison with Tex (incorrectly transcribed as
"tech").

[http://www.princeton.edu/~hos/mike/transcripts/cherry.htm](http://www.princeton.edu/~hos/mike/transcripts/cherry.htm)

------
slaymaker1907
Thank you! I've been wanting to do this for a while for myself after becoming
fed up with the verbosity of LaTex. My strategy has been a little different in
that I've been working on plugging into equations using a Pandoc filter.

Instead of rolling my own or hacking into SymPy, I'll use asciimath.

~~~
slaymaker1907
Don't even have to make it, it looks like a Pandoc filter exists already
[https://github.com/Kerl13/AsciiMath](https://github.com/Kerl13/AsciiMath)

------
thyselius
I would love to have the opposite, get the code from writing maths as it is
printed. Has that been made?

~~~
umanwizard
Do you mean something like Detexify?

~~~
ygra
That only works for individual glyphs. I guess they meant something like the
Math Input Panel where you can draw an entire expression and paste it into
other applications.

------
stu_douglas
I actually wrote a little compiler that converts AsciiMath to LaTeX for a
course in school.

Hooked up the executable to an Automator service so I could highlight some
AsciiMath text and replace it with LaTeX from the right-click menu. Much
faster for writing math notes in LaTeX!

If anyone's interested, the project's at
[https://github.com/studouglas/AsciiMathToLatex](https://github.com/studouglas/AsciiMathToLatex).
Haven't touched it since I made it, so don't judge too hard :p

------
wodenokoto
What are the benefits of this over just using latex with mathjax?

~~~
dreamcompiler
It's a little bit easier to read in raw notation such as in Github readme.md
documents, since GH hasn't yet figured out how to incorporate Mathjax. (If I'm
wrong about this, _please_ correct me!)

------
krick
This is fabulous. It seems crazy to me, that some in this thread are like
"meh, no big deal, LaTeX is fine".

Except, I guess it would be better if that could be compiled to LaTeX instead
of rendering it directly. LaTeX is still de-facto standard, and surely there
are situations when it would be more powerful. So this mid-layer still would
be useful, I guess. But otherwise, I would gladly write everything I need in
Markdown+AsciiMath instead of pure LaTeX.

------
sameera_sy
Everything is about how we get used it to quickly though! Takes a little time
to get used to latex, but this is definitely something worth trying.
Especially the word syntax seems much more effective here! Thanks! The website
named [http://www.mathifyit.com/](http://www.mathifyit.com/) helps in getting
latex syntax through plain english. Seems like something I'll use!

------
dbranes
Great. Would love to have some support for diagrams drawing.

This seem to tackle the issue that Latex equations are not very readable,
which is great. A related problem is that tikz code for drawing commutative
diagrams in latex is basically completely incomprehensible. Looks like this
project is in a good position to start tackling that problem.

~~~
laxd
I have a projects which, in a addition to a asciimath-inspired language, have
support for click-and-drag graph creation.

[https://mathblocks.net](https://mathblocks.net)

It's a work in progress (probably forever).

------
msimpson
Comparison of ASCIIMathML, PHPMathPublisher, MathJax, KaTeX, MathTeX

[http://www.intmath.com/blog/mathematics/comparison-math-
web-...](http://www.intmath.com/blog/mathematics/comparison-math-web-
publishing-options-9915)

------
sigvef
In a perfect world, everything is generated from ASCII:
[https://github.com/sigvef/sigvehtml](https://github.com/sigvef/sigvehtml) .

------
murbard2
This is really neat. Your table doesn't mention that => can make a double
arrow, even though it does. Also it would be nice for the dx in integrals to
be \mathrm{d}x.

------
dylanrw
As someone who doesn't have a math background, and doesn't know latex. This is
very handy as a teaching and learning tool.

------
jcoffland
This is great. It would make an awesome addition to Markdown. Does parsing
conflict with the use of backticks in Markdown?

------
jbmorgado
To all the commenters pointing out the people that talk about LaTeX, you are
getting a part of the criticism wrong. It's not: "Why this when we already
have LaTeX?", but a "Why this when LaTeX does it better?".

I wouldn't mind for an easier way to introduce mathematics, but just from the
example given, I can see right away that the typography in AsciiMath is not
good.

Just look at the space (or lack of it) around the inner parenthesis for
instance.

------
seesomesense
At my kid's school, some children used Latex for their maths. Surely, adults
can grok Latex too.

