summaryrefslogtreecommitdiff
path: root/tests/typ/layout/terms.typ
blob: 6e8280947839b89283460396b5026b2c0546d979 (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
// Test term list.

---
// Test with constructor.
#terms(
  ([One], [First]),
  ([Two], [Second]),
)

---
// Test joining.
#for word in lorem(4).split().map(s => s.trim(".")) [
  / #word: Latin stuff.
]

---
// Test multiline.
#set text(8pt)

/ Fruit: A tasty, edible thing.
/ Veggie:
  An important energy source
  for vegetarians.

---
// Test style change.
#set text(8pt)
/ First list: #lorem(6)

#set terms(hanging-indent: 30pt)
/ Second list: #lorem(5)

---
// Test grid like show rule.
#show terms: it => table(
  columns: 2,
  inset: 3pt,
  ..it.items.map(item => (emph(item.at(0)), item.at(1))).flatten(),
)

/ A: One letter
/ BB: Two letters
/ CCC: Three letters

---
/ Term:
Not in list
/Nope

---
// Error: 8 expected colon
/ Hello