[pstricks] Fwd: Re: Getting tooltips in a pdf file from latex
Herbert Voss
Herbert.Voss at FU-Berlin.de
Mon Apr 19 23:35:26 CEST 2010
-------- Original-Nachricht --------
Betreff: Re: Getting tooltips in a pdf file from latex
Datum: Mon, 19 Apr 2010 23:34:21 +0200
Von: Herbert Voss <Herbert.Voss at FU-Berlin.de>
Organisation: T-Online
Newsgruppen: comp.text.tex
Referenzen: <85aasztbi0.fsf at emr.cs.iit.edu>
Am 19.04.2010 22:48, schrieb Edward M. Reingold:
> I use latex -> dvips -> ps2pdf to produce pdf files.
>
> I need (in the pdf file) to get tooltips of simple text (no links,
> mathematics, drawings, etc) attached to both simple text and to items in a
> PSTricks picture. The following desctibes the effect that I wnat to achieve:
\documentclass{article}
\usepackage{pstricks-add}
\usepackage{hyperref}
\newcounter{tooltip}
\newcommand\tooltip[2]{%
% arg #1: text to put on the page
% arg #2: tooltip text
\pdfmark[#1]{
pdfmark=/ANN,
Subtype=/Widget,
Raw={
/TU (#2)/T (tooltip \thetooltip)
/FT/Btn/Ff 65536/H/N
}
}%
\stepcounter{tooltip}%
}
\def\myF{\phantom{\rule{1cm}{1cm}}}
\begin{document}
\begin{center}
\begin{pspicture}(-4,-4)(4,4)
\psaxes(0,0)(-4,-4)(4,4)
\rput[c](0,0){\tooltip{\myF}{Origin}}
\rput[c](4,4){\tooltip{\myF}{top right}}
\rput[c](-4,-4){\tooltip{\myF}{bottom left}}
\end{pspicture}
\end{center}
\end{document}
Herbert
More information about the PSTricks
mailing list