Hi smart people! Does anyone know if it is possible to import and embed the PDF from a Zotero item into a reference note in Obsidian.
For reference I use this template which I found online and have edited (unfortunately I cannot remember who made it originally but I owe them a lot):
{# version: 3.6 -#}
-–
citekey: {{citekey}}
aliases:
- "{%- if creators -%}
{{creators[0].lastName or creators[0].name }}
{%- if creators|length == 2 %} & {{creators[1].lastName or creators[1].name}}{% endif -%}
{%- if creators|length > 2 %} et al.{% endif -%}
{%- endif -%}
{%- if date %} ({{date | format(“YYYY”)}}){% endif -%}
{%- if shortTitle %} {{shortTitle | safe}} {%- else %} {{title | safe}} {%- endif %}"
{% if itemType == “bookSection” %}book-title: “{{bookTitle | replace('”‘,"’“)}}”{% endif %}
- "{%- if creators -%}
{{creators[0].lastName or creators[0].name }}
{%- if creators|length == 2 %} & {{creators[1].lastName or creators[1].name}}{% endif -%}
{%- if creators|length > 2 %} et al.{% endif -%}
{%- endif -%}
{%- if date %} ({{date | format(“YYYY”)}}){% endif -%}"
{% if itemType == “bookSection” %}book-title: “{{bookTitle | replace('”‘,"’“)}}”{% endif %}
title: “{{title | replace('”‘,"’“)}}”
{%- set camelRegex = r/([a-z])([A-Z])/g %}
{%- for type, creators in creators | groupby(“creatorType”) %}
{% if creators.length > 1 %}{{type | replace(camelRegex, “$1 $2”) | lower | trim}}s:{%- for creator in creators %}{% if creator.name %}
- {{creator.name}}{% else%}
- {{creator.firstName}} {{creator.lastName}} {% endif %}{%- endfor %} {% else -%}
{{type | replace(camelRegex, “$1-$2”) | lower | trim}}:{%- for creator in creators %}{% if creator.name %} “{{creator.name}}”{% else%} “{{creator.firstName}} {{creator.lastName}}”{% endif -%}{%- endfor -%}{% endif -%}{% endfor %}
year: {% if date %}{{date | format(“YYYY”)}}{% endif %}
item-type: {{itemType | replace(camelRegex, “$1 $2”) | title | trim}}
publisher: {% if publicationTitle %}“{{publicationTitle}}”{% else %}“{{publisher}}”{% endif %}
{%- if notes.length > 0 -%}
{%- set longShortCutoff = 1 -%}
{%- set shortnotes = -%}
{%- set longnotes = -%}
{%- for note in notes -%}
{%- if note.note | wordcount <= longShortCutoff -%}
{%- set shortnotes = (shortnotes.push(note.note), shortnotes) -%}
{%- else -%}
{%- set longnotes = (longnotes.push(note), longnotes) -%}
{%- endif -%}{%- endfor -%}{%- endif -%}
{%- for comment in shortnotes %}
{%- if comment and loop.first %}
comments:
{% endif -%}
- “{{comment|replace('”‘,"’“)| replace(”\n"," “)}}”{% endfor %}
tags:{% for t in tags %}
- {{t.tag | replace(r/\s+/g, “-”)}}{% endfor %}{% if DOI %}
doi: https://doi.org/{{DOI}}{% endif %}{% if itemType == “book” %}
ISBN: {{ISBN}}{% endif %}
cssclasses:
- literature-note{% if attachments.length > 0 %}{% for attachment in attachments %}{% if loop.first %}
attachments:{% endif %}
- {{attachment.path}}{% endfor %}{% endif %}
libraryID: {{libraryID}}
-–
> [!info]- Info
[**Zotero**]({{desktopURI}}){% if DOI %} | [**DOI**](https://doi.org/{{DOI}}){%{%) endif %}{% for attachment in attachments | filterby(“path”, “endswith”, “.pdf”) %} | [**PDF-{{loop.index}}**](file:///{{attachment.path | replace(" ", “%20”)}}){%- endfor %}
>
>{% if bibliography %}**Bibliography**:: {{bibliography|replace(“\n”,“” )}}{% endif %}
>
> **Authors**:: {% for a in creators %} [[Source notes/People/{{a.firstName}} {{a.lastName}}|{{a.firstName}} {{a.lastName}}]]{% if not loop.last %}, {% endif %}{% endfor %}
>
> {% if tags %}**Tags**: {% for t in tags %}#{{t.tag | replace(r/\s+/g, “-”)}}{% if not loop.last %}, {% endif %}{% endfor %}{% endif %}
>
> **Collections**:: {% for collection in collections %}[[{{collection.name}}]]{% if not loop.last %}, {% endif %}{% endfor -%}
{%- set readingSpeed = 220 %}
{%- set wordsPerPage = 360 %}
{%- if pages %}
{%- set pageRegex = r/(\d+)\-(\d+)/ %}
{%- set splitPages = pageRegex.test(pages) %}
{%- if splitPages %}
{%- set pageMatch = pageRegex.exec(pages) %}
{%- set firstPage = pageMatch[1] %}
{%- set pageCount = pageMatch[2] - pageMatch[1] %}
{%- else %}
{%- set pageCount = pages %}
{%- endif %}
{%- elif numPages %}
{%- set pageCount = numPages %}
{%- else %}
{%- set pageCount = 0 %}
{% endif -%}
{%- if firstPage %}
>
> **First-page**:: {{firstPage}}
{%- endif -%}
{%- if pageCount > 0 -%}
{%- set readingTime = ((pageCount* wordsPerPage)/readingSpeed)/60 %}
>
> **Page-count**:: {{pageCount}}
>
> **Reading-time**:: {% if readingTime < 1 %}{{(readingTime * 60) | round + " minutes"}}{% else %}{{readingTime | round(3) + " hours"}}{% endif %}{% endif %}
> [!abstract]-
> {% if abstractNote %}
> {{abstractNote|replace(“\n”,“\n>”)|striptags(true)|replace(“Objectives”, “**Objectives**”)|replace(“Background”, “**Background**”)|replace(“Methodology”, “**Methodology**”)|replace(“Results”,“**Results**”)|replace(“Conclusion”,“**Conclusion**”)|replace(“Conclusions”,“**Conclusions**”)|replace(“Objective”,“**Objective**”)|replace(“Methods”, “**Methods**”)|replace(“OBJECTIVE”,“**Objective**”)|replace(“METHODS”,“**Methods**”)|replace(“BACKGROUND”,“**Background**”)|replace(“RESULTS”,“**Results**”)|replace(“Discussion”,“**Discussion**”)}}
> {% endif %}
> [!quote]- Citations
>
> ```query
> content: “{{citekey}}” -file:{{citekey}}
> ```
-–
{% persist “notes” -%} {%- if isFirstImport %}
**RQ**::
**Data**::
**Strategy**::
**Conclusion**::
**Takeaways**::
**Contributions**::
**Reason**::
{% endif %}{% endpersist %}
___