5

I have a very large .bib file, which I use in my latex project (a research paper). How can I remove all unused entries in a .bib file?

I don't want to only list them (as checkcites does), but instead I want to remove them. I found https://github.com/jamestrimble/remove-unused-citations but its readme mentions it's unreliable.

1 Answers1

7

bibtool can do it.

First build your document. Then, run

bibtool -x <jobname>.aux -o <outputfile>.bib

The tool assumes you don't just want to clobber the original database, so it extracts the entries used from your giant database and saves it into a new database that you specify. You are of course free to then move the original database elsewhere and rename the new one to match the old.

(Note, since bibtool is reading the aux file, it can tell where the original database is, so you needn't specify that on the command line.)

Willie Wong
  • 24,733
  • 8
  • 74
  • 106
  • +1 You can do the same with GUI in JabRef (menu Tools). For a individual reference there also a tab to see if that reference is cited elsewhere, so it is also easy mark it manually in some way (e.g., use the score column, add a keyword, use some code in bibkeys, etc.) to allow to sort/search and select references by that mark. – Fran Mar 27 '24 at 09:49