Skip to content

Paper size and landscape pagesΒΆ

Print documents on US Letter paper, and print wide tables on landscape pages.

A portrait page A table on a landscape page

reference/paper-sizes/index.pdf

plugins:
  - exporter:
      formats:
        pdf:
          stylesheets:
            - pdf.css
          footer:
            center: "{page}"
@page {
  size: letter;
  margin: 2cm;
}

/* Elements of the `landscape` class are printed on landscape pages */
@page landscape {
  size: letter landscape;
}

.landscape {
  page: landscape;
}
<div class="landscape" markdown>

## Common sizes

| Name | Width (mm) | Height (mm) | Width (in) | Height (in) | ... |
|---|---|---|---|---|---|
| A3 | 297 | 420 | 11.69 | 16.54 | ... |

</div>
  • size accepts a keyword (A4, A5, letter, legal...), optionally followed by an orientation, or a width and a height (e.g. size: 6in 9in).
  • @page landscape defines a named page, used by the elements of the landscape class: they start on a new landscape page, and the content following them on a new portrait page.
  • The md_in_html extension renders the Markdown inside the <div>: any block can be given the class, here a section with its heading and its table.
  • On the landscape page, the content is laid out with the width of that page, so the table fits.

Browse the files of this example