Pruning .bib files with JabRef

BibTeX files are quite amazing when you think about it: It’s a plain text file, acting as a format-independent database, holding information about various types of published (or unpublished) artifacts, to support the generation of citations in LaTeX documents.

BibTeX styles typically ignore fields that it doesn’t support, so you can add arbitrary field names to hold whatever additional information you want about each item, e.g. “annote“, “keywords“, “abstract“, etc. Some reference management software even take to embed an entire PDF file as a binary string as a field (e.g. “bdsk-file-1“) right inside the .bib file.

While this means you can use your .bib as a completely standalone reference library, it does mean that the .bib’s physical file size can get quite bloated, even to many MBs: bibliography processors like bibtex or biber would then take a much longer time reading and parsing the .bib file, even if they’re just going discard these field values. And if these fields contain special characters, like %, then bibtex/biber will likely choke and fail to process the entire .bib file correctly.

It may therefore make sense to prune your .bib file to remove these fields, to export a leaner .bib. Several Python scripts have been written for such purposes (e.g. this one), but if you happen to have a copy of JabRef it’s pretty nifty too, especially if you prefer a GUI tool.

  1. Click on any items in the .bib first, and then Ctrl-A (or Cmd-A on a Mac) to select all entries in the .bib.
  2. Click on the “Library” menu and choose “Manage field names & content
  3. Specify/choose “abstract” for field name, then select “Clear fields” and “Overwrite existing field values“. Then click “OK”.
  4. Repeat step 3 for “keywords”, “annote”, “bdsk-file-1” and any other fields that you want to truncate. Make sure that all entries are still selected; because the “set/clear/append/rename fields” operation only applies to selected entries.
  5. Remember to Save the .bib to commit the changes to file.

jabref-clearfield

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.