[pstricks] Can a PSTricks pspolygon be made a clickable hyperlink?

Herbert Voss herbert49 at googlemail.com
Wed Jul 11 22:21:50 CEST 2007


Randy Yates wrote:
> Boris Veytsman <borisv at lk.net> writes:
> 
>> HV> From: Herbert Voss <herbert49 at googlemail.com>
>> HV> Date: Wed, 11 Jul 2007 08:27:55 +0200
>>
>> HV> Randy Yates wrote:
>>>> Is is possible to do this? For example, let's say you have a block
>>>> diagram of your design in PSTricks, and the design is hierarchical, so
>>>> that when you click on a block (actually click inside the pspolygon
>>>> area in the figure itself), it opens that block's design document.
>> HV> http://tug.org/PSTricks/main.cgi?file=Examples/misc#hyperref
>>
>> In this example the whole image becomes a hyperlink.  What is more
>> challenging (and interesting) is to make certain areas inside
>> pspicture to be hyperlinks, like imagemap in html
> 
> Yes, and that's what I need. My diagram has several blocks and I
> want each block to be a different hyperlink. 
> 
> Unless I enclose each one in a pspicture environment? Sounds like
> a bad idea.

no, you need it. By default all pspicture objects have no width and
height, hence they cannot act as a hyperlink. Only a box can, like
\pspciture ...

If you can divide your polynom in a sequence of boxes, then you
can have any possible hyerlinks.

HErbert

\documentclass{article}

\usepackage{pstricks}
%\usepackage{pst-pdf}
\usepackage{hyperref}

\begin{document}

The following image
\href{http://PSTricks.tug.org}{%
\begin{pspicture}(-2,-2)(2,2)%
\pscircle[fillstyle=vlines,linecolor=blue](0,0){2}
\end{pspicture}}
is a link to \nolinkurl{http://PSTricks.tug.org}

\vspace{2cm}

\begin{pspicture}(-3,-3)(3,3)%
\psset{linewidth=2pt}
\rput(-3,0){\href{http://PSTricks.tug.org}{\pspicture(3,3)\psline[linecolor=red](3,3)\endpspicture}}
\rput(0,0){\href{http://www.tug.org}{\pspicture(3,3)\psline[linecolor=green](0,3)(3,0)\endpspicture}}
\rput(0,-3){\href{http://www.tug.org/TeXnik}{\pspicture(3,3)\psline[linecolor=blue](3,3)\endpspicture}}
\rput(-3,-3){\href{http://www.dante.de}{\pspicture(3,3)\psline[linecolor=yellow](0,3)(3,0)\endpspicture}}
\end{pspicture}

\end{document}




-- 
http://PSTricks.tug.org
http://www.dante.de/CTAN/info/math/voss/



More information about the PSTricks mailing list