Zotero best practices

Little trick : you can upload the csl here by renaming it to .css :slight_smile:

2 Likes

Great idea @Martin, for those interested see attached. Obsidian APA.css (62.6 KB) @kimstacks @gafsiqueira

I’ve just used the APA standard, but it is relatively simple to modify any pre-existing standard, just need to find the correct spot to add the [[ ]] as both a prefix and suffix after the author names. (one hurdle I did run into was not being able to install it to Zotero, until I ultimately realised within the csl it was still named as APA, so Zotero was recognising it as already installed. So hot-tip for anyone that wants to modify a different style, make sure you rename the citation style (within the csl) to something unique).

7 Likes

@gafsiqueira

As a disclaimer, I’m pretty new to this note-taking business, but all the enthusiasm around Roam and Obsidian seems to be a bit infectious, so I’ve started getting into it. But this is really just me fumbling around and trying something after reading a few blogs and forums posts etc.

My thinking behind the note template for journal articles is to provide a single space to include my thinking, direct quotes, and any questions that arise from the article.

I also aim to provide links via keywords and links to other relevant notes (both of which I’m not sure how useful will be in the future, but will have to see as the database grows).

After understanding a bit more about the Zettelkasten method and the importance of small note sizes, I am writing up any unique ideas that are stimulated whilst reading the article and linking them in the bottom of this template in the Atomic notes section. Within these notes are links to other relevant articles and notes(zettels) that also support my idea. I guess the idea is that over time a depth and richness will evolve that helps peice these ideas together.

That’s my current process, but again, I’ve only just started this (have less then 10 articles within the database via this method at the moment), so time will tell how useful some of these links are and what additional information may be required.

6 Likes

Nice! Thanks for sharing @Svend.

I’ve recently started using Zotero and Word to do writing with citations, but I’m also adding in something worth looking at, since it uses markdown- I’m publishing articles on a Jekyll static-site with the Jekyll-scholar plugin, that lets me write a quick liquid tag to include a bibliography on a page depending on what I cited in it. https://github.com/inukshuk/jekyll-scholar

It might be cool if you could do something similar in obsidian- i.e. type tags for citations in pages and autogenerate a bibliography from a bibtex file for whatever citations appear in a specified collection of pages.

While I’m on the subject of Jekyll, I feel like there’s probably some desirable obsidian/jekyll integration possible, like the ability to export cards to Jekyll (just automatically adding front-matter to them and copying them to a Jekyll directory to publish online?)

6 Likes

Could you check if the discussion over at Zotero integrations is something close to what you’re looking for?
Exporting for web-publishing with citations and references is one of my concerns as well. Going by the discussion there, https://github.com/mfenner/jekyll-pandoc can help with export to Jekyll directory.

1 Like

Thanks @Svend for adding this APA css for us

1 Like

What a great idea! Thanks!

right now I’m using zotero -> zotero picker for windows. and also just incorporated @Svend’s great csl.

2 Likes

Kimstacks, your author problem has two causes:

  1. You have the field set to institutional author format. You need Last Name, First Name format. Click on the little box to the right of the author’s name, and this should yield “Scott” as the last name and “Alex” as the first.
  2. For some reason, “Alex” was truncated when you imported it. This is probably a function of the web page. If you were importing the metadata from a library site, where items are required to have correct information, you probably wouldn’t have this. I don’t know for sure how Zotero scrapes this kind of web page, but possibly it looks at the HTML. If the page author entered “Alex” instead of “Alexander,” this would explain the flaw.

As for the other kind of sources, use a trusted reference source to identify the item. For example, find articles on Google Scholar and books on Google Books. Amazon also is an easily scraped, often a convenient source of book metadata. If you have access to an academic library, their electronic catalogs and ejournals are usually quite good. I’ve even downloaded pdf’s from my library’s catalog and then used Zotero to access the file, and Zotero had the correct metadata. But this varies depending on the journal’s publisher. YMMV.

As for your question about using Zotfile, it requires two steps using the context menu:

  1. Attach the file to the reference.
  2. Then, Manage Attachments > Rename Attachments

If you set up ZotFile’s settings to point to where you’re keeping your pdf attachments, ZotFile will move the pdf file from where you have it (Downloads?) to a folder in your repository. The pdf will be renamed according to the naming rules you specified in the settings, and the folder will be named appropriately (e.g., “LuhmannN”).

3 Likes

If you’re using rmarkdown, are you using RStudio too? I use the RBBT addin to RStudio and the BibLaTeX plugin to Zotero. For a given paper, I create a dedicated collection in Zotero, and add cited references to the collection as I write. When I create the collection, I set up BibLaTeX to maintain a .bib file in the RStudio project directory where I’m writing. Then, as I write, the RBBT addin works with R Markdown files the way the Zotero plugin for Word, LibreOffice, etc. Because it just has to search in the collection instead of my entire 14,000+ item Zotero repository, it’s very fast.

I agree with what some people have said about the new Zotero interface being a bit clunky, but the classic version had its problems too. Hopefully the Zotero gods are working on this. But it’s still more than adequate.

An additional comment on Philipp’s excellent video.

If you are using any author-date citation style, like APA, you can omit the author from the parenthetical cite simply by prefixing the citation text with a minus sign. E.g.,

  • “This style of programming is driven by events [@brunsEventDrivenArchitecture2010: 2-5]” is rendered as “This style of programming is driven by events (Bruns 2010: 2-5).”

  • But “As discussed by Bruns [-@brunsEventDrivenArchitecture2010: 2-5]” is rendered as “As discussed by Bruns (2010: 2-5).”

5 Likes

https://getquicker.net/Sharedaction?code=72101143-4cc5-4dfe-2dda-08d80601d539

This action is developed by me, with higher efficiency and better effect.

1 Like

My friend helped me to write a small Python parser of my bibliography in BetterBibtex bib file and save every reference as md file in Obsidian vault.
How to use it:
1: install BetterBibtex as described in Zettlr docs. Citation key later will serve as a filename so use appropriate keys, i.e. no semicolons or other special symbols are allowed.
2. Copy the script (below) and bib file into references folder inside your vault.
3. Run the script:

import json
import collections

def flatten(d, parent_key='', sep='_'):
    items = []
    for k, v in d.items():
        new_key = parent_key + sep + k if parent_key else k
        if isinstance(v, collections.MutableMapping):
            items.extend(flatten(v, new_key, sep=sep).items())
        else:
            items.append((new_key, v))
    return dict(items)

def flatten_publication_info(publication_info):
    if publication_info.get('author', False):
        publication_info['authors'] = [author['family']+' '+author['given'] for author in publication_info['author']]
        publication_info = flatten(publication_info)
        return publication_info
    elif publication_info.get('authors', False):
        publication_info['authors'] = [author['family']+' '+author['given'] for author in publication_info['authors']]
        publication_info = flatten(publication_info)
        return publication_info
    return None

f = open('My Library.json','r', encoding='utf8')
data = json.load(f)
for elem in data:
    try:
        flat_publication = flatten_publication_info(elem)
        if flat_publication:
            filename = 'ZOT' + elem['id'] + '.md'
            writer = open(filename,'w+', encoding='utf8')
            title = flat_publication['title']
            abstract = flat_publication.get('abstract','Empty')
            authors = ';'.join(flat_publication['authors'])
            writer.write('tags: #zotero #reference\nlinks: [[Zotero library]] [[Readings MOC]]\n') #header
            writer.write('### %s\n ###### Authors\n%s\n ###### Abstract\n%s' % (title,authors,abstract))
            writer.close()
    except Exception as e:
        print('Problems with %s' % (elem['id']))
        print(e)

It will produce a lot of md files that you could reference from Obsidian. It will look like this:

7 Likes

That‘s cool, doing everything in Obsidian.

1 Like

I’ve posted the plugin I wrote before in Zotero integrations - #30 by argentum (updated workflow here), but I thought I’d add here a few things that could help make the most of Zotero (and also of the mdnotes plugin itself). My workflow

How to

Extract annotations and highlights

Zotfile will extract annotations from your PDF and store them as notes in Zotero. The notes include links to the specific page in the PDF where the highlight was made:

image

You can configure how to format these HTML notes with Zotfile’s hidden preferences, check the .pdfExtraction settings here

Keep in mind that if you annotate your PDFs, Zotfile is also able to extract “pop-up notes”, but not inline notes. These highlights:

End up in this note:
image

Splitting annotations and Highlights into different notes

There are a few settings worth looking into, depending on your workflow:

  • By default, the extensions.zotfile.pdfExtraction.colorNotes setting is turned off, which means all the highlights and annotations will be extracted to a single note.
    • You can change the format of the title with extensions.zotfile.pdfExtraction.formatNoteTitle

    • Setting extensions.zotfile.pdfExtraction.colorAnnotations to true, will add the color as a background in the annotations, and you can use %(color_category) to add labels in extensions.zotfile.pdfExtraction.formatAnnotationHighlight according to the colors in extensions.zotfile.pdfExtraction.colorCategories

  • Splitting notes by color can be turned on by setting extensions.zotfile.pdfExtraction.colorNotes to true
    • You can customize the title of the note in extensions.zotfile.pdfExtraction.formatNoteTitleColor

Export notes to markdown

Now that you have notes attached to your Zotero reference, you can export the reference’s metadata and your highlights and annotations to a markdown file.
The menus in Zotero are unfortunately not context-aware, so to know what to select for each menu follow the cheatsheet at the top of the README of mdnotes. The plugin helps with the following:

  • Exporting metadata of a reference
  • Exporting Zotero notes (e.g. those extracted by Zotfile or literature notes written by you)
    • The export format for markdown is a little hardcoded (right now), but you can experiment with changing Zotfile’s notes formats and include markdown or wikilinks in your annotations:

    • If you want to structure your notes, you can use underline (instead of highlight) to create H4 headings. A PDF like this:
      image
    • After being exported, results in a markdown note like this:
  • Creating a file for your notes. Since this file contains your notes, this is the only file that won’t be overwritten during batch export. If you want to replace it, you can choose the Create Notes file menu.

The plugin also can add these files you created as links to Zotero so you can double click them and edit them.

The default settings export all the information of the references in multiple files. If that doesn’t work for you, there some settings to play around with, depending on what you want:

  • If you don’t want to “pollute” your graph, you can choose to export everything in a single file.
  • If you don’t want to include highlights and annotations in your export (e.g. as literature notes), you can either disable them in the settings so they’re not included in the export. If you export everything in a single file, you can have the metadata in the same file.
  • Instead of using batch export on every item, selectively choose what you send to your vault by using the individual menus.

Get links to a Zotero item or PDF

You can use Zutilo to get a link to the Zotero item or a PDF. You want to enable Copy select item links in Zutilo’s settings so that it shows up in the context menu or as a shortcut. That will give you a link with Zotero’s URL e.g. zotero://select/library/items/FE7B33LA which you can format in markdown.

Update: @silent developed a Zotero translator to easily copy markdown-formatted zotero links here.

Naming conventions

Using Zotfile and Betterbibtex, it’s possible to establish certain rules about how your files are named. I covered this in a reply further down:

Web clipping

In order to successfully use Zotero to save articles, it should have a “translator” that can correctly get the data for the citation out of it. You can find a list of existing translators here

Plugins

69 Likes

That’s cool - thanks for that detailed overview!

I have been working with zotfile for quite a while now and more recently with mdnotes - but I just realised that so far I obviously only have discovered a small part of zotfile’s power! I wasn’t aware of zotfile’s hidden preferences that allow you to even better organise your notes - thanks for calling my attention to this! :slight_smile:

1 Like

Sorry that I just created another post to introduce related methods, now I introduce it again here.


In Obsidian 0.8.15, you can use URL scheme to jump to specific note.

So I share a geek way to achieve something interesting with you.

First of all, I am using pdf X-change editor plus, Zotero, Quicker(a software like autohotkey but has a GUI)

Jump from Obsidian to pdf

  1. Select what you want to save in Obsidian.
  2. Copy it and use pdf X-change editor plus to get the file path of what you are reading, capture its zotero’s library parameters(like G78UAI9B) by using autohotkey or any software you want.
  3. Get the page number of the text you selected.
  4. Then insert the library parameters & page number into the link(like: zotero://open-pdf/library/items/G78UAI9B?page=9).
  5. You can make similar text like follow.
    image
  6. Paste it in you obsidian note. Ctrl+E, You could jump from your note to pdf now.

Jump from pdf to Obsidian

  1. Get the URL link of your note.
  2. Add a web link to the text you selected in your pdf.
  3. Paste the URL link of your note in it. Click it, you could jump from pdf to your note now.

PS: If anyone find a better way to do these, please share it with me. Thanks.
PPS: The official website of Quicker software I use is https://getquicker.net, and its free version does not require login, so you can try to use it.
The script I use is:

  1. pdf to OB
  2. OB to pdf

Sorry that I didn’t add a English translation to their introduction.

A geek gif as follow:


link: Combine Zotero with Obsidian (Jump from pdf to Obsdian’s note)

11 Likes

Thank you for this amazing guide. When extracting annotations from zotfile, is it possible to replace or delete the old one extracted annotation note?

2 Likes