2

Does anyone know of any packages to help create latex tables (ie . tabular or tikzset object) with proper 508 compliant tags? When I put a table made by latex through a PDF tagger the text does not come through correctly.

There is a similar question here; LaTeX accessibility But the latest responses are from 2014 and I was hoping something has improved in the past 4 years.

Below is a MWE that produces a table. (Im using Sweave to knit the Latex)

\documentclass{article}
\usepackage{tikz}
\begin{document}
\SweaveOpts{concordance=TRUE}
\begin{tabular}{r | r }
TITLE 1 & Title 2 \\
More text & 2 \\
 Other Text  & 3 \\
\end{tabular}
\end{document}

This makes a fine table, but when read into acrobat it is not properly tagged as a table and the text does not come though properly.

The 508 compliance standards I am talking about are summarized here: https://webaim.org/techniques/tables/data

Basically the table is supposed to have tags like

<table>
<caption>My Table caption </caption>

<tr>
<th scope="col">Title 1</th>
<th scope="col">Title 2</th>
</tr>

<tr>
<th scope="row">Row 1</th>
<td>More Text </td>
<td>2</td>
</tr>

<tr>
<th scope="row">Row 2</th>
<td>Other Text</td>
<td>3</td>
</tr>

</table>

I would like to avoid programming regex to make this if possible!

clairekelley
  • 309
  • 2
  • 8
  • 1
    Please explain '508 compliant'. Isn't this a reference to a particular section of a particular piece of legislation in a particular jurisdiction? Would you recognise an equivalently opaque reference to a similar section of similar legislation in all other jurisdictions? – cfr Jul 23 '18 at 22:23
  • There is probably very recent material about this available online in the form of film from TUG 2018's accessibility workshop. So I'd recommend looking there for more up-to-date information. – cfr Jul 23 '18 at 22:24

1 Answers1

4

FWIW, it is relatively straight forward to create tags in ConTeXt:

% The first two lines are needed for tagged pdf
\setupbackend[export=yes]
\setupstructure[state=start, method=auto]

\startsetups table:style
  \setupTABLE[each][each][align=flushright]
\stopsetups

\starttext

\startchapter[title=First chapter]
  \startplacetable
      [
        location=here,
        title=My first table,
      ]

    \startTABLE[setups=table:style]
      \NC Title 1    \NC Title 2 \NC \NR
      \NC More text  \NC 2       \NC \NR
      \NC More text  \NC 3       \NC \NR
    \stopTABLE
  \stopplacetable

  \startparagraph
    \input ward
  \stopparagraph
\stopchapter

\stoptext

This is how the tags tab looks like in Adobe:

I wonder how easy/difficult it is to use Sweave to weave a ConTeXt document instead of a LaTeX one..

Aditya
  • 62,301