Annotation Tutorial 2: Integrating Zotero with Obsidian

Tutorial for an efficient academic workflow

How do you export Zotero annotations (= highlighted text and comments) from PDFs, ePUB eBooks, and website snapshots into Obsidian, and how do you go back from your Obsidian notes to the exact position of the annotation to (re)cover the context?
academic
obsidian
workflow
zotero
how-to
Author

Peter Baumgartner

Published

August 12, 2024

Modified

August 23, 2024

Zotero Integration with Obsidian

Academic Workflow

In the first part of this annotation tutorial, I have described the different annotation types in Zotero version 7 and how to use them. In this second part, I will explain a simple method for importing Zotero annotations into Obsidian. These Obsidian notes will link to the source of the annotation (quote) in Zotero.

These backlinks are essential because one cannot always remember the original context of the citation. Especially if the creation of the annotation happened long ago or if the original purpose of the quote for a specific publication/research issue has changed, you need to check and reassess the context of the quote. Only by looking up the annotation in the source document can you prevent redundant and superfluous information from remembering the context of the quote.

After reading and annotating, it is crucial to elaborate on the highlighted content. The general strategy is to add, reformulate, and include the citations in the paper that is in progress. Whatever these changes are in the initial annotations, it is vital for an efficient workflow to always have a reference to the original position of the citation.

There are two strategies for the integration of your “research assistant” (Zotero) with your note-taking app (Obsidian):

  1. Creating a note inside Zotero and importing it into Obsidian (this post).
  2. Extracting all annotation directly from the document programmatically (the third part of the annotation tutorial).

In both cases, you need to install two plugins: Better BibTeX in Zotero and Zotero Integration in Obsidian.

Notes in Zotero

Child and Standalone Notes

Zotero knows two types of notes. (The type names are my inventions to facilitate the explanation):

  • Child Note or Items Note belongs to the item where it was created. It lives inside the Zotero item.
  • Standalone Notes lives in the appropriate Zotero item collection but does not belong to any specific Zotero item. This note type is helpful for writing notes for multiple items.

Only the child note is an annotation because it fulfills the requirement of the annotation: It is anchored to specific text – even if it consists itself of (a collection of) annotations.

Both types of notes can be created either as individual notes or as a note that collects all highlights:

  • Individual note: This is a new, empty note item. You can write your text into the note directly or drag and drop annotations from the left column.
  • Highlights note: This note collects and copies all content created with the annotation types, as mentioned earlier. You are always free to add or change the note content.

The distinctions between child and standalone notes are not carved in stone, as you can always drag a standalone note into an appropriate Zotero item, and so it converts into a child note. You can also drag the child note as an item itself in the Zotero middle pane, and so it converts into a standalone note.

Important

You can create as many notes as you want. However, only child notes will be imported into Obsidian using the Zotero Integration plugin.

How to create a child note

Add Note from Annotations

  1. Select the Zotero item or the document (PDF, ePUB-eBook, website snapshot) inside the Zotero item.
  2. Open the context menu (right mouse click on my installation)
  3. Select “Add Note from Annotations”

Add (empty) Note

  1. Select the Zotero item (not the document).
  2. Open the context menu (right mouse click on my installation)
  3. Select “Add Note”
The screenshot shows different types of annotations with Zotero in a PDF. The page is divided horizontally into three parts. From left to right: a small sidebar (about 10% width) with the content of the annotations, the document with the annotations (about 70% width), and the context pane with metadata.
Figure 1: How to add an empty child note: (1) Select the Zotero item (2) Open context menu and (3) Select ‘Add Note’

To repeat: An “child note” is a note that is sorted under a Zotero item, independently of where it was created initially.

We generate child notes as the easiest way to export notes into Obsidian. This has the disadvantage that changes in the Zotero annotations need another export to Obsidian. We will, therefore, cover in the third part of the tutorial an alternative, a more complex way where the Obsidian plugin extracts the annotations programmatically from the Zotero document.

Installing Plugins

Better BibTeX and Zotero Integration

For the import of annotations into Obsidian, we need two plugins. At the side of Zotero Better BibTeX and in Obsidian the Zotero Integration.

  • Better BibTex makes it easier to manage bibliographic data, especially for people authoring documents using a text-based tool chains (e.g., based on LaTeX / Markdown). This plugin has a rich functionality, but we are using it for the Obsidian-Zotero integration just for one feature: To create a file with citations and consistent pandoc cite keys.
  • Zotero Integration does the main work: It inserts and imports citations, bibliographies, notes, and PDF annotations from Zotero into Obsidian. For this functionality, it needs the installation of the Better BibTeX plugin as an enhancement for Zotero.

Install “Better BibTeX”

To install a plugin in Zotero, download its .xpi file to your computer. Then, in Zotero, click “Tools → Add-ons” and drag the .xpi onto the Add-ons window. (Plugins for Zotero)

To find the latest version of the Better BibTeX .xpi file click at this link here.

For a more detailed installation procedure see here.

Install “Zotero Integration”

In Obsidian, open Settings; on the left, under Options, open Community Plugins, on Community Plugins, select Browse and search for ‘Zotero Integration’ (Help, How do I install the Plugin?).

For more details, especially troubleshooting the installation, see the README file of Better BibTeX.

Zotero Integration Settings

Introduction

The last task is to adapt the settings of the Obsidian Zotero Integration plugin.

  1. Open Preferences with the menu “Obsidian → Preferences…” or CMD+, (macOS) / CTRL+, (Windows).
  2. Scroll the left column down to “Zotero Integration” and select this plugin.

You will get a window with content similar to that in Figure 2. The look may differ depending on the Obsidian theme you are using. (I am using Cybertron)

The screenshot shows the general settings for importing annotated PDF files. The different fields are explained in the text.
Figure 2: Top part of the “Zotero Integration” plugin settings. For the import method explained here, you need only to complete the “General Settings”.

The configuration setting page for the “Zotero Integration” plugin is complex. It consists of four parts:

Although there are many preferences for the simple import method used in In this post, we will only need to complete the general settings.

General Settings

The first two settings provide the path to the main utility program for extracting data from PDFs. pdfannots2json.js should work immediately after the installation of the “Zotero Integration” plugin. Otherwise, you must download the tool and provide a path to it.

In the third field, you specify the program you will use. The plugin supports Zotero and the Jurism project, specializing in legal research, and is also based on the Zotero reference manager. For advanced usage, you also have the option to specify a custom port number. The default port where Zotero is listening to 23119. You don’t need to change it in a standard configuration. Only for a special Zotero configuration, e.g., when using Zotero on a terminal server, you must provide another port number.

In the following field, you specify the path in Obsidian where the Zotero annotations should be stored. I have used with “zotero” a subdirectory of “annotation” because I have with Calibre another app where I am importing annotations into Obsidian.

The following two fields determine if Obsidian should open the imported file and in the case, you have imported several at once, which of the imported files.

The last option of the general settings is enabling the concatenation of annotations. This feature could be nice if your highlight is spread over two PDF pages. I tried it out, but it didn’t work for me.

Import Annotation into Obsidian without Template

For this procedure, you need to create the annotation file in Zotero manually, as I have already explained in Section 2.2.1.

The screenshots shows a search field with the text 'zotero inte'. Below are the found Obsidian command that contain the search string. From top to bottom: 'Zotero Integration: Bib Format'; 'Zotero Integration: Import notes' with shortcut CMD-CTRL-SHIFT-Z; 'Zotero Integration: Pandoc Format' with shortcut CMD-ALT-CTRL-SHIFT-Z; 'Zotero Integration: Data explorer'; 'Zotero Integration: Formatted Citation'; 'Zotero Integration: Create Literature Note' with shortcut ALT-Z; 'Zotero Integration: Formatted Bibliography'; 'Zotero Integration: Insert notes into current document' with shortcut CMD-CTRL-Z.
Figure 3: Obsidian Command Palette displaying all available commands of the Zotero Integration plugin. For some of the commands I have assigned hotkeys.
  1. Now change to Obsidian and choose either “Import notes” or “Insert notes into the current document” from the command palette. If you attach shortcuts to these procedures, you don’t need to call the command using the Obsidian palette.
  2. You have to wait until a window with the Zotero database appears, where you can select the appropriate Zotero item. All note files inside the Zotero item will be exported. The first command (“Import notes”) creates a new file; the second command inserts the annotations into the cursor position of the current Obsidian document.
  3. The results are annotations with two links: “Go to annotation” and the citation using the appropriate Zotero citation style. “Go to annotation” opens the PDF and jumps to the annotation’s location in the original document. The citation link selects the appropriate bibliography item in the Zotero middle pane.
Screenshot of an example of an annotation file with a black background. From top to bottom: A yellow header says 'Annotations'; Timestamp '(7/31/2024, 7:23:53 PM)'; Followed by three examples of annotated text. Every entry starts with a red link to the exact position of the quote ('Go to annotation') and ends with a link to the bibliography entry in the Zotero middle pane. Eexample: '(Gethin et al., 2021, p.12)'. Between these two links is the annotated text passage surrounded by quotation marks.
Figure 4: An example of an annotation file. Every entry starts with a link to the exact position of the quote and ends with a link to the bibliography entry in the Zotero middle pane. Between these two links is the annotated text passage surrounded by quotation marks.

Summary

In this post, I have explained how to integrate your “research assistant.” tool Zotero with the note-taking app Obsidian.

Import Annotations from Zotero into Obsidian (without template)

  1. Highlight or use other annotation methods in Zotero as explained in the first part of this tutorial.
  2. Create a note with the annotations in Zotero.
  3. Install the necessary plugins: Better BibTeX in Zotero and Zotero Integration in Obsidian.
  4. Complete the ’General Settings” part of the “Zotero Integration.” plugin in Obsidian.
  5. Choose either “Import notes” or “Include notes into current document” into Obsidian.
  6. Wait for the Zotero dialog window and choose the Zotero item with the annotations.
  7. Inspect the imported file content and test the links.

You can now elaborate on your notes using all the advanced features Obsidian offers!

In the third part of the annotation tutorial, I will explain how to use templates to programmatically extract annotations from Zotero documents. This has several advantages, but it is more complex to apply.

Are you satisfied with our result from this second part of the tutorial? Then, you can skip the last part or read it later when the need for better management of your different types of annotation arises.

Glossary
term definition
Plugin A plug-in (or plugin, add-in, addin, add-on, or addon) is a software component that adds a specific feature to an existing computer program. ([Wikipedia]
Back to top