Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

To make LaTeX-generated documents accessible, there are three key steps:

  1. Share the source LaTeX file along with the compiled PDF files,

  2. Enable the PDF tagging feature in your LaTeX source file, and

  3. Update the content to fully utilize accessibility features.

Share the Source LaTeX File

While accessibility features can be enabled using modern LaTeX compilers, some assistive technologies may still struggle to fully parse LaTeX-generated PDF files. The Center for Disability & Access recommends that we provide the source LaTeX file along with the PDF file to ensure that all users can access the content.

Enable the PDF Tagging Feature

To enable the PDF tagging feature, add the \DocumentMetadata command with the appropriate options at the very beginning of your LaTeX source file.

\DocumentMetadata{
  lang=en-US,
  pdfversion=2.0,
  pdfstandard=ua-2,
  tagging=on,
  tagging-setup={math/alt/use}
}

Adding this command will automatically enable tagging and accessibility compatibility features in the generated PDF, and the resulting PDF file should pass the accessibility checker on Canvas. The PDF file will look visually identical, whether on screen or printed; the accessibility features are embedded behind the scenes.

If your document contains images or tables, you need to take additional steps to ensure full accessibility compliance (see the section below). You should also use semantic markup in your LaTeX source file (such as \section{} for section headings) to ensure the generated PDF file is properly tagged.

For math content such as equations, the setup above adds the LaTeX source code as alternative text, but this is not the best practice for people using screen readers. See Above and Beyond: Enable MathML with LuaLaTeX for a better approach for math content.

Update the Content to Fully Utilize Accessibility Features

Adding \DocumentMetadata enables PDF tagging, but you may need to update your content to fully utilize these accessibility features.

Add Alt Text to Images

All images in your LaTeX document should have alternative text (alt text). You can add alt text to an image using the alt option in the \includegraphics command. Here is an example:

\includegraphics[
  width=0.5\textwidth,
  clip,
  trim={0 1cm 0 1cm},
  alt={Repeating pattern of evenly spaced black dots arranged in staggered rows on a white background}
]{dot_pattern.png}

For guidance on writing good alt text, please refer to the Images and Alt Text page.

Use Semantic Markup

In your LaTeX document, make sure to use semantic markup commands for various elements. For example, use \section{}, \subsection{}, and \paragraph{} for headings, instead of manually changing font sizes or styles. Similarly, use \emph{} for emphasis instead of changing the font to italics directly.

Specify Header Rows in Tables

Each table should have its header row(s) specified to ensure proper tagging. You can do this by adding the \tagpdfsetup command right before the tabular (or similar) environment. Here is an example:

\tagpdfsetup{table/header-rows={1}}
\begin{tabular}{|c|c|c|}
%... table content...

If there are multiple header rows, specify all of them, separated by commas. For example, if the first two rows are both header rows, use:

\tagpdfsetup{table/header-rows={1,2}}

If there is no header row (e.g., you are using the table merely for formatting), use the following command instead:

\tagpdfsetup{table/tagging=presentation}

Above and Beyond: Enable MathML with LuaLaTeX

While the setup above can generate PDF files that meet accessibility requirements, you can further enhance the accessibility of math content by enabling MathML output. To do this, you must compile your LaTeX document with lualatex instead of pdflatex.

If you have lualatex set up on your machine, you can enable MathML tagging with the following setup:

% !TeX program = lualatex
\DocumentMetadata{
  lang=en-US,
  pdfversion=2.0,
  pdfstandard=ua-2,
  tagging=on,
  tagging-setup={math/setup=mathml-SE}
}

\documentclass{article}
\usepackage{unicode-math}
%... other packages ...