How to repeat a template multiple times?

You can make it simpler:

#let article(doc, title: "", subtitle: "", author: "") = {
  set page(columns: 2)
  set heading(offset: 1)
  show heading: set text(16.1pt, weight: "bold", font: "Myriad Pro")
  show heading.where(level: 1): none
  let bold = text.with(weight: "bold", font: "Myriad Pro")
  let place = place.with(top, scope: "parent", float: true)
  heading(level: 1, emph(title) + " (" + author + ")")
  place(bold(18.2pt, title))
  if subtitle.len() > 0 { place(bold(17.15pt, subtitle)) }
  place(author)
  doc
}

#outline(target: heading.where(level: 1), title: "Articles")

#[
  #show: article.with(title: "title one", author: "author one")

  = Section 1
  == Subsection 1
  = Section 2
]

#[
  #show: article.with(title: "title two", subtitle: "Subtitle", author: "author two")

  = Section 1
  == Subsection 1
  = Section 2
]

image

image image

image

1 Like