Custom export filters

JabRef allows you to define and use your own export filters, in the same way as the standard export filters are defined. An export filter is defined by one or more layout files, which with the help of a collection of built-in formatter routines specify the format of the exported files. Your layout files must be prepared in a text editor outside of JabRef.

Adding a custom export filter

The only requirement for a valid export filter is the existence of a file with the extension .layout. To add a new custom export filter, open the dialog box Options -> Manage custom exports, and click Add new. A new dialog box will appear, allowing you to specify a name for the export filter (which will appear in the File -> Custom export menu of the JabRef window), the path to the .layout file, and the preferred file extension for the export filter (which will be the suggested extension in the file dialog when you use the export filter).

Creating the export filter

Let us assume that we are creating an HTML export filter.

While the export filter only needs to consist of a single .layout file, which in this case could be called html.layout, you may also want to add two files called html.begin.layout and html.end.layout. The former contains the header part of the output, and the latter the footer part. JabRef will look for these two files whenever the export filter is used, and if found, either of these will be copied verbatim to the output before or after the individual entries are written.

Note that these files must reside in the same directory as html.layout, and must be named by inserting .begin and .end, respectively.

In our example export filter, these could look like the following:

html.begin.layout:
<HTML>
<BODY> text="#275856">
<basefont size="4" color="#2F4958" face="arial">

html.end.layout:
</BODY>
</HTML>

The file html.layout provides the default template for exporting entries. If you want to use different templates for different entry types, you can do this by adding entry-specific .layout files. These must also reside in the same directory as the main layout file, and are named by inserting .entrytype into the name of the main layout file. The entry type name must be in all lowercase. In our example, we might want to add a template for book entries, and this would go into the file html.book.layout. For a PhD thesis we would add the file html.phdthesis.layout, and so on. These files are similar to the default layout file, except that they will only be used for entries of the matching type. Note that the default file can easily be made general enough to cover most entry types in most export filters.