(I hope this is at least marginally on topic)
When I use the <abbr>
tag in HTML, the abbreviation and its expansion are marked by the browser:
But if I mark an abbreviation and its expansion with the accsupp
package like this:
\documentclass{article}
\pdfcompresslevel 0
\usepackage{accsupp}
\begin{document}
Trying out the \BeginAccSupp{method=plain,unicode,E={accessibility
support}}\texttt{accsupp}\EndAccSupp{} package.
\end{document}
then I have yet not found a way to make the expansion text visible in the PDF viewer:
I have looked in the PDF and the BDC
construct looks OK.
The PDF reference only talks about screen readers and such, so maybe this simply isn't meant to be viewed?
Still, I find it strange there should be no means to get at the expansion text from the viewer.
Remark: I've seen the question Are mouse over definitions of acronyms possible? but it deals with explicitly programming tooltips in JavaScript. This would be a last resort for me if I can't find a way to utilise the existing PDF construct.
Update: Let me formulate my question(s) a little broader (and maybe more precise):
- Is there any way to access the expansion text given in the
BDC
construct shown above from a PDF viewer (and if yes, which viewer)? - Which applications are accessing this construct at all? Is there a free screen reader or whatever which would access it?
- How could I validate whether I got this construct technically correct?
- Are there alternatives? What would be the PDF-Standard conforming way to implement HTMLs
<abbr>
tag in PDF (short of JavaScript programming)?
Update 2
With respect to @AlexG's answer, I have now played with the pdfcomment
package, with almost completely satisfying results:
\documentclass{article}
\pdfcompresslevel 0
\usepackage{accsupp}
\usepackage{pdfcomment}
\usepackage{xcolor}
\definecolor{underlinecolor}{gray}{0.9}
\begin{document}
Trying out the \BeginAccSupp{method=plain,unicode,E={accessibility
support}}%
\pdfmarkupcomment[color=underlinecolor,markup=Squiggly,borderstyle=dashed]{\texttt{accsupp}}{accessibility support}%
\EndAccSupp{} package.
\bigskip
Trying out the \BeginAccSupp{method=plain,unicode,E={accessibility
support}}%
\pdftooltip{\texttt{accsupp}}{accessibility support}%
\EndAccSupp{} package.
\end{document}
After looking at the implementation of \pdfmarkupcomment
, I've decided to go with \pdftooltip
. I would prefer also having the possibility to highlight the abbreviated word (like in the HTML display), but \pdfmarkupcomment
uses SOUL, and this is a little insecure to my taste.
Furthermore, I'm still a little disappointed that I didn't find any method to validate whether the BDC
construct produced by accsupp
has any effect at all. I opened the PDF in Acrobat Professional and enabled tagging, but still I could find no trace of the "abbreviation" anywhere.
<abbr>
?/Subtype/Link
line and enable the commented lines below.\pdftooltip
just boxes any material (text, graphic, ...) and just uses the size and position to calculate where to place the tooltop. If want to have light gray underline, you are free to do it on your own, e.g. in\myulpdftt
!