mirror of
https://github.com/typst/typst
synced 2025-05-17 02:25:27 +08:00
- Fixes #873 by properly handling `none` supplement for`ref`. - Fixes #523 by adding a `supplement` parameter to `math.equation` - In the future, we can remove supplement functions in favor of show-set rules with fine-grained selectors. Currently, this is not possible because show-set + synthesis doesn't play well together
49 lines
777 B
Typst
49 lines
777 B
Typst
// Test references.
|
|
|
|
---
|
|
#set heading(numbering: "1.")
|
|
|
|
= Introduction <intro>
|
|
See @setup.
|
|
|
|
== Setup <setup>
|
|
As seen in @intro, we proceed.
|
|
|
|
---
|
|
// Error: 1-5 label does not exist in the document
|
|
@foo
|
|
|
|
---
|
|
= First <foo>
|
|
= Second <foo>
|
|
|
|
// Error: 1-5 label occurs multiple times in the document
|
|
@foo
|
|
|
|
---
|
|
#set heading(numbering: "1.", supplement: [Chapter])
|
|
#set math.equation(numbering: "(1)", supplement: [Eq.])
|
|
|
|
= Intro
|
|
#figure(
|
|
image("/cylinder.svg", height: 1cm),
|
|
caption: [A cylinder.],
|
|
supplement: "Fig",
|
|
) <fig1>
|
|
|
|
#figure(
|
|
image("/tiger.jpg", height: 1cm),
|
|
caption: [A tiger.],
|
|
supplement: "Tig",
|
|
) <fig2>
|
|
|
|
$ A = 1 $ <eq1>
|
|
|
|
#set math.equation(supplement: none)
|
|
$ A = 1 $ <eq2>
|
|
|
|
@fig1, @fig2, @eq1, (@eq2)
|
|
|
|
#set ref(supplement: none)
|
|
@fig1, @fig2, @eq1, @eq2
|