Appendix

The appendix section style can be used in books and articles, and it can have subsections. While the AsciiDoc structure allows appendices to be placed anywhere, it’s customary to place them near the end of the document.

Appendix section syntax

For articles, the appendix must be defined as a level 1 section (==). For example:

= Article Title
:appendix-caption: Exhibit
:sectnums:
:toc:

== Section

=== Subsection

[appendix]
== First Appendix

=== First Subsection

=== Second Subsection

[appendix]
== Second Appendix

The table of contents will appear as follows:

1. Section
  1.1. Subsection
Exhibit A: First Appendix
  A.1. First Subsection
  A.2. Second Subsection
Exhibit B: Second Appendix

For books, the appendix must be defined as a level 1 section (==) if you want the appendix to be a adjacent to the chapters. 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 2 section (===).

The following example shows how to define an appendix for a multi-part book.

= Book Title
:doctype: book
:sectnums:
:toc:

= First Part

== Chapter

=== Subsection

== Second Part

== Chapter

[appendix]
= First Appendix

=== First Subsection

=== Second Subsection

[appendix]
= Second Appendix

The table of contents will appear as follows:

First Part
1. Chapter
  1.1. Subsection
Second Part
2. Chapter
Appendix A: First Appendix
  A.1. First Subsection
  A.2. Second Subsection
Appendix B: Second Appendix

Appendix label

When rendered, the titles of sections marked as appendix will include:

  • A label, taken from the value of the appendix-caption attribute, which defaults to “Appendix”

  • A letter that represents the order of the appendix within the sequence of appendices (A, B, …​)

  • A colon

  • The section title

For example:

Appendix A: Data Access Matrix

The prefix can be modified by setting the appendix-caption attribute and overriding the default value with a custom value.

:appendix-caption: Exhibit

Unset the attribute to remove the prefix.

:appendix-caption!: