Storing a Link from your Web Browser to BibTeX using Org protocol
25 Sep 2025 Charles Choi
If you’re familiar with this blog, you’ll know that I’m a fan of Org protocol, a means of sending data such as web links and content to an Org file from outside of Emacs. Following up on my last post on Casual BibTeX, this post will show how to re-purpose Org protocol to send a link from your preferred web browser to a BibTeX file.
This is achieved by adding the following template (named “bib”) to the variable org-capture-templates as shown below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | |
The web link is treated as an BibTeX Online entry type whose fields are populated as follows:
urlfield holds the web page link.titlefield holds the web page title.dateis populated with the current day (this should be edited to the actual date).notesis populated with the body value according to the capture protocol.authoris populated with the value entered via mini-buffer prompt.organizationis populated with the value entered via mini-buffer prompt, typically the name of the website.
The template is configured to prepend (via the :prepend property) the captured Online entry to the file “~/org/bib/references.bib”. These values can be adjusted to taste.
When invoking this template via Org protocol, a temporary capture window holding the populated template is created. This entry will not have a citation key, so it is recommended to run M-x bibtex-clean-entry to generate it before committing the capture via C-c C-c. If you have Casual BibTeX installed, you can invoke the Transient menu casual-bibtex-tmenu with the binding M-m and invoke the clean command from there.
Closing Thoughts
Arguably, Org protocol was not designed to support files other than those using Org markup, so the above practice skirts its design intent by sending the capture to a BibTeX file. But as of Emacs 30.2 and Org 9.7.34, this works fine, so YOLO. Users intent on customizing the above “bib” template should be advised that many template properties are not supported, so be advised.
That all said, it’s a nice win to automate the task of writing a BibTeX Online entry.