AsciiDoc Attributes for PDF
Asciidoctor PDF supports additional built-in document attributes that impact PDF conversion. You can use these attributes to control the PDF media, launch mode, and outline, PDF optimization, text hyphenation, and various document-specific theme settings such as the front and back cover images, the background images, the title page logo and background images, page dimensions, and more.
AsciiDoc document attributes
If an attribute is marked as "Header Only", it only takes effect if defined in the AsciiDoc document header or via the API. If an attribute matches a key in the theme file, the document attribute takes precedence.
Attribute | Value Type | Header Only | Example |
---|---|---|---|
|
flag (default: not set) |
No |
|
|
path[2] | image macro[3] |
Yes |
|
|
language code | blank to default to en_us (default: not set) |
Yes |
|
|
No |
|
|
|
String |
Yes |
|
|
|
No |
|
|
|
Yes |
|
|
flag (default: not set) |
Yes |
|
|
|
Yes |
|
flag (default: set) |
Yes |
|
|
flag | String (default: set) |
Yes |
|
|
Integer | Integer:Integer (default: same as toclevels) |
Yes |
|
|
path[2] | image macro[3] |
Yes |
|
|
path[2] | image macro[3] |
Yes |
|
|
|
path[2] | image macro[3] |
Yes |
|
flag (default: set) |
Yes |
|
|
|
|
Yes |
|
|
Yes |
|
|
|
Yes |
|
|
|
|
Yes |
|
|
Yes |
|
|
|
|
Yes |
|
|
|
Yes |
|
|
flag (default: not set) |
Yes |
|
|
|
Yes |
|
|
Yes |
|
|
path[2] | image macro[3] |
Yes |
|
|
flag (default: not set) |
Yes |
|
|
path[2] | image macro[3] |
Yes |
|
|
|
Integer (default: |
Yes |
|
-
<face>
can befront
orback
. -
A bare path is resolved relative to
base_dir
, which defaults to the document directory. -
The target of the image macro is resolved relative to
imagesdir
since it’s defined in the AsciiDoc document (unlike in the theme, where it is resolved relative to the value ofpdf-themesdir
). -
Enables generation of the pdfmark file, which contains metadata that can be fed to Ghostscript when optimizing the PDF file. If you’re using Ghostscript >= 8.54, this feature is not needed.
-
Activates hyphenation for the language code specified (defaults to en_us). If the
hyphens
attribute is set in the document, it overrides thebase-hyphens
key set in the theme. In other case, if the value is empty, then the value of thelang
document attribute is used for the hyphenation language. -
Activates line break rules for CJK languages (specifically Chinese and Japanese). Chinese and Japanese are written without spaces (and may not use spaces when mixing with English words either). This setting allows a line break to be placed between any two CJK characters to accommodate wrapping. These languages also use different punctuation for pause, full stop, and dash, which are taken into account when breaking lines.
-
The
text-align
document attribute is intended as a simple way to toggle text justification. The value of this attribute overrides thebase-text-align
key set by the theme. If atext-<align>
role is set on a block element, that alignment always takes precedence over the theme. -
If the TOC overlaps the first page of content, increase this number.