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

Can a PSTricks pspolygon be made a clickable hyperlink?

24 views
Skip to first unread message

Randy Yates

unread,
Jul 10, 2007, 10:02:25 PM7/10/07
to
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.

How to do?
--
% Randy Yates % "Bird, on the wing,
%% Fuquay-Varina, NC % goes floating by
%%% 919-577-9882 % but there's a teardrop in his eye..."
%%%% <ya...@ieee.org> % 'One Summer Dream', *Face The Music*, ELO
http://home.earthlink.net/~yatescr

Herbert Voss

unread,
Jul 11, 2007, 2:27:55 AM7/11/07
to
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.
>
> How to do?

http://tug.org/PSTricks/main.cgi?file=Examples/misc#hyperref

Herbert

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

Boris Veytsman

unread,
Jul 11, 2007, 10:51:04 AM7/11/07
to Herbert Voss
HV> From: Herbert Voss <herb...@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

--
Good luck

-Boris

Anyone who understands everything that comes out of fortune probably
has a problem

Randy Yates

unread,
Jul 11, 2007, 2:34:48 PM7/11/07
to
Boris Veytsman <bor...@lk.net> writes:

> HV> From: Herbert Voss <herb...@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.
--
% Randy Yates % "My Shangri-la has gone away, fading like
%% Fuquay-Varina, NC % the Beatles on 'Hey Jude'"
%%% 919-577-9882 %
%%%% <ya...@ieee.org> % 'Shangri-La', *A New World Record*, ELO
http://home.earthlink.net/~yatescr

Herbert Voss

unread,
Jul 11, 2007, 4:21:50 PM7/11/07
to Graphics with PSTricks
Randy Yates wrote:
> Boris Veytsman <bor...@lk.net> writes:
>
>> HV> From: Herbert Voss <herb...@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}

Boris Veytsman

unread,
Jul 11, 2007, 6:48:59 PM7/11/07
to Herbert Voss
HV> From: Herbert Voss <herb...@googlemail.com>
HV> Date: Wed, 11 Jul 2007 22:21:50 +0200


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

If only this code would work with pst-pdf or ps4pdf, it would be
perfect. Right now it works either with dvips->ps2pdf OR vtex, but it
is not what I need.

--
Good luck

-Boris

The Constitution may not be perfect, but it's a lot better than what we've got!

Alain Matthes

unread,
Jul 13, 2007, 9:00:49 AM7/13/07
to
Le Wed, 11 Jul 2007 18:48:59 -0400, Boris Veytsman a écrit:

If only this code would work with pst-pdf or ps4pdf, it would be
> perfect. Right now it works either with dvips->ps2pdf OR vtex, but it
> is not what I need.
>

With pdflatex, you make :

\documentclass{article}

\usepackage{tikz}
\usepackage{hyperref}

\begin{document}

The blue disk
\begin{tikzpicture}
\draw[fill=red] (0,0) circle (3cm);
\draw[fill=white] (0,0) circle (2cm);
\node at (0,0) {%
\href{http://altermundus.fr}{%
\begin{tikzpicture}
\draw[fill=blue] (0,0) circle (1cm);
\end{tikzpicture}}};

\node[circle,fill=blue] at (0,0) {alter};
\end{tikzpicture}
is a link to :

\nolinkurl{http://altermundus.fr}
\end{document}

Greetings

Alain Matthes

Jean-Côme Charpentier

unread,
Jul 13, 2007, 9:19:40 AM7/13/07
to
Alain Matthes a écrit :

> Le Wed, 11 Jul 2007 18:48:59 -0400, Boris Veytsman a écrit:
>
> If only this code would work with pst-pdf or ps4pdf, it would be
>> perfect. Right now it works either with dvips->ps2pdf OR vtex, but it
>> is not what I need.
>>
>
> With pdflatex, you make :
>
> \documentclass{article}
>
> \usepackage{tikz}

It was a question about PSTricks :-)

> [...]
>
> The blue disk
> [...]


> is a link to :
>
> \nolinkurl{http://altermundus.fr}
> \end{document}

That doesn't work for me, neither under xpdf, nor under acrobat reader.
The link is just a (very) tight rectangle below the blue disk.

I don't know very well the PDF format: is it possible to have
non-rectangular area for link? If no, the problem is funny: how consider
a polygon as a compound of many small rectangles.

Jean-Côme Charpentier

Alain Matthes

unread,
Jul 13, 2007, 11:19:11 AM7/13/07
to
Le Fri, 13 Jul 2007 15:19:40 +0200, Jean-Côme Charpentier a écrit:


>
> It was a question about PSTricks :-)

yes but this is an answer for pst-pdf or ps4pdf problem

>
>>
> That doesn't work for me, neither under xpdf, nor under acrobat reader.
> The link is just a (very) tight rectangle below the blue disk.

no the code works fine for me with evince , kpdf and adobe reader 7 on
ubuntu except the blue disk is not the aera link but it's
the square around the disk (with tikz or with pstricks).

With tikz or pstricks, I think that the background is a rectangle, no ?

> I don't know very well the PDF format: is it possible to have
> non-rectangular area for link? If no, the problem is funny: how consider
> a polygon as a compound of many small rectangles.

not sure, but I think the answer is no and the problem is funny...;
I don't know very well the PS format and the PDF format: is it possible to
have non-rectangular area for link with the PS format :)?

Alain Matthes


Alain Matthes

0 new messages