Skip to content

Page sized twice

papersize names a size while geometry also sets one. The build stops, because only one of the two can reach the page.

What it looks like

papersize: a5
geometry: paperwidth=5in,paperheight=5in,margin=0.5in
ERROR: papersize 'a5' and geometry both set the page
  paperwidth=5in
  paperheight=5in
  Keep one: clear papersize to size the page in geometry, or drop the geometry
  options above to size it by name.
  See https://keystone.knight-owl.dev/errors/page-sized-twice/

What it means

Only one of the two can reach the page, and LaTeX is not consistent about which — so Keystone stops rather than leave the losing key in pandoc.yaml, describing a book that is not the one being printed.

Only options that size the page count: paperwidth, paperheight, papersize, paper, papername, screen, and a bare a5paper-style name. A geometry describing margins alone — margin, inner, outer, scale, bindingoffset — agrees with papersize rather than competing, and is how the two keys work together.

Keep one key and clear the other

papersize names a size Keystone knows; geometry takes dimensions of your own.

To keep the named size and let geometry handle margins:

papersize: a5
geometry: inner=30mm, outer=20mm

To keep the custom trim, leave papersize empty:

papersize:
geometry: paperwidth=5in,paperheight=5in,margin=0.5in