GeneralLink to Files with relativ path

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
rodeobjoern
Posts: 1
Joined: Wed Oct 15, 2008 11:42 am

Link to Files with relativ path

Post by rodeobjoern »

Hello,

I am working on my master thesis and want to create documents in which external files like .jpg, .fig or .exe can be choosen by clicking on a hyperlink. Those Files should open than in the standard program choosen by the operating system. I managed to do so by using \href{file:///C:/...} but then the browser always pops up and of course I can just use the file on my computer. It does not work if I give an relative path like \href[/images/test.fig]{test.fig} and I would like not always having the browser poping up. Is there a smart solution in LaTex to handle this? Dos anybody know a solution? Hopefully someone can help me.

Greetings, Björn

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: Link to Files with relativ path

Post by corderin »

Hi,

you can try using the hyperref package, it works at least with .pdf files.


\usepackage{hyperref}

\begin{document}

\href{./document_name.pdf}{Open this PDF}

\end{document}

where the pdf document you want to open should be placed in the same directory as your output file.

Regards.

PS:A solution to print images is by printing them as pdf and saving them in the same directory.
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: Link to Files with relativ path

Post by corderin »

For a .exe file, try copying for example the windows calculator .exe file to your directory.

Then typ:

\href{run:./calc.exe}{CALCULATOR}

it works fine, for movies or sounds you should use the multimedia package...

:)
Post Reply