New plugin: Citations (with Zotero)

I would also very much like to see the ability to insert single bracket pandoc formatted citations. The plugin looks very promising, but I’d like to be able to use it for inserting citations to eventually export with pandoc. At present inserting a citation crtl + shift + E inserts the citation as [[@citekey2020]] which produces a link to a file–which is cool. I’d like to see an option to also insert a pandoc formatted citation as [@citekey2020].

Personally, at present I keep notes in Zotero as I started using it many years ago. More recently, I used zotero-mdnotes to export and link annotations and notes into an obsidian vault–handy. This citation plugin looks like a nice way to write notes about texts right in obsidian, but there is no way to pull highlighted text from Zotero. zotero-mdnotes and this citation plugin both use citekey for file name. I wonder about the perils of overwriting. Perhaps altering file name on export could resolve this. Anyway, this plugin looks fabulous but I’d really like to see a means for single bracket pandoc citation insertion much like Zettlr.

4 Likes

To site a page number use the following: [@citekey2020, 5]. See also here and here for some additional variations possible.

1 Like

Hi all, sorry for the delay in this new release – I spent a little more time writing in Obsidian rather than for Obsidian recently.

But a new version 0.3.2 was just pushed! And it includes Pandoc-style citation support, which I hope a lot of people here will find useful. Full change list:

  • Add a new command for inserting Markdown / Pandoc citations, e.g. of the form [@citekey2000]. This command is called “Insert Markdown citation” and is not assigned a hotkey by default. Users can also define a secondary Markdown citation format and insert it by using the same command, but pressing Shift+Enter. (cf. #24)
  • Show an error when literature notes cannot be created. This helps fix lots of previously-invisible issues with non-existent literature note directories. (#13)
  • Minor bugfixes.

BibLaTeX support is definitely on the feature list now, thanks for the suggestion. This will help us make the plugin Zotero-independent, and also enable some new plugin features.

10 Likes

Hmm, seems like I’ve found a bug in Obsidian - in third-party plugins -> browse it shows plugin description from the latest release (or master branch) but it allows to install only the latest but one release (probably due to small amount of time passed since the latest release).

Here is what I see right now in the UI (notice the release number and the highlighted bullet-point):

But if we open the actual README.md file for 0.3.1 release 3rd bullet-point would be absent (because it was only added in 0.3.2):

3 Likes

@pashkin thanks for the report – and nope, that’s entirely my fault :slight_smile: Just pushed a fixed 0.3.2 release, should be available inside Obsidian within the next hours.

3 Likes

Wow, thanks a lot! The plugin is perfect for me now (.bib file format would be a great surplus). I can now use the secondary quote command to enter [Cf. @{{citekey}}, ], which I use quite often.

Edit: One small addition would be nice: If there was an option to also create literature notes when entering citekeys in one of the pandoc formats. This way one could keep track of all the literature cited by looking into the literature note folder.

Edit 2: Before there was an information in the settings panel about how many references have been loaded from the source file. This does not appear anymore. Was this removed deliberately?

Hello, I have created the “literature note” folder, created the path and successfully uploaded 333 sources. When I click ctrl + shift + E, I correctly see the list of sources. However, when I try to input a source on a note, the following error appears: “Unable to access literature note. Please check that the literature note folder exists, or update the Citations plugin settings”.

Does anybody else see this? What should I do? Thanks!

3 Likes

Great plugin. Everything works fine for me, except for one crucial variable: Zotero URL.
I pasted such content template:
reference: {{zoteroSelectURL}}
However, while I am creating new literature note, variable does not work and Obsidian shows that “reference: (Unknown template variable zoteroSelectURL)”

Hi @Thom, you should check the plugin setting “Literature note folder.” Does this reference a folder that doesn’t exist?

1 Like

@smirnov_dd Note the tiny typo – it should be {{zoteroSelectURI}} :wink:

1 Like

Hi @jgauthier, thanks for your reply. In fact, it didn’t. I have now tried to change its name to the actual “literature note” folder I have created, and also to paste the link to it, but I keep viewing the same error message…

Triple like! :partying_face: The ability to add citekeys directly is awesome super useful stuff. :+1:t4: Thank you very much.

I had to restart Obsidian to see the insert cite key option in the Hotkeys settings, but restarting the app brought it right up.

I set my hotkey to crtl+shit+C so its the same as quick copy in Zotero. :smiley:

1 Like

First off this is a killer plugin as is, and I’m super psyched as it now makes the kind of writing I find myself doing way more efficient in Obsidian. Previously, because of Zettlr’s citation functions, I was bouncing back and forth between Zettler and Obsidian.

I was working with the Citation plugin today and I’m curious about the sort order from searches. In Zettlr the search is by author first. Personally, this how I tend to conceive of and call up works–by their author. It’s generally my first search approach in Zotero too, though there are obviously many others. For pulling up citations when writing, author as a search term works well because the search terms can’t have spaces. Therefore, even if the author has a two or more word last name, one of them generally recalls the work near the top of the list.

The Obsidian Citations plugin looks to prioritize title and then author, though not in each case. Or, I’m not understanding the sort order. If possible, I think many writers would prefer listing works by the author. I also think it is cleaner to list the author and work on the same line so that everything is very compact showing more entries for the space. I find this allows faster scanning of the list of works. Having the work described on two lines, and with different fonts, is a little slower on the eye. That being said, showing the cite key is an interesting approach. Personally, using Zettlr I never found myself needing to see the cite keys as I think about the work by author then title or author and year with a check on the title to make sure its the one I want to reference.

Please understand that I’m not complaining–not by any stretch. I think the plugin is fantastic and it will be part of my daily work. I just wanted to offer some initial feedback from one very grateful user.


Citation search in Zettlr, the entries are listed by author and then year. The listings are also very compact and minimal so that more are shown.


Citation search using Obsidian Citations plugin. The return from the same search seems to list items by title, then author, and then by title again.

Note that the shift+Enter to add a key with out [] is much appreciated. It saves a bunch of backspacing. Very nice touch.

3 Likes

Your new feature to add the citation is a game changer for me! Thank you so much!
If now you could show recently used citations it would reduce even more friction

It’s going to be great to have access to Zotero references in Obsidian! I’m really excited to see this plugin continue to evolve.

I’m a little confused by the markdown citation style–I think that I’m missing something because I haven’t used pandoc before.

What I’d like to do with the plugin is insert a citation that is the author(s)'s names and a link to my Zotero reference item.

The final output that I’d like in preview is something like:

“Economists Ran Abramitzky and Leah Boustan (2017, 1313) find…”

I can get close with this in the citation style:

{{authorString}} ({{year}}, {{page}})

That generates (where within the parentheses is a Zotero link to the entry):

Ran Abramitzky, Leah Boustan (2017, 1311-1345)

Maybe that’s not possible yet? Or more likely, I’m missing something haha! I expect the answer to be I should spend some more time learning the details for how the pandoc citation works.

But here I run into another issue, the {{zoteroSelectURI}} created link only seems to work once. Then it stops working. What might cause that?

Is there a way to:

  • Set the markdown citation template to be a consistently working Zotero link to the reference item in Zotero?
  • Suppress the full page range in favor of a specific page number?
  • Have {{authorString}} generate something more like:

“Author1, Author2, and Author3, (year, page) find that using the Citations Obsidian plugin makes knowledge management 100% more effective for writers and knowledge workers.”?

I’ll report back with anything that I figure out!

3 Likes

I’m seeing this error as well - when the ‘literature note folder’ setting is accurately set for a folder or when it’s left blank for root placement of notes.

Insert literature note link
Uncaught TypeError: Cannot read property 'basename' of null at eval (eval at <anonymous> (app.js:1), <anonymous>:22297:62) at t.e.tryTrigger (app.js:1) at t.e.trigger (app.js:1) at t.trigger (app.js:1) at t.setActiveLeaf (app.js:1) at t.<anonymous> (app.js:1) at app.js:1 at Object.next (app.js:1) at app.js:1 at new Promise (<anonymous>)

Open literature note
Uncaught TypeError: Cannot read property 'basename' of null at eval (eval at <anonymous> (app.js:1), <anonymous>:22297:62) at t.e.tryTrigger (app.js:1) at t.e.trigger (app.js:1) at t.trigger (app.js:1) at t.setActiveLeaf (app.js:1) at t.<anonymous> (app.js:1) at app.js:1 at Object.next (app.js:1) at a (app.js:1)

@jgauthier I realized my mistake: I didn’t have Better BibTex installed on Zotero, and I downloaded CLS JSON instead of “Better CSL JSON”. Now I renamed the folder and it works!

1 Like

I appreciate you following up - I’ve fixed the config and your timely help now makes it a pretty awesome morning. Thanks both you and JG!

@Alicyclo did you have my same issue?

Hi all, version 0.3.4 of the plugin is out — now with BibTeX / BibLaTeX support! Find 0.3.4 in your local Obsidian installation, available within the next few hours.

Apologies for falling behind on support here — I’ll respond to some of the above issues shortly. Thanks everyone for trying out the plugin!

All changes:

  • Bib(La)TeX citation databases are now supported. This makes the plugin unofficially compatible with most reference managers. You can switch to the BibLaTeX format in the Citations plugin settings.
  • Modal dialogs now clearly display when the database is being loaded vs. when the database is ready.
  • Minor bugfixes and performance improvements.
4 Likes