typstyle icon indicating copy to clipboard operation
typstyle copied to clipboard

Better format for math equation

Open Enter-tainer opened this issue 1 year ago • 2 comments

What will it looks like?

Enter-tainer avatar Apr 03 '24 03:04 Enter-tainer

I'd appreciate if operators had spaces around them, so

$
  x=y+1*3
$

Would become:

$
  x = y + 1 * 3
$

However, I'd make an exception for /, because I think this:

$
  x = 1 + 2 / 3
$

Is less clear than this:

$
  x = 1 + 2/3
$

llakala avatar Oct 13 '25 05:10 llakala

I'd appreciate if operators had spaces around them, so

$
  x=y+1*3
$

Would become:

$
  x = y + 1 * 3
$

That is impractical. We cannot identify whether the symbol + is really a binary operator, and spaces matter here.

If the user reparses the equation and uses symbols like = for a different semantics (maybe combined with others), the formatting result will be bad.

QuadnucYard avatar Oct 13 '25 05:10 QuadnucYard