Port the template from beamer to ltx-talk
Beamer cannot produce a genuinely tagged PDF. The master template validates as PDF/UA-2 only because tagpdf marks everything it was not told about as decorative, so a screen reader gets the frame titles and nothing else. Beamer 3.77 then made matters worse by refusing \DocumentMetadata outright, which breaks tagging on TeX Live 2025 and leaves the deck failing validation altogether. ltx-talk was written by the LaTeX Project with tagging as a design goal. The slides built here carry real paragraphs, lists as L/LI/Lbl/LBody, sections as headings, formulas as MathML, and alt text that reaches the PDF. veraPDF passes on the strength of that structure rather than in spite of its absence. The metropolis theme files go with beamer; trantor replaces them. Fonts, figures and the purple palette are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,306 +1,84 @@
|
||||
\DocumentMetadata{
|
||||
tagging=on,
|
||||
tagging-setup={math/setup=mathml-SE},
|
||||
pdfstandard=ua-2,
|
||||
pdfversion=2.0,
|
||||
lang=en-US,
|
||||
}
|
||||
\documentclass[10pt,xcolor=dvipsnames,aspectratio=169]{beamer}
|
||||
\documentclass[aspectratio=169]{ltx-talk}
|
||||
|
||||
\usetheme{metropolis}
|
||||
\usepackage{appendixnumberbeamer}
|
||||
|
||||
% math needs an OpenType math font so that every glyph carries a Unicode
|
||||
% mapping; the Computer Modern math fonts have no ToUnicode entries
|
||||
\usepackage{unicode-math}
|
||||
\usepackage{graphicx}
|
||||
|
||||
\usepackage{tagpdf}
|
||||
\tagpdfsetup{activate-all}
|
||||
|
||||
\usepackage{pgfpages}
|
||||
\input{notes.config}
|
||||
|
||||
\usepackage{pgfplots}
|
||||
\usepgfplotslibrary{dateplot}
|
||||
|
||||
\usepackage{booktabs}
|
||||
\usepackage[scale=2]{ccicons}
|
||||
|
||||
% optional metro things
|
||||
\metroset{numbering=fraction} % page numbering format
|
||||
\metroset{progressbar=foot} % progress bar in footer
|
||||
\metroset{sectionpage=none, subsectionpage=none}
|
||||
\metroset{block=fill}
|
||||
% \metroset{background=light}
|
||||
|
||||
% Tag frame titles as H1 headings for PDF accessibility
|
||||
% (must come after all \metroset calls, which reset the frametitle template)
|
||||
\addtobeamertemplate{frametitle}{%
|
||||
\tagstructbegin{tag=H1}%
|
||||
\tagmcbegin{tag=H1}%
|
||||
}{%
|
||||
\tagmcend%
|
||||
\tagstructend%
|
||||
}
|
||||
|
||||
% Font paths must stay inside this directory. LuaTeX fails to resolve a
|
||||
% parent-relative Path= and dies with an unhelpful empty-filename error.
|
||||
\setsansfont{OpenSans}[
|
||||
Path = ./fonts/OpenSans/,
|
||||
Extension = .ttf,
|
||||
UprightFont = *-Regular,
|
||||
BoldFont = *-Bold,
|
||||
ItalicFont = *-Italic,
|
||||
BoldItalicFont = *-BoldItalic
|
||||
]
|
||||
|
||||
Path = fonts/OpenSans/, Extension = .ttf,
|
||||
UprightFont = *-Regular, BoldFont = *-Bold,
|
||||
ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic]
|
||||
\setmonofont{RobotoMono}[
|
||||
Path = ./fonts/RobotoMono/,
|
||||
Extension = .ttf,
|
||||
UprightFont = *-Regular,
|
||||
BoldFont = *-Bold,
|
||||
ItalicFont = *-Italic,
|
||||
BoldItalicFont = *-BoldItalic
|
||||
]
|
||||
Path = fonts/RobotoMono/, Extension = .ttf,
|
||||
UprightFont = *-Regular, BoldFont = *-Bold,
|
||||
ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic]
|
||||
|
||||
\definecolor{makopurple1}{RGB}{57,39,91}
|
||||
\definecolor{makopurple2}{RGB}{137,119,173}
|
||||
\definecolor{makopurple3}{RGB}{29,13,59}
|
||||
\definecolor{makopurple4}{RGB}{124,99,173}
|
||||
\definecolor{accent}{RGB}{124,99,173}
|
||||
|
||||
% \definecolor{makopurple1}{HTML}{3b255b}
|
||||
\definecolor{makogreen1}{HTML}{0b7a75}
|
||||
\definecolor{makovanilla1}{HTML}{d7c9aa}
|
||||
\definecolor{makoumber1}{HTML}{7b2d26}
|
||||
\definecolor{makowhite1}{HTML}{f0f3f5}
|
||||
\usepackage{trantor}
|
||||
\usepackage{talk-notes}
|
||||
|
||||
\setbeamercolor{normal text}{fg=black, bg=white}
|
||||
\setbeamercolor{alerted text}{fg=makopurple4}
|
||||
\setbeamercolor{example text}{fg=makoumber1}
|
||||
% trantor's dark panels (section pages and \standout) default to black
|
||||
\colorlet{TrantorDark}{makopurple1}
|
||||
|
||||
\setbeamercolor{palette primary}{bg=makopurple1, fg=normal text.bg}
|
||||
\setbeamercolor{palette secondary}{bg=makogreen1,fg=normal text.bg}
|
||||
\setbeamercolor{palette tertiary}{bg=makovanilla1,fg=normal text.bg}
|
||||
\setbeamercolor{palette quaternary}{bg=makoumber1,fg=normal text.bg}
|
||||
\setbeamercolor{structure}{fg=makopurple1, bg=normal text.bg} % itemize, enumerate, etc
|
||||
\setbeamercolor{section in toc}{fg=makopurple1, bg=normal text.bg} % TOC sections
|
||||
\hypersetup{pdfdisplaydoctitle=true,pdftitle={Presentation Title}}
|
||||
|
||||
% \setbeamercolor{progress bar}{fg=makopurple1}
|
||||
% \setbeamercolor{title separator}{fg=makopurple1}
|
||||
% \setbeamercolor{progress bar in head/foot}{fg=makopurple1}
|
||||
% \setbeamercolor{progress bar in section page}{fg=makopurple1}
|
||||
\renewcommand{\titlelogo}{%
|
||||
\includegraphics[height=1.4cm,
|
||||
alt={Community Data Science Collective logo}]{figures/logo.pdf}}
|
||||
|
||||
% this is a fix for a bug with XeTeX and notes pages
|
||||
% see: https://tex.stackexchange.com/questions/232168/normal-text-is-invisible-when-using-beamer-with-notes-and-xelatex
|
||||
\usepackage{ifthen}
|
||||
\makeatletter
|
||||
\def\beamer@framenotesbegin{% at beginning of slide
|
||||
\ifthenelse{\not \boolean{metropolis@standout}}{%
|
||||
\usebeamercolor[fg]{normal text}%
|
||||
\gdef\beamer@noteitems{}%
|
||||
\gdef\beamer@notes{}%
|
||||
|
||||
}{\gdef\beamer@noteitems{}%
|
||||
\gdef\beamer@notes{}%
|
||||
}
|
||||
}
|
||||
% redfine the notes type to clear things (working around the same bug)
|
||||
% https://tex.stackexchange.com/questions/28966/change-beamer-notes-list-type-for-in-frame-notes
|
||||
\def\beamer@setupnote{%
|
||||
\gdef\beamer@notesactions{%
|
||||
\beamer@outsideframenote{%
|
||||
\beamer@atbeginnote%
|
||||
{\normalfont%
|
||||
\parskip 0.5em%
|
||||
\usebeamercolor[fg]{normal text}%
|
||||
\beamer@notes%
|
||||
\ifx\beamer@noteitems\@empty\else
|
||||
\beamer@noteitems%
|
||||
\fi%
|
||||
|
||||
\par}
|
||||
\beamer@atendnote%
|
||||
}%
|
||||
\gdef\beamer@notesactions{}%
|
||||
}
|
||||
}
|
||||
\makeatother
|
||||
|
||||
\usepackage{xspace}
|
||||
\usepackage{relsize}
|
||||
|
||||
% add tikz and a bunch of tikz foo
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{shapes,shapes.misc,backgrounds,fit,positioning}
|
||||
\tikzstyle{every picture}+=[overlay,remember picture]
|
||||
|
||||
% add functions to circle parts of slides (e.g., in tables)
|
||||
\newcommand\marktopleft[1]{\tagmcbegin{artifact}\tikz \node (marker-#1-a) at (0,1.5ex) {};\tagmcend}
|
||||
\newcommand\markbottomright[1]{%
|
||||
\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}{}
|
||||
|
||||
% more flexible non-tikz alternative with no dropshadow
|
||||
\newlength{\centertxtlen}
|
||||
\makeatletter
|
||||
\newcommand\centertext[2]{%
|
||||
\setlength{\centertxtlen}{#1}%
|
||||
\setlength{\centertxtlen}{0.48\centertxtlen}%
|
||||
{\centering
|
||||
\fontsize{#1}{2\centertxtlen}\selectfont
|
||||
\e{#2}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
% packages i use in essentially every document
|
||||
% give every \includegraphics an alt={...} description. the current
|
||||
% toolchain drops it, but it will be used once tagging is available
|
||||
\usepackage{graphicx}
|
||||
\usepackage{url}
|
||||
% \usepackage{dcolumn}
|
||||
% \usepackage{booktabs}
|
||||
|
||||
% replace footnotes with symbols instead of numbers
|
||||
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
|
||||
\usepackage{perpage}
|
||||
\MakePerPage{footnote}
|
||||
|
||||
% \hypersetup{colorlinks=true, linkcolor=Black, citecolor=Black, filecolor=makopurple1,
|
||||
% urlcolor=Plum, unicode=true}
|
||||
|
||||
% assistive software should announce the document title rather than the
|
||||
% filename; PDF/UA requires this to be set explicitly
|
||||
\hypersetup{pdfdisplaydoctitle=true}
|
||||
|
||||
% create a new \e{} command to make things purple and bold
|
||||
% (falls back to \textit{} on standout slides where alert color is invisible)
|
||||
\newcommand{\e}[1]{%
|
||||
\ifthenelse{\boolean{metropolis@standout}}{\textit{#1}}{\alert{#1}}}
|
||||
|
||||
% remove the nagivation symbols
|
||||
\setbeamertemplate{navigation symbols}{}
|
||||
|
||||
% suppress page number on standout slides
|
||||
\defbeamertemplate{frame numbering}{fraction-no-standout}{%
|
||||
\ifthenelse{\boolean{metropolis@standout}}%
|
||||
{}%
|
||||
{\insertframenumber/\inserttotalframenumber}%
|
||||
}
|
||||
\setbeamertemplate{frame numbering}[fraction-no-standout]
|
||||
|
||||
\newcommand{\credit}[1]{%
|
||||
\tikz[overlay]{\node at (current page.south west)
|
||||
[anchor=south west, yshift=3pt, xshift=2pt]
|
||||
{\tagmcbegin{artifact}\smaller \smaller {[}#1{]}\tagmcend};}}
|
||||
|
||||
\setlength{\parsep}{1em}
|
||||
% \e{} was the beamer template's emphasis command; ltx-talk provides \alert
|
||||
\newcommand{\e}[1]{\alert{#1}}
|
||||
|
||||
\title{Presentation Title}
|
||||
\subtitle{Presentation Subtitle}
|
||||
\author[Benj. Mako Hill]{\textbf{Benjamin Mako Hill}\\
|
||||
makohill@uw.edu}
|
||||
\institute[UW/Harvard]{\textbf{University of Washington}\\
|
||||
Department of Communication\\
|
||||
\emph{Associate Professor}\\
|
||||
\hspace{1pt}\\
|
||||
\textbf{Harvard University}\\
|
||||
Berkman Klein Center\\
|
||||
\emph{Faculty Associate}}
|
||||
|
||||
\author{Benjamin Mako Hill}
|
||||
\institute{University of Washington, Department of Communication}
|
||||
\date{December 2, 1980}
|
||||
|
||||
\begin{document}
|
||||
|
||||
% remove some of the space in the itemize to make it quite compact
|
||||
% \let\olditemize\itemize
|
||||
% \renewcommand\itemize{\olditemize\itemsep-1pt}
|
||||
|
||||
%% SLIDE: Title Slide
|
||||
\begin{frame}
|
||||
\titlepage
|
||||
|
||||
\tikz{\node at (current page.center) [anchor=center, yshift=-0.5in, xshift=1in]
|
||||
{\includegraphics[width=0.25\textwidth,alt={Community Data Science Collective logo}]{figures/logo.pdf}};
|
||||
}
|
||||
|
||||
% include version control stuff
|
||||
\input{vc}
|
||||
\credit{Revision:\ \VCRevision\ (\VCDateTEX)}
|
||||
\end{frame}
|
||||
\maketitle
|
||||
|
||||
\section{Introduction}
|
||||
|
||||
\begin{frame}
|
||||
\sectionpage
|
||||
|
||||
\note{This is an example section page.}
|
||||
\end{frame}
|
||||
|
||||
%% SLIDE: Slide 2
|
||||
\begin{frame}{A sample slide, A sample slide, A sample slide, A sample
|
||||
slide, A sample slide, A sample slide}
|
||||
|
||||
A displayed formula:
|
||||
|
||||
\[
|
||||
\int_{-\infty}^\infty e^{-x^2} \, dx = \sqrt{\pi}
|
||||
\]
|
||||
|
||||
An itemized list:
|
||||
|
||||
\begin{itemize}
|
||||
\item<1-> itemized item 1
|
||||
\item<2-> itemized item 2
|
||||
\item<3-> itemized item 3
|
||||
\end{itemize}
|
||||
|
||||
\visible<2->{
|
||||
\begin{example}
|
||||
\emph{In a right triangle, the square of hypotenuse equals
|
||||
the sum of squares of two other sides.}
|
||||
\end{example}
|
||||
}
|
||||
|
||||
\credit{Image credit: Shaw and Hill, 2099.}
|
||||
\note{These are the slide 2 notes.}
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}
|
||||
\frametitle{Short frame title}
|
||||
|
||||
\e{A first} paragraph.
|
||||
|
||||
And then \e{a second} paragraph.
|
||||
\end{frame}
|
||||
|
||||
\subsection{Introductory Subsection}
|
||||
|
||||
\begin{frame}
|
||||
\subsectionpage
|
||||
|
||||
\note{This is an example subsection page.}
|
||||
\end{frame}
|
||||
|
||||
\appendix
|
||||
|
||||
\begin{frame}[standout]
|
||||
Example and Data Appendix
|
||||
\end{frame}
|
||||
\sectionpage
|
||||
|
||||
\begin{frame}{A sample slide}
|
||||
Final Sample Slide
|
||||
A displayed formula:
|
||||
\[ \int_{-\infty}^\infty e^{-x^2} \, dx = \sqrt{\pi} \]
|
||||
|
||||
\texttt{Monospace font?}
|
||||
|
||||
\note{These are the slide 4 notes.}
|
||||
An itemized list:
|
||||
\begin{itemize}[<+->]
|
||||
\item itemized item 1
|
||||
\item itemized item 2
|
||||
\item itemized item 3
|
||||
\end{itemize}
|
||||
|
||||
\footline{Image credit: Shaw and Hill, 2099.}
|
||||
|
||||
\note<1>{Set up the integral before revealing anything else.}
|
||||
\note{Mention that this is the Gaussian integral.}
|
||||
\note<3->{Once the whole list is up, tie it back to the opening claim.}
|
||||
\end{frame}
|
||||
|
||||
\begin{frame}{Short frame title}
|
||||
\e{A first} paragraph with \texttt{monospace text}.
|
||||
|
||||
And then \e{a second} paragraph.
|
||||
|
||||
\note{A note that applies to this whole frame.}
|
||||
\end{frame}
|
||||
|
||||
\standout{Example and Data Appendix}
|
||||
|
||||
\end{document}
|
||||
|
||||
% LocalWords: xcolor dvipsnames beamer ugm phv sep pageofpages px
|
||||
% LocalWords: titleline alternativetitlepage titlepagelogo Torino
|
||||
% LocalWords: watermarkheight watermarkheightmult bg makopurple fg
|
||||
% LocalWords: noparskip colback colframe coltext coltitle fonttitle
|
||||
% LocalWords: colorlinks linkcolor citecolor filecolor urlcolor
|
||||
% LocalWords: unicode frametitle subbody subsubbody
|
||||
|
||||
Reference in New Issue
Block a user