How can I link to a local file in a LaTeX document typeset with PDFlatex on Mac OS X?
18,431
Solution 1
you should be able to put the URL in the \url
tag:
\url{file://./path-to-file}
pdflatex
will (I believe) do the right thing, so it appears as a link in the resulting PDF. Whether your computer will know how to open the file is another question.
Solution 2
You can try using \href{run:<file>}
. For example:
\href{run:./myfile.png}{%
This is the link (Can be also a figure)
}
- Put the
myfile.png
(or whatever extension) to the same folder as the .tex file.
Solution 3
I for sure that this works:
The test plan is \href{run:test_plan.pdf}{here}.
Where the file test_plan.pdf is in the same directory as the latex file that refers to it.
Solution 4
In Windows, this format worked for me with a network drive. Note the three backslashes at the front.
\url{file:\\\zfs\\server$\\folder\\sub_folder\\title with spaces_and_underscores.pptx}
Related videos on Youtube
Author by
aresnick
Updated on September 17, 2022Comments
-
aresnick almost 2 years
When I try to embed a link to a local file in a LaTeX document via
\href{file://./path-to-file}{filename}
it's typeset as a remote link, sohttp://
is prepended. How can I link to a local file, with a path relative to the location of the PDF produced? -
Auron over 13 years@aresnick Try asking at tex.stackexchange.com