Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/Text/TeXMath/Writers/Typst.hs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ writeExp (EMathOperator s)
= s
| otherwise = "\"" <> s <> "\""
writeExp (EGrouped es) = writeExps es
writeExp (EFraction NoLineFrac e1 e2) =
"mat(delim: #none, " <> mkArray [[[e1]], [[e2]]] <> ")"
writeExp (EFraction _fractype e1 e2) =
case (e1, e2) of
(EGrouped _, _) -> "frac(" <> writeExp e1 <> ", " <> writeExp e2 <> ")"
Expand Down
2 changes: 1 addition & 1 deletion test/writer/typst/choose.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
]
]
>>> typst
binom(a, {frac(b, c + 2)})
binom(a, {mat(delim: #none, b; c + 2)})
2 changes: 1 addition & 1 deletion test/writer/typst/genfrac.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
]
]
>>> typst
{x / y}
{mat(delim: #none, x; y)}
9 changes: 9 additions & 0 deletions test/writer/typst/nolinefrac.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<<< tex
{a \atop b} \quad
\genfrac{}{}{0pt}{}{a + b}{c + d} \quad
\genfrac{[}{]}{0pt}{}{a}{b} \quad
\genfrac{}{}{0pt}{}{}{b} \quad
\genfrac{}{}{0pt}{}{a}{} \quad
\binom{a}{b} \quad \frac{a}{b}
>>> typst
mat(delim: #none, a; b) quad mat(delim: #none, a + b; c + d) quad [mat(delim: #none, a; b)] quad mat(delim: #none, #none; b) quad mat(delim: #none, a; #none) quad binom(a, b) quad a / b
Loading