jupyter / nbconvert

Jupyter Notebook Conversion
https://nbconvert.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.75k stars 568 forks source link

easy mainstream citation workflow across latex and html targets #628

Open danmackinlay opened 7 years ago

danmackinlay commented 7 years ago

Currently if you wish to write citations in a jupyter notebook you must choose between the HTML Way

      <cite data-cite="granger2013">(Granger, 2013)</cite>

which is not supported by any major citation management software I'm aware of,

and the LaTeX Way

    \cite{granger2013}

which looks rubbish in the HTML version, but will export ok, and which is available as a drag-and-drop output format from, for example, Zotero.

@chrisjsewell implemented a regex-based converter for his nbconvert addon, ipypublish.

Additionally @takluyver implementd cite2c provide a JS-based extension which constructs this markup automatically, but it requires public references and only works for Zotero, which much as i like it, is not the only citation manager.

I wonder if this is the kind of thing that nbconvert should be offering natively? Or some other way of making the process of citing, which is a major use case for these processes, a little bit easier?

The ipypublish workflow has its own difficulties of course, but it seems like a commonly reported pain paint - every time I present jupyter to my academic colleagues, for example, I have a conversation where they say "Wow! I could almost write my papers in jupyter! but how do i cite my references?" and I say "er, you laboriously type in cite keys from some bibtex file wrapped in non-obvious html markup", and the conversation ends rapidly.

Understanding this is a non-trivial design problem, I'm nonetheless curious is there are any developments or plans here, or if cite2c and ipypublish are the best way forward?

mgeier commented 5 years ago

I've just implemented citations using the data-cite attribute in nbsphinx: https://github.com/spatialaudio/nbsphinx/pull/255.

This works in HTML and LaTeX output, but the citation is displayed quite differently in the Notebook app and on nbviewer.

Ideally, there should be some kind of JavaScript-based BibTeX processor in the Notebook app (or rather in JupyterLab) which would be able to process a local BibTeX file. And of course a similar thing should be used on nbviewer.

I would also be interested in any new developments!