Accessible LaTeX Generated PDFs
There are two main aspects to generating accessible LaTeX PDF files:
- Using a modern TeX distribution that has accessibility options built in, most notably tagging and alt tex. The latest versions of TeX Live should be sufficient, particularly any version after 2025 or later. Newer versions will be even more helpful. See the instructions below on LaTeX setups for accessible PDFs for more information.
- Following best practices in writing your TeX document. Some of these include:
- Use built-in heading styles like \section, \subsection, and \begin{theorem}...\end{theorem} in your documents
- Use built-in list tools (numbered/bulleted lists)
- If you include tables make sure to use header rows
- Include alt text for all images and diagrams, even math diagrams and graphs
- See the instructions below for more detailed tips
- Include your TeX document wherever you distribute the PDF, including on Canvas and websites.
Tips for Specific Issues
There are now workable options for producing more accessible PDFs from LaTeX, but compatibility still depends on your document class and packages. There are two main options you can use, both based on the LaTeX Tagged PDF Project.
Option 1: LuaLaTeX + MathML Tagging
This option aims for a properly tagged PDF. The formulas are tagged using MathML, which some screen readers and PDF viewers can use effectively.
TeX file header
Add the following to the very top of your TeX file, even before the \documentclass command.
% !TeX program = lualatex
\DocumentMetadata{
lang = en-US,
pdfstandard = ua-2,
tagging = on,
tagging-setup = { math/setup = {mathml-SE}}
}
TeX document skeleton
The text below can act as a skeleton for the entire document. It is the same header as above, then the rest of the document follows and can be filled in.
% !TeX program = lualatex
\DocumentMetadata{
lang = en-US,
pdfstandard = ua-2,
tagging = on,
tagging-setup = { math/setup = {mathml-SE}}
}
\documentclass{article}% or another supported class
% various other packages
\usepackage{unicode-math}%%important
% more packages, etc.
\begin{document}
\title{Your title}
%\author{Your name or other information}
\date{}%%optional if you want to turn the date off
\maketitle
% ... the rest of your document ...
\end{document}
When using this option:
- run lualatex <filename>.tex to compile, instead of pdflatex <filename>.tex
- you need to have an up-to-date version of LuaLaTeX for this to work, which you can obtain by installing TeX Live 2025 or later
- the first line % !TeX program = lualatex should cause lualatex to run, even if you call pdflatex
- in Overleaf change your compiler to lualatex via File → Settings → Compiler → LuaLaTeX
Option 2: pdfLaTeX + LaTeX source as alt text
This option also tags the PDF, and it uses LaTeX source as a fallback text alternative for math. This can sometimes satisfy automated checkers better, but the spoken output may be less natural (and custom macros may appear verbatim).
Compile the document below via pdflatex <filename>.tex
TeX document skeleton
\DocumentMetadata{
lang = en-US,
pdfstandard = ua-2,
tagging = on,
tagging-setup = { math/alt/use }
%%you can also use tagging-setup = {math/setup = {mathml-SE}} but then, on some screen readers, only the latex code is read
}
\documentclass{article}% or another supported class
% various other packages
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% more packages, etc.
\begin{document}
\title{Your title}
%\author{Your name or other information}
\date{}%%optional if you want to turn the date off
\maketitle
% ... the rest of your document ...
\end{document}
- Use \title{...}, \author{...}, \date{...}, and \maketitle to populate document metadata.
- Many people do not like the spacing around the title created by \maketitle in the article class. One way to try to fix that is:
\usepackage{hyperref} \hypersetup{pdftitle={My Title}, pdfdisplaydoctitle}
Alt text should communicate the purpose of the visual in context.
- Keep it concise when the figure is simple.
- If a full description is long, you can put the details in nearby text and keep alt text short (for the best ways to do this see W3.org’s suggestions on alt text).
- For graphs: name axes/units, and key relevant features (the main trend, intercepts, peaks, asymptotes, etc.).
- For diagrams (commutative diagrams, geometry figures): describe the objects and relations (what maps to what; what is perpendicular to what), not just “a triangle.”
- Tip: AI tools can help draft alt text, but you must review it for correctness and for the course context.
Some LaTeX specific tips are:
- All meaningful graphics must have alt text. Many commands support an alt={...} key:
\includegraphics[alt={Alt text for the image},scale=0.3]{MyImage.jpg}
- For purely decorative images, prefer marking as an artifact so screen readers skip it:
\includegraphics[artifact,scale=0.3]{DecorativeRule.png}
- Certain parts of TikZ support the [alt] key, for example tikz, tikzpicture and picture environment support the [alt] key:
\begin{tikzpicture}[scale=.30,alt={A line segment from A to B}]
\coordinate (A) at (0,0);
\coordinate (B) at (1,1);
\draw (A)--(B);
\end{tikzpicture}
- If you include tables, identify header rows so screen readers can interpret them better.
- See the examples listed in the LaTeX Tagging Project's Tagged PDF Usage Instructions - Handling Tables.
Both the LaTeX Tagged PDF Project and LaTeXML are only compatible with some packages and document classes. Others may not compile, or may compile but yield poor accessibility.
- Tagged PDF compatibility list: LaTeX Tagged PDF Compatible Classes and Packages
- LaTeXML bindings: Included Bindings for LaTeXML
As of Spring 2026 the following commonly used packages are not fully compatible:
- tikz-cd is currently not compatible in some tagging workflows and may fail to compile.
- xypic may not tag optimally and may require package order adjustments.
- See: xypic tagging issue
- enumitem and titlesec are not compatible.
- Consider alternatives for enumitem like enumext which has many features.
- See also the LaTeX Tagging Project's instructions on Handling LIsts and Other Block Structures
- beamer is not compatible at this time.
- Consider the more limited ltx-talk class for some talk/presentation workflows.