# How to reference another document in LaTeX?

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?

-
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
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

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