2.7 \DocumentMetadata: Producing tagged PDF output

The \DocumentMetadata command was added to LaTeX in 2022. It enables so-called “tagging” of the PDF output, aiding accessibility of the PDF. It is supported best with LuaLaTeX; pdfLaTeX and XeLaTeX are supported as well as possible (see TeX engines).

It is unlike nearly any other command in LaTeX in that it must occur before the \documentclass command that starts a LaTeX document proper (see \documentclass). Therefore it must be called with \RequirePackage rather than \usepackage (see \RequirePackage).

This support is still in development, so we will not try to list all the possible settings. Please see the documentmetadata-support-doc document, part of the latex-lab package (https://ctan.org/pkg/latex-lab). Here is a simple example which enables most tagging currently implemented:

\DocumentMetadata{testphase={phase-III,firstaid}}
\documentclass{article}
...

As you can see from the key name testphase, this is all still in an experimental phase. The LaTeX developers strongly encourage users to give it a try and report problems, so it can be improved.


Unofficial LaTeX2e reference manual