Reference the Author Information

Referencing the author attributes

You can reference the built-in author attributes in your document regardless of whether they’re set via the author line or attribute entries. In Example 1, the author and email attributes are assigned using attribute entries.

Example 1. Reference the author attributes
= The Intrepid Chronicles
:author: Kismet R. Lee
:email: kismet@asciidoctor.org

== About {author}

You can contact {firstname} at {email}.

P.S. Don't ask what the {middlename} stands for; it's a secret.
{authorinitials}

The result of Example 1 is displayed below.

Reference the built-in attributes for an author

Referencing information for multiple authors

The first author in an author line is assigned to the built-in attributes author, email, firstname, etc. Subsequent authors are assigned to the built-in author attributes, but the attribute names are appended with an underscore (_) and the numeric position of the author in the author line. For instance, the author B. Steppenwolf in Example 2 is the second author in the author line. The built-in attributes used to reference their information are appended with the number 2, e.g., author_2, email_2, lastname_2, etc.

Example 2. Reference the built-in attributes for multiple authors
= The Intrepid Chronicles
Kismet R. Lee <kismet@asciidoctor.org>; B. Steppenwolf; Pax Draeke <pax@asciidoctor.org>

.About {author_2}
Mr. {lastname_2} lives in the Rocky Mountains.

.About {author_3}
{firstname_3}, also known as {authorinitials_3}, loves to surf.

.About {author}
You can contact {firstname} at {email}.

The result of Example 2 is displayed below.

Reference the built-in attributes for multiple author