4

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

4

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.

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

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.

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

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.

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

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.