Improve equation reference example (#6481)

This commit is contained in:
Andrew Voynov 2025-06-24 15:49:28 +03:00 committed by GitHub
parent 87c5686560
commit f162c37101
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,16 +91,13 @@ use crate::text::TextElem;
/// #show ref: it => { /// #show ref: it => {
/// let eq = math.equation /// let eq = math.equation
/// let el = it.element /// let el = it.element
/// if el != none and el.func() == eq { /// // Skip all other references.
/// // Override equation references. /// if el == none or el.func() != eq { return it }
/// link(el.location(),numbering( /// // Override equation references.
/// el.numbering, /// link(el.location(), numbering(
/// ..counter(eq).at(el.location()) /// el.numbering,
/// )) /// ..counter(eq).at(el.location())
/// } else { /// ))
/// // Other references as usual.
/// it
/// }
/// } /// }
/// ///
/// = Beginnings <beginning> /// = Beginnings <beginning>