20 ms·
AsciiMath – An easy-to-write markup language for mathematics
- techwizrd 10y agoI 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
- skierscott 10y agoLooks like it does some more parsing than LaTeX; in the example you don't need to type \frac and \left(\right).
- IngoBlechschmid 10y agoBut to produce high-quality renderings of mathematical formulas, you need this fine-grained level of control. Not all fractions should use "\frac", sometimes "\tfrac" (which produces a vertically smaller fraction) or even an in-line "/" are more appropriate. Similarly, "\left(" and "\right)" sometimes result in parentheses whose size don't reflect stress and emphasis. In those cases, it's good to have "\bigl(" and friends available. LaTeX has several flaws. But it's also astonishingly good, making it extremely hard for a competitor to catch on. We're kind of locked in to LaTeX.
- ajarmst 10y agoAlso, AMS LaTeX, by its nature, allows you to write custom macros to shorten the particular notation(s) you happen to use most. A lot of these comparisons fail to note that important fact about the use of the tool.
- dmvaldman 10y agoNotice 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 :-)
- milesrout 10y agoNone of those things are difficult. And don't say 'no slashes or brackets'. Swapping `\sum_{..}` for `sum_(..)` isn't reducing the number of brackets, and in fact I find the top harder to read as it has more of just one type of bracket.
- coldtea 10y ago>None of those things are difficult. But all of these things distract from the main task. And you also have to learn LaTeX, which many might not care for.
- Smaug123 10y agoOne may use \left( and \right) to get automatically-sized brackets.
- wodenokoto 10y agoWhat are the benefits of this over just using latex with mathjax?
- dreamcompiler 10y agoIt'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!)
- andrepd 10y agoWhat 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.
- tarjei 10y agoAsciiMath 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 10y agoHmm, 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.
- blt 10y agosame, even when it adds nothing, for example I wrote \alpha in an email recently.
- vanderZwan 10y agoNow if only email had autocomplete like the Juno IDE does... http://junolab.org/ http://junolab.org/ (scroll down)
- zulln 10y agoEh.. there should be plugins for that.
- milesrout 10y agoIf you want email to have autocomplete, then it does. 'Email' isn't a client. The client you choose to use is. Write your emails in vim -> now you have autocomplete.
- monsieurbanana 10y agoBut does vim have a top class email plugin that allows powerful research, editing, sending and receiving emails? Because Emacs does. Choose smart, choose Emacs. (this comment is written half in jest) https://www.djcbsoftware.nl/code/mu/mu4e.html https://www.djcbsoftware.nl/code/mu/mu4e.html
- jostylr 10y agoThis 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 10y agoMathJax integrated asciimath long time ago: http://docs.mathjax.org/en/latest/asciimath.html http://docs.mathjax.org/en/latest/asciimath.html
- Animats 10y agoThe 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 10y agoThe 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 10y agoI'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 10y agoAs 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.
- amathprof 10y agoOne audience: undergrad students. They are familiar with calculator notation but not Tex. Particularly for simple algebraic expressions, AsciiMath is very similar to infix.
- kobeya 10y agoPeople who write emails.
- lenkite 10y agoAsciiMath is more readable than Latex for just about everyone except perhaps professional mathematicians. Simplicity versus power.
- thyselius 10y agoI would love to have the opposite, get the code from writing maths as it is printed. Has that been made?
- umanwizard 10y agoDo you mean something like Detexify?
- ygra 10y agoThat 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.
- H4CK3RM4N 10y agoThe best tool I've found for that is grapher.app which is still shipped with Macs. It has an interactive editor and the option to copy out latex.
- AlbertoGP 10y agoIt 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 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 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 https://news.ycombinator.com/item?id=12388407 This one is closer to what you want.
- devereaux 10y agoThat'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 10y agoI don't know how you would type those characters though, other than auto complete from the TeX commands?
- amathprof 10y agoYeah, 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 10y agoI 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)
- devereaux 10y agoA couple of ideas: - Keyboard shortcuts, like for diacritics on european keyboards. - On screen keyboard, like for phones and tablets. But entry is not the important part - rendering is.
- thomasahle 10y ago> But entry is not the important part - rendering is. If that was true, TeX already has us covered.
- jwmerrill 10y agoTo 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 10y agoI like MS equation editor. I think it does a pretty great job at being a WYSIWYG editor.
- adrianratnapala 10y agoI used to think it was about as good as could be expected for a graphical editor (which meant it was rubbish). And then I found LyX which was infinitely better. That was years ago and MS might have caught up by now. And yet, despite how much I like LyX, I keep using real LaTeX instead -- especially when there is complex maths. That's because the ability to create macros in maths eventually outweighs everything else readability-wise. And I'm afraid the same logic applies to AsciiMath. Is there some equivalent to \newcommand[1]{vr}{\mathbf{r_#1}} Or am I just going to have to use somethng `bb"r"_1` for every instance? That's a lot less readable than `\vr1`.
- acrefoot 10y agoI find TeXmac's equation editor to be an even faster WYSIWIG UI than LyX's. For example, a λ is just 'l'+tab. Simarly, you can cycle through other symbols. For b: b->β-> Sadly, TeXmacs hasn't gotten as much love as it deserves: I find it way better than jupyter at producing notebooks/papers that involve math, interactive code, and prose.
- runarberg 10y agoOne 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/
- a3_nm 10y agoThis 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 10y agoThe 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 10y agoThanks 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. :)
- lilgreenland 10y agoAfter 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
- dylanrw 10y agoAs someone who doesn't have a math background, and doesn't know latex. This is very handy as a teaching and learning tool.
- slaymaker1907 10y agoThank 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 10y agoDon't even have to make it, it looks like a Pandoc filter exists already https://github.com/Kerl13/AsciiMath https://github.com/Kerl13/AsciiMath
- wfunction 10y agoSame 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)...
- dbranes 10y agoGreat. 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 10y agoI 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).
- harmonium1729 10y agoDespite 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.
- sigvef 10y agoIn a perfect world, everything is generated from ASCII: https://github.com/sigvef/sigvehtml https://github.com/sigvef/sigvehtml .
- throwaway7645 10y agoNot 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.
- seesomesense 10y agoAt my kid's school, some children used Latex for their maths. Surely, adults can grok Latex too.
- davesque 10y agoIt'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.
- stu_douglas 10y agoI 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
- polm23 10y agoAnyone 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
- krick 10y agoThis 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 10y agoEverything 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!
- jcoffland 10y agoThis is great. It would make an awesome addition to Markdown. Does parsing conflict with the use of backticks in Markdown?
- Aardwolf 10y agoThis 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.
- msimpson 10y agoComparison of ASCIIMathML, PHPMathPublisher, MathJax, KaTeX, MathTeX http://www.intmath.com/blog/mathematics/comparison-math-web-publishing-options-9915 http://www.intmath.com/blog/mathematics/comparison-math-web-...
- jbmorgado 10y agoTo 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.
- murbard2 10y agoThis 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.