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
  • @moewe Thank you for the edit! Commented Jan 24, 2021 at 10:12
  • Please consider accepting the provided answer. Commented Feb 11, 2021 at 7:47

1 Answer 1

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) Commented Jan 24, 2021 at 10:10
  • You have to run latex (pdflatex) first and then bibexport.
    – Guido
    Commented Jan 24, 2021 at 10:45
  • Thanks, @Guido! This worked perfectly. ^-^ Commented Jan 24, 2021 at 12:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .