Headings and screen readers

Correct markup of headings is one of the key requirements for accessibility. When tags are assigned to indicate the level of each heading – for example h1, h2 and so on in HTML – screen readers are able to announce this information when they read the headings. Where sighted users typically rely on the visual formatting to ascertain the level of each heading – with higher-level heading generally using a larger font size – screen reader users rely on the tags.

In this article, we’ll look at the ramifications of how screen readers retrieve information about headings, in particular in Microsoft Word and PDF files.

An important concept here is that ‘reading’ a document doesn’t just mean reading every word from beginning to end. It can also mean scanning a document, reading a bit, scanning some more, reading some more, looking up the table of contents, jumping from there to a particular section or subsection, and so on.

Headings provide screen reader users with the most useful means for scanning a document. How a user actually does this depends on the options provided by the setup of the individual document, the capabilities of the software that opens the file, and the capabilities of the screen reader. There are four main mechanisms for scanning headings:

1. Reading the table of contents

2. Reading the bookmarks pane (PDF) or document map in the sidebar (Microsoft Word)

3. Reading the heading list generated by the screen reader

4. Using keyboard shortcuts to move from the current location in a document to the next or previous heading at a desired level

Each of these mechanisms create their own issues that authors need to be aware of. We’ll consider some key points for each one in turn.

1. Reading headings in the table of contents

Key points about tables of contents:

  • All long documents in Microsoft Word and PDF format should include a hyperlinked table of contents.
  • Typically, the table of contents does not list headings down to all levels. If that is the case, users must rely on one of the other three mechanisms for reading all of the headings.
  • By default, Microsoft Word uses styles named TOC 1, TOC 2 and so on for formatting TOC items. However, screen readers do not usually announce the level of each item in a TOC in Microsoft Word, which makes it difficult for the users to discern the structure of the document. (Where headings use a cascading numbering scheme, users can infer the level of the heading from the number.)
  • TOCs exported from Microsoft Word to PDF format should have the correct TOC and TOCI tags, but typically the TOC will be flat. Manual tagging is required to set up a nested TOC structure so screen readers can discern the level of each heading.
  • TOCs exported from InDesign to PDF format will not use the correct TOC and TOCI tags. These need to be manually set up in Acrobat, together with the appropriate nesting of each item.
  • Since TOCs are part of the document proper, even the most basic screen readers will be able to read them and follow the hyperlinks.

2. Reading headings from the bookmarks pane or document map

Key points about the bookmarks pane and document map:

  • In Microsoft Word, the document map is automatically available, and will include any heading paragraph style that is designated as Level 1–9, not just the default headings (Heading 1, Heading 2 and so on).
  • In PDF, ideally the bookmarks pane should include all heading levels, so it provides a more complete alternative to the table of contents, which typically only includes one, two or three levels.
  • By default, Microsoft Word and InDesign only export bookmarks for items that are included in the automatic table of contents. To include additional bookmarks for lower levels of headings, they need to be manually added in the PDF. Alternatively, a second, complete table of contents can be generated in pages added at the end of the source document, which can produce a full set of bookmarks in the exported PDF, even if those added pages are not exported. The right setup of the TOCs in Microsoft Word and InDesign will ensure that the exported bookmarks are correctly nested.
  • Basic screen readers may not be able to read the bookmarks pane or document map.

3. Reading headings from the screen reader heading list

Key points about screen reader heading lists:

  • Fully featured screen readers such as Jaws and NVDA provide the option of listing all the headings as hyperlinks in a dialogue box. Within this dialogue box, there may be additional options such as listing only headings at a certain level, and/or listing headings alphabetically.
  • In Microsoft Word, screen readers may only display default heading styles in this dialogue box, that is only Heading 1, Heading 2 and so on. Other heading paragraph styles may not be included, even if they are designated within Microsoft Word as a Level 1–9 heading. This is currently the case with Jaws.
  • In PDF, headings must be either tagged as H1, H2 and so on, or role-mapped to these styles in order to be recognised as headings by screen readers.
  • Some screen readers are able to generate a headings list in file formats that are intended for browsing but not in file formats that are intended for editing. For example, NVDA can generate a headings list for a web page or a PDF document, but not for a Microsoft Word document.

4. Reading headings via keyboard shortcuts

Key points about keyboard shortcuts for headings:

  • Shortcuts provide a mechanism for scanning headings beginning from the reader’s current location.
  • Typically shortcuts are available to jump to the next or previous heading at whichever level, or to the next or previous heading at a desired level.
  • In Microsoft Word, screen readers may only move in this way to the default heading styles, that is only Heading 1, Heading 2 and so on. Other heading paragraph styles may not be recognised, even if they are designated within Microsoft Word as a Level 1–9 heading. As with the headings list, this is currently the case with Jaws.
  • In PDF, headings must be either tagged as H1, H2 and so on, or role-mapped to these styles in order to be recognised as headings by screen readers.

It’s interesting to note that even Jaws, the most fully featured (and expensive) screen reader, will only recognise the default heading styles when generating the headings list and when skipping through headings via keyboard shortcuts. Curiously, when in reading mode, Jaws does correctly announce all headings as ‘Heading Level X’ (not just the default headings), as long as they are designated as a Level X heading in the paragraph style definition. However, more basic screen readers may be unable to retrieve the Level X designation and therefore will only announce the default heading styles as headings.

Conclusions

Based on all these points, we can recommend the following practices to ensure screen reader users have access to the full range of functions that can be enabled by headings. As with most accessibility practices, many of these practices are of benefit to all users.

  • In Microsoft Word, use the default heading styles if possible. The style definitions can be edited to match your visual requirements.
  • In PDF, check that all headings have correctly exported from Microsoft Word or InDesign with the correct tags H1, H2 and so on. If not, role-map the exported heading tags to the correct tags in Acrobat, or go back to the source file and set it up to export correctly.
  • Include a hyperlinked table of contents. In Microsoft Word, this can only be done on PC, not on Mac. Hyperlinked TOCs set up in Microsoft Word for PC and in InDesign will export to hyperlinked TOCs in PDF, although not with the correct tag syntax.
  • In PDF, ensure the table of contents is correctly tagged and nested using TOC and TOCI tags.
  • In PDF, include nested bookmarks for all levels of headings.
  • In PDF, set bookmarks to be visible when the file opens so all users are aware they’re available.