How do I preserve `grid` `row-gutter` across multiple pages?

Greetings!

I’m using a grid and an array of names to create a series of placeholders for signatures in my document. I use the row-gutter parameter to provide the extra whitespace needed between entries. Something like this:

#set page(width: 300pt, height: 200pt)

#grid(
    columns: (1fr, 0.5fr),
    stroke: (top: 1pt),
    column-gutter: 0.25in,
    row-gutter: 1.25in,
    inset: (y: 6pt),
    ..for n in ("user1","user2","user3") {
      (n, [Date])
    },
)

This approach works well until there are enough names to cause the grid to shift to another page. The first row that appears on the new page is very close to the header instead of having the expected amount of whitespace:

I have 2 questions:

  1. Is this the intended behavior?
  2. Is there a way to ensure that the first line on the new page will have the set amount of white space?
  1. I think it is intended behaviour that a grid row wrapped over to a new page will have no gap above itself. It’s the same gap that user1 Date has to its page header, no?

  2. Is it an option to just increase the page margin?

Thanks, @sermuns.

  1. Maybe so, and I think you’re correct that the gaps for user1 and user3 relative to the header are the same.
  2. Sadly, no.

Sorry, I’m not understanding what end result you want. Could you possibly illustrate this? Maybe by hardcoding somethign?

Sure, something like this:

Ultimately, if I have enough signatories to force the list to a new page, I need there to be enough space at the top of the second page to actually insert the signature.

What about the space before the 1st signature?

Could you indicate with perhaps some text on page 1 how the end result will look like in its entirety?

Sure, @vmartel08.

The actual document includes a vertical space before the grid, similar to:

Approvals:
#v(1.25in)

#grid(
    columns: (1fr, 0.5fr),
    stroke: (top: 1pt),
    column-gutter: 0.25in,
    row-gutter: 1.25in,
    inset: (y: 6pt),
    ..for n in ("user1","user2") {
      (n, [Date])
    },
)

The vertical space is the same as the row-gutter for the grid. If I hard-code the result that I want, it would look something like this:

With the second line pushed to the next page with enough room at the top to apply the signature. Instead of:

1 Like

One way to do that is to consider the vertical space not as a gutter but as part of the cells. For example by doing something like this:

#let c(text) = {
  box(stack(v(1.25in),line(length: 100%),v(6pt),text))
}

Approvals:
#grid(
    columns: (1fr, 0.5fr),
    column-gutter: 0.25in,
    ..for n in ("user1","user2") {
      (c(n), c[Date])
    },
)

In this way you also avoid having to add the space before the grid.

3 Likes

Apologies for the delay. @LucaD, your solution worked well. Thank you all for your help!