New plugin: Citations (with Zotero)

After using the Zotero → Export Bibliography → Create Literature Note using Citation → Zotfile to extract annotations → MDNotes to extract annotations to MD → Copy paste from temporary MD file into Literature Note pathway that I’ve seen posted, I dug into MDNotes a bit more, and found it’s easier to export the whole entry including annotations direct from Zotero. This means I don’t have to keep the .bib file up to date, and it’s a single click to generate everything from Zotero. To set this up, I used the Templates doc for MDNotes https://argentinaos.com/zotero-mdnotes/docs/advanced/templates/defaults and made a Mdnotes Default Template.md that mimics the Citations Literature Note entry like this:

---
title: "%(title)"
authors: [%(author)]
year: %(date)
type: %(itemType)
citekey: %(citekey)
alias: 
  - "%(title)"

---


{{title}}
{{author}}
(%(publicationTitle), %(date)) 

%(pdfAttachments) (%(localLibrary))

{{abstractNote}}
{{url}}
@%(citekey), %(DOI)

{{collections}}
{{tags}}, #zotero, #literature-notes, #reference

## Notes

## Quotes

with a Zotero Note Template.md that looks like this:

{{noteContent}}

The trick I needed was setting up the MDNotes preferences (Tools → MDNotes) to export everything as a single file, straight into a papers folder in my Vault, with the right filename.

Now, I can Read/Annotate a paper, click Extract Annotations and then MDNotes->Create Full Export Note, and it’s all there in Obsidian. It’s not perfect - still working through the fields in MDNotes, but it’s much quicker than making temp files and reloading Obsidian.

4 Likes

Hi Ncraig, I am back to this topic with three questions if you don’t mind :slight_smile:

  1. do I need to fill the yaml frontmatter even if I use the Citation plugin on Obsidian, or the one it automatically compiles is fine by itself?
  2. I don’t understand, from the instruction page, what it means “download the pandoc filter”, which simply redirect to the link "https://retorque.re/zotero-better-bibtex/exporting/zotero.lua
  3. what is the “path to script zotero.lua” you mention in your code? Where do I find that path?

Thanks so much in advance

Looks great! One question (I don’t know if this is the right thread to ask it, though): Is it possible to create a placeholder in Zotero for the author lastname only? I didn’t find it in the list of the Zotero Item Types.

I noticed that the plugin does not recognize editors as “authors”. So, in the case of an edited volume, it will say “unknown authors”, which is technically correct, but it would be better if it uses the editors instead (suggestion for improvement).

2 Likes

To add a bit on what @tophee said, is there a way to have different templates based on Zotero item type ?

The ability to use templater in Citations plugin would help in that sense.

If it’s not possible in the citations plugin, you might want to consider using the mdnotes plugin in Zotero. It has access to all fields in Zotero.

See for a brief comparison of the two plugins:

Thank you for developing such an amazing plugin! As already mentioned by previous users, the plugin cannot be enabled on iPadOS. Any way to fix this, or plans to address this in a future release?

Hi everyone! I’m new to Obsidian and to the forum. I was hoping to get some help. I installed the Citation plug-in today. Everything seems to be imported correctly. But when I press Ctrl+Shift+E to enter a citation and select the one I want (via Enter or mouse click), nothing appears. I just get this error:
2021-08-18 22_31_37-Microsoft Store

Does anyone have any idea how to fix this? Would be greatly appreciated. Thank you so much!

P.S. I might jus be missing something so any guidance is more than welcome. :slight_smile:

1 Like

Can you confirm that you have followed the error instructions i.e, 1.) verify that the ‘Literature note folder’ pathway exists, or 2) verify that the Citation plugin ‘Literature note folder’ points to an existing folder?

Hi @Otolith! Thanks for responding. I ended up watching a few YouTube videos on the Citations function and it turns out I just had to play around with the way “Literature note/content title templates” were set up. But I managed to sort this out.

I’m still confused as to why every time I reference a source, a new note is automatically created?

It shouldn’t be. But there are 2 commands that may get confused: 1) insert citation; 2) insert literature note link. A new lit note is created if you click on the link inserted in the second case.

So, you should check how your hotkeys are set up. For me, ctr+shift+E is the literature note command (NOT the citation command), so if it’s set up the same way for you too, then that’s why.

@atiz thanks for the feedback! I left the settings to be default.

Ctrl+Shift+E inserts a literature note link whereas Ctrl+Shift+O just opens a literature note. No shortcuts for the markdown citation. The markdown citation function. It just inserts the citation the way I set it up, but doesn’t link to anything really. Basically, it works as it should.

I want to be able to insert a literature note link, but even when I just insert it, without clicking on it, a new note is automatically created. Seems a bit redundant to me?

Oh I see – I’ve never noticed that! I guess the behavior makes sense, since otherwise you’d have a link to a non-existent note, which is kind of pointless. (But I can see that there may be circumstances in which that’s exactly what you want.)
To circumvent this, and the probable reason I hadn’t even noticed, is that I often insert a link to a literature note by really inserting a citation. But this is possible due to my specific setup. I name my literature notes @citekey, so if I type [ insert citation: citekey ], then what I end up with is [[@citekey]], which is exactly a link to an (either existing or non-existing) lit note. For me this is just often easier, since I only have to remember the 1 hotkey that I set up for the citations…

@atiz I make a note with that reference first (it has it’s own template system…), so when the Citations plug-in creates its own note, that’s just completely redundant.

It seems like your process would work for me. Would you have some time to explain how you set that up?

I use PhraseExpress as a text expander, and I can see how that could be incorporated. I use Zotero regularly, but from what I know, you can only insert a citation from there in Word (if you have the add-on) or by manually going in, clicking on the source and generating a note/bibliography item).

For the time being, I’m opting to use the “Insert markdown citation” option, which I’ve set up to be {{authorString}}, {{title}}, {{year}}: p.
So that way, I have a reference, but I have to manually navigate to the note.

I still, however, need to understand in what context the use of a Pandoc-style markdown citation would be useful i.e. using a [@{{citekey}}]. It seems like you’re using some variation of that?

Well, I don’t use Zotero or Word so my workflow may be a bit different (and probably somewhat idiosyncratic). I manage my references in BibDesk, which creates and maintains a bib file. But as far as I know, the very same can be achieved by a Zotero library with betterbibdesk.

I do use the Pandoc-style markdown citations (simply [@citekey]) because I write my final drafts in latex. When I have a first draft ready that I wrote in Obsidian, then I export it to latex via pandoc. This way, all my Pandoc-style markdown citations end up as properly formatted latex citations, which then I can compile with my latex compiler. (Or, if I have to send the piece to some colleague who doesn’t use latex, I can export it to Word, etc., with the same result.)

So my setup may require this specific workflow. But I just set up the citations plugin to generate literature notes with the file name of @citekey; this way, first of all, it is easy to tell if something is a literature note, and second, it allows me to enter lit note links as if they were citations, with an extra pair of [ ] added.

For your problem, I’m not sure I understand. If you have a note about a reference already, then could you just set up the Citations literature note file name in such a way that it would take you directly to the already existing note? In that case, it would not create a new one. The doability of this may depend on the naming scheme for your literature notes that are not created with the plugin.

If you change the title of a literature note, it is not taken into account by the Citation plugin (e.g. : if you open a literature note whose name has been changed, it will open a new note with title from the template, and not the already existing one).

Has someone found a workaround ?

Link to Github issue.

I think this is expected behavior; one should be consistent with how one names the lit notes. If you rename one, then since the plugin is set up with a template, I’d expect for another one to be created that do actually follow the template. You can of course always change the template.

Thanks. Problem is I use a special character at the beginning of title, depending on reference type. I think this is currently not handled by this plugin.

1 Like

@atiz Ah, I see now. So the Pandoc style citations work seamlessly with Latex! I’ve never used Latex before because nobody in my field does and (although I’ve heard great things about it) I’m afraid it would cause me a lot more hassle than necessary. Plus, I consider myself an advanced Word user. I’d discussed this with a friend who’s in STEM (I’m in the Humanities), he was surprised to see how far Word has come since he’d last used it - I’d explained how I do things in Word that he does in Latex.

But I’m getting off topic.

Using the citekey is practical because you can then at least see that something’s a reference in a glance. The way I’ve tried it, it just adds in the reference as simple text so it isn’t as clearly visible. I’ll give the citekey a chance.

I’ll be using the notes for only myself anyway so as long as I know what it’s referencing, it’s fine. :slight_smile:

Thanks for the feedback and taking the time to type all that out!

1 Like

Of course :). Yeah, our field is kind of humanities but with a bunch of tech nerds, so some but probably a minority of people use latex. (I’m in philosophy.) I just procrastinated a lot in grad school so I learned it then and now am used to it and don’t like messing with Word as much. But at least for me it’s not really a question of quality than just what I’m used to. (Except for bibliography management, which I think is really top-notch in BibDesk.)

Good luck! I also think that there have been some requests to preview pandoc-style citations directly in Obsidian, which may also help if it ever comes to be. See here.