What is the easiest way to use citation in Jupyter notebook. I would like to be able to add references to a bib file then insert those references in my Jupyter notebook. Many Thanks for your help
Thomas Kluyver has a nice Notebook extension for enabling citations in Jupyter Notebook. It connects to a Zotero library. I think you’d have to link your bibfile to Zotero.
Thanks for this! I am not able to run this code. I am using Anaconda to run Jupyter notebook:
python3 -m pip install cite2c
python3 -m cite2c.install
(Start/Restart the Notebook server)
I see that cite2c is still not supported in Jupyterlab cite2c in jupyterlab · Issue #37 · takluyver/cite2c · GitHub. Do you know when it would become available?
Hi,
From what I see, apparently the cite2c plugin has not been updated since at least 2 years.
Is there any work currently done on supporting citation / bibliography in notebooks with the JupyterLab (and JupyterHub) interface?
That would be very useful for use in academia, particularly education.
Many thanks,
CĂ©cile
@krassowski has been doing some work in this space for JupyterLab, and might be able to comment. There was something demoed a few weeks ago backed by a specific citation SaaS, but I don’t remember the details!
Yes, there is a work-in-progress GitHub - krassowski/jupyterlab-citation-manager: Citation Manager for JupyterLab using Zotero Web API</tit. The latest version does not ship with citation styles included, I am still figuring out how to distribute them without having everyone install 10MB of citation styles. Any feedback greatly appreciated!
If you’re already in LaTeX-town, 10mb is a drop in the bucket!
But seriously: I’ve wrestled with this vs 30MB of drawio
as well: the interactive discovery value of having lots of x
(where x
is citation styles, diagram templates, or shapes) already around, with rich, searchable metadata, probably exceeds the inconvenience. Package managers already have the best caching/distribution a user is likely to get, and far more robust than home-rolled solutions.
Another lesson learned from drawio
: once dealing with non-trivial amounts of XML… installing lxml
isn’t as hard as it used to be, and will be a lot more performant than stdlib’s…
Finally, those submoduled CSL are licensed CC-BY-SA-3.0 (or something) and might not be compatible with your “main” license (or its dependencies) anyway.
A potential approach is a multi-package setup:
- jupyterlab-citations # a metapackage that depends on...
- jupyterlab-citation-manager # reads/indexes $PREFIX/share/jupyter/csl, lxml in extras_require
- jupyterlab-citation-data # fills in $PREFIX/share/jupyter/csl, requires lxml
The “basic” instructions could then be just install jupyterlab-citations
while the “advanced” one (e.g. for a course where it’s known what format is preferred/required) would install jupyterlab-citation-manager and put your CSL file in …
@krassowski thank you for your amazing job at implementing these amazing extensions - they will have to be implemented in Jupyter by default. I am sure you already know about this, but you might have a look at the R equivalent of what you are doing, here: GitHub - paleolimbot/rbbt: R Interface to the Better BiBTex Zotero Connector. They exploit Zotero’s plugin Better BibTex