Oct 122008
I‘d like to thank Prof Michael Friendly for telling me this: just create a hyperlink to the file with the run protocol and then you can open a file directly from the hyperlink. For example, in LaTeX with hyperref package, you may use \href{run:path/to/some.file}{some link} to open this some.file in your PDF. This is a useful hack that I have been looking for over a long time.
Related Posts
7 Responses to “How to Open a File from a Hyperlink”
Comments (7)
Thank you!!
it didn’t work for me!!
At least it works for Windows and MikTeX (compile by
pdflatex), e.g.\documentclass{article} \usepackage{hyperref} \begin{document} \href{run:c:/downloads/run.txt}{hi} \end{document}At the end I got it working on my Mac:
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\href{run:./sameDirectoryAsMaster/run.txt}{hi}
\end{document}
But the link only worked with AdobeAcrobat, not with Apple’s Preview.
I see. Maybe the
runprotocol only works for Windows/Acrobat.Can you get it to open at a specific page in the target document?
Sorry, I don’t know.