Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tooltip/popup in PDF with PDFLaTeX

66 views
Skip to first unread message

Mycroft

unread,
Feb 13, 2006, 5:24:19 PM2/13/06
to
Hello'

I've asked this a while ago but never got any answer. I also googled a
lot today and can't find a single working example...so here goes:

Does anyone know a way of having a tooltip or a popup display when I'm
hovering over a word in a PDF file created with PDFLaTeX??????

Martin

Bob Tennent

unread,
Feb 13, 2006, 6:24:02 PM2/13/06
to
On 13 Feb 2006 14:24:19 -0800, Mycroft wrote:
>
> Does anyone know a way of having a tooltip or a popup display when I'm
> hovering over a word in a PDF file created with PDFLaTeX??????

This will depend on the PDF viewer. Adobe acroread will produce a
"tooltip" of the URL of a hyperlink, but other PDF viewers do other
things. So even if you could fool hyperref into accepting arbitrary text
as a URL, you can't depend on what the PDF viewer will do with it.

Bob T.

Mycroft

unread,
Feb 14, 2006, 9:16:07 AM2/14/06
to
99% of the intended audience has Acrobat Reader anyway, so how do I do
it??? I know that it does it automatically for a url but I don't want
it just for urls, I want it on any word I like!

Bob Tennent

unread,
Feb 14, 2006, 3:06:45 PM2/14/06
to

It's what in the popup that "must" be a URL:

This is a \href{http://www.google.com}{link} to a web site.

But you'd have to re-define the \href macro to get it to accept
arbitrary text *in* the popup. There are options to control the
appearance of the hyper-linked text; for example,

\usepackage[urlcolor=black,colorlinks]{hyperref}

to avoid any change to the text.

Mycroft

unread,
Feb 14, 2006, 4:34:46 PM2/14/06
to
Well, we don't really have any control over that. As far as I
understand, It's all done by Acrobat Reader. It creates the popup
automatically for links of the forms "http://", "ftp://", "file://",
etc.

Playing around with the specs and Acrobat Profesionnal, I found this,
which is kind of elegant:

\leavevmode\pdfstartlink user{/Subtype/Text/CA
0/Name/Comment/Contents(popup)>>}test\pdfendlink

It creates a Text Annotation of opacity 0 (/CA) around the "test".
Problem is, it works only with Reader 6 and up. Also, it works only
with PDFLaTeX and now you can't click on it if, for example, it is also
an hyperlink...

I'll work on it some more eventually...

Martin

0 new messages