I am using pdfLaTex to create a pdf document containing a link with an
outlined text description. I want that link to open an animated gif file in
a Web browser (Internet Explorer 6 in my case). The gif file is located in
the same folder (directory) as the pdf document, and I want the link to
point to the gif file using only a RELATIVE pathname.
Consider the document below which exists in the same folder as the animated
gif file "wavemovie.gif":
------------------------
\documentclass{article}
\usepackage[final,pdftex]{hyperref}
\begin{document}
\href{wavemovie.gif}{Link to animated gif} \hfill \url{wavemovie.gif}
\end{document}
--------------------------
When compiled with pdfLaTeX, this produces a pdf document in the same folder
as "wavemovie.gif". The first link has a text description as desired and
opens the Web browser, but a "Cannot find server" message is seen. The
second link only shows the name of the file, of course, and has no text
description. However, it opens up the browser and runs the movie
successfully.
The hyperref documentation states that \url{URL} is equivalent to
\href{URL}{URL}. However, we see they are not exactly equivalent since
\href cannot be used with the same relative pathname that \url can.
How can I use a relative pathname with \href? Any helpful comments would be
appreciated.
Dwynn
================================================
L. Dwynn Lafleur
Professor of Physics
University of Louisiana at Lafayette
laf...@louisiana.edu
http://www.ucs.louisiana.edu/~ldl6737/index.html
================================================
> . . .
> \documentclass{article}
> \usepackage[final,pdftex]{hyperref}
> \begin{document}
>
> \href{wavemovie.gif}{Link to animated gif} \hfill \url{wavemovie.gif}
>
> \end{document}
>
> . . .
> The hyperref documentation states that \url{URL} is equivalent to
> \href{URL}{URL}. However, we see they are not exactly equivalent since
> \href cannot be used with the same relative pathname that \url can.
Hmm... Running pdflatex from TeXLive 2003 under RedHat, and then
running "strings -a" on the pdf output, I see:
/Subtype/Link/A<</Type/Action/S/URI/URI(file:wavemovie.gif)>>
...
/Subtype/Link/A<</Type/Action/S/URI/URI(wavemovie.gif)>>
Clearly different, as stated.
-- Bill
\makeatletter
\newcommand{\myhref}[2]{\hyper@linkurl{#2}{#1}}
\makeatother
and replaced "\href" in the document with "\myhref". However, I do
not feel very comfortable (or competent in) using hyperref's internal
commands.
(1) Is this a reasonable solution, or
(2) have I overlooked an equivalent command already available in the
hyperref package?
Dwynn
-------------------------------------
"L. Dwynn Lafleur" <laf...@louisiana.edu> wrote in message news:<-_qdnYQCquC6...@centurytel.net>...