1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
= Print and Prepress Modes
[#print]
== Print mode
Asciidoctor PDF provides the following behaviors to assist with printing:
* Shows the URL for links (unless the linked text matches the URL)
* Consolidates page ranges in the index
* Disables links from page numbers in index to location of term in document
You activate these printing features by setting the `media` attribute to `print` in the header of your AsciiDoc document (e.g., `:media: print`) or from the API or CLI (e.g., `-a media=print`).
You may also want to consider using the print-optimized theme, which uses darker, grayscale colors for text and borders (e.g., `-a pdf-theme=default-for-print`).
[#prepress]
== Prepress mode
In addition to the <<print,printing mode behaviors>>, Asciidoctor PDF provides the following behaviors to assist with publishing:
* Double-sided (mirror) page margins
* Automatic facing pages
You activate these publishing features by setting the `media` attribute to `prepress` in the header of your AsciiDoc document (e.g., `:media: prepress`) or from the API or CLI (e.g., `-a media=prepress`).
The following sections describe the behaviors that this setting activates.
You may also want to consider using the print-optimized theme, which uses darker, grayscale colors for text and borders (e.g., `-a pdf-theme=default-for-print`).
=== Double-sided page margins
The page margins for the recto (right-hand, odd-numbered) and verso (left-hand, even-numbered) pages are automatically calculated by replacing the side page margins with the values of the `page-margin-inner` and `page-margin-outer` keys.
For example, let's assume you've defined the following settings in your theme:
[source,yaml]
----
page:
margin: [0.5in, 0.67in, 0.67in, 0.67in]
margin-inner: 0.75in
margin-outer: 0.59in
----
The page margins for the recto and verso pages will be resolved as follows:
recto page margin:: [0.5in, *0.59in*, 0.67in, *0.75in*]
verso page margin:: [0.5in, *0.75in*, 0.67in, *0.59in*]
The page margins alternate between recto and verso.
The first page in the document (after the cover) is a recto page.
If no cover is specified, the recto margin is not applied to the title page.
To apply the recto margin to the title page, but not include a cover, assign the value `~` to the `front-cover-image` and `back-cover-image` attributes.
=== Automatic facing pages
When converting the book doctype using the `prepress` media setting, a blank page will be inserted when necessary to ensure the following elements start on a recto page:
* Title page
* Table of contents
* First page of body
* Parts and chapters
Other "`facing`" pages may be added in the future.
It's possible to disable the automatic facing feature for a given part or chapter.
This can be done by adding the nonfacing option to the section node.
When the nonfacing option is present, the part or chapter title will be placed on the next adjacent page rather than the next facing page.
[source,asciidoc]
----
[%nonfacing]
= Minor Chapter
content
----
////
TODO: Issue 95 is solved, this should be deleted
For documents that use the article doctype, Asciidoctor PDF incorrectly places the document title and table of contents on their own pages.
This can result in the page numbering and the page facing to be out of sync.
As a workaround, Asciidoctor PDF inserts a blank page, if necessary, to ensure the first page of body content is a recto-facing page.
You can check on the status of this defect by following https://github.com/asciidoctor/asciidoctor-pdf/issues/95[issue #95].
////
|