On Tue, Aug 04, 2026 at 10:44:14PM +0200, Patrice Dumas wrote:
> On Sat, Jul 25, 2026 at 06:19:35PM +0200, Patrice Dumas wrote:
> > We could output that kind of code based on a customization variable too.
>
> I propose LATEX_TAGGED_PDF for the name of the customization variable.
> The idea is that if it is set but empty, it is set to the default value
> of
>
> lang=<BCP47 document-language-from-texinfo>,
> pdfstandard=ua-2
>
> and if it is set, to the default or a user-defined value, the following
> is inserted at the beginning of the document:
> \DocumentMetadata{tagging=on,
> <LATEX_TAGGED_PDF value>
> }
>
I'm confused where BCP47 language identifiers have come into this.
I find it hard to follow all the details of this discussion but it was
mentioned earlier:
Date: Thu, 23 Jul 2026 22:30:17 -0700
From: Charles Staats <[email protected]>
> In case it is possible to use \DocumentMetadata, which should be the
format of the lang? Some examples on the internet look like BCP 47
yes or omit it and it defaults to `en`
I believe that was David Carlisle replying to Patrice Dumas.
I found documentation online for \DocumentMetadata:
https://ctan.math.washington.edu/tex-archive/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf
> While the underlying functionality is still under development (e.g., further
> keys
> will be added over time and keys marked temporary may vanish again) the code
> for
> \DocumentMetadata is placed in a separate bundle, so that it is easier to
> update it
> without the need to build a full LATEX release. Over time the functionality
> will move
> fully into the kernel.
So I don't know how new or set in stone what is documented here is, but in this
document it does say BCP-47 format:
> The language key should be used to set the main language of the document.
> The value is given in BCP 47 format, so, e.g, languade=de-DE or language=fr.
> The value is stored in the document properties and can be retrieved
> (expandably)
> with \GetDocumentProperty{document/language}.
("languade" is presumably a typo for "language".)
However, I don't know what problem is being solved by outputting the document
language with this command. Is it required for "accessibility" conformance?
Is it required for 'pdfinfo' to state the PDF as tagged (as explained by
David Carlisle below)?
> Date: Fri, 24 Jul 2026 07:58:41 -0600
> From: Charles Staats <[email protected]>
>
> accessibility means in this context having a pdf that exposes structure to
> the operating system accessibility API so screen readers and braille
> displays can make use of the document.
>
> You can check a pdf with the common `pdfinfo` commandline utility and see
> if it says `Tagged: yes` the actual tagging should meet PDF/UA-2 standard
> (ISO 14289-2 https://pdfa.org/iso-14289-2-pdfua-2/) In many jurisdictions
> public bodies such as Universities have a legal requirement to produce
> accessible documents (aside from the fact that doing so is a good thing in
> itself)