How to change spacing between a paragraph and the next subheading?

Hi everybody, I’m new to Typst and have a layout question:

image

As you can see in the image, the spacing above and below my list isn’t equal. I have #set par(spacing: 2em) so the spacing between paragraphs is 2 em. But this doesn’t apply to the space between a paragraph/list and the next subheading. How do I make this space (below the list) 2 em as well?

Thanks.

Hey @jddotdk, welcome to the forum! I’ve changed your question post’s title to better fit our guidelines: How to post in the Questions category

For future posts, please make sure your title is a question you’d ask to a friend about Typst. :wink:

1 Like

Hi again,

I fixed the spacing by putting #v(2em, weak: true) after the list.

If you don’t want to insert the spacing elements by hand all the time, you can also set the spacing around headings once via a show-set rule. You can then also filter them by level:

#show heading: set block(above: 2em, below: 1em)
#show heading.where(level: 1): set block(spacing: 2em) // both above and below

Note that when using em units here, they are relative to the heading’s font size, which is usually larger than the font size of the main text!

1 Like