TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you produce a document with citations (\citep, \citet) working properly in the paper but without a bibliography at the end?

I've come up with one solution that is bad because it breaks my makefile.

latex file.tex
bibtex file
# comment out \bibliography{} command
latex file.tex

Similarly, is there a way to produce the bibliography with no accompanying text? Again, I've come up with a solution: fill an otherwise blank .tex file with \nocite{} commands. However, this is a pain because I have to keep two files synced by hand (and regular expressions to search for \citep{author1, author2} can be a huge pain when there are pagebreaks...).

share|improve this question

migrated from stackoverflow.com Oct 12 '11 at 17:09

This question came from our site for professional and enthusiast programmers.

why are you commenting out the \bibliography{} command? presumably you do have a .bib file, otherwise it makes no sense to have any \cite instructions. once bibtex has created a .bbl file from the .bib file, it doesn't matter whether the cite entries are put into the .aux file again. – barbara beeton Oct 12 '11 at 17:40
up vote 17 down vote accepted

Your second request is easy: use \nocite{*}. This will produce a full bibliography, regardless of which bibliography entries are actually cited.

share|improve this answer
This is a good idea only if your .bib file contains nothing but entries you want in your bibliography. I guess that's so for the OP but thought it worth mentioning for others. It would produce something ridiculous with a common database of entries, for example. – cfr Mar 24 '14 at 0:29
The link seems to be broken. – Bach Feb 13 at 15:48
@Thanks, fixed. – Konrad Rudolph Feb 13 at 15:51

Use the \usepackage{bibentry} and then instead of \bibliography{} use \nobibliography{}.


share|improve this answer
Welcome to TeX.sx! Thanks for your answer, we're looking forward to your future contributions to this Q&A. – Marco Daniel Nov 7 '13 at 18:09

You can define a savebox and put the \bibliography command inside the savebox.

Here is a small example:




NOTE: If you are using biblatex you don't need such hacks.


In relation to my answer I have a small question. What do you think about a small package which allows the user to print the bibliography or not?

Here my first try:

%% Copyright (C) 2011 by Marco Daniel
\ProvidesPackage{nobibprint}[2011/10/12 v0.1 nobibprint]

Now simple use:





share|improve this answer
I certainly like the idea of the package, and will give it a shot. I don't think I understand saveboxes; will have to look those up. – keflavich Oct 12 '11 at 21:20
Amazing, but I still had to add \bibliographystyle{} before \bibliography{}. Otherwise, this is magical. – crippledlambda Oct 15 '12 at 20:08
Great. Just to be clear, the only thing that's needed is: \newsavebox\mytempbib \savebox\mytempbib{\parbox{\textwidth}{\bibliography{test}}} – Bjørn Kjos-Hanssen Sep 22 '14 at 21:24

If you put the \bibliography command in a file, say bibcommand.tex and in the main file you say


<the document>



then a normal compilation will include the bibliography, but commenting out \includeonly{} will omit it.

You can also add the \includeonly{} from the shell

latex "\includeonly{}\input{filename}"

(where your main file is filename.tex) and this may be included in a Makefile, I believe.

share|improve this answer
So \includeonly{} forces the later \include command to be ignored? And using "latex [some latexcommand] filename" prepends the latex command to the file? Both very useful features, thanks. – keflavich Oct 12 '11 at 21:15
@egreg this was very useful, thanks! – Sosi May 9 '13 at 17:47
@Sosi I'd like to acknowledge who first taught me this trick, but it was something I read in comp.text.tex several years ago. – egreg May 9 '13 at 18:03

Simply use biblatex and its natbib compatibility option.




  author = {Author, A.},
  year = {2001},
  title = {Alpha},



Some text \citep{A01}.

% \printbibliography

share|improve this answer

Your makefile can empty the *.bbl file. If you want to use Konrad's suggestion to separately compile the bibliography, you can try the following (untested):

file.dvi: file.tex
        latex file
        bibtex file
        mv -f file.bbl references.bbl; touch file.bbl
        latex file
        latex references

where references.tex is the Latex file that invokes \nocite{*}.

share|improve this answer

I used a sorta hack :)

Compiling only a page range or page selection

this gives info on page selection while making pdf ... I put a \newpage before bibliography and just didn't compile those pages ...

share|improve this answer

If you already have a foo.bbl file that you want to pull from (e.g. from another main document), a slight modification from this question works wonders:

share|improve this answer

Your Answer


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.