typst/tests/typ/text/par.typ
2022-11-09 18:20:02 +01:00

47 lines
1023 B
Typst

// Test configuring paragraph properties.
---
// Test ragged-left.
#set par(align: right)
To the right! Where the sunlight peeks behind the mountain.
---
// Test changing leading and spacing.
#set block(spacing: 1em)
#set par(leading: 2pt)
But, soft! what light through yonder window breaks?
It is the east, and Juliet is the sun.
---
// Test that paragraph spacing loses against block spacing.
// TODO
// #set block(spacing: 100pt)
// #show table: set block(spacing: 5pt)
#set block(spacing: 5pt)
Hello
#table(columns: 4, fill: (x, y) => if odd(x + y) { silver })[A][B][C][D]
---
// While we're at it, test the larger block spacing wins.
#set block(spacing: 0pt)
#show raw: it => { set block(spacing: 15pt); it }
#show math: it => { set block(spacing: 7.5pt); it }
#show list: it => { set block(spacing: 2.5pt); it }
```rust
fn main() {}
```
- List
Paragraph
---
// Error: 17-20 must be horizontal
#set par(align: top)
---
// Error: 17-33 expected alignment, found 2d alignment
#set par(align: horizon + center)