summaryrefslogtreecommitdiff
path: root/tests/typ/layout/align.typ
blob: 98ee8da5c5072b8b23755a469715cdcd85d1d14e (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 alignment.

---
#set page(height: 100pt)
#stack(dir: ltr,
  align(left, square(size: 15pt, fill: eastern)),
  align(center, square(size: 20pt, fill: eastern)),
  align(right, square(size: 15pt, fill: eastern)),
)
#align(center + horizon, rect(fill: eastern, height: 10pt))
#align(bottom, stack(
  align(center, rect(fill: conifer, height: 10pt)),
  rect(fill: forest, height: 10pt, width: 100%),
))

---
// Test that multiple paragraphs in subflow also respect alignment.
#align(center)[
  Lorem Ipsum

  Dolor
]

---
// Test start and end alignment.
#rotate(-30deg, origin: end + horizon)[Hello]

#set text(lang: "de")
#align(start)[Start]
#align(end)[Ende]

#set text(lang: "ar")
#align(start)[يبدأ]
#align(end)[نهاية]

---
// Ref: false
#test(type(center), alignment)
#test(type(horizon), alignment)
#test(type(center + horizon), alignment)

---
// Error: 8-22 cannot add two horizontal alignments
#align(center + right, [A])

---
// Error: 8-20 cannot add two vertical alignments
#align(top + bottom, [A])

---
// Error: 8-30 cannot add a vertical and a 2D alignment
#align(top + (bottom + right), [A])