plurimath / html2asciimath

MIT License
0 stars 1 forks source link

Preference on output layout #1

Open skalee opened 3 years ago

skalee commented 3 years ago

AsciiMath is quite liberal when it comes to spacing. All of following are correct and equivalent:

  1. sum_(i=1)^ni^3=((n(n+1))/2)^2
  2. sum _ ( i = 1 ) ^ n i ^ 3 = ( ( n ( n + 1 ) ) / 2 ) ^ 2
  3. sum_(i = 1)^n i^3 = ((n (n + 1)) / 2)^2

And they render to:

Zrzut ekranu 2021-03-20 o 16 23 08

Which style is preferred? IMO third one is the best, but it involves some spacing rules, so obviously it will be more difficult to implement than the other ones. The other two are very straightforward to implement, with the reservation that in the "never add spaces" mode there is a small risk that a sequence of variables will collide with a reserved word, e.g. sum and s u m have different meanings. There is no such danger in "always add spaces" mode AFAIK.

@ronaldtse WDYT?

ronaldtse commented 3 years ago

As long as asciimath works it’s fine.