In obsidian an annotation imported from zotero shows the text of the annotation and a link to the pdf file it is imported from. If I click on the link obsidian tells me:
Could not read file zotero://open-pdf/library/items/H4D9W3X6?page=77&annotation=KW8Q2XSM
Things I have tried
Searched the internet and obsidian help: Happened nothing
Tried to change parts of the link to find the pdf manually in my home directory. I found a directory in my Zotero storage. The link seems correct. There is the pdf in a directory “H4D9W3X6”. But I can’t locate the “KW8Q2XSM” part in my obsidian vault.
I suppose there is an entry somewhere to tell obsidian where to locate the annotations but I did not find it.
Since I use flatpak, Obsidian plugins for Zotero don’t work for me.
You could install a Zotero plugin called “better notes”, which is able to generate markdown notes (with and without highlights) and with links to your highlights in zotero
In zotero, click on the yellow note, then the plus button under the search field to generate your notes.
Then click on your note, in there click on the 3 dots to export your note.
Simple and useful. Just “wegwerf” other plugins that don’t work.
This part looks like your suggestion. I don’t know where the part after the “?” is added. Obviously by the Zotero Integration plugin.
What I tried: I enter ‘file:///home/username/Zotero/storage/H4D9W3X6/’ in my browser and am directed into the correct directory where my pdf is stored.
How to proceed? Is there a way to enter code into my template to direct the link to the annotation? In my example it would be “page77&KW8Q2XSM” - I suppose this is the name of the annotation stored in Zotero?
Can you share the full code for the pagenumbers and annotation link? The critical part is missing. And please make sure to share it in a code block, so it can be read correctly.
Yes, it’s called desktopURI and it’s stored in the data of each annotation. When I see you current code, I can help you implement it.
Better Notes adds a yellow note icon to your right-side ribbon.
Like in Obsidian, Zotero has two sidebar buttons:
click on the left sidebar button to expand panels on the left (with page overview, etc)
click on the sidebar button on the right to expand panels on the right (tools like metadata, etc).
First if all, open Zotero and a PDF (or other document) with highlights in it and enter in reading mode. Same, as when you would read and highlight your document
expand the panels on your right side with the right sidebar button
With the panels open, click on the yellow note icon in the right ribbon.
With the Better Notes panel open, click the plus button under the search field to choose an option to generate notes from your existing highlights and confirm. This generates your note
Then click on your new note, to open your note
With your note open, click on the toolbar icon with 3 dots to select export and confirm: save your note to the documents folder.
This is the part of the plugin you want. There’s no need to discuss other features of Better Notes.
I’m just trying around to understand templates - I copied some code from this forum’s posts as a starting point - so maybe it’s from Feralflora ;-). Here is my last try:
Referenz: “{{bibliography}}”
{% persist “annotations” %}
{%- set newAnnotations = annotations | filterby(“date”, “dateafter”, lastImportDate) -%}
{% if newAnnotations.length > 0 %}
{%- set noteIndex = 1 -%}
{% for annotation in newAnnotations %}
{{annotation.annotatedText}}
Nope, that’s not mine. Mine has functioning annotation links
If that’s your current template, then there should be no link at all associated with each annotation, since you just output the page label, but not {{annotation.desktopURI}} as part of a markdown link, like:
These links don’t link to the file itself, but to Zotero, which then navigates to the PDF and the correct location within it.
If you need the link to the PDF attachment, something like this works, while accounting for the possibility of having more than one PDF attached to an item:
{% for attachment in attachments | filterby("path", "endswith", ".pdf") %} | [**PDF-{{loop.index}}**](file:///{{attachment.path | replace(" ", "%20")}}){%- endfor %}
Another way to get a direct link to the first PDF attachment is to use {{pdfLink}}, or if it’s an EPUB or something like that, you need: {{firstAttachmentLink}}.
You can explore all the available template variables in the Data explorer provided by Zotero Integration with a command called the same.
My first example above is exactly what you need. You need that code as is, no parts missing. I’m not sure your non-working code is a proper markdown link like [link text](link destination). Or is it just the formatting that’s off without the backticks needed for inline code or code blocks?