[Tex/LaTex] Creating .bib file containing only the cited references of a bigger .bib file

bibtex

Normally, LaTeX will only create references for the BibTeX entries cited in the text. Is there a way of extracting these entries into a different .bib file automatically? For example if I have a .bib file with two entries, and only one is cited in a particular text, I need a way of creating a new .bib file with just that reference.

Best Answer

With a TeX Live distribution (possibly also with MiKTeX) there is a bibexport program. Assuming your document is myarticle.tex, you have to compile it normally and then you call

bibexport -o extracted.bib myarticle.aux

where extracted.bib is the name that you want to give to your new .bib file. Notice that you have to give the extension .aux (or no extension at all).

Then you have to change the name of the .bib file in your document, in order to use extracted.bib.

Related Question