Exported Annotations have PDF page number instead of actual page number

edited May 30, 2024
EDIT: I solved this by using {{annotation.pageLabel}} instead of just {{annotation.page}}!

Hello,

I'm exporting annotations made in the Zotero PDF viewer to Obsidian using Zotero Integration's "Import" option. I have a template made to extract the annotations:

{% for annotation in annotations -%}{%- if annotation.annotatedText -%}{% if 'Red' in annotation.colorCategory %}
##### {{annotation.annotatedText | escape }}{% else %}
{{annotation.annotatedText | escape }} ([{{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 -%}

When I make annotations in Zotero PDF viewer, I am able to change the page number from the PDF page number to the "actual" page number (of the book the PDF is a section of), and then it even remembers and populates new annotations' page numbers as the "actual" page numbers in relation. This is awesome!

My problem is that when I import those annotations into Obsidian, the PDF page number populates in the {{annotation.page}} hyperlink section instead of the actual page number. Here's how it looks in Obsidian (in markdown format):

Where fear and weapons meet — and they often do in urban America — there is always the possibility of death ([3](zotero://open-pdf/library/items/6XPPZCVN?page=3&annotation=6FGZMHNN))

Instead of [3], it should be [519]. This is how it shows up in Zotero's notes after I select "Add Note from Annotations":

"Where fear and weapons meet — and they often do in urban America — there is always the possibility of death” (Staples, 2018, p. 519)

Any idea how I can modify the template to do this, or will I just have to go in and change all of the hyperlinks manually?
  • Zotero Integration's "Import" option
    I'm not sure what you're referring to, but if that's a plugin, 1) it shouldn't be called that and 2) you'd need to contact the plugin developer.
  • edited May 30, 2024
    https://github.com/mgmeyers/obsidian-zotero-integration

    You're talking about this? We don't have anything to do with that. I'd be curious to know if you thought we did, because it's very important to us that people have a clear understanding of when something is our software vs. a third-party tool.
  • edited May 30, 2024
    I submitted this question in this forum as well as the Obsidian forum to see if any users who also use the Obsidian plugin knew how to solve the issue. I knew it was most likely a problem with my coding, not the software itself.

    Obsidian is just a markdown editor. Zotero Integration is a very popular community-made Obsidian plugin that allows one to import citations and annotations from their Zotero library into obsidian! :)

    Don’t worry about it, I was able to figure out the issue by looking at some other users’ templates. Thanks for responding, though!
  • edited May 30, 2024
    We know what Obsidian is and we know of that plugin. I was just trying to understand whether you were aware that you were using a tool not made by Zotero developers, since you referred to it as just "Zotero Integration". That's both not really a fully descriptive name for that tool and sounds an awful lot like Zotero's official Word/LibreOffice/Google Docs plugins, so we're sensitive to potential confusion here.
Sign In or Register to comment.