mirror of
https://github.com/typst/typst
synced 2025-06-25 23:02:52 +08:00
Improve equation reference example (#6481)
This commit is contained in:
parent
87c5686560
commit
f162c37101
@ -91,16 +91,13 @@ use crate::text::TextElem;
|
||||
/// #show ref: it => {
|
||||
/// let eq = math.equation
|
||||
/// let el = it.element
|
||||
/// if el != none and el.func() == eq {
|
||||
/// // Skip all other references.
|
||||
/// if el == none or el.func() != eq { return it }
|
||||
/// // Override equation references.
|
||||
/// link(el.location(),numbering(
|
||||
/// link(el.location(), numbering(
|
||||
/// el.numbering,
|
||||
/// ..counter(eq).at(el.location())
|
||||
/// ))
|
||||
/// } else {
|
||||
/// // Other references as usual.
|
||||
/// it
|
||||
/// }
|
||||
/// }
|
||||
///
|
||||
/// = Beginnings <beginning>
|
||||
|
Loading…
x
Reference in New Issue
Block a user