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}
Cindy
  • 63
  • 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. –  Nov 08 '18 at 03:20
  • Thanks! I've removed the \pdftooltip command... – Cindy Nov 08 '18 at 04:56
  • For tagged PDFs have a look at the experimental tagpdf package. – TeXnician Nov 08 '18 at 05:57

1 Answers1

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.
Ulrike Fischer
  • 327,261
  • 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 '22 at 14:57
  • @MadyYuvi as the documentation says tagpdf now requires the pdfmanagement. Put \RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} before \documentclass. – Ulrike Fischer Apr 13 '22 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 '22 at 15:29
  • I'm using XeLaTeX in MikTeX V2.9 in Win10 – MadyYuvi Apr 13 '22 at 15:30
  • Update your miktex. – Ulrike Fischer Apr 13 '22 at 15:35
  • My version is Version 3.141592653-2.6-0.999993 (MiKTeX 21.3), is it old? Kindly suggest the recent version number...please... – MadyYuvi Apr 13 '22 at 15:36
  • the miktex version is not the point. The question is your version of the pdfmanagement. Current is {pdfmanagement-testphase}{2022-03-17}{0.95m}. – Ulrike Fischer Apr 13 '22 at 15:37