13

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.

  • 2
    Search for \nocite{*} in your document and delete it. – Gonzalo Medina Jun 7 '11 at 1:38
  • 1
    Why would you prefer not to use bibtex? It is one of the best features of TeX/LaTeX. – David Hammen Jun 7 '11 at 1:53
  • @David Hammen: I think that SoftTimur doesn't want to use biblatex. He'd like to continue using bibtex. – Gonzalo Medina Jun 7 '11 at 1:56
  • because when i use biblatex, it says "biblatex.sty" can not be found... We share this tex file among several people, so I am afraid not all of them has installed biblatex completely. – SoftTimur Jun 7 '11 at 2:07
16

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.

  • Thanks for your reply. I really do not have \notice{*} in "paper.tex" or "paper.bbl". – SoftTimur Jun 7 '11 at 2:05
  • 1
    @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 7 '11 at 2: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 7 '11 at 2: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 7 '11 at 2:27
  • 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 7 '11 at 4:47
3

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

1

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

1

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
  • 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 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 4 at 18:47

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.