Tokens and page selectors¶
Page tokens¶
Use these in page numbers, headers, footers, captions, watermarks, QR and
barcode values, and template fields. They differ from ${variables}, which
are replaced once when the config is loaded.
| Token | Value |
|---|---|
{n} |
Page number (from page_numbers; otherwise the page's position) |
{total} |
Total pages (as counted by the page numbering) |
{input} |
Title of the input the page came from |
{input_n}, {input_total} |
Page number within that input, and its page count |
{section}, {subsection} |
The top-level and second-level bookmark the page falls under |
{filename} |
File name of the input |
{date} |
Today's date (YYYY-MM-DD) |
{title} |
Document title (on dividers: the section title) |
{page_count} |
Pages in the document (on dividers: in the section) |
{input_count} |
Number of inputs (on dividers: in the section) |
{toc_pages} |
Pages in the table of contents |
Formats: {n:04} (zero-padded), {n:roman}, {n:ROMAN}, {n:alpha},
{n:ALPHA}. Write {{ and }} for literal braces.
Page selectors¶
| Selector | Pages |
|---|---|
all, first, last, odd, even |
As named |
3, -1 |
Page 3; the last page |
5-8, 2-, 1--2 |
Ranges; open-ended; up to the second-to-last |
1,3,5-8 or [1, 3, "5-8"] |
Several |
cover, toc, dividers, transmittal, index |
Generated pages |
generated, content |
All generated pages; all pages from your inputs |
Numbers are pages of the final document, except in an input's own pages: and
rotate:, which use that file's page numbers.