diff options
| author | John MacFarlane <[email protected]> | 2025-04-26 17:32:45 -0700 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2025-04-26 17:32:45 -0700 |
| commit | 8e9d90504ca95ae28a0ab0dc6f1e13c05b7b71fb (patch) | |
| tree | a295c20a2d1994d9f9f0ee042cdbb5f10725e4d1 | |
| parent | fb5499d7af1654bdcb93247950d72baffa562d98 (diff) | |
Typst writer: handle equation labels with spaces.
Closes #10805.
| -rw-r--r-- | src/Text/Pandoc/Writers/Typst.hs | 2 | ||||
| -rw-r--r-- | test/command/10805.md | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs index d18b0fde3..d0c92c8ac 100644 --- a/src/Text/Pandoc/Writers/Typst.hs +++ b/src/Text/Pandoc/Writers/Typst.hs @@ -386,7 +386,7 @@ inlineToTypst inline = Right r -> (case extractLabel str of -- #10805 Nothing -> id - Just lab -> (<> ("<" <> literal lab <> ">"))) <$> + Just lab -> (<> (toLabel FreestandingLabel lab))) <$> case mathType of InlineMath -> return $ "$" <> literal r <> "$" DisplayMath -> return $ "$ " <> literal r <> " $" diff --git a/test/command/10805.md b/test/command/10805.md index e3d02bc51..a25f695ac 100644 --- a/test/command/10805.md +++ b/test/command/10805.md @@ -7,3 +7,13 @@ ^D $ U = A $<eq:U> ``` + +``` +% pandoc -t typst -f latex +\begin{equation} + \label{eq:U 2} + U = A +\end{equation} +^D +$ U = A $#label("eq:U 2") +``` |
