[Tex/LaTex] Improving a workflow for importing BibTeX citations

bibtexjabref

I am hoping to draw upon the expertise of other LaTeX/BibTeX user to help improve a common workflow of mine.

Currently, I download and import BibTex citations from the likes of IEEE/Springer/ScienceDirect and then cut and paste the citation into JabRef. That is, it goes something like this:

  • (In firefox) IEEE/Springer/Whatever -> Export as BibTeX
  • Open export.bib in gedit
  • Create new article in JabRef
  • Copy-paste citation text from gedit into Jabref.

Trying to open the export.bib file into Jabref has it open the BibTeX file as a new database and I have to copy and paste the citation anyway.

I would like to improve this workflow to a one-click "Open With" when I save the .bib from Firefox and it gets added to my BibTeX database.

I currently use JabRef, but would be willing to switch BibTeX managers if something else (in Linux) offers this feature. Of course, a script with cat $FILE >> /path/to/my_database.bib might work, but I then still have to find that reference to link it to the paper I just saved 🙂

Best Answer

You can set up Jabref to automatically import a reference from Firefox into the current database, but it's somewhat arcane. Here is my solution under Linux:

1) Select Options -> Preferences -> Advanced -- and check "Listen for remote operation ..." I don't think it matters which port.

2) Create a small bash script (text file) named "jabref-import" that looks like this:

#!/usr/bin/env bash
java -jar ~/local/jabref/JabRef-2.8.1.jar -i --importToOpen "$*"

Replace "~/local/jabref/JabRef-2.8.1.jar" with the path to your Jabref .jar file on your machine. Or if you have a working executable called "jabref", you can replace everything before the "-i" with "jabref". Just make sure your executable accepts command-line options (mine didn't).

In Ubuntu 13.04, the following variant of the script works:

#!/usr/bin/env bash
jabref -i --importToOpen "$*"

3) Make the file executable:

chmod ugo+x jabref-import

4) Make sure Jabref is already open. Go to Firefox, download a citation file. It could be a .bib or .ris or .ref or whatever. Select the "Open with..." option in the dialog, and select the jabref-import executable that you just made. The import dialog should pop up in Jabref with your citation.

Related Question