Showcase: Reading Notes Template for Zotero Integration

Hi to everyone! I have been using obsidian for a while now, and been lurking in the background of this forum “stealing” from your generosity… it was time to give back a little.
I share with you my Reading Notes template for Zotero Integration. It relies on:

  • Admonitions plugin (yeah, I refuse to change)
  • List Callouts
  • Pandoc Reference.

and was made using as starting point uncountable themes that I can’t reference because I lost them. If you recognize something as yours, say it, as it probably is. Please don’t be mad at me
My workflow is the following:

  1. Underline every title you want to keep
  2. Highlight with yellow the base things that you want to keep.
  3. Highlight with blue or green things that you want to stand out slightly.
  • (ab) This is how a blue highlight is seen later (list callouts for me gives me a green arrow here)
  • (ag) This is how a green highlight is seen later (list callouts for me gives me a green arrow here)
  1. Highlight with red/purple important stuff you want to mark out.
  • (!v) This is how a purple highlight is seen later (list callouts for me gives me a purple beware sign here)
  • ! This is how a red highlight is seen later (list callouts for me gives me a red beware sign here)

The thing I most like from this is that I wrote the template so that, appart from titles, when you have two (or more) consecutive highlights of the same type / color from the same page it merges them in the same paragraph. This way I get way nicer summaries from the documents.

Anyhow, here goes the code. I’m in no ways an expert so don’t expect me to explain anything about nunjuks. And as always, feel free to copy and better my template.

# {{title}}
 <p style="font-style: italic; text-align:right">{{authors}}{%- if date %} - ({{date | format("YYYY")}}){% endif -%} </p >

{% persist "notes" %}
{% if isFirstImport %}
```ad-theo
title: Contribution and main takeaways
- **Contribution**::

**Main Takeaways:**

```
{% endif %}{% endpersist %}
- (d) **Citation**:: {{bibliography}}

```ad-exer
title: Metadata - [**Zotero**]({{desktopURI}}) | [**DOI**](https://doi.org/{{DOI}}) | {% for attachment in attachments | filterby("path", "endswith", ".pdf") %}[**PDF**](file:///{{attachment.path | replace(" ", "%20")}}){%- endfor %}
{%- for creator in creators %} {%- if creator.name == null %} 
- **{{creator.creatorType | capitalize}}**:: {{creator.lastName}}, {{creator.firstName}}{%- endif -%}
{%- if creator.name %}
- **{{creator.creatorType | capitalize}}**:: {{creator.name}}{%- endif -%}
{%- endfor %}
 - **Title**:: {{title}}
 - **Year**:: {{date | format("YYYY")}}
 - **Citekey**:: @{{citekey}} {%- if itemType %} 
 - **Field**:: {% for collection in collections %}#{{collection.name}}{% if not loop.last %}, {% endif %}{% endfor %}
 - **itemType**:: {{itemType}}{%- endif %}
 {%- if itemType == "journalArticle" %}
 - **Journal**:: *{{publicationTitle}}* {%- endif %}
 {%- if volume %}
 - **Volume**:: {{volume}}{%- endif %}
 {%- if issue %}
 - **Issue**:: {{issue}}{%- endif %}
 {%- if itemType == "bookSection" %}
 - **Book**:: {{publicationTitle}}{%- endif %}
 {%- if publisher %}
 - **Publisher**:: {{publisher}}{%- endif %}
```


{%- if abstractNote %}
```ad-obs
title: Abstract:
{{abstractNote|replace("\n"," ")|striptags(true)|replace("Objectives", "**Objectives**")|replace("Background", "**Background**")|replace("Methodology", "**Methodology**")|replace("Results","**Results**")|replace("Conclusion","**Conclusion**")}}
```
{% endif %}
## Reading notes
{% macro Prefix(colorCategory) -%}
{%- if colorCategory == "Blue" -%}
- (ab)
{%- endif -%}
{%- if colorCategory == "Green" -%}
- (ag)
{%- endif -%}
{%- if colorCategory == "Purple" -%}
- (!v)
{%- endif -%}
{%- if colorCategory == "Yellow" -%}

{%- endif -%}
{%- if colorCategory == "Red" -%}
- !
{%- endif -%}
{%- if colorCategory == "Black" -%}
###
{%- endif -%}
{%- endmacro -%}

{% persist "annotations" %}
{%- set lastType, lastPage = 0 -%}
{% set annotations = annotations | filterby("date", "dateafter", lastImportDate) %}
{% if annotations.length > 0 %}
*Imported on {{importDate | format("YYYY-MM-DD HH:mm")}}*

{%- for annotation in annotations -%}
{%- if annotation.source == "pdf" -%}
{%- if annotation.imageRelativePath -%} 

![[{{annotation.imageRelativePath}}]]
<div class=figure-caption> Page {{annotation.page}}</div>  

{%- elif annotation.annotatedText -%}
{% if annotation.colorCategory == "Black" %}
{{Prefix(annotation.colorCategory)}} {{annotation.annotatedText | nl2br}} {{" — "}}[(p. {{annotation.page}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}) 
{%- elif annotation.colorCategory == lastType and annotation.page==lastpage-%}
{{" (...) "}} {{annotation.annotatedText| nl2br}}
{% else %}
{{Prefix(annotation.colorCategory)}} [(p. {{annotation.page}})](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.pageLabel}}&annotation={{annotation.id}}) {{" — "}} {{annotation.annotatedText | nl2br}} 
{%- endif -%}
{%- set lastType = annotation.colorCategory -%}
{%- set lastpage = annotation.page -%}
{%- endif -%}
{%- endif -%}
{%- endfor %}
{% endif %}
{% endpersist %}

Edit: forgot to add but the <div figure-caption> is a custom css div I use so that I can have “latex like” captions in obsidian. Is nothing too fancy. Could be change by anything else you wanted. If someone wants the code just ask.

2 Likes

I assume Pandoc Reference refers to Pandoc Reference List? If so, how does this plugin play a part in this template?

Sorry, I think I may have those two plugins mixed up in my head

Thank you sharing, could u show a screen shot how it looks. Really curious