Serendipity. I did not plan this hack at the BioHackathon Europe 2021 but it happened anyway. Based on earlier work in the Journal of Cheminformatics, extending on the work by Krewinkel et al. I looked into the idea of using the Lua filter for BioHackrXiv, a preprint server for BioHackathons. Actually, I started by looking at the Citation Styling Language file used by the BioHackrXiv tools. But that was just wrong.

Long story short: it worked! Thanks to the encouragements from Pjotr and Tazro and suggestions from Lars and some code on how to dump a Lua data structure to stdout.

In the Markdown/BibTeX combination you would normally write [@bibtexkey] to add the reference to the article with the given key in the .bib file. To type the citation (to state the intention why you cite that source), for example because you use a method in it, you write [@usesMethodIn:bibtexkey]. This is different from how it currently works for the Journal of Cheminformatics, where the intention cannot be given at citation level yet. You can even use more than one intention, e.g. [@usesMethodIn:extends:bibtexkey].

If you want to try it, just create a compatible Markdown file with BibTeX file in a new GitHub repository, and post the repository URL on this cool preview website.

Here’s what the created PDF could look like: