jgm / typst-hs

Haskell library for parsing and evaluating typst
Other
42 stars 5 forks source link

Typst math formulas: number followed by dot ("1.") leads to parse error #50

Closed nullst closed 3 months ago

nullst commented 3 months ago

Explain the problem. Running pandoc --from typst --to latex - and entering $1.$ results in parsing error:

(line 1, column 4):
unexpected "$"
expecting digit

Expected output: $1.$. This is considered a valid formula by both typst and LaTeX.

This is a minimal example, but the issue occurs quite commonly in practice. A more realistic example is a display formula at the end of a sentence, something like this:

Thus we obtain a short exact sequence
$ 0 -> A -> B -> C -> 0. $

Pandoc version?

I am using pandoc 3.2.1 on PopOS. The issue also appears in the online version.

jgm commented 3 months ago

Moving to typst-hs, which does the parsing of typst formulas.