Reputation: 21
How to change the paragraph spacing in Typst? Do we have any codes to perform it? It seems the function par() is not the case.......
I tried to look for the relevant codes, but I failed to find them. Any suggestions, mates?
Upvotes: 2
Views: 2005
Reputation: 1
Since this the first result appeared on google when I searched "typst double line spacing", here is a solution to double spacing for you:
#set par(
justify: true,
leading: 2em,
spacing: 3em
)
#show heading: it => [
#set par(
leading: 1em,
spacing: 1em
)
#it.body
]
I added the show rule for headings since if there is a 2-line or 3-line heading, it will also have a huge spacing.
Upvotes: 0
Reputation: 1450
Do you mean the spacing between paragraphs, or lines in the paragraph?
leading
controls the spacing between lines:
#set par(leading: 2em)
#lorem(100)
A block's spacing
controls the distance between paragraphs:
#set block(spacing: 4em)
#lorem(30)
#lorem(30)
Upvotes: 4