I would like to create nametags like this:
This is the code I have so far.
// template
#set page(
height: 16.5cm,
width: 18cm,
margin: (left: 0cm, right: 0cm, top: 0cm, bottom: 0cm)
)
#set align(center)
#set text(16pt, fill: rgb("#444444"))
#let name-style(content) = {
text(20pt, content)
}
#let author-box(content) = {
set align(center + horizon)
box(
width: 100%,
height: 100%,
stroke: (paint: silver, thickness: 0.5pt, dash: "dashed"),
content
)
}
#let conf(
authors: (),
doc,
) = {
let count = authors.len()
let ncols = 2
let nrows = 4
grid(
columns: (1fr,) * ncols,
rows: (1fr,) * nrows,
row-gutter: 0cm,
..authors.map(author => author-box([
#author.name \
#author.affiliation \
#author.email
]))
)
}
// values
#show: doc => conf(
authors: (
(
name: "Theresa Tungsten",
affiliation: "Artos Institute",
email: "tung@artos.edu",
logo_left: "images/logo1.png",
logo_right: "images/logo2.png"
),
(
name: "Eugene Deklan",
affiliation: "Honduras State",
email: "e.deklan@hstate.hn",
),
(
name: "Eugene Deklan",
affiliation: "Honduras State",
email: "e.deklan@hstate.hn",
),
(
name: "Eugene Deklan",
affiliation: "Honduras State",
email: "e.deklan@hstate.hn",
),
(
name: "Eugene Deklan",
affiliation: "Honduras State",
email: "e.deklan@hstate.hn",
),
(
name: "Eugene Deklan",
affiliation: "Honduras State",
email: "e.deklan@hstate.hn",
)
),
doc,
)
It has been a struggle to get to this point. I would like to add two logos to the top left and top-right of each nametag.
grid(
columns: (1fr, 1fr),
row-gutter: 0pt,
align(left, image(author.logo_left, height: 6mm)),
align(right, image(author.logo_right, height: 6mm))
)
I can’t quite get this to work. Any help is appreciated.
Thanks!