Introduction
JabRef is a cross-platform BibTeX reference manager. I use it to manage my references for my research, not only because BibTeX is my preferred format, but also for the added features such as keeping track of my pdfs.
JabRef exports to a wide range of different formats, and also allows one to write custom export filters. I have written several export filters for HTML pages. The main features lie in the JavaScript to search and view the references.
Export filters
To use the filters, first download the three .layout files of the filter. Then open JabRef and select "Manage custom exports..." in the Options menu. There you select the main .layout file, and provide html as the extension. Now you are ready to use the export filter!
- References Table
- The most basic of the reference tables, as it only includes an overview of the main information of each of the references. The QuickSearch fields allows for easy lookup of references.
- Example | Export Filters
- References Table with Abstracts
- The advanced version of the reference tables, as it also includes the abstract and/or review of each of the references. These are hidden by default, but are shown when desired.
- Example | Export Filters
- References Table with Abstracts and BibTeX
- The references tables now always includes a link to the full BibTeX entry, so that sharing of references becomes simpler than ever. Abstracts and reviews are also available. A hat tip to Roberto Cornacchia for suggesting this feature.
- Example | Export Filters
- References Table with Abstracts and BibTeX, with auto-filter
- The references tables with BibTeX and Abstract/Review, with as an extra addition an automatically-populated selectbox, which allows to filter the BibTeX types. A hat tip to Stéphane De Cara for suggesting this feature.
- Example | Export Filters
- Sortable References Table with Abstracts and BibTeX
- The full reference table can now be sorted by clicking on the column headers, even within search results! However, for large tables this comes as a burden to browser performance, and especially in the Gecko engine (i.e. Firefox) the sorting takes a long time.
- Example | Export Filters
- Simple HTML
- Updated version of the simple HTML export filters shipped with JabRef 2.2. The V1 version of the filter is shipped with JabRef 2.3.
- Example | Export Filters
- List of References
- This export filter provides a list of references, formatted in a way similar to reference lists at the end of an article. It also includes BibTeX/URL/DOI/PDF links. This filter is based on an initial suggestion by Eugen Popovici.
- Example | Export Filters
The filters and scripts have been tested in Opera 9.5/IE 7/FireFox 3/Safari 3.1 on WinXP. The script works by far the fastest in Opera; in the other browsers the QuickSearch might lag a little. The pages are well-formed HTML 4.01 but do not necessarily validate, due to for example use of HTML5 attributes.
History of Changes
| Export Filter | JabRef Versions |
|---|---|
| V1 | 2.2—2.3 |
| V2 | ≥2.3 |
As JabRef adds features, so do my export filters. Therefore, the latest export filters may not work in older versions of JabRef. I will provide an archive, but the solution is of course to update your JabRef installation.
Version V2.0 == JavaScript == + substantial speed optimizations (suggested by Jean-Luc Falcone) * when the search string becomes longer, only search within the still visible rows * only search abstract/review when necessary * stop iterating through columns once a match has been found + visual indication of invalid searches (invalid RegExp expression) + optionally search abstract/review + use Creative Commons Attribution license instead of OpenBSD + enable specifying default search column in sortable table script == Export Filters == + various stylistic updates + show volume/issue below Journal name + updated print styles + retrieves encoding type from Jabref using \encoding (JabRef 2.3+) + now resolves DOI links (JabRef 2.2+) Version 1.0 * first version of QuickSearch script
Documentation
General documentation on writing custom export filters, including the various export options, can be found in the online JabRef help files or in the Help menu. Here I focus on issues specific to my export filters.
Specifying sort order of the exported entries
One'd expect JabRef to export the files in the displayed sort order, but that is unfortunately not the case. There are basically two options to specify the desired sort order:
- change default sort order in JabRef
- use a modified version of the Sortable Table script
For a) you do the following. Open JabRef's Preferences, and go to File. There change the 'sort order' to 'Save in Default Table Sort Order'. Then go to to 'Entry Table' section of the prefs and choose the default table sort order. That will ensure the correct exporting of the file entries.
For b) use V2 of the Sortable Table export filters available above. There you can specify which column to sort after the page has finished loading, by adding a classname to the appropriate column header <th>, such as: <th class="sort_asc">, where sort_asc means ascending and sort_des means descending. However, note that the script will currently reverse whatever you specify! So if you want the column to sort ascending, you specify sort_des! A more sane implementation of this feature will be available in the future, I promise :-)
Adding Extra Columns
Many adaptations of these export filters I have found on the internet, add extra columns to the table to show more information. This is easily done by adding a new column header <th> to the .begin.layout file of the export filter:
<table> <thead> <tr> <th>Column Header</th> </tr> </thead>and adding a corresponding
<td> to the data rows in the main .layout file of the export filter. However, many people then forget to adjust the colspan value on the Abstract and/or BibTeX rows to the new number of columns!
<tr id="abs_johndoe2008" class="abstract noshow"> <td colspan="6">The value for the
colspan should be the same as the number of columns, otherwise the Abstract/BibTeX won't span the entire width of the table, with rather ugly results.
RegExp Searches
The QuickSearch field in many of the export filters allows you to use Regular Expression searches, giving you more control over your searches.
Here are some examples. To find entries...
- ... starting with "begin", type
^begin
and for entries ending with "end", typeend$
- ... published between 1980 and 1989, type
198[0-9]
- ... written either by John or Doe, type
(John|Doe)
- ... written by both John and Doe, type
(John|Doe).+(John|Doe)
By default the RegExp search is case-insenstive. For more specific information about JavaScript's RegExp abilities, see this page.
NB: note that in Version 2 of the search script, speed optimizations may cause some esoteric problems with the RegExp searches, particulary when the search string becomes longer, but does not match a subset of the current search results (e.g. 200[7] followed by 200[4-7] will not yield new search results). The search will work correctly after pressing any key, such as the cursor keys. The speed optimizations can be turned off if desired, by setting var searchOpt = false; in the sourcecode of the page.
Default Export Filters
Sometimes you simply want to make a small tweak to the default JabRef export filters. You can obtain this by going to your JabRef directory, and opening the JabRef-2.3.jar with your favourite compression-program (e.g. WinZip, WinRar, 7-Zip etc.). Then look for the resource/layout subdirectory and there you will find the standard export filters.
Licensing
The JavaScript code in the export filters is covered by a Creative Commons Attribution License. This license basically allows you to adapt, share and use the code for any purpose, provided the copyright and license notice is kept intact.
Feedback
Feedback such as feature requests and bugreports is always welcome. Just contact me.
