TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a BibTeX database with some big number of references which I use for work. When I need to send a document prepared using that database to somone I have two options: either send a full copy of the database (which I would not like to do), or copy all referenced entries from a large database to a smaller copy, and send that copy with a document. Are there any tools which would do this automatically?

share|improve this question
Is the recipient going to edit the bibliography? If not you can just send the .bbl file generated by BibTeX, which should contain only those citation entries actually used in the document. Open up the .bbl file in a text editor and you'll see what I mean. – Willie Wong Jul 27 '10 at 20:48
Yes, I would like to send an editable bibliography. – abbot Jul 27 '10 at 21:03
Since the \citation{} and \bibcite{} commands are in the .aux files, it should be quite easy to extract the relevant entries from a BibTeX database. Has no-one written such a tool? – András Salamon Jul 27 '10 at 21:39
up vote 30 down vote accepted

BibTool is a command-line tool which allows you to perform various manipulations on .bib files, including extracting all of the entries which are mentioned in a given .aux file.

share|improve this answer
I think you should mention how to usebibtool that is: bibtool -x file.aux -o refs.bib for example. For biblatex users, this question is relevant – Seamus Mar 31 '11 at 20:37
Also note that by default bibtool searches for the bib files in the same way as bibtex does. For instance, to have it pick up bib files only in the current directory one can use BIBINPUTS=:.: bibtool -x file.aux -o refs.bib. – orbeckst Apr 28 '14 at 20:37

A reference manager such as JabRef will allow you to save selected entries from your entire .bib database to a new, smaller .bib file. JabRef also allows you to export to many other formats, such as XML, HTML, EndNote, and Harvard RTF.

share|improve this answer
Jabref can extract the entries based on .aux file and write them to a new .bib file. – Pedro J. Aphalo Jul 28 '10 at 10:22
Jabref > Tools > New subdatabase based on AUX file. – dips Jul 5 '14 at 11:35

You could also try M-x reftex-create-bibtex-file if you're using Emacs and RefTeX.

share|improve this answer
my reftex doesn't seem to have this feature. The only autocomplete options for reftex-create- are reftex-create-customize-menu and reftex-create-tags-file – Seamus Mar 16 '11 at 13:17
@Seamus: seems to be a bug in reftex's autoloads; try loading the reftex-site library first? – SamB Mar 17 '11 at 23:01
That works! Thanks. Except this method seems to fail to find references with optional arguments: \cite{foo} gets put in the bib, but \cite[p.1]{foo} doesn't... – Seamus Mar 21 '11 at 16:34
wow.. this is damn simple. – kindahero Sep 8 '11 at 18:47
@Seamus I also had this problem: was was able to use the menu item, but the tool seems quite broken (multiple citations also seem to fail.) – mforbes Feb 23 '13 at 0:45

I use a shell script called bibexport

bibexport: a tool to extract BibTeX entries out of .bib files.
usage: .../bibexport [-h|v] [-n] [-b bst] [-a [-e file]...] [-o file] file...
  -a, --all          export the entire .bib files
  -b, --bst          specifies the .bst style file  [default: export.bst]
  -e, --extra        extra .bib files to be used (for crossrefs)
  -c, --crossref     include entries that are crossref'd   [default: yes]
  -n, --no-crossref  don't include crossref'd entries       [default: no]
  -o file            write output to file        [default: bibexport.bib]
  -h, --help         print this message and exit
  -v, --version      print version number and exit
share|improve this answer

Or again Mendeley -- with it you could even have a shared collection which will stay in sync.

share|improve this answer

latex2html has a tool called aux2bib which does the job.

share|improve this answer
+1 because in contrast to other tools, latex2html is included in / installable by the TeX distributions TeX Live and MiKTeX. – matth Feb 25 '12 at 13:48

The current download of JabRef will not run for me on OS 10.10.2 (OS X says it is 'damaged'.) But BibDesk also provides a way of doing this.

  1. Open your large .bib in BibDesk.
  2. Create a new, empty Bibliography.
  3. Click Database > 'Select Publications from .aux File'
  4. Navigate to the .aux file for your document.
  5. All entries cited in your document will now be selected. Drag them into the empty Bibliography. Save and rejoice.

I have had many journals request a separate .bib of this kind rather than a .bbl.

share|improve this answer
Welcome to TeX.SX! – Christian Hupfer Apr 12 '15 at 16:04

If you happen to use Bookends it allows you to create a folder with references to be used in a specific project. When you're done it's easy export the given folder into a bib file. I created an Applescript to do just that. First you select the folder in BE, set your seetings in Biblio, Bibliography. Then you invoke the script below. If it works for you then save script as application for easy access.

tell application "Bookends"
end tell
tell application "System Events"
tell process "Bookends"
    keystroke "h" using {option down, shift down, command down}
    delay 0.5
    click menu item "Mark All References" of menu 1 of menu item "Mark" of menu 1 of menu bar item "Refs" of menu bar 1
end tell
end tell
tell application "System Events"
tell process "Bookends"
    keystroke "b" using {shift down, command down}
    keystroke return
    delay 0.5
    keystroke return
    delay 0.5
    keystroke "r" using {command down}
end tell
end tell
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.