summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/meta/ref.typ100
1 files changed, 13 insertions, 87 deletions
diff --git a/tests/typ/meta/ref.typ b/tests/typ/meta/ref.typ
index 2bed2125..a62e6cce 100644
--- a/tests/typ/meta/ref.typ
+++ b/tests/typ/meta/ref.typ
@@ -21,102 +21,28 @@ As seen in @intro, we proceed.
@foo
---
+#set heading(numbering: "1.", supplement: [Chapter])
+#set math.equation(numbering: "(1)", supplement: [Eq.])
-#show ref: it => {
- if it.element != none and it.element.func() == figure {
- let element = it.element
- "["
- element.supplement
- "-"
- str(element.counter.at(element.location()).at(0))
- "]"
- // it
- } else {
- it
- }
-}
-
+= Intro
#figure(
- image("/cylinder.svg", height: 3cm),
- caption: [A sylinder.],
+ image("/cylinder.svg", height: 1cm),
+ caption: [A cylinder.],
supplement: "Fig",
) <fig1>
#figure(
- image("/tiger.jpg", height: 3cm),
+ image("/tiger.jpg", height: 1cm),
caption: [A tiger.],
- supplement: "Figg",
+ supplement: "Tig",
) <fig2>
-#figure(
- $ A = 1 $,
- kind: "equation",
- supplement: "Equa",
-
-) <eq1>
-@fig1
-
-@fig2
-
-@eq1
-
----
-#set heading(numbering: (..nums) => {
- nums.pos().map(str).join(".")
- }, supplement: [Chapt])
-
-#show ref: it => {
- if it.element != none and it.element.func() == heading {
- let element = it.element
- "["
- emph(element.supplement)
- "-"
- numbering(element.numbering, ..counter(heading).at(element.location()))
- "]"
- } else {
- it
- }
-}
-
-= Introduction <intro>
-
-= Summary <sum>
-
-== Subsection <sub>
-
-@intro
-
-@sum
-
-@sub
-
----
-
-#show ref: it => {
- if it.element != none {
- if it.element.func() == text {
- let element = it.element
- "["
- element
- "]"
- } else if it.element.func() == underline {
- let element = it.element
- "{"
- element
- "}"
- } else {
- it
- }
- } else {
- it
- }
-}
+$ A = 1 $ <eq1>
-@txt
+#set math.equation(supplement: none)
+$ A = 1 $ <eq2>
-Ref something unreferable <txt>
+@fig1, @fig2, @eq1, (@eq2)
-@under
-#underline[
-Some underline text.
-] <under>
+#set ref(supplement: none)
+@fig1, @fig2, @eq1, @eq2