How to add lines around all grid items?
Here is the code I have so far:
// template
#set page(height: 16.5cm, width: 18cm,
margin: (left: 1cm, right: 1cm, top: 1cm, bottom: 1cm))
#set text(14pt, fill: rgb("#444444"))
#let conf(
authors: (),
doc,
) = {
let count = authors.len()
let ncols = calc.min(count, 2)
let nrows = 4
set align(center)
set page(
background: grid(
columns: (1fr,) * ncols,
rows: (1fr,) * nrows,
row-gutter: 1cm,
block(height: 100%, width: 100%,
stroke: (paint: silver, thickness: 1pt, dash: "dashed")
)
)
)
grid(
columns: (1fr,) * ncols,
rows: (1fr,) * nrows,
row-gutter: 1cm,
..authors.map(author => [
#author.name \
#author.affiliation \
#link("mailto:" + author.email)
])
)
}
// values
#show: doc => conf(
authors: (
(
name: "Theresa Tungsten",
affiliation: "Artos Institute",
email: "[email protected]",
),
(
name: "Eugene Deklan",
affiliation: "Honduras State",
email: "[email protected]",
),
(
name: "Eugene Deklan",
affiliation: "Honduras State",
email: "[email protected]",
),
(
name: "Eugene Deklan",
affiliation: "Honduras State",
email: "[email protected]",
),
),
doc,
)

Generally, you want to style elements instead of the page. This can be accomplished with a simple helper function that takes your content and formats it using a
boxwith your stroke.A few notes:
width/height: 100%insideauthor-boxmeans the box will size to its full container, which is the grid cell. So if you change how big the grid makes its cells, the box will fill that space. You can alternatively setoutsetorinsetto keep a fixed margin around the content: https://typst.app/docs/reference/layout/box/#parameters-outsetcolumn-gutterto your grid.