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.
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?
I would say that markdown for informal writing is fine and I like Markdown for many thing BUT if I need formatting LaTeX is a better tool. I have always waited for a new system but its hard to replace what works (With some cursing and banging on the desktop). Writing Math equations there is almost always a need for formatting within the document.
To me a math equation is just another plot. I love making quick plots but when it is my name on the document I want to be able to control every line and space.
I really like Scribble a Racket made document language is certainly the way to go but it will take a while to get broader usage. https://docs.racket-lang.org/scribble/
What Scribble does really well is you write your document and it is a one line change to change the output. It can output to MathJax or LaTeX or Markdown or PDF etc....
Not a fan of markdown myself at least for comment boxes. Everything that uses markdown as input (which seems to be hacker news comments too) ignores a single newline as a single newline, giving you different output than what you see in the box you type it in, which is very bad for intuitive web comment boxes.
Lots of people make that mistake, making a nice listing with newlines in between but them it becomes an ugly single line.
BBcode from forums in the past worked better for comments.
i am studying CS an we had to use it (not learn it ;) ) in the 3rd semester to hand in reports in their special format. I first thought this is stupid, but later when i needed it (my math proseminar, CS proseminar then now (or next semester) my bachelor-thesis), i could already do simple things. So in hindsight it was a good move from my university.
But i was always a bit disappointed, because i had to try hard to keep my source readable. LATEX really clutters your enumerations, equations etc with way to much syntax. I always thought about writing a simple Markdown-with special math mode (similar to AsciiMath)-to-LATEX compiler.
If you were to remove your \left and \right commands, which are unnecessary in the example, there would be very little difference in legibility between the two examples.
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.
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.
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
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?
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.
One audience: undergrad students. They are familiar with calculator notation but not Tex. Particularly for simple algebraic expressions, AsciiMath is very similar to infix.
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.
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.
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.
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.
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.
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.
The COMBINING RIGHT ARROW ABOVE combination on that second line rendered both the letter and the arrow as two separate squares, on macOS, in fully-updated Chrome.
It maybe 2017, but this doesn't quite work yet. Not to mention how it falls apart as soon as I want some _clever_ typesetting. Don't get me wrong: I think we can do better than TeX, and in a lot of cases common characters like e.g. Greek characters might be fine, but, uh, we aren't there yet.
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.
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)
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.
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.
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").
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.
Same here! It's been on my to-do list but I haven't gotten around to solving it in a robust manner (tried regexes just for kicks and they failed like I expected)...
It has been tried several times with different approaches.
I mentioned some of them in my bachelor's thesis "Multimodal mathematical formula editing for web services":
http://matracas.org/tacto/index.html.en
As part of that work I implemented part of the DRACULAE formula layout analysis algorithm and improved on it to allow certain disambiguations when parsing the formula: the result encoding is not presentational like LaTeX but semantical like the ones used in Computer Algebra Systems. That makes thing much more complicated and I only implemented simple notations like super/subscripts and fractions.
Still, it might give you an idea of how it can be done.You can play with it here:
http://matracas.org/tacto/test.html
Speech synthesis using the HTML5 audio API (reads aloud the formula you write) worked in several browsers including Chrome at the time, but nowadays it seems to work only in Firefox.
You might combine the handwritten symbol recognition of detexify, mentioned in a sibling comment, with this layout analysis to have full handwritten recognition of formulas but it's not straightforward.
Some time ago there was a story in HN about someone else's PhD thesis that went much further ahead:
"SESHAT: Handwritten math expression parser"
https://news.ycombinator.com/item?id=12388407
This one is closer to what you want.
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!
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!)
[+] [-] jwmerrill|9 years ago|reply
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:
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?[+] [-] baldfat|9 years ago|reply
To me a math equation is just another plot. I love making quick plots but when it is my name on the document I want to be able to control every line and space.
I really like Scribble a Racket made document language is certainly the way to go but it will take a while to get broader usage. https://docs.racket-lang.org/scribble/
EDIT----
Math Library - http://docs.racket-lang.org/scribble-math/
What Scribble does really well is you write your document and it is a one line change to change the output. It can output to MathJax or LaTeX or Markdown or PDF etc....
[+] [-] Aardwolf|9 years ago|reply
Lots of people make that mistake, making a nice listing with newlines in between but them it becomes an ugly single line.
BBcode from forums in the past worked better for comments.
[+] [-] paulddraper|9 years ago|reply
I think it does a pretty great job at being a WYSIWYG editor.
[+] [-] LeanderK|9 years ago|reply
But i was always a bit disappointed, because i had to try hard to keep my source readable. LATEX really clutters your enumerations, equations etc with way to much syntax. I always thought about writing a simple Markdown-with special math mode (similar to AsciiMath)-to-LATEX compiler.
[+] [-] psychometry|9 years ago|reply
[+] [-] techwizrd|9 years ago|reply
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
[+] [-] dmvaldman|9 years ago|reply
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 :-)
[+] [-] skierscott|9 years ago|reply
[+] [-] tarjei|9 years ago|reply
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|9 years ago|reply
Knowledge of latex is assumed, and honestly I (and my colleagues) are able to parse thus natively.
[+] [-] jostylr|9 years ago|reply
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|9 years ago|reply
[+] [-] TheRealPomax|9 years ago|reply
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|9 years ago|reply
[+] [-] amathprof|9 years ago|reply
[+] [-] kobeya|9 years ago|reply
[+] [-] harmonium1729|9 years ago|reply
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|9 years ago|reply
[+] [-] Aardwolf|9 years ago|reply
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|9 years ago|reply
[+] [-] lilgreenland|9 years ago|reply
https://github.com/Khan/KaTeX
[+] [-] devereaux|9 years ago|reply
∀α,β ∈ ℝ², √ϕ=αβ, ...
∃ 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.
[+] [-] lvh|9 years ago|reply
It maybe 2017, but this doesn't quite work yet. Not to mention how it falls apart as soon as I want some _clever_ typesetting. Don't get me wrong: I think we can do better than TeX, and in a lot of cases common characters like e.g. Greek characters might be fine, but, uh, we aren't there yet.
[+] [-] ygra|9 years ago|reply
[+] [-] thomasahle|9 years ago|reply
[+] [-] runarberg|9 years ago|reply
1: https://runarberg.github.io/ascii2mathml/
[+] [-] lenkite|9 years ago|reply
[+] [-] a3_nm|9 years ago|reply
- 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)
- The project looks dead: https://github.com/asciimath/asciimathml/pulse/monthly
[+] [-] amathprof|9 years ago|reply
[+] [-] throwaway7645|9 years ago|reply
[+] [-] polm23|9 years ago|reply
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
[+] [-] slaymaker1907|9 years ago|reply
Instead of rolling my own or hacking into SymPy, I'll use asciimath.
[+] [-] slaymaker1907|9 years ago|reply
[+] [-] wfunction|9 years ago|reply
[+] [-] thyselius|9 years ago|reply
[+] [-] AlbertoGP|9 years ago|reply
As part of that work I implemented part of the DRACULAE formula layout analysis algorithm and improved on it to allow certain disambiguations when parsing the formula: the result encoding is not presentational like LaTeX but semantical like the ones used in Computer Algebra Systems. That makes thing much more complicated and I only implemented simple notations like super/subscripts and fractions. Still, it might give you an idea of how it can be done.You can play with it here: http://matracas.org/tacto/test.html
Speech synthesis using the HTML5 audio API (reads aloud the formula you write) worked in several browsers including Chrome at the time, but nowadays it seems to work only in Firefox.
You might combine the handwritten symbol recognition of detexify, mentioned in a sibling comment, with this layout analysis to have full handwritten recognition of formulas but it's not straightforward.
Some time ago there was a story in HN about someone else's PhD thesis that went much further ahead: "SESHAT: Handwritten math expression parser" https://news.ycombinator.com/item?id=12388407 This one is closer to what you want.
[+] [-] H4CK3RM4N|9 years ago|reply
[+] [-] umanwizard|9 years ago|reply
[+] [-] stu_douglas|9 years ago|reply
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. Haven't touched it since I made it, so don't judge too hard :p
[+] [-] wodenokoto|9 years ago|reply
[+] [-] dreamcompiler|9 years ago|reply