mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
46 lines
960 B
Typst
46 lines
960 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(above: 5pt, below: 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: set block(spacing: 15pt)
|
|
#show math: set block(spacing: 7.5pt)
|
|
#show list: set block(spacing: 2.5pt)
|
|
|
|
```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)
|