STEM-accessibility-test-docs

PDF/UA-2 MathML Encoding Test Files

This directory contains the six LaTeX source files, compiled PDFs, and documentation used to generate the PDF/UA-2 Math Encoding Test Results. Each subdirectory corresponds to one encoding combination tested.

Compilation environment

All six projects were compiled on Overleaf using the following settings:

Setting Value
Compiler LuaLaTeX (via lualatex-dev)
TeX Live version Rolling TeX Live (Overleaf Labs)
Compile mode Normal
Stop on first error On

Overleaf Labs must be enabled to access the Rolling TeX Live version. The rolling image provides the latest LaTeX tagging project fixes ahead of the annual TeX Live release, which is important for MathML tagging support. See Creating accessible PDFs in LaTeX - docs.overleaf.com for more information.

The latexmkrc file

All six projects share the same latexmkrc file:

$max_repeat = 1;
$force_mode = 1;
$pdflatex='pdflatex-dev -synctex=1 -interaction=nonstopmode';
$lualatex='lualatex-dev -synctex=1 -interaction=nonstopmode';

What each line does:

Why -dev variants? The -dev engines (lualatex-dev, pdflatex-dev) ship the development version of the LaTeX kernel (latex-dev package). When using Rolling TeX Live on Overleaf, this ensures you are running the absolute latest tagging code rather than the stable kernel bundled with that TeX Live snapshot.

The latexmkrc file and its contents were recommended for use with Overleaf by the LaTeX Tagging Project on their Using LaTeX to produce accessible PDF page.


PDF standards: pdfstandard=ua-2 and pdfstandard=A-4f

All six files declare pdfstandard = {ua-2, A-4f}. Here is what each means and why both are declared.

ua-2: PDF/UA-2 (ISO 14289-2)

PDF/UA-2 is the current Universal Accessibility standard for PDFs. It is built on PDF 2.0 and provides native support for MathML as a first-class structure type. It is the standard most directly relevant to math accessibility and is what screen reader / PDF viewer combinations must support to render MathML correctly.

A-4f: PDF/A-4f (ISO 19005-4, level f)

PDF/A is the archiving standard. The -4 generation aligns with PDF 2.0 (the same base as PDF/UA-2). The f conformance level (for “files”) permits embedded files which is what makes the Associated File (AF) encoding method possible. Without A-4f, embedding a MathML file as an Associated File attached to the formula object would not be standards-conforming.

A-4f is strictly required only for the files that use AF encoding. It is declared in all six files for consistency; its presence in SE-only files is unnecessary and harmless. The PDF simply claims conformance to a standard that permits embedded files, whether or not any are present.

Why pdfversion=2 does not need to be set explicitly

When pdfstandard=ua-2 (or A-4f) is declared, \DocumentMetadata automatically sets the PDF version to 2.0, because both of those standards require PDF 2.0. Writing pdfversion=2 explicitly would be redundant.


Language: lang=en

All six files use lang=en rather than lang=en-US. This is deliberate. lang=en is a valid BCP 47 tag meaning “English, no regional variant.” When a screen reader encounters it, they fall back to the user’s own configured locale for region-specific conventions if the base language is the same. So an en-GB user hears math spoken with British English conventions (e.g. “bracket” for parenthesis) and an en-US user hears American English conventions (e.g. “parenthesis” for parenthesis). Setting lang=en-US would override that and impose American conventions on all users regardless of their locale. lang=en is therefore the correct choice for a document intended for a broad English-speaking audience.


Encoding combinations at a glance

# Folder Encoding math/setup math/alt/use Overleaf project
1 01-pdfua2-mathml-af AF only mathml-AF — pdfua2-mathml-af
2 02-pdfua2-mathml-se SE only mathml-SE — pdfua2-mathml-se
3 03-pdfua2-mathml-af-se AF + SE {mathml-AF, mathml-SE} — pdfua2-mathml-af-se
4 04-pdfua2-mathml-af-alt AF + Alt text mathml-AF true pdfua2-mathml-af-alt
5 05-pdfua2-mathml-se-alt SE + Alt text mathml-SE true pdfua2-mathml-se-alt
6 06-pdfua2-mathml-af-se-alt AF + SE + Alt text {mathml-AF, mathml-SE} true pdfua2-mathml-af-se-alt

Key findings

See the full test results table for per-combination, per-environment detail.