New plugin: Citations (with Zotero)

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.

@atiz I’ll definitely have a look at that page now. Thanks so much!

As for bibliography management, the Zotero-Word system works seamlessly for me, personally. Though loading the references can get a big slower once your document reaches 1000 references haha.

1 Like

Thanks, I use a consistent naming convention that can’t be set up in the template (title begins with a special character depending on the reference type). Perheaps I should switch to a simpler naming convention as a temporary workaround.

1 Like

Are there any plans to make this work on mobile ?
Thanks !

2 Likes

Thank you very much this is very helpful! Is there a way to set up multiple templates depending on the type of content in Zotero? For example a template for books and one for journal articles?

Hello there! I would like to know if there is any possibility to articulate an “if … else …” statement in the template field of the plugins options.

In my case I have the following problem: For example I have the following item in my Zotero database:

@incollection{Armstrong2007,
  title = {The {{Fiction}} of {{Bourgeois Morality}} and the {{Paradox}} of {{Individualism}}},
  shorttitle = {Bourgeois {{Morality}}},
  booktitle = {The {{Novel}}: {{Forms}} and {{Themes}}},
  author = {Armstrong, Nancy},
  editor = {Moretti, Franco},
  date = {2007},
  volume = {2},
  pages = {349--388},
  publisher = {{Princeton University Press}},
}

I want to set up the literature note title template that it shows the following:

T - Armstrong2007 - Bourgeois Morality

Until here it works fine with:

T - {{citekey}} - {{entry.titleShort}}

My problem now is that not every item has a short title. Is it possible to write an expression that the template uses the short title if provided and else just the normal title?

Thanks in advance and all the best!

2 Likes

Cannot figure out how to add a return newline character to a “markdown primary citation template”

Questions:

  1. Can this tiny textbox be a reference to a template file instead ( or just make this box bigger like the one above it )
  2. How can we put a NL, [return] character, line-break into a template in that tiny box?

I have tried many ways to have this one template have multiple lines, please help.
Thanks for the cool plugin!

Hi there - this is awesome - thanks!

I’m new to Obsidian, and Zotero, and so maybe I’m missing something trivial… I can pull in citations with no problem, including the abstract. But when I try to bring in annotations, using {{note}} that field is empty. Should it work and, if so, any ideas? I can see that my annotations are in the Bib file - do I need to save them as a note in Zotero, rather than as an attachment (I haven’t yet figured out how to do that).