From 2841ae97df3c3fc2d8dd47cda6fba7e9330ac34a Mon Sep 17 00:00:00 2001 From: Benjamin Mako Hill Date: Tue, 31 Mar 2026 11:14:19 -0700 Subject: [PATCH] Add tagged PDF accessibility support Switch to LuaLaTeX (better tagged PDF support), add \DocumentMetadata for PDF 2.0 and language metadata, enable tagpdf tagging, and mark tikz overlay commands (\credit, \marktopleft, \markbottomright) as PDF artifacts. Co-Authored-By: Claude Sonnet 4.6 --- slides_template/Makefile | 2 +- slides_template/example.tex | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/slides_template/Makefile b/slides_template/Makefile index 13364cf..0d15514 100644 --- a/slides_template/Makefile +++ b/slides_template/Makefile @@ -4,7 +4,7 @@ all: notes.config vc $(patsubst %.tex,%.pdf,$(wildcard *.tex)) pdf: all %.pdf: %.tex - latexmk -f -xelatex $< + latexmk -f -lualatex $< # latexmk -f -pdf -pdflatex="xelatex -synctex=1 %S %O" -verbose -file-line-error -interaction=nonstopmode $< # qpdf --qdf --object-streams=disable $@ - | sponge $@ # sed -e 's|/PageLabels|/BageLapels|g' < $@ |sponge $@ diff --git a/slides_template/example.tex b/slides_template/example.tex index 41a4c27..04b16a7 100644 --- a/slides_template/example.tex +++ b/slides_template/example.tex @@ -1,8 +1,15 @@ +\DocumentMetadata{ + pdfversion=2.0, + lang=en-US, +} \documentclass[10pt,xcolor=dvipsnames,aspectratio=169]{beamer} \usetheme{metropolis} \usepackage{appendixnumberbeamer} +\usepackage{tagpdf} +\tagpdfsetup{activate-all} + \usepackage{pgfpages} \input{notes.config} @@ -109,10 +116,10 @@ BoldItalicFont = *-BoldItalic \tikzstyle{every picture}+=[overlay,remember picture] % add functions to circle parts of slides (e.g., in tables) -\newcommand\marktopleft[1]{\tikz \node (marker-#1-a) at (0,1.5ex) {};} +\newcommand\marktopleft[1]{\tagmcbegin{artifact}\tikz \node (marker-#1-a) at (0,1.5ex) {};\tagmcend} \newcommand\markbottomright[1]{% - \tikz{\node (marker-#1-b) at (0,0) {};} - \tikz[dashed,inner sep=3pt]{\node[violet!75,ultra thick,draw,rounded rectangle,fit=(marker-#1-a.center) (marker-#1-b.center)] {};}} + \tagmcbegin{artifact}\tikz{\node (marker-#1-b) at (0,0) {};}\tagmcend + \tagmcbegin{artifact}\tikz[dashed,inner sep=3pt]{\node[violet!75,ultra thick,draw,rounded rectangle,fit=(marker-#1-a.center) (marker-#1-b.center)] {};}\tagmcend} % create an empty quotetxt so we can reuse it \newcommand{\quotetxt}{} @@ -153,7 +160,7 @@ BoldItalicFont = *-BoldItalic \newcommand{\credit}[1]{% \tikz[overlay]{\node at (current page.south west) [anchor=south west, yshift=3pt, xshift=2pt] - {\smaller \smaller {[}#1{]}};}} + {\tagmcbegin{artifact}\smaller \smaller {[}#1{]}\tagmcend};}} \setlength{\parsep}{1em}