1

I am writing an article using RevTex4-2, where I reference from 10 individual .bib files (separated by topic). This works beautifully.

However, I would like to extract only the references I need from these 10 .bib files and place them in a single .bib file. Is there an automatic way to do this?

Is it possible to generate a new .bib file containing only these .bib entries from, say, my .tex document?

2
3

You can do that with bibexport. The workflow to create a new bibTeX file with only the items cited in a document is

pdflatex filename
bibexport filename

Where filename is the name of the tex file without extension. bibexport operates on the .aux file (this is why one has to run latex first).

For the full documentation of bibexport run

texdoc bibexport

from a terminal or command line.

3
  • Thanks for the swift answer! Unfortunately, the generated document is blank. The following error messages are in the terminal: cat: filename.aux: No such file or directory This is BibTeX, Version 0.99d (TeX Live 2019/Debian) The top-level auxiliary file: bibexp.1611482776.aux I found no \citation commands---while reading file bibexp.1611482776.aux I found no \bibdata command---while reading file bibexp.1611482776.aux I found no \bibstyle command---while reading file bibexp.1611482776.aux (There were 3 error messages) – PhysicsHobbit Jan 24 at 10:10
  • You have to run latex (pdflatex) first and then bibexport. – Guido Jan 24 at 10:45
  • Thanks, @Guido! This worked perfectly. ^-^ – PhysicsHobbit Jan 24 at 12:37

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.