Summary

Order content documents in the EPUB spine to ensure the reading order is logical and identify whether each document contains linear or non-linear content.

Techniques

Examples

Example 1 — Including a non-linear cover

The cover is marked as non-linear in this example as it is not essential that reading systems present it as the first document.

<package …>
   …
   <spine>
      <itemref idref="cover" linear="no"/>
      <itemref idref="title"/>
      <itemref idref="toc"/>
      <itemref idref="intro"/>
      <itemref idref="c01"/>
      <itemref idref="c02"/>
      …
   </spine>
</package>
Example 2 — Including separate description files

The image descriptions are marked as non-linear and included at the end of the spine to avoid users encountering them between chapters.

<package …>
   …
   <spine>
      …
      <itemref idref="appendix-03"/>
      <itemref idref="desc-01" linear="no"/>
      <itemref idref="desc-02" linear="no"/>
      <itemref idref="desc-03" linear="no"/>
      <itemref idref="desc-04" linear="no"/>
      <itemref idref="desc-05" linear="no"/>
      …
   </spine>
</package>

Frequently Asked Questions

Do reading systems hide non-linear content from readers when paging through a publication?

No, the EPUB specification does not mandate a specific way of rendering non-linear content, so you cannot rely on reading systems hiding content marked as non-linear. If you place a non-linear document between two chapters, some users will encounter that content as they manually page through the publication.

Although some reading systems will ignore non-linear documents, only rendering them if a user clicks on a link to them, such behaviour is not universal.

Explanation

Spine Order

The spine element in the EPUB package document defines the order of documents in the publication. Reading systems use the element to determine which document comes next when users are reading.

The spine consists of one or more itemref elements, each of which references an item in the manifest. The idref attribute on the itemref provides the specific ID of manifest item to render, as depicted in the following example. (Note there is no hash (#) at the start of the reference as the value is an ID reference not a URL.)

<package …>
   …
   <manifest>
      …
      <item id="c01"
            href="xhtml/chapter01.xhtml"
            media-type="application/xhtml+xml"/>
      …
   </manifest>
   <spine>
      …
      <itemref idref="c01"/>
      …
   </spine>
</package>

The average reader is typically not aware that an EPUB publication is usually a set of many documents in the spine. The reading system hides this fact from them, as when they reach the end of one document, it automatically propagates the next page by inspecting the spine to load the next.

It is critical that you reference all the primary content documents from the spine, and you must order these documents to present the primary narrative of the publication in logical sequence. Although misorderding documents is not common, it can happen during edits and revisions (e.g., if you insert a new chapter or section). In these cases, all readers will be confused if the documents are out of sequence, or if one is missing, so it is more of a general usability issue than specifically an accessibility one.

Linear Content

Linear content documents are those that the author expects users to read sequentially: Chapter 1 is followed by Chapter 2, which is followed by Chapter 3, and so on. The linear reading order represents the primary pathway through a publication.

If readers are expected to read linear documents in sequence, then it follows that they are not required to read non-linear documents that way. An answer key is an example of a non-linear document. The reader might want to review it after the chapter containing the corresponding quiz, they might want to wait until the end of the book before checking the answers, or they might not be interested in it at all. It is not essential to read the answers where the author has inserted them into the spine, in other words.

Non-linear content documents are identified by adding a linear attribute with the value no to the itemref element, as depicted in the following example:

<itemref
    idref="answers-01"
    linear="no"/>

Note

Reading systems assume that itemref elements without a linear attribute represent linear content documents, so it is rare to find linear="yes" set in EPUB publications.

The placement of non-linear content in the spine does pose some issues for the readability of the content. Because reading systems do not all handle non-linear content the same way, authors cannot assume how reading systems will present it to users. Reading systems may or may not present such content where it is placed in the spine.

Consequently, a primary consideration for non-linear content is to ensure that its nature and purpose is clear on its own. Do not assume that readers will have followed a link to reach the non-linear content, so will already know its purpose.

Using the example of an answer key, make sure that the file starts with a heading that identifies that what follows are the answers to the quiz. If you place image descriptions in a separate non-linear file, ensure that each description makes clear what image it is describing.

Another option for non-linear content is to place it where it will have the least impact on the linear reading experience. You can place image descriptions and pop-out images after all the linear content in the spine, for example (see example 2). Placement at the end of the spine is particularly useful when you cannot adequately describe the content. An enlarged version of an image might suffer from an explicit caption, for example.

Note

EPUB 3's requirements for non-linear content differ from EPUB 2's in one significant way, namely authors must include a link to all non-linear documents in the spine. This requirement ensures that readers can reach the non-linear content regardless of whether reading systems render it while manually paging through a publication.

In most cases, this requirement is not onerous to meet, as authors typically do not include non-linear content that they have not linked from the linear content. One known issue involves including a non-linear cover in the spine (see example 1). To satisfy the linking requirement to this document, you can include a link to the cover in the landmarks nav.

Related Links