Using \DocumentMetadata in LaTeX 2026 for Modern PDFs
Starting with the LaTeX kernel updates in 2023-2024 and continuing into 2026, the \DocumentMetadata command provides a unified interface for enabling modern PDF features — including automatic tagging, PDF/A compliance, and document-level metadata. This replaces the need for multiple separate packages and configurations. It must be the very first command in your document, before \documentclass. Bibby AI uses the latest TeX Live distribution, so \DocumentMetadata works out of the box — ensuring you can produce modern, standards-compliant PDFs without any server configuration.
Enable DocumentMetadata for Modern PDF Output
Place \DocumentMetadata before \documentclass to activate modern PDF features at the kernel level:
% \DocumentMetadata MUST be the very first command
\DocumentMetadata{
lang = en-US, % Document language
pdfstandard = a-2b, % PDF/A-2b compliance
pdfversion = 2.0, % Use PDF 2.0 standard
testphase = {phase-III}, % Enable structure tagging (phase III)
}
\documentclass{article}
\usepackage{graphicx}
\usepackage{hyperref} % Enhanced by DocumentMetadata automatically
\begin{document}
\title{A Modern LaTeX Document}
\author{Author Name}
\date{2026}
\maketitle
\begin{abstract}
This document uses \texttt{\textbackslash DocumentMetadata} to produce
a tagged, PDF/A-compliant output suitable for archival and accessibility.
\end{abstract}
\section{Introduction}
With the modern LaTeX kernel, headings, paragraphs, lists, and tables
are automatically tagged without additional packages.
\begin{itemize}
\item Lists are tagged as \texttt{L}, \texttt{LI}, \texttt{Lbl} elements.
\item Sections become \texttt{H1}, \texttt{H2}, etc.
\item Paragraphs are wrapped in \texttt{P} tags.
\end{itemize}
\end{document}Configure PDF Standards and Metadata Options
Explore the various options available in \DocumentMetadata for different use cases:
% === Option A: PDF/A for archival (journals, dissertations) ===
\DocumentMetadata{
lang = en-US,
pdfstandard = a-2b, % PDF/A-2b: widely accepted archival format
pdfversion = 1.7, % Compatible PDF version
testphase = {phase-III},
}
% === Option B: PDF/UA for accessibility ===
\DocumentMetadata{
lang = en-US,
pdfstandard = ua-1, % PDF/UA-1: universal accessibility
pdfversion = 1.7,
testphase = {phase-III},
}
% === Option C: Maximum modern features ===
\DocumentMetadata{
lang = en-US,
pdfstandard = a-4, % PDF/A-4 (based on PDF 2.0)
pdfversion = 2.0,
testphase = {phase-III},
uncompress, % Uncompressed (for debugging structure)
}
\documentclass{article}
\begin{document}
\section{Standards Reference}
\begin{description}
\item[PDF/A-2b] Archival. Embeds fonts, restricts features for long-term preservation.
\item[PDF/UA-1] Accessibility. Requires complete tagging, alt text, reading order.
\item[PDF/A-4] Latest archival standard based on PDF 2.0.
\end{description}
\end{document}Handle Common Issues with DocumentMetadata
Work around common compatibility issues when enabling DocumentMetadata with existing packages:
% \DocumentMetadata can conflict with some packages.
% Here's how to handle common issues:
\DocumentMetadata{
lang = en-US,
pdfstandard = a-2b,
pdfversion = 1.7,
testphase = {phase-III},
}
\documentclass{article}
% hyperref is auto-loaded by DocumentMetadata.
% Don't load it again — just configure it:
\hypersetup{
colorlinks = true,
linkcolor = blue,
citecolor = green!50!black,
urlcolor = purple,
}
% Some packages need specific loading order:
\usepackage{amsmath} % Load before cleveref
\usepackage{amsthm}
\usepackage{cleveref} % Works with DocumentMetadata
% graphicx works normally
\usepackage{graphicx}
% biblatex works but verify with your style
\usepackage[backend=biber, style=numeric]{biblatex}
\begin{document}
\section{Compatibility Notes}
Most standard packages work. Check the LaTeX tagging project
status page for known incompatibilities.
If a package causes errors, try updating to the latest version first.
\end{document}💡 Tips
- •\DocumentMetadata must be the very first line of your .tex file — even before \documentclass. Nothing can precede it.
- •The 'testphase' key enables tagging features that are still being developed — check the LaTeX Project website for the current stable phase.
- •PDF/A-2b is the safest choice for most journal submissions — it's widely supported and doesn't require PDF 2.0 viewers.
- •Bibby AI keeps its TeX Live distribution current, so you always have access to the latest DocumentMetadata features.
Try This in Bibby AI
Write LaTeX faster with AI auto-complete and instant compilation.
Start Writing Free