summaryrefslogtreecommitdiff
path: root/tests/typ/structure/enum.typ
blob: 24c28147bc148ffaebfd585c6df4f7d9e9f5a8dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Test enums.

---
. Embrace
. Extend
. Extinguish

---
1. First.
   2. Second.

1. Back to first.

---
2. Second
1. First
  . Indented

---
// Test automatic numbering in summed content.
#for i in range(5) {
   [. #roman(1 + i)]
}

---
// Test label pattern.
#set enum(label: "~ A:")
. First
. Second

#set enum(label: "(*)")
. A
. B
. C

#set enum(label: "i)")
. A
. B

---
// Test label closure.
#enum(
   start: 4,
   spacing: -3pt,
   label: n => text(fill: (red, green, blue)(mod(n, 3)), [#upper(letter(n))]),
   [Red], [Green], [Blue],
)

---
// Error: 18-20 invalid pattern
#set enum(label: "")

---
// Error: 18-24 invalid pattern
#set enum(label: "(())")

---
// Error: 18-28 expected content, found boolean
#set enum(label: n => false)
. A