Mandatory keys for \DocumentMetadata

Bruno Voisin bvoisin at icloud.com
Wed Feb 19 14:15:16 CET 2025


The following is more a LaTeX issue than a TeX Live issue, but since it occurred while testing TL 2025 I'm posting it here.

Is there somewhere a list of mandatory keys for LaTeX's \DocumentMetadata?

I've been using for some time code by Ulrike Fischer

	https://tex.stackexchange.com/a/594499

for the automatic rotation of PDF pages containing sideways figures or tables, namely

	\DocumentMetadata{}
	\documentclass{article}
	\usepackage{rotating}
	\ExplSyntaxOn
	\AddToHook{env/sidewaysfigure/end}{\pdfmanagement_add:nnn{ThisPage}{Rotate}{90}}
	\AddToHook{env/sidewaystable/end}{\pdfmanagement_add:nnn{ThisPage}{Rotate}{90}}
	\ExplSyntaxOff

This works, but testing TL 2025 I'm now getting a warning

	LaTeX DocumentMetadata Warning: The language has not been set in
	(DocumentMetadata)              \DocumentMetadata.
	(DocumentMetadata)              Setting it to 'en' as fallback.

The warning is suppressed by writing

	\DocumentMetadata{lang=en}

It's harmless, but the less warnings the better, so you can concentrate on actual errors in the TeX log.

Looking closer, this is not new with TL 2025, the warning was already present using TL 2024 but not TL 2023. So it must have been introduced at some point in 2024.

Ulrike gives a detailed explanation of \DocumentMetadata at

	https://tex.stackexchange.com/a/686905

There's later on the same page a reference to "texdoc documentmetadata-support", which says

	lang Explicitly sets the Lang entry in the Catalog, e.g., lang=de-DE. If not given the
	     default value used is en-US.

I did not find an explicit mention that \DocumentMetadata is expected to hold at least a lang setting, so that its absence triggers a warning.

lang seems to be the only such "mandatory" key. Is this referenced somewhere in the LaTeX doc?

Bruno Voisin




More information about the tex-live mailing list.