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:


(Talal) #3

Has anything changed in TBX since the above was posted? I am unable to get this to work, either in my own file or using the example document above. Thank you.


(eastgate) #4

Lots has changed, but nothing that ought to affect the workaround above.

Have you modified the default RIS format as above?

Let me know if you have, and I’ll have a look.


(Talal) #5

Yes, I’ve modified the default RIS format as instructed, and downloaded the example document, making sure that the edict was correct. No luck.


(eastgate) #6

Can you email me the document you’re trying this on? That would save a few steps.


(Talal) #7

We’ve found the problem: using the edict code kindly provided by Galen above, there can only be one space before and after the hyphen. In my copy of Bookends, the RIS format had two spaces before the hyphen in all the existing fields, and I thus assumed that this was necessary for the manually-added U1.

After making it only one space before the hyphen in my Bookends’ RIS record for the added line “$U1 - $u1”, the BibTeX Key is being imported correctly into Tinderbox.

(Alternatively, I could have put two spaces before the hyphen both in the RIS format and in the regular expression above, as Mark correctly pointed out to me.)