Accessible PDF from LaTeX

2026-02-24 → 2026-04-02

Making LaTeX documents produce tagged, screen-reader-friendly PDFs – relevant for ADA Title II compliance (deadline April 2026).

Most LaTeX documents (pdflatex + standard classes) produce untagged PDFs with no structure metadata, invisible to screen readers. The fix is minimal: add a few lines to your preamble, switch to LuaLaTeX, and your existing layout is preserved.

Validated with PDFix PDF/UA validator. Also available as a Claude Code skill: /accessible-pdf in Claude Scholar.

The fix (5 changes)#

1. Add \DocumentMetadata before \documentclass#

This must be the very first thing in your .tex file, before \documentclass.

\DocumentMetadata{
  lang = en,
  pdfstandard = a-2b,
  pdfstandard = ua-1,
  pdfversion = 2.0,
  testphase = {phase-II},
}
\documentclass[10pt]{article}  % your existing documentclass

2. Swap font packages (LuaLaTeX requires OpenType fonts)#

LuaLaTeX uses OpenType fonts via fontspec instead of the old Type1 font system.

% REMOVE these:
%   \usepackage[utf8]{inputenc}
%   \usepackage[T1]{fontenc}
%   \usepackage[sc]{mathpazo}

% ADD these:
\usepackage{fontspec}
\setmainfont{TeX Gyre Pagella}    % Palatino equivalent
\setmonofont{Inconsolatazi4-Regular.otf}[BoldFont=Inconsolatazi4-Bold.otf]  % optional, for \texttt

Common font substitutions:

3. Add metadata to \hypersetup#

If you already load hyperref, add these keys:

\hypersetup{
  pdftitle={Your Document Title},
  pdfauthor={Your Name},
  pdfsubject={Description of the document},
  pdflang={en},
  pdfdisplaydoctitle=true,    % required for PDF/UA
  % ... your existing options (colorlinks, etc.)
}

pdfdisplaydoctitle=true is required by PDF/UA – it tells PDF viewers to show the document title in the title bar instead of the filename.

4. Replace symbol fonts that lack Unicode mappings (if applicable)#

Some packages (e.g., marvosym) produce glyphs that can’t be mapped to Unicode, which fails UA validation. Replace them with fontawesome5:

% REMOVE:
%   \usepackage{marvosym}   % \Letter, \Mundus lack Unicode mapping

% ADD:
\usepackage{fontawesome5}   % \faEnvelope, \faGlobe, \faOrcid, etc.

Icon examples:

5. Build with LuaLaTeX#

latexmk -lualatex mydocument

Or in a Makefile:

mydocument.pdf: mydocument.tex
    latexmk -lualatex mydocument

How to verify#

Limitations#

The result is a A-2b + UA-1 compliant document with structure tags (H1, P, L, LI) for screen reader navigation.

Requirements#

Tested with#

Receive my updates

YY's Random Walks — Science, academia, and occasional rabbit holes.

YY's Bike Shed — Sustainable mobility, urbanism, and the details that matter.

×