A couple of weeks ago I wrote about the potential for producing semantically rich JATS element-citations by using Zotero's built-in CSL engine. A short while after writing that post, I wondered whether it might, instead, be possible and better to directly link my typesetter to a Zotero database. I quickly mocked up a prototype using an improved version of the libzotero library in Qnotero for the Zotero interaction.
A full initial implementation of this, which replaces the original meTypeset internal bibliographic database, is now available in the zotero branch of meTypeset.
The process for Zotero typesetting in meTypeset is now, as follows:
- meTypeset classifies bibliography entries and places them inside mixed-citation elements
- If the Zotero flag is passed to meTypeset ('--zotero' or '-z') then the bibliographic database kicks in
- The Zotero handler sanitizes input through a series of regex replaces (special characters, digits etc.)
- The Zotero handler searches the local database iteratively reducing the search string by one word from right to left until it finds a unique hit
- If a unique hit is found, the original mixed-citation string is transcribed into a comment and a semantically rich JATS element-citation is inserted