This page looks best with JavaScript enabled

Linking to Zotero items and collections from Org mode

 ·  ☕ 3 min read  ·  ✍️ Charl P. Botha

I’ve been using Zotero since somewhere in 2011 as my main reference manager.

Just to get you up to speed, a reference manager is a tool with which you can keep track of often academic references.

My Zotero is filled with the bibliographic information and fulltext PDFs of hundreds of references.

When I have to cite any references in something I’m writing, I export the relevant collection from Zotero, often as a bibtex file, and then cite away either in LaTeX or Org mode.

Most importantly, Zotero acts as the long-term storage of all of the more academic articles that I read and cite.

(I have a different storage mechanism for more casual referencing).

In addition to actually citing references, often I just need to link to specific items or collections of items in Zotero right from my Org mode notes, so that I can easily jump to them from notes.

This post describes how to do that in three easy steps.

First you should download the latest zutilo add-on XPI from its github releases page.

To install this in Zotero standalone, select Add-ons from the Tools menu, then select the ear icon and select Install add-on from file, after which you can finally select the zutilo.xpi that you downloaded.

Once installed, configure zutilo by selecting Zutilo Preferences from the Tools menu.

Under the Zotero item menu grouping, activate Copy select item links, and under the Zotero collection menu, activate Copy select collection link.

I prefer to activate them both for the Zutilo context menu.

On Windows, clicking or opening a zotero:// link should by default open the Zotero app. Ok that was really hard.

On Linux, as is its wont, you have to put in some extra effort to get this working.

In KDE, find Zotero in your application menu, and then select Edit application from the context menu.

If you’re not using KDE, you will have to find the relevant .desktop file via some other means. Please let us know in the comments if you discover something new.

In my case, the .desktop file KDE then opened was ~/.local/share/applications/zotero.kde.

Ensure that that file contains a MimeType=x-scheme-handler/zotero; as show below.

1
2
3
4
5
6
7
8
9
[Desktop Entry]
Name=Zotero
Exec=bash -c "~/opt/Zotero_linux-x86_64/zotero -url %U"
Icon=zotero.ico
Type=Application
Terminal=false
Categories=Office;
MimeType=text/plain
MimeType=x-scheme-handler/zotero;

Add the following to your init.el:

1
2
3
4
5
(org-link-set-parameters "zotero" :follow
                         (lambda (zpath)
                           (browse-url
                            ;; we get the "zotero:"-less url, so we put it back.
                            (format "zotero:%s" zpath))))

This just tells Org mode to pass on any zotero:// links to the operating system for further handling.

Let’s say you are writing a note about a specific paper or about an interesting collection of papers that you’ve collected in Zotero.

In Zotero, right click on the collection, or on the item, and then select Copy select collection link or Copy select item links.

When you paste this in Org mode, you’ll get a link that looks like zotero://select/library/collections/DY4K5MSJ for collections or like zotero://select/library/items/F8AFZ7YL for specific items.

You can use this link as you would any other link in your notes.

When you C-c C-o (M-x org-open-at-point) with your cursor on the link, your zotero will open up with the relevant collection or item in focus, ready for you to consult it.

Brilliant!

Share on

Charl P. Botha
WRITTEN BY
Charl P. Botha
Engineer