summaryrefslogtreecommitdiff
path: root/tests/typ/style/show.typ
blob: 9aabfb34bf07f598be0147a801d93697a606a826 (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 show rules.

#set page("a8", footer: p => v(-5pt) + align(right, [#p]))

#let i = 1
#set heading(size: 1em)
#show node: heading as {
  if node.level == 1 {
    v(10pt)
    underline(text(1.5em, blue)[{i}. {node.body}])
    i += 1
  } else {
    text(red, node.body)
  }
}

#v(-10pt)

= Aufgabe
Some text.

== Subtask
Some more text.

== Another subtask
Some more text.

= Aufgabe
Another text.

---
#set heading(size: 1em, strong: false, block: false)
#show _: heading as [B]
A [= Heading] C

---
// Error: 21-25 expected content, found string
#show _: heading as "hi"
= Heading

---
// Error: 22-29 dictionary does not contain key: "page"
#show it: heading as it.page
= Heading

---
// Error: 10-15 this function cannot be customized with show
#show _: upper as {}

---
// Error: 2-19 set, show and wrap are only allowed directly in markup
{show a: list as a}