How to place content fixed on a page and the rest of the content below?

This is very elegant, but note that if Content 2 is long it won’t break onto the next page, even if grid.cell.breakable is set to true (which seems like a bug?).

You are right that my solution errors out if the page margins are a dictionary, i’ve edited my answer accordingly. Whereas for behaviour, if Content 1 should be placed in the center of the margined area, my previous answer behaves as expected. If it should be placed in the center regardless of margins, we can get rid of the margin calculations altogether:

#let force-center(content) = layout(container => [
  #let content-height = measure(content, width: container.width).height
  #let offset = here().position().y
  // the offset ensures that content is in the center even if the page is not empty
  
  #pad(
    top: (page.height - content-height) / 2 - offset,
    content
  )
])
1 Like