TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to make the section titles in my document link to external files on my machine, so that when you click on the section title, an external document (a pdf-file) is opened. What is the nicest way to do this?

share|improve this question
I guess one solution is: \section{\href{../somefile.pdf}{Section Title}} but is there a "better" way to do this? – utdiscant Jan 7 '13 at 2:55
Better in what respect? – Stephan Lehmke Jan 7 '13 at 2:57
In the sense that often, some solution which works is deprecated or frowned upon. Like the use of double dollars for equations, where [ ] is a better solution. A solution is also better if it does not break other functionality. – utdiscant Jan 7 '13 at 3:14
up vote 3 down vote accepted

You could define a \hrefsection command:



which replicates the behavior of \section:

\hrefsection{file}[toc entry]{Title}
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.