Tinderbox Forum

Bringing Bookends BibTeX Key to Tinderbox

(Josh Fishburn) #1

Bookends can generate a BibTeX key for a reference, and it puts that key into a field called “Key”. That field doesn’t come along when Option+CMD clicking and dragging from Bookends to Tinderbox. I looked at the attribute browser to see if it might have been included in one of the other RIS fields, but I don’t see it.

I can manually copy it, but since I use Pandoc to generate bibliographies, it would be helpful to have this key automatically import as an attribute of the reference in Tinderbox so I could include it in exported text. Does anyone know how to automate this, or is it something that the developers would have to work out? (I suspect the latter but would appreciate any pointers).

(Galen Menzel) #2

This is doesn’t work by default in either Bookends or Tinderbox, but it is completely doable.

The first step is to get Bookends to export the BibTeX key as part of a reference’s RIS record. To do this, go to Biblio -> Formats Manager… and edit RIS.fmt to include the BibTeX key. Bookends stores the generated BibTeX key in the User1 field, so this is done by adding the following to the RIS record:

$U1 - $u1

For example, I’ve placed it at the end of the RIS format for book records here:

Here $U1 stands for the “U1” field tag of the RIS record (which is user definable) and $u1 represents the contents of the “User1” field of the Bookends reference. So if you had a reference with the BibTeX Key of “foobar1991a”, then the following will now be included in the reference’s RIS record:

U1 - foobar1991a

Note that the U1 field must come before the ER “end record” field.

Once you have done this for every type of reference that you use (book, journal, etc.), the BibTeX key will now be included in all the RIS records that are exported from Bookends.

The second step is to get Tinderbox to import the BibTeX key. Tinderbox doesn’t import custom User fields of RIS records by default. So you should first create a $BibTeXKey attribute to store the key. Then add this edict to the Reference prototype:

if ($ReferenceRIS.contains("^U1 - (\S+)\s*$")) { $BibTeXKey = $1; }

This edict basically says that if the note’s RIS record contains a line of the form “U1 - abcde…” then assign “abcde…” to the note’s $BibTeXKey.

This document (71.7 KB) shows this in action. I’ve pulled in a few references from Bookends after adding the User1 field to the RIS record, and Tinderbox has automatically imported the BibTexKey: