4

I am autogenerating several LaTeX documents from the same base. Some of them have a \cite inside, so I want to include a Bibliography. I am using bibtex and it is perfectly working.

However sometimes, I can have a document without any \cite inside, thus my final document appears with an Empty bibliography. Is it possible to include a bibliography only it there are references in it? Of course, because documents are autogenerated, I need to have the same management for all documents, so not calling bibtex is not an acceptable solution for me.

  • Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. – Guido Nov 22 '13 at 10:10
  • 5
    With biblatex/biber this would work automatically: \printbibliography prints only something if there is an entry. – Ulrike Fischer Nov 22 '13 at 10:12
  • @UlrikeFischer Do you want to make that into an answer? – Johannes_B Apr 23 '17 at 09:34
  • Related: https://tex.stackexchange.com/questions/74476/how-to-avoid-empty-thebibliography-environment-bibtex-if-there-are-no-refere?rq=1 and https://tex.stackexchange.com/questions/463498/printing-the-bibliography-conditionally-by-hooking-cite-to-toggle-a-boolean – Mars May 13 '19 at 20:38
  • (I'm disappointed that the only answer suggests biblatex. I'll try it, but I recall that I had previously decided that I needed to avoid biblatex. Can't find the remarks on TeX.SE that lead me to that conclusion, though.) – Mars May 13 '19 at 20:47

1 Answers1

3

With biblatex/biber this would work automatically: \printbibliography prints only something if there is an entry.

Ulrike Fischer
  • 327,261