23

I have a file called paper.tex. Another file called PaperBib.bbl contains all the bibliography for this. I've used \cite{...} to cite a paper and \bibliography{PaperBib} to print the references in the end of the document.

One problem is that currently all the papers in PaperBib.bbl are listed no matter whether they are cited or not. Is there a way to list:

  • Only the ones which are cited?
  • Only the ones which are not cited?

By the way, I have searched a little bit for similar questions. Someone suggested using biblatex, but I would prefer not to.

PS: I do not have \nocite{*} in either of these 2 files.

SoftTimur
  • 19,767

4 Answers4

26

Most probably you have \nocite{*} somewhere in the body of your document; this command will cause all entries of the chosen bibliographical database to be included in the list of references.

Simply delete \nocite{*} and re-compile your document (using, for example, pdflatex+bibtex+pdflatex+pdflatex).

The \nocite command can also be used with a key-list as its argument; in this case, it will write the bibliographical information associated to the key-list (even if the publication(s) is(are) otherwise not cited) into the list of references.

Gonzalo Medina
  • 505,128
  • 1
    Thanks for your reply. I really do not have \notice{*} in "paper.tex" or "paper.bbl". – SoftTimur Jun 07 '11 at 02:05
  • 2
    @SoftTimur: It has to be (or had to be) somewhere. Try deleting the .bbl auxiliary file and processing again your document; if the problem persists, please add to your question a minimal working example illustrating your problem. – Gonzalo Medina Jun 07 '11 at 02:09
  • @SoftTimur Delte (almost) everything but the .tex file and .bib file. And run again, perhaps with latexmk. If you don't have \nocite, the only reason I can imagine is that you didn't run bibtex after updating the .aux file and therefore the .bbl file remains unchanged from previous run. – Yan Zhou Jun 07 '11 at 02:24
  • @Gonzalo Medina: i just realize that when i run bibtex the .bbl is cleaned... is it normal? I thought .bbl is written manually and should not be erased. – SoftTimur Jun 07 '11 at 02:27
  • @Yan Zhou: You are right, but I do not see how .bbl is generated except manually writing it manually... – SoftTimur Jun 07 '11 at 02:31
  • @SoftTimur: the file .bbl is generated automatically by bibTeX. – Gonzalo Medina Jun 07 '11 at 02:43
  • Actually, i just realize that it is PaperBib.bib which generates Paper.bbl by BibTeX. I just add PaperBib.bib to my folder, then BibTex runs successfully, then it only prints the cited works. Thank you all – SoftTimur Jun 07 '11 at 03:23
  • 1
    The compilation queue works like this: Wherever (pdf)LaTeX finds \cite command it writes note into .aux file. Then bibTeX read this .aux file looking for \cite notes and (re)creates .bbl file with structure defined by bibliography style and containing only cited references (\nocite cites all referencies). Then (pdf)LaTeX again rewrites .aux file and includes .bbl file into document. Double compilation is mandatory because of making referencies right - all listof*s are reading old .aux and the correct one is made after compilation. – Crowley Jun 07 '11 at 04:47
5

@SoftTimur you must make sure that you are searching for \nocite{*} and NOT for \notice{*} this is a little late, but you consistently misspelled the command here ... so maybe you have \nocite in your document and are searching for \notice (which does not exist - is not a normal command).

Mensch
  • 65,388
triple5
  • 51
  • 2
    Was this intended as a comment? Admittedly people complain that too many answers are given as comments (see http://meta.tex.stackexchange.com/questions/3238/why-do-people-answer-in-comments) but I suppose it is a matter of style. – John Kormylo Sep 29 '15 at 20:11
4

I had the same problem that you are describing, and didn't have '\nocite{*}' anywhere in my document either.

I managed to fix this by deleting the files with the same name as the .tex file but with the following extensions:

  • .aux
  • .bbl
  • .blg
  • .log
  • .pdf
  • .synctex.gz
Danquin
  • 51
  • 1
    @Sveinung actually it provides a partial answer to the question, and the answer is perhaps better than the other three - the problem was that an old bbl file was used. Deleting the file, as suggested in this answer, is a step towards the solution. In the accepted answer this is not stated, although it is discussed in the comments. Instead the accepted answer only talks about \nocite{*}, which was not very relevant to the problem (although it may have been the cause if a previous version of the document contained \nocite{*} and the bibliography had not been recreated since). – Marijn Jun 10 '19 at 10:33
  • 2
    @Marijn Thank you. I have upvoted the answer and deleted my comment. Hopefully, this will repair that I misunderstood of the answer. – Sveinung Jul 04 '19 at 18:47
  • Thank you - this solved it for me! – Guenterino Mar 03 '22 at 15:13
2

The same issue happened in TexStudio the following case. A bibliography.bib file in a top folder was used by main.tex files in subfolders, with the .tex files having the same name. Renaming solved the issue.

(PS Answered because couldn't comment yet.)