Reference numbered equations.
This commit is contained in:
parent
121e5f7758
commit
0adad39a50
|
@ -58,7 +58,8 @@
|
|||
if name == "" {
|
||||
math.equation(numbering: numbering-equation, block: true)[#body]
|
||||
} else {
|
||||
counter(math.equation).update(n => calc.max(0, n - 1))
|
||||
math.equation(numbering: it => "(" + name + ")", block: true)[#body]
|
||||
// Hacky.
|
||||
let cmd = counter(math.equation).update(n => calc.max(0, n - 1))
|
||||
math.equation(numbering: it => "(" + name + ")", block: true)[#body#place(left, cmd)]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,21 @@
|
|||
set math.mat(delim: "[", row-gap: 0.65em, column-gap: 1em)
|
||||
set math.vec(delim: "[", gap: 0.65em)
|
||||
|
||||
/* Show references to equations without leading text. */
|
||||
show ref: it => {
|
||||
let eq = math.equation
|
||||
let el = it.element
|
||||
|
||||
if el != none and el.func() == eq {
|
||||
numbering(
|
||||
el.numbering,
|
||||
..counter(eq).at(el.location())
|
||||
)
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}
|
||||
|
||||
/* Show headings like in asmart. */
|
||||
show heading: it => {
|
||||
set block(above: 1.8em, below: 1.2em)
|
||||
|
|
Loading…
Reference in New Issue