I want to compile sections of the article independently. Clearly, I can make their numbers right just by using something like \setcounter{section}{4}.

How can I get something like \ref{VeryUsefulTheorem} working if the command \label{VeryUsefulTheorem} is in another section (i.e., in another TeX file, which is compiled to its own PDF file)?

I'm using the hyperref package, and, therefore, inter-document links are clickable. Is it possible to make links to a stuff in a different PDF file clickable?

  • 5
    Do you really need to produce separate pdf files? Maybe the \include and \includeonly features would be enough for you? – Juan A. Navarro Aug 15 '10 at 14:14
  • 1
    I'd like to quote Juan A. Navarro. This is not the recommended way to work with LaTeX... You are just complicating what LaTeX allows you to do so easily... – Alessandro Cuttin Aug 16 '10 at 7:27
  • There are other use cases where it makes sense to have that capability. For example, when writing a document that discusses another document (e.g., a response letter for an academic journal explaining what was changed in a manuscript). – tmalsburg Nov 5 '13 at 16:39

Use the xr package and xr-hyper if you need hyperref.

If all you want to do is compile selected parts of you document you should \include them and use \includeonly to select which files to compile. This will keep track of references and numbering.

  • Yes, it works if I write \usepackage{xr-hyper} before \usepackage[some options]{hyperref} and will not write \usepackage{xr} (otherwise I will have warnings "... has been referenced, but doesn't exist."). Thank you. – fiktor Aug 15 '10 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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