3

Does anyone know how to make a tagged document with graphs in LaTex? I tried adding a comment and a label to a graph, but the .pdf file still fails (missing alternate text) through Adobe's Full Check. I also use Adobe Autotag before Full Check. Thanks!

\documentclass[11pt]{article}
\usepackage[top=0.85in, bottom=1.1in, left=0.8in, right=0.8in]{geometry}
\usepackage{graphicx}
\begin{document}
\includegraphics{img}
\label{fig:img.jpg}

\end{document}
3
  • Sorry, your document does not seem to be compilable. Apart from the fact that it includes a graphics that probably not too many of us have, it uses the \pdftooltip command without loading appropriate packages that define it. BTW, I'd also like to draw your attention to this post.
    – user121799
    Nov 8, 2018 at 3:20
  • Thanks! I've removed the \pdftooltip command...
    – Cindy
    Nov 8, 2018 at 4:56
  • For tagged PDFs have a look at the experimental tagpdf package.
    – TeXnician
    Nov 8, 2018 at 5:57

1 Answer 1

3

You should be able to add the alt text with acrobat. But beside this you can use the accsupp package:

\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{accsupp}
\begin{document}
\BeginAccSupp{Alt={my figure},method=escape}
\includegraphics{example-image-duck}\label{fig:img.jpg}
\EndAccSupp{}
\end{document}

Something similar can be done with the tagpdf package mentioned in the comments:

\documentclass[11pt]{article}
\usepackage{graphicx}
\usepackage{tagpdf}
\tagpdfsetup{uncompress, %for the test, to check the pdf
             activate-mc}
\begin{document}
\tagmcbegin{tag=Figure,alttext={my figure}}
\includegraphics{example-image-duck}\label{fig:img.jpg}
\tagmcend
\end{document}

But attention

  • tagpdf is an experimental package!
  • unlike accsupp tagpdf hasn't currently different input methods for the alttext key. Its value is handled as verbatim, no TeX commands are expanded.
7
  • If I tried your suggestion, then I got the error Package tagpdf Error: PDF resource management is no active! (tagpdf) tagpdf will no work.. Please advise...
    – MadyYuvi
    Apr 13, 2022 at 14:57
  • @MadyYuvi as the documentation says tagpdf now requires the pdfmanagement. Put \RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} before \documentclass. Apr 13, 2022 at 15:17
  • My tags are follows: \RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} \documentclass[11pt]{article} \usepackage{graphicx} \usepackage{tagpdf} \tagpdfsetup{uncompress, %for the test, to check the pdf activate-mc} \begin{document} \tagmcbegin{tag=Figure,alttext={my figure}} \includegraphics{example-image-duck}\label{fig:img.jpg} \tagmcend \end{document} but still I got the error Undefined control sequence. <recently read> \DocumentMetadata Please advise...
    – MadyYuvi
    Apr 13, 2022 at 15:29
  • I'm using XeLaTeX in MikTeX V2.9 in Win10
    – MadyYuvi
    Apr 13, 2022 at 15:30
  • Update your miktex. Apr 13, 2022 at 15:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .