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.

While working on a long LateX document I would like the citations to be displayed correctly, but the bibliography itself not being added to the document.

Is it possible to make the bibliography being compiled, but not producing output? (Maybe it's not even difficult, and I am just being stupid...)

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted

The simplest way is to use \include and \includeonly:

\documentclass{book}
...
% \includeonly{}
\begin{document}
...<the document>...

\include{biblio}
\end{document}

The file biblio.tex will contain the commands to produce the bibliography: the thebibliography environment or the \bibliography command if you use the traditional method with BibTeX.

When you are sure about the correctness of the references, uncomment the \includeonly line.

As lockstep says, with biblatex it's sufficient not to use \printbibliography.

share|improve this answer
    
So what I have to do is to list all included tex files in the includeonly command (which is not commented out...). Then the references are displayed correctly, but the bibliography is not appended to the document. –  fuenfundachtzig Aug 18 '11 at 7:35
add comment

You can use

\printbibliography[keyword=xxx]

were "xxx" is a keyword you don't use. This way the correct files are compiled but no bibliography is added to the document.

share|improve this answer
    
This command must be from a particular package? LaTeX does not recognize it. –  fuenfundachtzig Aug 17 '11 at 17:11
    
@Rainer: but your solution applies to biblatex bibliographies, and fuenfundachtzig needs a bibtex approach. –  Gonzalo Medina Aug 17 '11 at 17:16
3  
Assuming the use of biblatex is permitted, there's a much more simple solution: Don't include \printbibliography in your document. –  lockstep Aug 17 '11 at 17:56
add comment

One option would be to use the comment package and to enclose the \bibliography command (in the body of your document) inside a comment environment initially deactivated; i.e., schematically to write something like

\documentclass{article}
\usepackage{comment}
\includecomment{comment}
%\excludecomment{comment}

\begin{document}

\cite{key1},\cite{key2},...,\cite{keyn}

\bibliographystyle{plain}
\begin{comment}
\bibliography{biblio}
\end{comment}

\end{document}

then, process your document in the usual way: pdflatex+bibtex+pdflatex+pdflatex to get the citations and the bibliography, and then to activate the comment environment (by uncommenting the \excludecomment{comment} line and commenting out \includecomment{comment} ) and then run pdflatex one more time.

share|improve this answer
    
That's certainly a possibility, but I recompile after every other sentence and wouldn't want to change this every time. –  fuenfundachtzig Aug 17 '11 at 18:12
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.