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
8 changes: 5 additions & 3 deletions src/resources/filters/crossref/equations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ function process_equations(blockEl)
targetInlines:insert(pandoc.RawInline("latex", "\\end{equation}"))

elseif _quarto.format.isTypstOutput() then
local is_block = eq.mathtype == "DisplayMath" and "true" or "false"
targetInlines:insert(pandoc.RawInline("typst",
"#set math.equation(numbering: \"(" .. inlinesToString(numberOption("eq", order)) .. ")\"); " ..
"$ " .. eq.text .. " $ <" .. label .. "> #set math.equation(numbering: none)"
))
"#math.equation(block: " .. is_block .. ", numbering: \"(" .. inlinesToString(numberOption("eq", order)) .. ")\", " ..
"[ "))
targetInlines:insert(eq)
targetInlines:insert(pandoc.RawInline("typst", " ])<" .. label .. ">"))
else
local eqNumber = eqQquad
local mathMethod = param("html-math-method", nil)
Expand Down
17 changes: 17 additions & 0 deletions tests/docs/smoke-all/2023/11/29/7744.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: issue-7744
format: typst
keep-typ: true
---

$$
\begin{aligned}
\frac{dS_1}{dt} &= -\frac{\rho \beta S_1(c_{11} I_1 + c_{12} I_2)}{N} \\
\frac{dS_2}{dt} &= -\frac{\beta S_2(c_{12} I_1 + c_{22} I_2)}{N} \\
\frac{dI_1}{dt} &= \frac{ \rho \beta S_1(c_{11} I_1 + c_{12} I_2)}{N} - \gamma I_1 \\
\frac{dI_2}{dt} &= \frac{\beta S_2(c_{12} I_1 + c_{22} I_2)}{N} - \gamma I_2 \\
\frac{dR_1}{dt} &= \gamma I_1 \\
\frac{dR_2}{dt} &= \gamma I_2
\end{aligned}
$$ {#eq-model}