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 often have to create documents with multiple sections, and each section might have contain references, which of course are global to the document.

I want to be able to compile one section of the document at a time, and be able to automatically cross-reference my citations.

However, as far as I can tell, there is no way to do that without also including the Bibliography section. Is there a way to compile a single section of a document such that all of the citations get properly referenced, but the works cited page does not?

For instance, my MainDocument.tex file might read:

\begin{document}
...
\include{section1}
%\include{section2}
...
\include{references}
...
\end{document}

If I comment out the references section, then all my citations obviously show up as [?].

Any way to do what I'm looking to do?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You can use \includeonly. First you process your document with the \includeonly line commented out as many times as necessary to get cross-references, citations, and all elements right; next you uncomment the \includeonly line and process the document again.

An example: first you will process this document until it's stable:

\documentclass{article}

%\includeonly{section1}

\begin{document}

\include{section1}
\include{section2}
\include{references}

\end{document}

and then you work only on section1 with this:

\documentclass{article}

\includeonly{section1}

\begin{document}

\include{section1}
\include{section2}
\include{references}

\end{document}
share|improve this answer
    
Brilliant, thanks! –  Arkamis Apr 6 '12 at 14:03
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.