Formatting of exported annotations/ highlights (and other questions)
I really, really like the drag and drop export of annotations from zotero into a text editor (Obsidian, in my case), but I still don't fully understand it yet (and based on what I read from other users, I'm not alone), so I'd like to point out some areas of confusion and ask for clarification:
1. There are various ways of getting annotations into a text editor and I'm not sure how they relate to each other (and which of them are provided by Zotero itself and which rely on add-ons. For example:
- dragging and dropping an annotation/highlight from the annotation pane seems to yield the same results as dragging the corresponding annotation from the pdf in Zotero reader. But I'm not sure whether this is coincidental or by design (some users seem to get different results).
- is the drag and drop operation synonymous with Quick Copy of Notes (as in Preferences -> Export)?
2. Annotations/highlights are obviously new terms in Zotero 6 while "Notes" have existed in Zotero forever. But it seems that _some_ settings that apply to Notes also apply to annotations (see Quick Copy of notes above or the advanced settings
3. I'm really glad I found this explanation of how to customize the formatting of exported annotations: https://www.zotero.org/support/note_templates but it doesn't explain where the variables like
- It's great that this link is available, but it is somewhat counterintuitive that it "hidden" inside the
- I would also like to customize the
4. I have tried to customize the template at
but it doesn't work. If I paste
5. To what extent does the receiving editor matter? By that I mean: whether it is a plain text editor, rich text editor or, as in the case of obsidian, also accepts HTML. I am also asking because I noticed that dragging-and-dropping of annotations only works if the editor window was the last window in focus before losing it to Zotero. If I come from another app and try to drag an annotation into obsidian, it just bounces back into Zotero.
P.S. This post was a pain to get to render properly because the forum editor apparently doesn't understand markdown and misinterprets all < as HTML code so that I had to replace all of them with, well, I can't get this to render either, because it will simply render as "<" - I couldn't find any instructions on how to paste code in a forum post. (Fixed the post with <code> and </code>, thanks @adamsmith!)
1. There are various ways of getting annotations into a text editor and I'm not sure how they relate to each other (and which of them are provided by Zotero itself and which rely on add-ons. For example:
- dragging and dropping an annotation/highlight from the annotation pane seems to yield the same results as dragging the corresponding annotation from the pdf in Zotero reader. But I'm not sure whether this is coincidental or by design (some users seem to get different results).
- is the drag and drop operation synonymous with Quick Copy of Notes (as in Preferences -> Export)?
2. Annotations/highlights are obviously new terms in Zotero 6 while "Notes" have existed in Zotero forever. But it seems that _some_ settings that apply to Notes also apply to annotations (see Quick Copy of notes above or the advanced settings
extensions.zotero.annotations.noteTemplates...
. The latter admittedly also have "annotations" in their name, but when they refer to *note*Templates, this seems to be notes in a broader sense.)3. I'm really glad I found this explanation of how to customize the formatting of exported annotations: https://www.zotero.org/support/note_templates but it doesn't explain where the variables like
{{citation}}
or {{highlight}}
are defined (or how to change their internal formatting). The {{highlight}}
variable seems to include not just the highlighted text but also a link to the deep-link to the annotation in zotero reader. - It's great that this link is available, but it is somewhat counterintuitive that it "hidden" inside the
{{highlight}}
variable. It also seems to behave somewhat strangely as it seems to render differently depending on its proximity to the {{citation}}: if the template is <p>{{highlight}} {{citation}} {{comment}}</p>
, the pdf-link is inserted between the citation and the comment but in <blockquote>{{highlight}}</blockquote><p>{{citation}} {{comment}}</p>
it is part of the blockquote, i.e. inserted between highlight and citation. Is there any way of getting into the {{highlight}}
variable somewhere, i.e. to change its composition?- I would also like to customize the
{{citation}}
variable but none of the citation-style settings seems to affect it. Or did I miss one? Also this variable I would like to get into and tweak it. My idea is to put the link to the zotero item (which is currently under the entire citation) just under the Author Year part and then use the deep link (which currently is locked inside the {{highlight}}) as a link under the page number of the citation. But as far as I can see, this is nothing the user can modify, right?4. I have tried to customize the template at
extensions.zotero.annotations.noteTemplates.highlight
so that the citation is justified right instead of left like this: <blockquote>{{highlight}}{{if tags}} #{{tags join=' #'}}{{endif}}</blockquote><div style="text-align: right">{{citation}}</div>{{comment}}
but it doesn't work. If I paste
<div style="text-align: right">{{citation}}</div>
, however, it renders correctly in obsidian. So I suspect that the html code is removed before pasting? Is there any way of knowing which HTML-tags are removed and which aren't?5. To what extent does the receiving editor matter? By that I mean: whether it is a plain text editor, rich text editor or, as in the case of obsidian, also accepts HTML. I am also asking because I noticed that dragging-and-dropping of annotations only works if the editor window was the last window in focus before losing it to Zotero. If I come from another app and try to drag an annotation into obsidian, it just bounces back into Zotero.
P.S. This post was a pain to get to render properly because the forum editor apparently doesn't understand markdown and misinterprets all < as HTML code so that I had to replace all of them with, well, I can't get this to render either, because it will simply render as "<" - I couldn't find any instructions on how to paste code in a forum post. (Fixed the post with <code> and </code>, thanks @adamsmith!)
I'm using the following highlight template (as explained : https://www.zotero.org/support/note_templates):
{{citation}} {{comment}}
But when I drag and drop a note into Obsidian, I get the following :> highlight
(“PDF_NAME”, PAGE_NUMBER)
However :
1. How to change citation format ? I don't want "PDF_NAME" but say "citeKey" ?
2. How to get a link with PAGE_NUMBER ? Currently, there is no link that redirects to Zotero.
Thanks !
Look forward to this function can be added in the following update. Thank you!
{{citation}}
and it doesn't look like the developers want to open up that variable. I read a post saying something like that the other day, but I can't find it now.Regardless of what will or will not be implemented, I think it would be great to get some clarity about how the
{{citation}}
variable is rendered.As for variable editing, I don't think that is possible at this moment.
I am also unable to reproduce the output of “PDF_NAME”.
{{citation}}
produces a an "author-year, page"-type citation (which is correctly linked to the zotero item if "include Zotero Links" is checked under edit->preferences -> export.Could it be that the results @JorgePLK saw earlier are due to there not being any author names in the item concerned? (I suppose that's what you meant by "check the item metadata").
In any case, what remains unclear to me is where the formatting of the author-year reference comes from. I have tried both changing the Quick copy Item Format (in settings -> export) and the citation style selected in settings -> Cite but neither of these settings seems to affect how
{{citation}}
is rendered.I think part of the confusion is due to Zotero's explanations in the "Export"-tab are incomplete. It states: So it talks about items and citations but not about annotations.
I also find the terminology confusing. The way those two paragraphs are written suggests that they are talking about exporting two different kinds of things, "items" and "citations", but they are not. They are both about exporting items. The difference is in how these items are rendered once they are exported. In the first paragraph
the exported item will be rendered as a full reference (i.e. an item in a bibliography) and the second paragraph will render the item as an in-text citation (e.g. author-year).
It says nothing about exporting annotations, yet, the "note format" settings apply to annotation export. So, the Quick Copy settings are not just about exporting (Zotero-)items, but also about exporting annotations...
So, my suggestion would be to change the explanation text to something like this:
About the “PDF_NAME” ouput, my guess was indeed that the author field was empty.
Also, to clarify any doubt, at this moment I'm just a Zotero user without other kind of affiliation to this organisation.
Good luck!