Tag issue

I have been importing PDFs into Zotero and then highlighting text selections within Zotero. After I highlight a section, I have been clicking on the section a second time, and it gives me the option of tagging the selected text. I have been diligently tagging this way for two months. I now have 72 articles with text selections tagged, but I cannot create a report by tag with selected text from multiple articles. I need a list of all of the quotations I have tagged across multiple articles, by tag as the headline. Can you please tell me how to do this?
  • Hi, thanks for your note, however, I am not able to implement the suggestions and need more help. I am not even sure if this will solve my problem as the solution you've sent seems to apply to importing PDFs from elsewhere. My issue is this:
    1. I have highlighted PDFs IN Zotero, which I have tagged (but not tagged within notes)
    2. I want to collect all of the selected text by tag in a document, from all of the PDFs I have highlighted. It appears that by default, Zotero will only let you do that if you have tagged a selection of text using the tag selector at the bottom right-hand side of the screen in notes. I have not done this.
  • edited December 15, 2023
    The information in the links above explains how to go from your annotations (in the PDF files in Zotero) to a note in Zotero.
    You can then still export that note to any other place where you want to get your report, either from the Zotero export tools, or with the Better Notes plugin for more options.
  • Hi there,
    I do not understand how to use the Better Notes plugin to generate a report by tags. Can you please explain without sending me back to the plugin page? I need more direct help.
  • Can you explain what you have tried and at which step you are blocked?

    The relevant information for your question is detailed in this page of the Zotero documentation (linked above):
    https://www.zotero.org/support/note_templates
    and in the link given in the first sentence of that page:
    https://www.zotero.org/support/pdf_reader#adding_annotations_to_notes
    If you have read these pages but still face problems, please give more details on what is the problem.

    Following the documentation, are you able to:
    1) Export a single highlight annotation to a Zotero note
    2) Export the resulting Zotero note to the report format that you want (Work, HTML, Markdown, text, ...?)
    3) Export all annotations from a single item
    4) Export all annotations from multiple items

    After getting familiar with these steps, you will be able already to export all your annotations.
    After that, you still need to organize these annotations by tags. As you can see in the page linked above on the Note Templates, Zotero lets you access the tags information of your PDF annotations to write a custom template.

    So, Zotero gives you all the tools to do what you want. But you still need to write the note template to fit your needs.

    The Better Notes plugin is useful here to:
    Simplify and automate knowledge analysis with extensive note templates. With one click.
    https://github.com/windingwind/zotero-better-notes?tab=readme-ov-file#-what-can-it-do

    More specifically, I have linked to a Note Template, provided by the developper of the plugin, which does something similar to what you are asking for:
    https://github.com/windingwind/zotero-better-notes/discussions/232

    If you have completed the steps above, but still have problems using the Better Notes plugin or modifying the template linked above, please explain what you have tried and at which step you are blocked.
    People in the forum will be able to help further and give direct help if you explain your problem in more details.
  • Good evening,

    Thank you for your detailed response. Your numbered questions above:
    Following the documentation, are you able to:
    1) Export a single highlight annotation to a Zotero note YES
    2) Export the resulting Zotero note to the report format that you want (Work, HTML, Markdown, text, ...?) YES
    3) Export all annotations from a single item YES
    4) Export all annotations from multiple items YES

    What I am having difficulty with is the instructions provided in the link you gave: https://github.com/windingwind/zotero-better-notes/discussions/232

    The instructions given sound like they are for importing documents. I do not understand how to apply the instructions, or where to copy/paste the code. The following seem to be instructions, but I do not know how to follow them as they refer to an import situation, whereas my documents are tagged within Zotero, and I am trying to collect all the highlighted text with a particular tag in one document. These are the instructions that I don't understand how to execute:

    # This template is specifically for importing/sharing, using better
    # notes 'import from clipboard': copy the content and
    # goto Zotero menu bar, click Edit->New Template from Clipboard.
    # Do not copy-paste this to better notes template editor directly.

    To the last instruction "Do not copy-paste this to better notes template editor directly." However, do I copy-paste the following somewhere, and if so, where?

    name: "[item] collect annotations by tag"
    content: |-
    // @beforeloop-begin
    ${{
    sharedObj.tags = Zotero.getMainWindow().prompt("Please input tags. Split with ',':", "").split(',');
    return "";
    }}$
    // @beforeloop-end
    // @default-begin
    ${{
    if(!sharedObj.tags){
    return "";
    }

    async function getAnnotationsBy(item, filter) {
    const annots = item.getAnnotations().filter(filter);
    return await Zotero.BetterNotes.api.convert.annotations2html(annots, { noteItem: targetNoteItem });
    }

    const attachments = Zotero.Items.get(topItem.getAttachments()).filter((i) =>
    i.isPDFAttachment() || i.isSnapshotAttachment() || i.isEPUBAttachment()
    );
    let res = `

    ${topItem.getField("title")}

    `;
    for (let attachment of attachments) {
    res += `

    ${attachment.getFilename()}

    `;
    for (let i in sharedObj.tags) {
    const renderedAnnotations = (
    await getAnnotationsBy(
    attachment,
    (_annot) => _annot.getTags().map(_t=>_t.tag).includes(sharedObj.tags[i])
    )
    );
    if (renderedAnnotations) {
    res += `

    ${sharedObj.tags[i]}

    \n${renderedAnnotations}`;
    }
    }
    }
    return res;
    }}$
    // @default-end

    Thank you so much for your continued time with this matter!
  • Before using a note template, you need to import it into the list of templates stored by the plugin. This is what the instructions are refering to (importing the template, not importing documents). See Import Note Template.

    After importing the template, you can use it for example in this way:
    Now you can open a note/the workspace and in editor toolbar, click Insert Template to cursor line. Select the template, it is inserted to the note.
    This template may also be useful:
    https://github.com/windingwind/zotero-better-notes/discussions/241

    For further questions on the plugin, you can post directly on the plugin's GitHub, where there is a discussions page with a Note Templates category:
    https://github.com/windingwind/zotero-better-notes/discussions/categories/note-templates
Sign In or Register to comment.