# Link to open a LaTeX file

How can you create a link with `hyperref` in a PDF file to open a LaTeX file?

-
If you prefer to discuss your question in german, consider asking at golatex.de or mrunix.de. –  Benedikt Bauer Dec 21 '12 at 12:19
I asked a similar question, but for pdf files on record in bibtex database. tex.stackexchange.com/questions/86189/… –  Nicholas Hamilton Dec 21 '12 at 12:57

The trick is to use `run:/.` like

``````\href{run:./myFile.pdf}{LinkText}
``````

To make a Link to the PDF `myFile.pdf` in the same directory as the LaTeX file (more precisely the created PDF from that file). It is then opened in the PDF-Viewer thats standard for viewing PDFs on that specific system.

Edit I had that in my file to Link to a TeX file, of course that works the same way

``````\href{run:./myFile.tex}{LinkText}
``````

It should then open in the standard editor for `.tex` files. Thanks for mentioning in the comments.

-
Whether or not this works is of course viewer dependent, and in Adobe requires disabling "Enhanced security". –  cyberSingularity Dec 21 '12 at 13:04
Thank you, this was just what I needed. The remark is correct, that the matter is viewer dependent. With Adobe it works, but what about sumatra? For some reasons I want to use this PDF viewer. –  Klaus Wagner Dec 21 '12 at 16:12