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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
= Title Page
Author Name
v1.0, 2020-02-20
:description: The title page contains the doctitle, author, date, and revision information.
The Asciidoctor PDF converter introduces a dedicated title page at the start of the document.
The title page contains the doctitle, author, date, and revision info.
The title page can be styled using the theme and reserved page attributes.
[#activate]
== Activate the title page
The title page is enabled if one of these conditions is met:
* the `doctype` document attribute is set to `book`, or
* the `title-page` document attribute is set with an empty value in the document header.
The title page is only enabled by default for the `book` doctype.
The `doctype` is set and assigned `book` either in the document header or using the CLI.
[,asciidoc]
----
= Document Title
:doctype: book
----
To force the title page to be used for other doctypes, set the `title-page` attribute in the document header.
[,asciidoc]
----
= Document Title
:title-page:
----
If a front cover image is specified, the title page comes after the front cover.
When the title page is enabled, the table of contents also gets its own page (or pages, if necessary).
[#notitle-attribute]
== Deactivate with notitle attribute
For documents that declare the `book` doctype, the title page can be omitted by setting the `notitle` attribute in the AsciiDoc document header.
(Its counterpart, `:!showtitle:`, does not work with Asciidoctor PDF.)
[,asciidoc]
----
= Document Title
:doctype: book
:notitle:
----
The title page can also be xref:theme:title-pages.adoc#deactivate[deactivated from the theme] by setting the value of the `title-page` category key to `false`.
For all other doctypes, the title page is not added by default.
In that case, setting the `:notitle:` attribute only removes the document title from the first page of content.
== Author and revision information
The author and revision information is displayed on the title page by default.
If the document does not have a title page, you must use explicit references to this information in the text in order for it to be displayed.
Here's an example of how to display the author and revision information in an article without a title page.
[,asciidoc]
----
= Article Title
Author Name
v1.0, 2020-02-20
[.metadata]
{author} -- version {revnumber}, {revdate}
Begin main content.
----
You can style this line by xref:roles.adoc#custom[defining a role] in a custom theme.
[#background]
== Background image
You can place a background image on the title page using the `title-page-background-image` document attribute.
[,asciidoc]
----
= Document Title
Author Name
:title-page-background-image: image:title-bg.png[]
----
By default, page background images are automatically scaled to fit the bounds of the page (i.e., `fit=contain`) and centered (i.e., `position=center`).
See xref:background-images.adoc[] to learn more.
[#logo]
== Logo image
You can place a logo image on the title page using the `title-logo-image` document attribute.
Using an inline image macro, you can specify attributes to position and resize the image.
The special `top` attribute is recognized in this context for setting the vertical position of the image.
[,asciidoc]
----
= Document Title
Author Name
:title-logo-image: image:logo.png[top=25%,align=center,pdfwidth=0.5in]
----
The value of the `top` attribute is the distance from the top of the content area (just below the top margin).
It can either be a fixed value (e.g., `1in`) or relative value (`10%`).
A fixed value is converted to a point value.
A percentage value is multiplied by the height of the content area (the area inside the top and bottom margins).
The advantage of a fixed value is that it gives you precision.
The advantage of a relative value is that it automatically adjusts for different page sizes.
|