1
0

Switch to lualatex and generate accessible PDF/UA-2 output

Add \DocumentMetadata for PDF 2.0 / PDF/UA-2, load tagpdf with
activate-all, extend hypersetup with pdftitle/pdfauthor/pdflang/
pdfdisplaydoctitle, and add alt text to the letterhead and signature
images. Drop xetex-only xltxtra and switch the Makefile from xelatex
to lualatex. Verified compliant with verapdf's PDF/UA-2 profile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-12 16:43:47 -07:00
parent c89a06cb19
commit 2d28230c53
2 changed files with 19 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ figures/signature.pdf:
gpg --yes --output $(DEC_SIGIMAGE) --decrypt $(ENC_SIGIMAGE) gpg --yes --output $(DEC_SIGIMAGE) --decrypt $(ENC_SIGIMAGE)
%.pdf: %.tex %.pdf: %.tex
latexmk -f -xelatex $< latexmk -f -lualatex $<
clean: clean:
latexmk -C *.tex latexmk -C *.tex

View File

@@ -1,3 +1,8 @@
\DocumentMetadata{
pdfversion=2.0,
pdfstandard=ua-2,
lang=en-US,
}
\documentclass[11pt,letterpaper]{article} \documentclass[11pt,letterpaper]{article}
% MODIFY THE DETAILS IN THIS SECTION TO MATCH WHAT YOU WANT ON /YOUR/ LETTERHEAD % MODIFY THE DETAILS IN THIS SECTION TO MATCH WHAT YOU WANT ON /YOUR/ LETTERHEAD
@@ -6,12 +11,16 @@
\def\phone{mobile 206-409-7191} \def\phone{mobile 206-409-7191}
\def\email{makohill@uw.edu} \def\email{makohill@uw.edu}
\def\web{https://mako.cc/academic/} \def\web{https://mako.cc/academic/}
\def\lettertitle{Letter from \email}
\def\letterauthor{John Hancock}
\usepackage[top=1.25in,left=1.25in,bottom=1.20in,right=1.25in]{geometry} \usepackage[top=1.25in,left=1.25in,bottom=1.20in,right=1.25in]{geometry}
\usepackage{xltxtra}
\usepackage{fontspec} \usepackage{fontspec}
\usepackage{tagpdf}
\tagpdfsetup{activate-all}
\newopentypefeature{Contextuals}{NoAlternate}{-calt}
\defaultfontfeatures{Kerning=Uppercase,Ligatures=TeX}
\setsansfont{OpenSans}[ \setsansfont{OpenSans}[
Path = ./fonts/OpenSans/, Path = ./fonts/OpenSans/,
@@ -31,6 +40,11 @@ BoldItalicFont = *-BoldItalic
\usepackage[colorlinks=false, \usepackage[colorlinks=false,
pdfborder={0 0 0}, pdfborder={0 0 0},
]{hyperref} ]{hyperref}
\hypersetup{unicode=true,
pdftitle={\lettertitle},
pdfauthor={\letterauthor},
pdflang={en-US},
pdfdisplaydoctitle=true}
\usepackage{tikz} \usepackage{tikz}
\usepackage{lastpage} \usepackage{lastpage}
@@ -43,7 +57,7 @@ BoldItalicFont = *-BoldItalic
\ifnum\thepage=1 \ifnum\thepage=1
\begin{tikzpicture}[remember picture,overlay,every node/.style={inner sep=0,outer sep=0}] \begin{tikzpicture}[remember picture,overlay,every node/.style={inner sep=0,outer sep=0}]
\node at (current page.north west) [anchor=north west] \node at (current page.north west) [anchor=north west]
{\includegraphics{figures/matrix_header.pdf}}; {\includegraphics[alt={University of Washington letterhead}]{figures/matrix_header.pdf}};
% add the department name % add the department name
\node at (current page.north west) [anchor=north west, xshift=1.19in, yshift=-0.56in] \node at (current page.north west) [anchor=north west, xshift=1.19in, yshift=-0.56in]
{{\fontsize{14pt}{16pt} \fontspec{MatrixIIOT-Book.otf}[ {{\fontsize{14pt}{16pt} \fontspec{MatrixIIOT-Book.otf}[
@@ -127,7 +141,7 @@ Sed ullamcorper morbi tincidunt ornare massa eget egestas purus. Feugiat pretium
Sincerely, Sincerely,
\includegraphics[width=1.7in]{figures/signature.pdf}\\ \includegraphics[width=1.7in,alt={Signature of \letterauthor}]{figures/signature.pdf}\\
John Hancock\\ John Hancock\\
Assistant Professor of Communication\\ Assistant Professor of Communication\\
Adjunct Assistant Professor of Human-Centered Design and Engineering Adjunct Assistant Professor of Human-Centered Design and Engineering