Live data from Hacker News

Mathup: Easy MathML authoring tool with a quick to write syntax

mathup.xyz

21–30 of 38 posts

Re: Mathup: Easy MathML authoring tool with a quick to write syntax

#22
post #20

At first glance it seems that it not only has functional whitespace, but has overloaded it (used for grouping numerator and denominator or for pre- and suffixes). Also, it seems inconsistent in how it handles commands, some seem to be reserved words while others seem to require \`X`. It might be the right choice for its intended use case of quick and easy math, but it seems like it might come with a few footguns if y…

Author here. The intended use case is indeed quick and easy math expressions, and the target users are those that may or may not know LaTeX. I tried to make most expressions possible (I even added tensor notation a couple of weeks ago) but if you want to author complex equations you should probably use LaTeX. In my opinion very complex equations are much more manageable with LaTeX (this is also true of AsciiMath proper).

When your write LaTeX you maintain some structure for complex equations, while here you kind of take the quickest route possible and very quickly loose your footing in the equation’s complexity. In LaTeX you can very easily write out a very complex equation with nothing but your text editor, but here once you are maybe 6 or 7 terms deep you loose your place and will probably need to see a visual rendering to find your footing and continue. Mathup makes this problem worse than in AsciiMath proper, because in AsciiMath proper you are forced to at least parenthesize many of your sub-expressions, while here you are free to go wild with the whitespace.

The whitespace grouping is actually even more powerful than just for fractions, e.g. you can use it group terms around any infix (incl. sub- and superscripts) as well as after any prefix (such as sqrt): `e ^ -x^2/2 / sqrt 2pi` will give you the standard normal distribution. The rule is that if there is space between the operator and the operand it will operate on everything until the next applicable whitespace, the space between sqrt and 2pi applies the the sqrt prefix, and is not applicable to the fraction, but the space before slash is applicable to the ^ so the sqrt 2pi term are not apart of the superscript. I actually don’t recommend relying on this and just use parentheses for all but the simplest expressions (it is fine in sub-expressions though).

But like I said the target usecase is quick and easy expressions, so people that write a+b / c+d are favored over the ones that write `(e^(-(x^2)/2))/sqrt(2pi)` - but honestly I would write this as `e^(-(x^2)/2) / sqrt(2pi)`.

Re: Mathup: Easy MathML authoring tool with a quick to write syntax

#23
post #19

This is pretty much how I always wanted formulas in my notes to look like (but was too lazy to implement it myself, I guess). It's not even so much about fast input, it's about that it needs to be at least somewhat readable in plain text (not rendered), which LaTeX certainly isn't. Typing greek letters and stuff is not really a problem with XCompose, but TeX-based tools are too dumb to render "naïve" expressions pret…

> it seems not a huge computational task to figure out that ] is a `\right]`

TeX's design was finalised in 1982, when the computational resources were different by a few orders of magnitude. There is a very strong culture of backward compatibility (search for "A torture test for TeX") and there are so many equations written in TeX documents that it would be impossible to change the parsing now.

That said, something like MathJax would be free to create their own TeX-like syntax where parentheses are automatically paired.

I for one often find myself wanting more control, writing `\bigr]` or `\biggr]` instead of `\right]` to get the rendered equation to look good.

> And while rendering `(a+b)/a` as a `\frac` is opinionated, honestly, the only reason why this occurs in my notes is when I was too lazy to type `\frac{}{}`.

Plain TeX has the much nicer syntax `{a+b \over a}` but for some obscure reason LaTeX recommends against that.

Re: Mathup: Easy MathML authoring tool with a quick to write syntax

#24

Earlier quoted context omitted.

This is for authoring math expressions which compiles to MathML. MathML has the explicit design goal of being hard to write, and is much more meant to be a compiler target rather than for humans to write. This space is pretty dominated by LaTeX whom almost all professionals use, but is pretty verbose and not exactly easy to use for beginners (or even non-frequent users). Other than LaTeX we have Office Math, which is…

Casual users probably just want the GUI options with less care of what syntax that may eventually involve on the backend. People deep enough to care about writing everything in raw syntax probably want to stick with LaTeX and can have a program transform that to MathML or SVG whatever else they need for display. The "here's a special syntax which is neither all of A or B" is just a hard sell. On specific tools I've a…

I agree. Since it's all about writing math for presentation and not inputting math for calculation, having to learn a supplementary markup language to learn makes no sense. There is no way you get back the time invested in any meaningful way, unless you write math books for a leaving, I guess.

Some sort of keyboard only markup language for inputting complexe math calculation seem like something worthwhile at first glance. But then you realize that you still need some specialized keyboard keys (and/or macro) if you really want to have completely "inline" (single line).

But at the end you get something that's extremely unreadable and you find out that what's actually needed is computing software that both has a way to write and compute math as we used to on paper.

The 3D aspect is extremely important for comprehension/readability, the only time it makes sense to lay out the equation in some sort of inline markup is for rendering when it's part of a larger document compilation process. And plenty of people use Microsoft Word or some other sort of GUI to avoid even doing this...

Also, you realize that nowadays, pen tablets are extremely cheap and pen input is very simple, so what is really needed is the same type of software that exists on tablets to convert math pen input into formalized markup representation that the computer can understand (no need for the end user to see the underlying mechanics). And voilà, you can have math input without wasting too much time with a markup language.

Re: Mathup: Easy MathML authoring tool with a quick to write syntax

#25
If there had been something like this standardized in Markdown from the start, it might have had a chance for wide adoption. Right now, learning to see and use LaTeX math as easily as more ASCII-like notation is just more convenient since it is widely adopted (in GitHub, in VS Code, etc.). It's harder, but it also provides the added benefit of maintaining your LaTeX skills.

I think Google's Chrome team's choices of priorities bear a significant portion of the blame for this. They refused to implement MathML for the longest time, and even when it was implemented, it was partly done and financed by a third party. Without MathML, LaTeX-to-HTML JavaScript hacks became the norm, solidifying LaTeX as the standard even for non-typesetting use cases. Had MathML been implemented by Chrome early on, a more direct and easier translation from something ASCII-like to MathML would likely have been adopted.

Re: Mathup: Easy MathML authoring tool with a quick to write syntax

#27
post #24

Earlier quoted context omitted.

Casual users probably just want the GUI options with less care of what syntax that may eventually involve on the backend. People deep enough to care about writing everything in raw syntax probably want to stick with LaTeX and can have a program transform that to MathML or SVG whatever else they need for display. The "here's a special syntax which is neither all of A or B" is just a hard sell. On specific tools I've a…

I agree. Since it's all about writing math for presentation and not inputting math for calculation, having to learn a supplementary markup language to learn makes no sense. There is no way you get back the time invested in any meaningful way, unless you write math books for a leaving, I guess. Some sort of keyboard only markup language for inputting complexe math calculation seem like something worthwhile at first gl…

I think the real power comes when you have both a GUI and an initiative (though not always correct) keyboard input methods. Point and click can be slow, and if you are taking notes while attending a lecture, you probably don’t want to waste your valuable focus looking for the correct icon to write the thing, you just want to type `||a||^2` and hope it does the right thing (and if it doesn’t your temporary markup is obvious enough that you can return to it later).

Re: Mathup: Easy MathML authoring tool with a quick to write syntax

#28
post #26

Sounds cool! How is this different than https://asciimath.org ?

This is a dialect of AsciiMath. The major difference is in the implementation. AsciiMath proper is pretty tightly integrated with MathJax, while this just outputs standard MathML, and then you decide what to do with it.

Second difference is with supported MathML target output. Mathup is far more expressive (we even have tensor index notation in mathup). In mathup you can target your preferred MathML output in a way you can’t in AsciiMath. For example in mathup you can purposefully write any token element you want except . (``, \``, "", and #``), in AsciiMath if you want to wrote Gamma as an identifier (as opposed having it turn into the greek letter) or int as an operator (as opposed to an integral) you have to do it with . Here you can do `Gamma` for Gamma or \int for int.

Thirdly is some differences in syntax. Most noticeable is matrix notation, in AsciiMath you write [(row, one), (row, two)], while in mathup you write [row, one; row, two]. Another major syntax difference is how whitespace works. In mathup you can group pars of your expression together with whitespace, so a+b / c+d is not the same as a + b/c + d. In AsciiMath, you have to use parenthesis to do this.

Re: Mathup: Easy MathML authoring tool with a quick to write syntax

#29

The example on first hit made no sense for me, the markup and the result were completely unrelated. Maybe it's a server load issue.

Probably not, this is a static website, I pick a random equation from a pool of 10 on load time. Do you remember which one it showed? or tried to show?

Re: Mathup: Easy MathML authoring tool with a quick to write syntax

#30

The example on first hit made no sense for me, the markup and the result were completely unrelated. Maybe it's a server load issue.

Probably not, this is a static website, I pick a random equation from a pool of 10 on load time. Do you remember which one it showed? or tried to show?

The markup was something like ai = bj + ck + dl where i,j,k,l were superscripts. But there was a theta in there somewhere.

Sorry, I should've taken a screenshot.

Post reply on HN