How to get tagging off in new LaTeX

Bruno Voisin bvoisin at icloud.com
Sun Nov 2 21:28:05 CET 2025


> On 2 Nov 2025, at 20:45, David Carlisle <d.p.carlisle at gmail.com> wrote:
> 
> No, in the new release \DocumentMetadata{} is essentially  \DocumentMetadata{tagging=off} so it does load new template code and other things but does not trigger the generation of tagged PDF.

Thanks David (and Norbert, and Ulrike), for your answers that clarify things.

>> So, in essence, my question is: how to de-activate tagging while keeping everything else \DocumentMetadata provides (PDF 2.0, T1 fonts and pdfmanagement)? Is this
>> 
>> \DocumentMetadata{tagging=off}
>> 
>> Or
>> 
>> \RequirePackage{pdfmanagement}
>> \SetKeys[document/metadata]{pdfversion=2.0}
>> 
>> plus something else for T1 fonts?
> 
> the "something else" would be \usepackage[T1]{fontenc} 
> 
> You can use either. The first form with \DocumentMetadata loads the code (currently mostly in latex-lab) that re-implements many parts of latex with the template key-value system, this sets things up to enable tagging but tagging is not enabled, but the templates have other uses as well providing features such as key=value lists similar to the well known enumitem package.
> 
> Packages can detect the use of "new" documents that have \DocumentMetadata with \IfDocumentMetadatTF{...}{...}  so for most
> purposes if you want to opt in to the new code at all I would use that form but if you have compatibility reasons for not loading the latex lab code you can still load just pdfmanagement as you show.

Thanks, I will use

\DocumentMetadata{tagging=off}

and switch to

\RequirePackage{pdfmanagement}

in case the output gets odd or errors are triggered.

>> If I get things right, another hyperref driver file is involved when \DocumentMetadata{} is used, from another location. Where should I look then?
> 
> see pdfresources/hyperref-generic.dtx 

That's in pdfmanagement-testphase in the TL distro, I think. I see, the driver file is redefined there but not the core hyperref.sty. Looking closer at my mods, they were mostly taken from the latter, so no need to worry.

For example, I'm using a journal style that in its latest version loads hyperref and redefines \appendix but does not include the code hyperref adds to \appendix. So the PDF output is bugged: the appendix links in the PDF toc bring to the sections from the main text, not the appendices. I added

% From hyperref.sty
% Ensures PDF bookmarks are correct in appendices
\let\HyOrg at appendix\appendix
\def\Hy at AlphNoErr#1{%
  \ifnum\value{#1}>26 %
    Alph\number\value{#1}%
  \else
    \ifnum\value{#1}<1 %
      Alph\number\value{#1}%
    \else
      \Alph{#1}%
    \fi
  \fi
}
\renewcommand\appendix{%
  \gdef\theHsection{\Hy at AlphNoErr{section}}%
  \xdef\Hy at chapapp{\Hy at appendixstring}%
  \HyOrg at appendix
}

taken from hyperref.sty, to correct.

Bruno




More information about the tex-live mailing list.