#Trying to debug whitespace

21 messages · Page 1 of 1 (latest)

proud cipher
#

I'm working on a resume template for myself and i'm mostly happy with it except for the spacing.
It is uneven and i'm trying to figure out where its coming from.
Wrapping most things in block mostly works but i don't really want to clutter my main.typ with layout code.
I also don't know how to reduce the space further in that case.

Link for the version in the image: https://typst.app/project/r6f9Aia7JQiwvTFGb6_1ui

thin pike
#

i think you could try changing the heading spacing, e.g. #show heading: set block(spacing: 1em) or smth

#

as a last resort there's always #v(-0.5em) or similar

drowsy belfry
#

literally just adding that line as Pg suggested, with the default length .65 fixes it

  show heading: h => {
    set block(spacing: .65em)
    if h.level == 1 {
proud cipher
#

Yes, adjusting the spacing works, thank you

#

Just another question so i'm sure i understand this correctly: Does wrapping something in a block always just overwrite the spacing of the child element? I can't find anything about this in the documentation https://typst.app/docs/reference/layout/block/

thin pike
#

and in particular it is block-level

#

so it has block spacing

#

while a box is inline and has different semantics

#

it attempts to fit within the text flow

proud cipher
#

Not sure what this means. It just seems kind of weird to me that wrapping something reduces its space

thin pike
#

wdym?

#

the thing is that when you wrap something in a block, the "something" will be laid out in the context of the block, not of the page

#

so it's as if the page got reduced to a tiny part of it

#

for the element inside the block

proud cipher
#

Ah i see

thin pike
#

so it wont interact that well with other things around it, the block will be responsible for that instead

proud cipher
#

Okay, thanks

thin pike
#

you can observe that in a clearer manner by assigning a fixed width and height to the block

#

you'll see how the content tries to adjust itself to it