diff --git a/paper_template/text.Rtex b/paper_template/text.Rtex index 23eb40e..8335334 100644 --- a/paper_template/text.Rtex +++ b/paper_template/text.Rtex @@ -163,6 +163,14 @@ 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}. +% 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 which column a value belongs to. Without it, a table +% reads as an undifferentiated grid of numbers. kable puts the column +% names in a single header row, so {1} is right for the table below; +% use {1,2} where two rows are headers. Set it for each table, since +% it applies to the tables that follow it. +\tagpdfsetup{table/header-rows={1}} \begin{table} \centering <>= @@ -190,19 +198,24 @@ 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. +Table~\ref{tab:test} above is tagged with a header row. Figures need +alt text, 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 it is wasted. These are worked examples; +delete 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. +% For a figure generated by a chunk, knitr passes the fig.alt option +% through to the \includegraphics call it writes: +% +% <>= +% plot(year, edits) +% @ +% +% For a figure included from a file, put alt= on \includegraphics +% directly. A purely decorative image takes [artifact] instead, which +% keeps it out of the reading order entirely: % % \begin{figure} % \centering @@ -212,23 +225,6 @@ when you start writing. % \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}