How to Make an Accessible PDF with LaTeX
By Shihab Shahriar Antor · Updated November 2026 · 7 min read
To get an accessible PDF from LaTeX, add a \DocumentMetadata line with tagging=on before \documentclass, build with LuaLaTeX on a current LaTeX release, give every figure alt text and mark the header rows of every table. Then check the PDF with a validator such as veraPDF. The example on this page passes its PDF/UA-2 check.
What accessible means for a PDF
A PDF made the usual way is a picture of a page: letters at positions. A screen reader has to guess what is a heading, where the columns of a table are and what a figure shows. A tagged PDF carries that structure inside the file: this is a heading, this is a list, this cell is a header, this picture means the following. PDF/UA is the ISO standard for what a tagged PDF must contain, and PDF/UA-2 is its current part, written for PDF 2.0.
For most of its life LaTeX could not write such files. The LaTeX Tagging Project changed that. With a current LaTeX release, one declaration at the top of the document turns tagging on.
The line that turns tagging on
\DocumentMetadata{
lang=en-US,
pdfstandard=ua-2,
pdfversion=2.0,
tagging=on,
tagging-setup={math/setup=mathml-SE}
}
\documentclass{article}
\usepackage{unicode-math}
\usepackage{hyperref}
\hypersetup{pdftitle={Cooling of a cup of tea}, pdfdisplaydoctitle=true}langis the language a screen reader reads the text in.pdfstandard=ua-2declares PDF/UA-2, and LaTeX writes what that standard asks for.tagging=onwrites the tags. Older LaTeX releases do not know this key.math/setup=mathml-SEstores every equation as MathML too, which is what lets a screen reader speak it.pdftitleis the name a screen reader announces when the file opens.
Build with LuaLaTeX. The LaTeX Project recommends it for new tagged documents, and it writes the MathML for your equations by itself. On LetX a new project that has this line and loads unicode-math or fontspec is built with LuaLaTeX without your choosing it. A project whose engine you set yourself keeps that engine.
Figures need alt text
Alt text is one sentence saying what a reader who cannot see the figure needs to know. Say what the picture shows, not what it looks like. A figure that is only decoration is marked as an artifact, so a screen reader skips it.
\includegraphics[width=8cm,
alt={Temperature of the tea falling from 92 to 41 degrees over 30 minutes}]{cooling}
\begin{tikzpicture}[alt={Graph of y = x squared with its tangent at x = 1}]
...
\end{tikzpicture}
\includegraphics[artifact]{page-ornament}Tables need header rows
By default every cell of a table is tagged as data. Say which rows are headers, so a screen reader can read each value with its column name. Keep tables simple: one header row and no merged cells is the form that works everywhere.
\tagpdfsetup{table/header-rows={1}}
\begin{tabular}{lr}
Minute & Temperature \\
0 & 92 \\
30 & 41
\end{tabular}Headings, lists, links and maths
- Use
\sectionand\subsectionin order. Bold text made to look like a heading is not a heading. - Use
itemize,enumerateanddescriptionfor lists, not line breaks. - Write maths in maths mode. A formula typed as ordinary text or pasted in as a picture cannot be read aloud.
- Give links text that says where they go. A bare address is read out letter by letter.
What we built and what the validator said
We wrote three templates this way, built each one on LetX with LuaLaTeX and ran the PDF through veraPDF, an open-source validator, against its PDF/UA-2 profile. Results of 14 November 2026, veraPDF 1.30.4:
| Template | What it contains | PDF/UA-2 check |
|---|---|---|
| Accessible article | Headings, lists, a table, a graph, equations, citations and a reference list | Passed: 1,728 rules, none failed |
| Accessible letter | Addresses as text, the subject as a heading, lists | Passed: 1,728 rules, none failed |
| Accessible course handout | Headings, lists, equations, a graph with alt text, a table, a link | Passed: 1,728 rules, none failed |
Since then we have added templates other people wrote and published under free licences. Each was built on LetX the same way and checked with the same validator on the same day, and each carries its authors’ names and licence.
| Template | By | PDF/UA-2 check |
|---|---|---|
| MIT thesis | John H. Lienhard, the mitthesis class (MIT licence), with tagging switched on | Passed: 1,728 rules, none failed |
| UC Irvine thesis and dissertation | Isabela Figueira and Alyson Yin, UC Irvine (CC BY 4.0) | Passed: 1,728 rules, none failed |
| Accessible teaching slides | Richard Stanton, UC Berkeley (CC0), on the ltx-talk class | Passed: 1,728 rules, none failed |
| Accessible article with teaching notes | Richard Stanton, UC Berkeley (CC0) | Passed: 1,728 rules, none failed |
Thesis templates published by the universities themselves or by their students passed the same check on the same day: UC Berkeley, Purdue, Auburn, UCF, Iowa State, Brandeis, UW-Madison and Lancaster. They are all on the accessible templates page, each with its authors and licence.
Slides need a different class. Beamer cannot produce a tagged PDF, and the next page explains what to use in its place: accessible slides in LaTeX.
Check your own PDF
verapdf -f ua2 your-document.pdfA validator checks what a machine can check: that tags exist, that a language and a title are set, that every figure has some alternative. It cannot tell whether the alternative is a good one. Before you publish, do what the validator cannot:
- Read each alt text with the figure covered. Does it tell you what you need?
- Read the headings alone, as a list. Do they make an outline of the document?
- Open the PDF with a screen reader (NVDA on Windows, VoiceOver on a Mac) and listen to one page.
- Check that text and background have enough contrast, and that colour is never the only signal.
If your course site runs its own checker, expect noise. Blackboard Ally and PAC do not support PDF/UA-2 yet, so they flag things in a correct file: a title they cannot find, and every equation as an image without a description. Richard Stanton of UC Berkeley keeps a dated record of what each checker reports. Do not accept a suggested fix that replaces the MathML of an equation with a text label: it raises the score and takes the maths away from a screen reader.
What does not work yet
Tagging is new and still being built. Not every package and class works with it: the LaTeX Project keeps a status list of packages and classes, and it is worth looking up yours before converting a long document. You also need a current LaTeX release; the project’s instructions cover the release of November 2025 and later, which is the one LetX builds with. An older installation ignores or rejects the tagging key.
Start from a template whose PDF already passes.
Accessible templatesFrequently asked questions
Can LaTeX produce an accessible PDF?
Yes. With a current LaTeX release, a \DocumentMetadata line with tagging=on before \documentclass makes LaTeX write a tagged PDF: headings, lists, tables, figures and equations carry the structure a screen reader needs. Every LetX template that carries the Accessible PDF label was built this way and passed the PDF/UA-2 check in veraPDF.
What is a tagged PDF?
A PDF that records its own structure: which text is a heading, a list or a table header, what language it is in, and a text alternative for each picture. Screen readers use the tags to announce and move through the document. PDF/UA is the ISO standard that defines what the tags must contain.
How do I add alt text to a figure in LaTeX?
Use the alt key: \includegraphics[alt={What the figure shows}]{file}. The same key works on tikzpicture. Mark a purely decorative picture with the artifact key instead, so a screen reader skips it.
Do I need LuaLaTeX for an accessible PDF?
It is the engine the LaTeX Project recommends for tagged documents, because it writes MathML for equations by itself. pdfLaTeX can also produce tagged PDFs, with more work for the maths. LetX builds a new tagged project that loads unicode-math or fontspec with LuaLaTeX.
How do I check that my PDF is accessible?
Run a validator such as veraPDF against the PDF/UA-2 profile (verapdf -f ua2 file.pdf), then check what a machine cannot: read your alt text with the figures covered, read the headings as an outline, and listen to a page with a screen reader.
Related

Written by Shihab Shahriar Antor , AI Engineer & Founder of Shahriar Labs. Builder of LetX (collaborative LaTeX) and offSchool (SSC science and maths, learned through simulations).