10  LaTeX: Article Accessibility

10.1 Introduction

The package tagpdf is an experimental package for creating tagged PDFs to meet the accessibility requirements. See Structure for more information on how the semantic structure of documents contributes to accessibility. Currently, this package does not work with the beamer class. Eventually, this package will disappear and the baseline LaTeX distributions will include the same functionality. For now, including tagpdf can improve the accessibility of LaTeX-compiled documents.

This chapter focuses on creating an accessible document using tagpdf. There are other options, including the accessibility package, which includes similar approaches.

10.2 Basic Setup

  1. Before you start, ensure that you have the latest version of LaTeX installed on your computer. Use a LaTeX distribution from 2024, preferably one from 2025. You will also want to use the LuaLaTeX engine to compile (rather than, say, pdfLaTeX). There are frequent updates to tagpdf given the evolution of LaTeX accessibility efforts. If you encounter issues, it may be wise to check that you have the latest version from CTAN - tagpdf, or follow the issues in GitHub.

  2. Add code to setup tagging at the beginning of the document. This should be the first line of the file. It will generate a tag structure for the document. This code example is from The Tagging Project.

\DocumentMetadata{
  lang        = en-US,     % Sets the document language to English.
  pdfstandard = ua-2,     % Specifies the PDF accessibility standard (PDF/UA-2)
  pdfversion = 2.0, % Updated PDF versions have better accessibility features
  tagging=on,     % Enables PDF tagging for structure and accessibility
  tagging-setup={math/setup=mathml-SE} % Configures math tagging using MathML structured expressions
}

\documentclass{article}
\begin{document}


\end{document}

10.3 Figures

The DocumentMetadata code at the beginning of the document takes care of a lot of the tagging requirements. There are some additional steps to ensure accessibility. For figures, include alternative text, or “alt text.” See (Alternative Text)[#alt_text] for more information on alt text. It is standard to keep the alt text concise, for example under 150 characters.

\includegraphics[width=\textwidth,alt={alt text description}]{graph.jpg}

10.4 Tables

For the tabular environment, you must identify the header rows using \tagpdfsetup. Here is an example from (The Tagging Project)[https://latex3.github.io/tagging-project/documentation/prototype-usage-instructions]. At this point, merged columns and rows, such as those using \multicolumn are not fully accessible.


\tagpdfsetup{table/header-rows={1,2}}
\begin{tabular}{lr}
  Example & \\
    Name&Value\\
    This& 11 \\
    That & 2
\end{tabular}

Sometimes, tables are useful in LaTeX to arrange information, rather than to formally present information as a table with headers. If so, use \tagpdfsetup{table/tagging=presentation} instead.

10.5 Lists

Common list environments do not require additional tagging with the tagpdf package.

10.6 Math

For math, it is easiest to use LuaLaTeX to rely on MathML to display the math in the PDF. Once you set tagging-setup={math/setup=mathml-SE} in the DocumentMetadata command at the top of the LaTeX document, the tagpdf package will tag the equations appropriately.

10.7 Structure

Follow conventions laid out in (Structure)[#structure]. For example, do not skip heading levels (\subsection to \subsubsubsection). Also, follow common conventions, such as using \title{} to define the title of the document.

10.8 Resources

Documentation for tagpdf

GitHub for tagpdf

StackExchange for tagpdf