Skip to content
PDF Accessibility

LaTeXUpdated 2026-12-03

How to create an accessible PDF from LaTeX

Modern LaTeX can produce tagged PDFs natively. It takes one line, a recent distribution and some care with packages.

How do I make a tagged, accessible PDF from LaTeX?

Add \DocumentMetadata{tagging=on} as the very first line of your source, before \documentclass, and compile with LuaLaTeX (preferred) or pdfLaTeX using TeX Live 2025 or later. You can also request a standard, for example pdfstandard=ua-2. Set the title and language, add alt text to figures, then check the PDF, because support varies by class and package.

How to produce an accessible PDF from LaTeX

  1. Update your distribution. Use TeX Live 2025 or later, or set that version in Overleaf.
  2. Turn on tagging. Add \DocumentMetadata{lang=en-US, tagging=on} as the first line, before \documentclass.
  3. Add alt text and structure. Use sectioning commands, set the title, and give each graphic alt text.
  4. Compile with LuaLaTeX. LuaLaTeX is the preferred engine, especially for documents with mathematics.
  5. Check and fix. Check the PDF and fix remaining problems in the source or with the fixer.

How LaTeX tagging works now

For years, LaTeX output was untagged by default and making it accessible meant fragile add-on packages. The LaTeX Project's tagging project has changed that: the kernel can now produce a structure tree directly. You switch it on with \DocumentMetadata at the top of the file. As of the November 2025 LaTeX release, a bare \DocumentMetadata{} does not turn tagging on by itself, so state tagging=on explicitly.

A typical start looks like: \DocumentMetadata{lang=en-US, pdfstandard=ua-2, tagging=on}, followed by \documentclass{article}. On Overleaf, choose TeX Live 2025 or later in the project settings so the tagging keys are recognized.

Good practice in the source

  • Use sectioning commands (\section, \subsection) so headings are tagged correctly.
  • Set the title and language in \DocumentMetadata and with \title; the hyperref package's pdftitle can also set the PDF title.
  • Add alt text to graphics: \includegraphics accepts an alt key in the tagging-enabled kernel; decorative images can be marked as artifacts.
  • Use LuaLaTeX with unicode-math for mathematics; the tagging code can attach MathML to formulas.
  • Keep tables simple and identify header rows where the tagging setup supports it.
  • Check package compatibility against the tagging project's status list before relying on a specialized package.

What typically breaks

The tagging code is still evolving. Older document classes and some popular packages are not yet fully compatible, and may produce warnings or untagged content. Common issues are figures without alt text, complex tables tagged without header relationships, custom title pages and headers built with low-level commands, beamer slides (whose support lags behind article-style documents), and older TeX distributions that silently ignore the keys. University and journal templates can also override settings.

Check, then fix what remains

Upload the compiled PDF to the checker to see what came through. If you cannot fix an issue in the source, for example an incompatible template, the fixer can tag or repair the PDF directly and add title, language and the PDF/UA identifier. Mathematics is best handled in the source, where the tagging code can attach MathML; fixing a PDF after the fact cannot add the same rich math structure, so formulas may need alt text instead.

Sources

This page is general information, not legal advice. Automated checks cannot prove full compliance; some requirements need human review.

Frequently asked questions

Do I still need the accessibility or tagpdf packages?

For new documents on a current distribution, the kernel's tagging via \DocumentMetadata is the recommended route. Older accessibility packages are not needed for it.

Why is my LaTeX PDF still untagged?

Common causes are an old TeX distribution, \DocumentMetadata not being the first line, or tagging=on not being set.

Can LaTeX produce PDF/UA?

It can target PDF/UA-2 with pdfstandard=ua-2. Whether a specific document passes depends on its class, packages and content, so check the output.

Does beamer support tagging?

Support for presentations lags behind standard document classes. Check the tagging project's status page for the current state.

Is mathematics accessible in tagged LaTeX PDFs?

With LuaLaTeX and unicode-math, formulas can carry MathML. Screen reader support for MathML in PDFs still varies by reader.