Adding annotation tags to notes

This discussion was created from comments split from: Zotfile no option to extract annotations.
  • Dear developers, I am very pleased with the new pdf editor. Nevertheless, one functionality that I use a lot seem to be either lost or misunderstood by me. I have previously been using tags to tag notes. This way I can search a specific tag to get all the content related to it. I now created a note and tagged it in the new pdf editor. I then used the "Add note from annotations" functionality and noticed that the tag did not join the note to the item. I can of course tag the note manually but then the feeling of this brand-new workflow gets lost.
    Kind regards
  • @andersculturalstudies: You can add tags to notes with note templates — there's an example there. We may add an option to do this without a template in a future version.

    Currently annotation tags themselves are only searchable within the PDF reader, but it will be possible to search for annotations by tag from the library view in a future version.
  • Thank you @dstillman I will look into the note template and happily wait for a future version.
  • So I wanted to share how I set it up. Possibly this is very elementary for folks but it was fun (new) for me to figure out.

    I followed the note template examples & set up the layout I wanted:

    + yellow: general highlight --> "in quotations”

    + green: technical highlight of method or explaining a concept

    + blue: (no classification yet for blue highlight)

    + red: important or key term --> “in bold & quotations”

    + purple: question or I don’t understand the text here --> "in italic quotations"

    + comments in block quotes followed by my initials “gc:”

    + annotation tags directly behind highlight --> #bold

    + a dash break between highlights, & a centered divider under title

    This was the code:
    -------------------------------------------------------------
    in Preferences -> Advanced -> Config Editor -> extensions.zotero.annotations.noteTemplates.highlight :

    {{if color == '#ff6666'}}

    <b>{{highlight quotes = 'true'}}</b>{{citation}} {{if tags}} <b>#{{tags join=' #'}}</b>{{endif}}

    {{elseif color == '#a28ae5'}}

       <i>{{highlight quotes = 'true'}}</i> {{citation}} {{if tags}} <b>#{{tags join=' #'}}</b>{{endif}}

    {{else}}

    {{highlight quotes='true'}} {{citation}} {{if tags}} <b>#{{tags join=' #'}}</b>{{endif}}

    {{endif}} {{if comment}}<blockquote> gc: {{comment}}</blockquote>{{endif}}<p style="text-align:center;"> - </p>

    ----------------------------------------------------------
    code used in Preferences -> Advanced -> Config Editor -> extensions.zotero.annotations.noteTemplates.title:

    <h1>{{title}}<br/>({{date}})</h1><p  style="text-align:center"> ============ </p>
    ---------------------------------------------------------
    Here some pictures of what it looks like: !https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs/app/oddlyaware/NMWMoFz6OW.22.21.png?alt=media&amp;token=f19c2aa3-a8ac-4933-aee9-968190d92c58

    https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs/app/oddlyaware/Y5fYKNwjrx.21.36.png?alt=media&amp;token=3ad2e6e6-810d-451c-9aac-7e9658f606bd

    with highlight color toggled off (three dots in corner of note):
    https://firebasestorage.googleapis.com/v0/b/firescript-577a2.appspot.com/o/imgs/app/oddlyaware/0z5vBfuYla.38.16.png?alt=media&amp;token=80478fd6-e42b-4c15-a5f7-a71c8d7b1566

    material I referred to:
    + https://www.zotero.org/support/note_templates
    + https://www.zotero.org/support/kb/rich_text_bibliography
    + https://www.w3schools.com/html/html_headings.asp
    happened across @aflamingo also shared their template, & workaround with obsidian tags : https://forums.zotero.org/discussion/97185/sharing-a-very-basic-template-for-tags-in-child-note#latest
  • edited November 28, 2022
    I tried the above but did not succeed. Is there any chance that Zotero pdf reader notes and tags automatically appear under the "item" as separate childnotes in later versions of Zotero?
  • edited December 12, 2022
    I export my annotations to Roam Research, where I do my writing/zettelkasten, and in the case of tags that have multiple words, things can get messy. Here is an example of using a tag called 'multiple words' and wanting to add # to the tag so Roam knows it's a word that should be hyperlinked. Going with the script above: #{{tags join=' #'}} will create an output of '#multiple words', which will cause you a headache when you load it into Roam because only 'multiple' is hyperlinked. To correct this, you would have to manually edit, and it's a pain.

    For Roam syntax reasons, I would like the tag 'multiple words' to appear as #[[multiple words]]. This way Roam assigns the hyperlink to both words because they are contained within the square brakcets, and I don't have to do any editing work. Because of the volume of reading and notetaking I'm taking, I rely on annotations and tags to streamline my workflow which enables me to be do analysis work right up front while I'm reading the PDF or book.

    My initial question with regards to the code from above: #[[{{tags join=' #[['}} and I asked for some guidance on how I could have ']]' appended to the end of each tag. I wracked my brain for a few hours, got some sleep, queried all the threads again first thing this morning and found the solution!

    ******** SOLUTION FOUND*******

    I found the solution in the following thread: https://forums.zotero.org/discussion/comment/400038#Comment_400038.

    Here's the syntax to have your tag appear inside #[[ ]], which you can easily import into Roam Research and not have to fiddle around with manual editing

    {{if tags}} #[[{{tags join=']] #[['}}]] {{endif}}
  • I tried this solution without success. What would the syntax look like if I only want to make the item notes appear as child notes instead?
  • Dear anderscutlturalstudies, If you find a solution to your question, please let us know as I would like to do the same (if possible within Zotero, but!)
  • @aurora.pinto: This is answered above.
Sign In or Register to comment.