Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
AsciiMath: An easy-to-write markup language for mathematics (asciimath.org)
103 points by amichail on Jan 23, 2023 | hide | past | favorite | 31 comments


Related:

AsciiMath – An easy-to-write markup language for mathematics - https://news.ycombinator.com/item?id=13962242 - March 2017 (111 comments)


Reminds me very much of UnicodeMath (https://www.unicode.org/notes/tn28/UTN28-PlainTextMath-v3.1....), in a similar way like J works around APL symbol with Ascii characters.


Reminds me of eqn, where you'd write the example

    sum from {i=1} to n {i sup 3} = ({n(n+1)} over {2}) sup 2


That's also a valid formula in LibreOffice Math.


Centering an input language around Unicode is brave and I mean that in a positive sense.

Someone’s gotta try to push the status quo forward on Unicode input.


At the very least, latex could be upgraded to accept unicode characters for certain things like the greek alphabet.

For instance, while writing, the user inputs \alpha and the editor automatically converts it into the greek symbol right there in the source file. Later, when compiling latex transparently recognizes the greek symbol for what it is.


Unicode math input works out if the box in Context and (I believe) also in lualatex + unicodmath package.


I like the way Julia does it - full unicode suport in the language, and easy input in the repl and notebooks with a simple backslash escape sequence. \pi -> [tab] -> π

Sometimes I fire up a Julia repl purely as a unicode-getter.


We already have TeX and anyone who writes math is used to it. Why more fragmentaton?


Ascii math is easier to read and takes less time and effort to type.


Could you demonstrate with an example how Ascii math is easier to read and takes less time and effort to type? The example on the main page,

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

looks to me no less complicated than

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

so if the goal is it quickly communicate mathematics in plain text (without rendering), I see no difference. If the advantage is that the outer parentheses are automatically resized, why not write a renderer that uses Latex and puts \left, \right everywhere? Better yet, why not go straight to TeXmacs?

I'd love to see an example of a mathematical expression where Ascii math is visibly simpler than Latex and is not just about parenthesis resizing.


Going through the syntax tables:

  ((a,b),(c,d)) |-> ul x < 10 != y ~~ (dz)/(dt) !in RR -> oo
which is equal to:

  \begin{pmatrix} a & b \\ c & d \end{pmatrix} \mapsto \underline x \lt 10 \ne y \approx \frac{dz}{dt} \notin \mathbb{R} \to \infty
Though some may prefer TeX even in this case due to being more explicit.


I'm not used to it (after trying) and would like to get into writing math.


> sqrt x √x

Not at all a fan of using unescaped character sequences to represent non-latin characters. Ultimately, this leads to situations where you have to resort to some hack to write something that coincides with one of these special names.

Not to mention, this restricts extending the language for special use cases. Suddenly, you discover that you have to throw away the entire thing and resort to a math-typographically-complete language like Latex to write what you want to write.


In general, I agree with you. However, I'm somewhat torn here, as the point is for ease it typing math. It already has an allowance where what you type is not necessarily the same characters that will get rendered.

Consider the example the page loads with "sum_(i=1)^n i^3=((n(n+1))/2)^2". Some of those parens are dropped entirely. Some are changed into taller versions. The + is not the same as the \plus sign that is rendered.

So, yes, it is a restriction that comes with some tradeoffs. My gut is that this is probably fine for the vast majority of use cases, though. Such that it was probably the right call.


It looks like if you wanted to write a literal "sqrt" you can just type:

  s q r t
but it is kind of nasty.


You can also quote text. This works:

    "sqrt"


Quoting something renders it in English font. If s,q,r,t are variables they should be rendered in math font.


Seems to approach Tex the more obscure the symbols get.


This is great, I'm so tired of writing \frac{1}{2}. Got my VSCode markup set up with this now, looking forward to some easier typing this semester.


Are there smarter math markup languages that take advantage of Unicode and allow entering actual math symbols instead of spelling every name? It's just that on a proper computer it's easy to set up a few (or many if you typeset math alot) actual math symbols that would take as much or less effort to type, but look way more readable even in the unparsed format

For example,

∑(i=1)^n instead of

sum_(i=1)^n

√x instead of

sqrt x


Not exactly what you're asking for, but in Julia you can write and use unicode symbols like this under the backslash key (supported both in the REPL and VS Code plugin), which lets you use more operators and makes the code look fancier


Folks have worked up macro support for replacing Unicode symbols w/ equivalent LaTeX commands, as well as the reverse, so that it's possible to round-trip.


∑√

These keys aren't on my keyboard.

If they're on your keyboard, just reprogram them to emit `sum` and `sqrt` respectively.

Unicode is for viewing; keyboard locales are for inputting. We're never going to have 2^32 keys on our keyboards.


Use the power of combinatorics! 26 keys offer 18252 2 letter + three letter combinations.

Using special chars even more.

Compose key is memetic and easy to use on all operating systems.


>Unicode is for viewing

So? That's exactly what ∑√ allows you to do: view these nicer chars instead of the verbose/ugly names

> We're never going to have 2^32 keys on our keyboards.

And how is this relevant? You don't need 2^32, a much smaller number would suffice. Just read the posted link and count the number of rows - that's closer to your upper limit


AsciiMath is my favourite math language and math renderer (over mathjax and katex). It is fast, quick to write, and human readable.


This is a sad statement on Internet Standards:

While HTML5 now includes MathML as an official recommendation, the remaining browsers do not appear to be implementing it. For widest browser compatibility, the use of MathJax is recommended.

I use MathJax but would love to have a portable version of this.


Well Chromium did recently announce it would start supporting MathML. https://bugs.chromium.org/p/chromium/issues/detail?id=6606#c...


What brought this change of heart? Chromium was going to get MathML support a decade ago (basically enable the relevant WebKit code) but then Google decided to drop it.


The code reportedly diverged too much from WebKit for it to be a straightforward toggle, then a separate company[1] agreed to take on the implementation (and presumably support) burden.

[1] https://mathml.igalia.com/




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: