How to put content only on left pages

I guess it’s not impossible. You could write something like this:

#let grid-paper(filter: _ => true, content) = {
  let grid-color = rgb("#CCCCCC")
  let grid-spacing = 5mm
  
  set page(
    paper: "a4",
    margin: (x: 2cm, y: 2cm),
    background: {
      context if filter(here().page()) {  // n'affiche la grille que sur les pages paires
        // Lignes verticales
        for x in range(int(page.width / grid-spacing)) {
          place(
            line(
              start: (x * grid-spacing, 0pt),
              end: (x * grid-spacing, page.height),
              stroke: (paint: grid-color, thickness: 0.2pt)
            )
          )
        }
        // Lignes horizontales
        for y in range(int(page.height / grid-spacing)) {
          place(
            line(
              start: (0pt, y * grid-spacing),
              end: (page.width, y * grid-spacing),
              stroke: (paint: grid-color, thickness: 0.2pt)
            )
          )
        }
      }
    }
  )
  content
}

#let print-every-other-page(repeat: 10, ct) = {
  import "@preview/meander:0.2.3"
  meander.reflow({
    import meander: *
    // predetermined number of iterations
    for i in range(repeat) {
      container()
      // pagebreak twice to skip every other page entirely.
      pagebreak()
      pagebreak()
    }
    content(ct)
  })
}

#show: grid-paper.with(filter: pg => pg >= 2 and calc.odd(pg))

= Page de garde

#pagebreak()

#set page(numbering: "1")
#show: print-every-other-page.with(repeat: 3)

= Section

#lorem(2000)

paracol.pdf (32.4 KB)

I do see a few issues with this.

  1. There is not yet a convenient way to tell Meander to repeat a layout, so the most straightforward solution currently is to specify manually how many pages you’re going to need. I’ll come back to this soon.
  2. Meander does not currently have the performance required to compile large documents. Expect long startup times.
2 Likes