mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
37 lines
629 B
Typst
37 lines
629 B
Typst
// Test the `h` and `v` functions.
|
|
|
|
---
|
|
// Linebreak and leading-sized weak spacing are equivalent.
|
|
#box[A \ B] #box[A #v(0.65em, weak: true) B]
|
|
|
|
// Eating up soft spacing.
|
|
Inv#h(0pt)isible
|
|
|
|
// Multiple spacings in a row.
|
|
Add #h(10pt) #h(10pt) up
|
|
|
|
// Relative to area.
|
|
#let x = 25% - 4pt
|
|
|#h(x)|#h(x)|#h(x)|#h(x)|
|
|
|
|
// Fractional.
|
|
| #h(1fr) | #h(2fr) | #h(1fr) |
|
|
|
|
---
|
|
// Test spacing collapsing before spacing.
|
|
#set align(right)
|
|
A #h(0pt) B #h(0pt) \
|
|
A B \
|
|
A #h(-1fr) B
|
|
|
|
---
|
|
// Test RTL spacing.
|
|
#set text(dir: rtl)
|
|
A #h(10pt) B \
|
|
A #h(1fr) B
|
|
|
|
---
|
|
// Missing spacing.
|
|
// Error: 11-13 missing argument: amount
|
|
Totally #h() ignored
|