Linking to PDF files within JabRef
JabRef is a reference manager based upon the BibTeX system and has many useful and powerful features. One of these features is to link any reference to any arbitraty file. This means, for example, that you can click on an icon by each reference and be immediately shown the relevant source file; a very handy feature. The problem is that is is not immediately obvious how to set up the program to detect these files automatically. That is what this article is about.
The PDF icons by each reference load the relevant file
This tutorial assumes that JabRef has been installed already. If this is not the case, go to the JabRef download page and grab a copy.
1 - Decide on your folder structure
I try and keep my pdf files in folders and sub-folders divided by subcategory. How you keep your files is up to you but you need to know where the files are relative to each other.
\Root folder \pdf (All my PDF files are in this folder...) \Topic 1 (...divided by topic) \Subtopic 1 \Subtopic 2 \Topic 2 \Library (This is where I keep my JabRef libraries)
2 - Set the path to your pdf files
Run JabRef and load your database. Now select "File > Database Properties" from the menu bar. In the 'File directory' box, you should enter the relative path to your pdf files from your database. Add a '../' for every directory you need to go up in the tree before adding the path. In my case, I have entered ../pdf because the pdf folder is one folder up in the directory structure from the place where my database is stored. If the pdf files and the database are in the same folder, you can leave this field blank.
The database properties dialogue where the path to the pdf files is entered.
3 - Allowing JabRef to automatically find files
By default, JabRef will only automatically locate files that are named the same as the BibTeX key (e.g. 'Author2000.pdf'). I find this a bit restrictive as I often want to put a summary or other details in the filename (e.g. 'Author2000 + Jones et al - Summary of paper.pdf'). Fortunately, it is possible to set JabRef to find these files automatically as well. Open "Options > Preferences". In 'External Programs', select 'Autolink file names starting with the BibTex key' and click OK.
4 - Linking a pdf to a reference
Once everything is set up, it is very easy to link references to files. Begin by adding a reference in the normal manner and then saving a pdf file somewhere in the pdf folder. Check the BibTeX key assigned to the paper by JabRef. It is usually of the format 'AuthorYear' but you can set it to anything you want. Check that the pdf filename begins with the BibTeX key (e.g. 'AuthorYear - Paper title.pdf'). Then, double click on the relevant reference, go to the 'General' tab and click 'Auto' button. That should find any and all files that begin with the BibTeX key and link them to the reference (picture below).
The 'Auto' button finds and links each file found. Then clicking on the pdf icons (top left) load the relevant files.
Now, the reference will have a pdf icon adjecent to its index number. Clicking on that will load the pdf file.
For extra convenience, adding a DOI to the relevant box will give each reference a second icon () which links to the web page that the article can be found.
First published on 5th February 2011 and last modified on 21st March 2011.