Authoring guide

Accessible PDFs from LaTeX: the tagging project, \DocumentMetadata, and what works in 2026

How to produce tagged, PDF/UA-2 targeted output from LaTeX with \DocumentMetadata, which engine to use, how to add alt text and tagged math, and where package support still limits results.

Updated September 2, 2026. Reviewed by the DocAccessible team under our editorial policy.

Scientific and mathematical publishing has long been the hardest corner of document accessibility, because the dominant authoring system produced PDFs with no structure and no way to expose equations. That is changing through the LaTeX Project's tagged PDF work, which now lives in the LaTeX kernel rather than in experimental packages. This guide follows the project's own usage instructions and states plainly what is and is not covered.

Enable tagging

The switch is a \DocumentMetadata declaration placed before \documentclass. The project's reference example sets the language, the PDF standards to target, and tagged math in one block:

Preamble from the LaTeX Project usage instructions
\DocumentMetadata{
  lang        = en,
  pdfstandard = ua-2,
  pdfstandard = a-4f,
  tagging     = on,
  tagging-setup = {math/setup=mathml-SE}
}
\documentclass{article}
  • tagging=on enables the tagging engine; off disables it.
  • lang sets the document language, which becomes the PDF's declared natural language.
  • pdfstandard may be given more than once; ua-2 targets PDF/UA-2 and a-4f (or a-4) targets PDF/A-4. The PDF version defaults to 2.0.
  • tagging-setup={math/setup=mathml-SE} enables MathML structure elements for tagged math.

Engine and release

The project describes LuaLaTeX as "the preferred engine recommended for new documents". pdfLaTeX is supported, but math tagging there depends on external MathML files, and the instructions do not cover XeLaTeX. The project strongly recommends a current LaTeX release, naming 2026-06-01 and 2025-11-01, and notes that older releases have incomplete feature support; separate instructions exist for 2025-02-01 and 2024-06-01. In practice that means a recent TeX Live, and development releases receive new tagging support first. Overleaf documents the same workflow for its users.

Images: alt text, artifacts, and actual text

The graphicx interface gained keys for accessibility. A meaningful image takes alt={...} with a description of what the image conveys; a purely decorative image takes artifact so it is hidden from assistive technology; and an image that stands in for a character or short string takes actualtext={...}:

\includegraphics[height=4cm,alt={Portrait of Shakespeare}]{file.jpg}
\includegraphics[height=4cm,artifact]{crinklepaper}
\includegraphics[height=\baselineskip,actualtext=A]{file.jpg}

The project states these keys also work for \tikz, tikzpicture, and picture environments, which covers most programmatically drawn figures. Writing good alt text for a plot is a separate skill; the charts and graphs guide explains the short description plus long description pattern that scientific figures usually need.

Math

With LuaLaTeX and unicode-math, enabling the MathML setup produces MathML structure elements for equations, which is the mechanism PDF/UA-2 provides for accessible math. The project notes that MathML checksums must match the source, so edited math must be regenerated. pdfLaTeX users need amsmath and the external MathML file workflow. This is the area of fastest change, so consult the project's current instructions for the release you use.

Package support and what to check

Tagging works only as far as the packages a document loads cooperate with it. The project publishes tagging status pages covering more than 1,800 contributed packages, and its usage notes list known limits, for example that presentation tables and nested lists may not transfer well when a PDF is later derived to HTML. Before relying on output:

  1. Check each package the document loads against the tagging status pages and prefer supported alternatives where a package is unsupported.
  2. Validate the PDF with a checker that understands PDF/UA-2. The open-source veraPDF validator publishes PDF/UA-2 and WTPDF validation profiles, and PAC checks PDF/UA and WCAG requirements; see Acrobat's checker vs PAC.
  3. Inspect the tag tree in the free PDF tag viewer to confirm headings, lists, tables, figures, and formulas appear where expected.
  4. Read a representative section with a screen reader in a viewer that supports PDF 2.0 structure; see testing a PDF with a screen reader.

Frequently asked questions

Can LaTeX produce an accessible tagged PDF?

Yes, on a current LaTeX release. Placing \DocumentMetadata{tagging=on} before \documentclass and compiling with LuaLaTeX produces tagged output, with pdfstandard=ua-2 targeting PDF/UA-2, lang setting the language, and alt= keys on \includegraphics for image descriptions. Support depends on the packages a document loads, which the LaTeX Project tracks on its tagging status pages.

Which engine should I use for tagged LaTeX output?

The LaTeX Project recommends LuaLaTeX for new documents and describes it as the preferred engine. pdfLaTeX is supported but requires external MathML files for tagged math. The project's usage instructions do not cover XeLaTeX.

How do I add alt text to a figure in LaTeX?

Use the alt key on \includegraphics, for example \includegraphics[alt={Line chart of monthly temperature}]{figure.pdf}. Use the artifact key for decorative images and actualtext for images that stand in for a character or short string. The same keys work for TikZ and picture environments.

Sources

The statements above rest on the primary sources below. Where a source is a law or standard, the version and date named in the text are the ones checked on the review date. This guide is general information, not legal advice.

  1. LaTeX Project: Using LaTeX to produce accessible PDF (usage instructions) . The \DocumentMetadata keys, engine recommendations, release guidance, graphics keys, and math setup quoted in this guide.
  2. LaTeX Project: The LaTeX Tagged PDF Project
  3. Overleaf: Creating accessible PDFs in LaTeX
  4. veraPDF validation profiles: PDF/UA Part 2 rules

Keep reading