#Justify vertically / fill entire page
25 messages · Page 1 of 1 (latest)
?r t=l pagesize=default
top
#v(1fr)
bottom
this will create vertical space that fills as much as it can
for a uniform bottom margin, you can also just set a margin with #set page() ofc
Thanks for the anwser.
Putting #v(1fr) between each paragraph works, but feels a bit messy.
I believe that this is a one line command in latex for the entire document.
This is quite an extreme example. But I would like to put this on all of my pages, so that the bottom line will not be jagged.
setting the margin did not fix this issue
Glue in Typst basically
?r t=l pagesize=default
#show par: set block(below: 1fr, above: 1fr)
#lorem(50)
#lorem(50)
#lorem(50)
#lorem(50)
#lorem(50)
#lorem(50)
You can achieve something like this, but it kind of looks odd when you only have 2 paragraphs on a page, i.e.
?r t=l pagesize=default
#show par: set block(below: 1fr, above: 1fr)
#lorem(50)
#lorem(50)
Or you could do something a little cumbersome like this:
?r t=l pagesize=default
#let spaced_page(first, content) = page([
#first
#show par: set block(above: 1fr)
#content
])
#spaced_page[
//First paragraph
#lorem(50)
][
#lorem(50)
#lorem(50)
#lorem(50)
#lorem(50)
#lorem(50)
]
Which is basically just, put the first paragraph, then put a 1fr above every paragraph after that for the page
Thanks for all your answers.
The below/above solution seems to not play nicely with my header, and other page content :/.
The other one is indeed quite cumbersome.
My goal was to mimic the layout of my double sided latex paper which uses the \flushbottom command to space pages evenly.
From what I understand there is no such thing in typst currently, which is fine.
There is a GitHub issue for a glue equivalent
https://github.com/typst/typst/issues/3442
The main argument against it in the issue seems to be "looks bad, therefore it shouldn't be possible"
seems to presuppose that vertical justification would be a forced feature and that there wouldn't be any other uses for stretching/shrinking
Like a lot of design approaches it looks bad if it's used badly! For a couple of purposes such as lots of short entries in tight, maybe multi-column layouts (glossaries, indices, other stuff in appendices...) it can have its uses.
Agreed