2 ms·
I'm a Typst fan, although I don't use it much, and I don't really use it for math. If you're not much of a Unicode person, you can write this: $ x = (-b plus.
by adiabatty 3y ago
I'm a Typst fan, although I don't use it much, and I don't really use it for math.
If you're not much of a Unicode person, you can write this:
$ x = (-b plus.minus sqrt(b^2 - 4 a c))/(2a) $
If you're more of a Unicode person, you can write this, and it means the same thing AFAICT:
$ x = (-b ± √(b^2 - 4 a c))/(2a) $
You can also put newlines in this, and it works just fine:
$ x =
(-b ± √(b² - 4 a c))
/
(2a)
$
Both ± and √ have been on Mac keyboards, if you hold down the Option key, since probably 1984. Using ² instead of ^2 doesn't give me the same output, though.
A Typst Unicoderator could make this transformation for you, but I don't think one's been written yet. An automatic linebreaker à la Prettier sounds like an even more difficult challenge.
There's UnicodeMath, defined at <https://www.unicode.org/notes/tn28/UTN28-PlainTextMath-v3.2.pdf https://www.unicode.org/notes/tn28/UTN28-PlainTextMath-v3.2....> and <https://unicodemath.org https://unicodemath.org> says there's a UnicodeMath to MathML converter at <https://github.com/MurrayIII/UnicodeMathML/tree/main https://github.com/MurrayIII/UnicodeMathML/tree/main>. All UnicodeMath seems to get you over Typst in this instance is superscript support.