Tinderbox Forum

Bringing Bookends BibTeX Key to Tinderbox

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).

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:


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.

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.

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

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

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.)

1 Like

Has anything changed in Tinderbox since introduction of version 9 that would stop the action code used in edict introduced in the first post from working correctly? I’ve tried to make it work whole afternoon and evening but without positive results - $BibTeXKey value stays empty. It doesn’t even work in the example uploaded by the author. My $ReferenceRIS does contain U1 field with bookends citekey…

Should work fine. If trouble persists, make a test folder with:

  1. A tiny bookends database with one or two of the references you’re using;
  2. A Tinderbox document containing the relevant notes. Share them here, and I’m sure we’ll find an answer for you.

Thank you for the quick response! Here you can find TBX document and Bookends database with few references:
TBX+Bookends.zip (118.4 KB)

I’m using latest Tinderbox (9.0) and Bookends version 13.5.5.

Great. I’ll download and take a look!

Thanks. But the bookends export file is not what I need.

I need a Bookends Database Document — a bdb file — that contains the reference you’re working with. That way, I can open your document and import the reference on a special version of Tinderbox that will indicate in detail just what’s happening.

Sorry! I hope this time I understood correctly what file is needed!
Thanks for your patience and help!
TBX+BDB.zip (184.6 KB)


It turns out your Bookends RIS format is incorrect. As discussed above, you’re storing the BibTeX key in Bookends in the field named User 1. To export this in RIS, you add this line (as explained in Galen Menzel’s message above):

U1  - $u1

What is subtle here is that RIS requires TWO spaces before the hyphen, and one space after it.


Correcting your Bookends setting ought to fix this

Thank you for looking into my issue! Unfortunately, the problem still persists i.e. I’m unable to extract $BibTeXKey through action code located in edict of prototype “Reference”. $ReferenceRIS includes citekey imported from bookends after moving it into Tinderbox document, but action code doesn’t find it :confused: . I’ve implemented corrections that you have mentioned above, but still nothing happens.

I am encountering the same issue, even with the suggestions of @eastgate. For some reason the edict is not identifying the text to use for BibTeXKey in the ReferenceRIS attribute, even though the text is present in the attribute.

OK: let’s do it again! Post a sample reference database, and I’ll see what’s the matter.

1 Like

Thanks, @eastgate. Here is a sample Bookends database along with a Tinderbox doc using those references.

Archive.zip (78.6 KB)

The edict can be made simpler (and much more efficient) in Tinderbox 9, thanks to the new $ReferenceDictionary. It becomes:

$BibTeXKey = $ReferenceDictionary[U1]

I tested this, and it worked well.

@eastgate, I can confirm that this edict works for me as well. Many thanks.