This is an Obsidian plugin that reinforces the workflow between Zotero and Obsidian. It enables the importation of literature notes from Zotero, and use them not only as the knowledge base but also the references for your writing. Requiring the installation of Better Bibtex for Zotero and Pandoc.
command: Add literature note
The dataview query in the gif above is as follows:
table without id
authors[0] as FirstAuthor, journal, year, title,
link(file.name, "Note") as Note,
elink(zotero,"Zotero") as Zotero,
elink(doi,"DOI") as DOI
from "Literatures" // set the folder name of the literature notes
sort file.ctime desc
limit 100And the notes generated by the command is as follows:
Important
You have options to add literature notes automatically when the bibliography file is updated. You also have options to automatically update literature notes when opened.
This means that you have to add items only to Zotero, and automatically add/update them to Obsidian.
command: Pandoc Citeproc Execution (docx)
- Optionally, set csl file path or url in the properties named
csl. - CSL file is the file that defines the citation style of the journal.
- You can download or get url of the csl file from here.
The result file(docx) is as follows:
- Install the better bibtex for zotero to the Zotero and configure the export of the bibliography file.
- Set the export location to your vault.
- Set the automatic export option to true.
- Set the file type to
Better CSL JSON.
- Enable the Obsidian community plugin, then install Simple Citations and activate it.
- Set the bibliography file path and export folder path in the plugin settings.
- You can use the commands:
Add literature noteUpdate literature noteUpdate literature note (active file)Pandoc Citeproc Execution (docx)Copy missing note links- This command identifies and copies links to literature notes that are not included in the JSON file.
Warning
Citekeys containing # ^ [ ] | \ / : will be skipped as these characters are not allowed in Obsidian filenames. Check the console log if items are missing.
Tip
The optional content below will be removed if you set the option to false and execute the "Update" command.
Generate tags for the following:
author/${firstAuthor}journal/${journalName}
Better Bibtex for Zotero has the function to add optional fields to the bibliography file.
- Open the Zotero
- Open the "Preferences"
- Set "postscript" as you want
Reference for the script. → Scripting :: Better BibTeX for Zotero
Zotero itemkey
if (Translator.BetterCSLJSON) {
csl.key = zotero.key;
}Set key in the plugin settings.
PDF file path
if (Translator.BetterCSLJSON) {
csl.pdf = zotero.attachments
.filter(a => a.localPath && a.localPath.toLowerCase().endsWith('.pdf'))
.map(a => a.localPath);
}Set pdf in the plugin settings.
Collection name
if (Translator.BetterCSLJSON) {
function path(key) {
const coll = Translator.collections[key]
if (!coll) return ''
if (!coll.parent) {return `${coll.name}`}
else {return `${path(coll.parent)}/${coll.name}`}
}
let collections = [];
zotero.collections.forEach((key) => {
collections.push(path(key))
});
csl.collections = collections;
}Set collections in the plugin settings.
From Issues #5
Insert the abstract section in the top of the note. The comment tag below is used to identify the abstract section.
<!-- START_ABSTRACT -->
<!-- END_ABSTRACT -->
Insert the template content in the top of the note. The comment tag below is used to identify the template section.
<!-- START_TEMPLATE -->
<!-- END_TEMPLATE -->
Note
This template is applied to all notes and the content is static. Therefore, it is recommended to use Dataview for setting dynamic templates.
When executing the "Pandoc Citeproc Execution (docx)" command, the link format is temporarily converted to the format of the pandoc citeproc.
The plugin modifies the link format as follows:
[[@citation-key]]→[@citation-key][[@citation-key|aliases]]→[@citation-key]// aliases are allowed[[@citation-key]][[@citation-key]]→[@citation-key;@citation-key]// multiple citations are allowed[[@citation-key]] [[@citation-key]]→[@citation-key;@citation-key]// spaces or line breaks can be inserted between links- End of a sentence:
[[@citation-key]]→ end of a sentence[@citation-key]. // inserts links before.if there is nothing between them.



