diff --git a/paper_template/text.tex b/paper_template/text.tex index efc59dd..5a3bc2d 100644 --- a/paper_template/text.tex +++ b/paper_template/text.tex @@ -1,7 +1,16 @@ % Tagged PDF (PDF/UA-2) accessibility setup. The article class works -% with the LaTeX tagging-project, so we use the full \DocumentMetadata +% with the LaTeX tagging project, so we use the full \DocumentMetadata % path here. +% +% tagging=on is what actually builds the structure tree: it loads the +% kernel code that tags paragraphs, headings, lists, tables, and +% floats. Declaring pdfstandard=ua-2 on its own only writes the claim +% into the metadata; without tagging=on the PDF is marked as UA-2 but +% carries no structure for a screen reader to read. This needs TeX +% Live 2025 or later --- on Overleaf, set it in Menu > Settings > +% TeX Live version. \DocumentMetadata{ + tagging=on, pdfversion=2.0, pdfstandard=ua-2, lang=en-US, @@ -10,8 +19,6 @@ \documentclass[12pt]{article} \usepackage{cdsc-paper} -\usepackage{tagpdf} -\tagpdfsetup{activate-all} \usepackage{fontspec} % fontspec disables the classic TeX input ligatures by default @@ -201,6 +208,51 @@ brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog \citep{989866}. +\section{Accessible Figures and Tables} + +Table~\ref{tab:example} shows a data table whose header row is tagged, +and the commented-out block below it shows a figure carrying alt text. +Both are here as worked examples; delete them along with this section +when you start writing. + +% ACCESSIBILITY: every figure needs an alt= description, which is what +% a screen reader announces in place of the image. Describe what the +% reader is meant to take from the figure rather than naming it: "Edit +% counts rising sharply after 2005" tells them something, "Figure 1" +% does not. The caption is read separately, so alt text that repeats +% the caption is wasted. For a purely decorative image, use +% \includegraphics[artifact]{...} instead, which keeps it out of the +% reading order entirely. +% +% \begin{figure} +% \centering +% \includegraphics[width=0.6\linewidth, +% alt={Edit counts by year, rising sharply after 2005}]{figure.pdf} +% \caption{A caption, which is read separately from the alt text.} +% \label{fig:example} +% \end{figure} + +% ACCESSIBILITY: header-rows tells the tagging code which rows are +% headers, so their cells become TH rather than TD and a screen reader +% can announce the column a value belongs to. Without it, a data table +% reads as an undifferentiated grid of numbers. Set it for each table +% that has headers; use {1,2} if two rows are headers. +\tagpdfsetup{table/header-rows={1}} +\begin{table} + \centering + \begin{tabular}{lr} + Item & Quantity \\ \hline + Widgets & 42 \\ + Gadgets & 13 + \end{tabular} + \caption{A data table whose first row is tagged as headers.} + \label{tab:example} +\end{table} + +% A table used only to position things on the page, rather than to +% present data, should be marked so assistive software skips its +% structure: \tagpdfsetup{table/tagging=presentation} + % bibliography here \setcounter{biburlnumpenalty}{9001} \printbibliography[title = {References}, heading=secbib]