Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 a hyperref package, and, therefore, inter-document links are clickable. Is it possible to make links to a stuff in a different pdf file clickable?

share|improve this question
4  
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
add comment

1 Answer

up vote 10 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

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.