As I’ve been struggling for few days to make it right, I’d like to share my implementation of Zotero annotations template that I built and I believe looks very nice.
Features:
Simple layout
Focuses on the content
Large headers based on annotation color (Default is red annotation = h5)
Includes highlights, boxes, comments
Requirements:
Obsidian (obviously)
Zotero with Better Bibtex installed
“Zotero Integration” plugin for Obsidian
Steps:
Copy my template into a new document of yours
Direct the integration plugin into that template
Activate the CSS snippet that I’m attaching
Pull the annotation from Zotero using the integration plugin
Template:
---
year: {{date | format ("YYYY")}}
tags: research
authors: {{authors}}
Abstract: {{abstractNote}}
---
### {{title}}
{{pdfZoteroLink}}
### Notes
{% for annotation in annotations -%}{%- if annotation.annotatedText -%}{% if 'Red' in annotation.colorCategory %}
##### {{annotation.annotatedText | escape }}{% else %}
<mark class="customZot-{% if annotation.color %}{{annotation.colorCategory}} {% endif %}">{{annotation.annotatedText | escape }}</mark> ([{{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}}))
{% endif %}{%- endif %} {% if annotation.imageRelativePath %} ![[{{annotation.imageRelativePath}}]]{% endif %}{% if annotation.comment %}
>{{annotation.comment}}
{% endif %}{% endfor -%}
Just wanted to say thank you so much for posting this. I have finally been able to get my Zotero notes imported into Obsidian after spending hours fiddling around with it.
Thanks so much for this template - took some time for me to find my way through it but I did it
here’s my rendition - with the help of you and others (Source1), used with BibTex and Zotero integration. I’m not the best with this templating stuff, so many apologies if its messy!
---
status:
year: {{date | format ("YYYY")}}
authors: {{authors}}
type: {{itemType}}
last-reviewed:
---
## {{title}}
> [!info]
> - **Abstract:** {{abstractNote}}
> - **Sources**: [online]({{uri}}) [local]({{desktopURI}}) {%- for attachment in attachments | filterby("path", "endswith",".pdf") %} [pdf](file:///{{attachment.path | replace(" ","%20")}}) {% if loop.last %}{% endif %}{%- endfor %}
> - **Bibliography**: {{bibliography}}
> - **Cite Key:** [[@{{citekey}}]]
{%- if hashTags %}
> - **Tags:** {{hashTags}}
{%- endif %}
>[!Personal Summary]
## Annotations
{% for annotation in annotations -%}{%- if annotation.annotatedText -%}{% if 'Purple' in annotation.colorCategory %}
##### {{annotation.annotatedText | escape }}{% else %}
<mark class="customZot-{% if annotation.color %}{{annotation.colorCategory}} {% endif %}">{{annotation.annotatedText | escape }}</mark> ([{{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}}))
{% endif %}{%- endif %} {% if annotation.imageRelativePath %} ![[{{annotation.imageRelativePath}}]] {% endif %}{% if annotation.comment %}
>*{{annotation.comment}}*
{% endif %}{% endfor -%}
First, very nice template! I have a question tho…
I’m fiddling a little with your callout headers. I’d like them to have the same name on each calloutHeader as the header they sort under. Now they are hard coded into:
I’ve tried a lot but my nunjuck-fu is too poor. Could you please help me to point out where to edit? In the setting above or in the object call further down?
This is the best thing I have found for my Obsidian and finally got my Zotero workflow working. However, could you possibly help me change a few things in it? I have no understanding of coding.
Thanks to this thread and to elena razlogova’s notetaking process I’ve writed my own script for when I read research article and to import my annotations into Obsidian. I also wanted to make it look good.
It put each highlights/notes/image into a callout of its own which color correspond to the annotation’s color in Zotero with underneath your comment if there is one. Then you can link it to your main writing notes.
Hope that it can help someone !
Template :
---
{% if title %}Title: "{{title}}"{% endif %}
Authors: {{authors}}{{directors}}
{% if publicationTitle %}Publication: "{{publicationTitle}}"{% endif %}
{% if date %}Date: {{date | format("YYYY-MM-DD")}}{% endif %}
citekey: {{citekey}}
tags: {{hashTags}}
---
## {{title}}
**Bibliographie :** {{bibliography}}
**Lien de la publication :** {{url}}
**Lien Zotero :** {{pdfZoteroLink}}
**Tags :** {{hashTags}}
>[!abstract]+
>*« {{abstractNote}} »*
{% for annotation in annotations -%}
>[!Annotation|{{annotation.color}}]+
>{%- if annotation.annotatedText -%}*« {{annotation.annotatedText}} »*([{{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}})){% endif %}{% if annotation.imageRelativePath %}![[{{annotation.imageRelativePath}}]]{% endif %}{% if annotation.comment %}
>
>{{annotation.comment}}{%- endif %}
{% endfor %}
Thank you for share your template. Obsidian are a powerful tool, but could be frustrating for people like me that doesnt undestand so much about coding
Hello, these posts have been so helpful, thank you! I have one problem – I can’t get the {{bibliography}} to produce anything in my import. Obsidian says “style getCiteProc is not a function” – does anyone know where I’m going wrong, or could point me to any information on how to set this aspect up?
Hey georgie, had the same problem. Your citation/bibliography style must be the same as your Quick Copy item format in Zotero (Preferences > Export > Item Format).
If not present, you can add new styles under Preference > Cite > click ‘Get additional styles’.
Are you by any chance using IEEE with URL in Obsidian? If so, the regular IEEE format in Zotero won’t work; you’ll need to actually add ‘IEEE (with URL)’ as a style.
Thanks for your help, tidebo, I checked and I do have the same style in the quick copy item format in Zotero and in obsidian, and after double checking and trying the import again I still get the same error message. I’m not using IEEE with url as far as I know - what is it?
Is there anything else I could have not set up properly?
Really like this setup - however - if I copy your exact template - all my annotation callout boxes have the same background color. Do you know how I can fix this?
Thanks for posting! I have a problem and am interested in help on figuring out. When I read articles my red highlight means never read this again. Saves me from reviewing impertenant portions of articles in the future. But I don’t want these brought over to my Obsidian vault.
Is there any way to import annotations without importing the red color highlights?