logoalt Hacker News

kragenyesterday at 10:40 PM1 replyview on HN

When you render it for proper typesetting, do the parentheses around dy/dx disappear? (Oh, I guess you've removed them in your edit.)

If they do, it seems like an error-prone way to write your math.

If they don't, it seems like it will make your math look terrible.

Supposing that the parentheses aren't necessary, as implied by your edit: how does AsciiMath determine that e^y isn't in the numerator in "e^y dy/dx", or (worse) in the denominator in "d/dx e^y"?

It seems somewhat less noisy than the LaTeX version, but not much; assuming I can insert whitespace harmlessly:

  \frac d{dx}e^y = e^y\frac{dy}{dx} = 1
        d/dx e^y = e^y      dy/dx   = 1

  \frac d{dx}e^y = \frac d{dx}x = 1
        d/dx e^y =       d/dx x = 1

Replies

bmachotoday at 12:09 AM

Here is an online renderer and the description: https://asciimath.org/

The rules are basically the same as LaTeX, with saner symbol names, support for fractions, \ is not needed before symbols and () can be used instead of {}.

> Supposing that the parentheses aren't necessary, as implied by your edit: how does AsciiMath determine that e^y isn't in the numerator in "e^y dy/dx"

It seems to me that dx,dy,dz,dt behave like numbers, single letter variables and symbols (probably they are symbols, but not listed for some reason). Just as LaTeX doesn't need {} parentheses for numbers, single letter variables and symbols, AsciiMath allows omitting them too.

So `/` captures a single number/symbol/variable left to it, and that is `dy`. But if there was `du` for example it would only capture u, and you would need to put du between parentheses.

show 1 reply