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:
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())
if publication_info.get('author', False):
publication_info['authors'] = [author['family']+' '+author['given'] for author in publication_info['author']]
publication_info = flatten(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)
f = open('My Library.json','r', encoding='utf8')
data = json.load(f)
for elem in data:
flat_publication = flatten_publication_info(elem)
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))
except Exception as e:
print('Problems with %s' % (elem['id']))
It will produce a lot of md files that you could reference from Obsidian. It will look like this:
I’ve posted the plugin I wrote before in Zotero integrations (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
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:
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:
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:
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.
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:
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
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!
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
Select what you want to save in Obsidian.
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.
Get the page number of the text you selected.
Then insert the library parameters & page number into the link(like: zotero://open-pdf/library/items/G78UAI9B?page=9).
You can make similar text like follow.
Paste it in you obsidian note. Ctrl+E, You could jump from your note to pdf now.
Jump from pdf to Obsidian
Get the URL link of your note.
Add a web link to the text you selected in your pdf.
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:
If you mean the yellow Zotero notes, I don’t think it is possible. Zotfile creates new notes every time you extract new annotations, if you want to get rid of them I think deleting them manually is the only way. I think there may be use cases where people annotate/highlight the PDFs for different purposes and/or at different times, and might want to keep the old notes too.
Has anyone created at alternative copy (i.e. Quick Copy alt 1) that is specific to Markdown? Ideally I’d have it copy the [Title](zotero link) rather than just the simple Zotero link. I’ve been trying to figure out how to do this, but any pretty lost…
How are you guys avoiding special character in titles names in Zotero? I have set zotfile to replace special characters, but it seem to only do it for the filenames and not the actual title within Zotero.
I only became aware of “curl” this week, and I think the idea is to use it to download/build packages. I’ve been using homebrew, and read a bit about macports, then saw a bit about curl. But what’s up with the anonfile “upload” bit? If I use zotfile, what am I uploading, if anything?
Hey @s0ph0s, let me start with the disclaimer that I’m not the Zotfile developer, so all the explanation below is just based on my experience as a dev. I also want to say that there is no reason to be worried about that line, since Travis can’t run in your computer.
Travis is a continuous integration service, that is, something you use to test and build your code, and, in Zotfile’s case, “deploy” your code. You can see how Travis executes the commands listed in that yaml file over here. They seem to be using it to upload the xpi file to the link in that line, most likely to be able to send it to people if they need to test a fix.
I don’t use Zotero, but just a plain .bib file for my references. Since Zotero users might export their data with Better Bibtex to a .bib file, too, this might be interesting to some of you (works on macOS and probably on Linux, requires certain familiarity with terminal applications):