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 “Edit” menu and choose “Automatic field editor
  3. In the “Edit content” tab, specify/choose “abstract” for field name, then click “Clear field content“.
  4. Repeat step 3 for “keywords”, “annote”, “file”, “bdsk-file-1” and any other fields that you want to remove. Make sure that all entries are still selected; because this operation only applies to selected entries.
  5. Click “Keep Modifications” to close the dialog. Remember to Save the .bib to commit the changes to file.

Leave a Reply

Your email address will not be published. Required fields are marked *