You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
2.1 KiB

4 years ago
////
Included in:
- user-manual
////
You can indicate that a section, part, or chapter is an appendix by adding an `[appendix]` line above the section title.
[source]
----
[appendix]
== Copyright and License
----
While the AsciiDoc structure allows appendices to be placed anywhere, it's customary to place them at the end of the document, after all other sections.
Sections marked as appendix have a different title, which is built as follows:
* A fixed prefix (taken from the value of the `appendix-caption` attribute, which defaults to "`Appendix`")
* A letter that represents the number of this appendix within the sequence of appendices (A, B, C, ...)
* A colon
* The original section title
For example:
Appendix A: Copyright and License
The prefix can be modified by defining the `appendix-caption` attribute.
This value can be changed using:
[source]
----
:appendix-caption: Appx
----
Or it can be unset using:
[source]
----
:appendix-caption!:
----
Appendices can have subsections.
However, there are some rules to follow depending on which type of document you are creating.
For articles, the appendix must be defined as a level-1 section.
(If a level-0 section is used, a level-1 section is implied).
For example:
[source]
----
include::ex-appendix.adoc[tag=appx-article]
----
The table of contents will appear as follows:
[source]
----
include::ex-appendix.adoc[tag=appx-article-out]
----
For books, the appendix must be defined as a level-1 section if you want the appendix to be a adjacent to other chapters (and in the current part if the book has multiple parts).
In a multi-part book, if you want the appendix to be adjacent to other parts, the appendix must be defined as a level-0 section.
In either case, the first subsection of the appendix must be a level-3 section, not a level-2 section.
That's because an appendix cannot contain chapters.
The following example shows how to define an appendix for a multi-book (take away the part title if you're creating a simple book):
[source]
----
include::ex-appendix.adoc[tag=appx-book]
----
The table of contents will appear as follows:
[source]
----
include::ex-appendix.adoc[tag=appx-book-out]
----