Page Category Keys

page

The keys in the page category control the size, margins, and background of the pages in a document (i.e., canvas). We recommended that you define this category before all other categories.

The background of the title page can be styled independently of other pages. See Title Page and Title Page Category Keys for details.
Key Value Type Example

background-color

Color
(default: 'FFFFFF')

page:
  background-color: #FEFEFE

background-image

image macro | path
(default: not set)

page:
  background-image: image:page-bg.png[]

background-image-(recto|verso)

image macro | path
(default: not set)

page:
  background-image:
    recto: image:page-bg-recto.png[]
    verso: image:page-bg-verso.png[]

columns

Integer
(default: not set)

page:
  columns: 2

column-gap

Measurement
(default: $base-font-size)

page:
  columns: 2
  columns-gap: 12

foreground-image

image macro | path
(default: not set)

page:
  foreground-image: image:watermark.svg[]

initial-zoom

Fit | FitH | FitV
(default: FitH)

page:
  initial-zoom: Fit

layout

landscape | portrait
(default: portrait)

page:
  layout: landscape

margin

Measurement | Measurement[top,right,bottom,left]
(default: 36)

page:
  margin: [0.5in, 0.67in, 1in, 0.67in]

margin-rotated

Measurement | Measurement[top,right,bottom,left]
(default: $page-margin)

page:
  margin-rotated: [0.5in, 0.5in, 1in, 0.5in]

margin-inner

Measurement
(default: 48)

page:
  margin-inner: 0.75in

margin-outer

Measurement
(default: 24)

page:
  margin-outer: 0.59in

mode

outline | none | thumbs | fullscreen | fullscreen outline | fullscreen none | fullscreen thumbs
(default: outline)

page:
  mode: fullscreen none

size

Named size | Measurement[width,height]
(default: A4)

page:
  size: Letter

Disable background-color

To turn off the background color for the page, set the value of the background-color key to white (i.e., #FFFFFF). The color keyword transparent is not recognized in this context.

Rotated margin

The rotated margin is applied to the opposing page layout when a page is rotated. If the initial page layout is portrait, then the rotated margin applies to landscape pages, and vice versa. The margin key applies to the initial page layout.

The rotated margin does not honor Inner and outer margins. Rather, it’s the same margin regardless of whether the page side is recto or verso.

Inner and outer margins

The margins for recto (right-hand, odd-numbered) and verso (left-hand, even-numbered) pages are calculated automatically from the margin-inner and margin-outer values. These margins are only used when the value prepress is assigned to the media document attribute.

The recto margin is applied to the title page if a front cover is specified. To apply the recto margin to the title page without specifying a front cover, assign the value ~ to the front-cover-image. See Cover Category Keys for information about the cover category keys.

Setting front-cover-image to ~ makes the converter acts as though a front cover is present without reserving a page for it. It essentially informs the converter that the front cover will be inserted by a separate process.

Columns

Page columns are applied to the body of a document that has either the article or manpage doctype. The body of the document begins after the document title and, if present, the TOC.

If the toc macro is used in a document configured to have columns, the behavior is undefined.

If the columns are set on the index section using the index-columns key, that setting will be overridden by the value of page-columns. The index will be arranged within the page columns.

Column break

Even when columns are enabled, the AsciiDoc page break macro will still end the current page and start a new page. The next chunk of content will be written to the left-most column on that new page.

If you want the page break macro to end the current column instead, add the column role to it.

left column

[.column]
<<<

right column

If columns are not enabled, the column role will be ignored and it will revert to a true page break. Thus, it’s safe to add the role even when you’re not using columns.

page-numbering

The key in the page-numbering category controls where the integer (1-based) page numbering begins.

Key Value Type Example

start-at

Start page | Integer
(default: body)

page:
  numbering:
    start-at: cover

See Starting integer page numbering for more information about the start-at key, its values, and their requirements.