1= Layout2
3Typst provides fine control over page setup, columns, and spacing.4
5== Page setup6
7#set page(8 paper: "a4",9 margin: (x: 2.5cm, y: 3cm),10 numbering: "1 / 1",11 header: align(right)[_Layout Demo_],12)13
14This page uses A4 paper with custom margins, page numbers, and a header.15
16== Columns17
18#columns(2)[19 Two-column layout is useful for dense content like reference material or academic papers.20
21 Text flows naturally from the first column into the second column when the first one fills up.22
23 #colbreak()24
25 This is the second column. Use `#colbreak()` to force a column break at a specific point.26
27 Columns work well for lists, definitions, and short paragraphs.28]29
30== Spacing31
32Vertical spacing with `#v()`:33
34First paragraph.35
36#v(1em)37
38Extra space above this paragraph.39
40#v(2em)41
42Even more space above this one.43
44Horizontal spacing with `#h()`: word#h(2em)gap#h(4em)bigger gap.45
46== Boxes and blocks47
48A box is inline: #box(stroke: 1pt, inset: 4pt)[boxed text] within a line.49
50A block is its own paragraph:51
52#block(53 width: 100%,54 fill: luma(240),55 stroke: luma(200),56 inset: 12pt,57 radius: 4pt,58)[59 This is a styled block element. Use blocks for callouts, notes, or highlighted content.60]61
62== Alignment63
64#align(center)[Centered text]65
66#align(right)[Right-aligned text]67
68#align(center)[69 #block(width: 60%)[70 This block is centered and takes 60% of the page width. Useful for narrow content in wide layouts.71 ]72]73
74== Page break75
76Content before the break.77
78#pagebreak()79
80= Second Page81
82This content appears on a new page. v1
commit dfd90b7
message create layout.typ via macOS
author anton
date Apr 18, 2026
size 1.5 KB