cite2c
cite2c copied to clipboard
Work out some story for exporting citations to Latex
People will inevitably want to export notebooks to Latex, despite my misgivings about it. This will involve turning the citations into latex \cite{foo} commands (see the citation filter in nbconvert), possibly re-keying them, and creating a bibtex file with the corresponding citation data.
For creating the bibtex file: I've not yet found a tool that will convert CSL JSON to bibtex. Pandoc-citeproc does the other way. Bibutils goes between various citation format, but not CSL JSON, and it's GPLed, so I'd rather avoid it if possible. Is there something out there to do it? Is Bibtex simple enough that we can do it ourselves?
Zotero can import CSL JSON and export Bibtex, so it must have the necessary code, but I don't know how easy it would be to pull it out.
Failing anything else, references can be re-downloaded from the Zotero web API in Bibtex format, but then all the citations must be in Zotero, and in one user/group library. That's how citations are inserted, but at present, once they're in the document, it doesn't matter where they came from, and it would be nice to preserve that abstraction.
It would be slightly more preferable to use biblatex (more features). I use this to export biblatex: https://github.com/ZotPlus/zotero-better-bibtex.
Citations are handled within markdown by RMarkdown: http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html
Hi. Is there any news on this issue (exporting to PDF/ Latex)? Would be super-interested in this...
I got a good tip for converting to bibtex (presumably biblatex too) the other day: there are CSL files for bibtex, so we can convert CSL JSON to bibtex by rendering with a bibtex 'style'. I'm just on the way back from an electronic publishing conference, which has inspired me to get back to developing cite2c. My first priority will probably be supporting different citation styles in the live notebook, but after that nbconvert integration is the next thing.
Cool.
Thanks for the heads-up
On 10 Jun 2016, at 13:33, Thomas Kluyver [email protected] wrote:
I got a good tip for converting to bibtex (presumably biblatex too) the other day: there are CSL files for bibtex, so we can convert CSL JSON to bibtex by rendering with a bibtex 'style'. I'm just on the way back from an electronic publishing conference, which has inspired me to get back to developing cite2c. My first priority will probably be supporting different citation styles in the live notebook, but after that nbconvert integration is the next thing.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/takluyver/cite2c/issues/7#issuecomment-225159544, or mute the thread https://github.com/notifications/unsubscribe/ANQyV3r4c3OiSVak9f9v_2zhu6EpWvFuks5qKUudgaJpZM4C19Hc.
Hi again.
Just another quick question if you don’t mind? I’m currently implementing the proposed workflow from here:
http://blog.juliusschulz.de/blog/ultimate-ipython-notebook
This works, but I was wondering if there is a way to use my trusty bibtex citeckeys instead of these crazy Zotero keys?!? I’m not a Zotero user per se but rather importing my bibtex library to Zotero in order to pull it in via your cite2c script…
Thanks man, C
On 10 Jun 2016, at 13:34, Christian Werner [email protected] wrote:
Cool.
Thanks for the heads-up
On 10 Jun 2016, at 13:33, Thomas Kluyver <[email protected] mailto:[email protected]> wrote:
I got a good tip for converting to bibtex (presumably biblatex too) the other day: there are CSL files for bibtex, so we can convert CSL JSON to bibtex by rendering with a bibtex 'style'. I'm just on the way back from an electronic publishing conference, which has inspired me to get back to developing cite2c. My first priority will probably be supporting different citation styles in the live notebook, but after that nbconvert integration is the next thing.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/takluyver/cite2c/issues/7#issuecomment-225159544, or mute the thread https://github.com/notifications/unsubscribe/ANQyV3r4c3OiSVak9f9v_2zhu6EpWvFuks5qKUudgaJpZM4C19Hc.
Sorry, there isn't a way to do that. Zotero IDs provide consistent, unique identifiers, and since you shouldn't need to write them by hand, there isn't a strong pressure for them to be especially memorable.
Thanks for the link, though - it's cool to see that @jcfschulz has already worked out a way to export to Latex. I'll try to use that as a starting point.
Hi, we have a more worked out version of my blog post above already on github: https://github.com/schlaicha/jupyter-publication-scripts
The automatic install scripts are not perfect, but since I was switchting jobs recently, I didn't have time yet. Also the devel branch is I think more bug free than the master branch. Feel free to post any bugs, we will try our best to fix them.
Greetings, J
Thanks for the info :-) I'll try to work it into cite2c so that it's one thing to install for citations in notebooks.
Great. iirc the only file you need to include is https://github.com/schlaicha/jupyter-publication-scripts/blob/master/extensions/pre_cite2c.py. Not the added dependency on the unicode_tex module, which correctly masks the non-ascii characters, since bibtex doesn't work with uff-8.
Also I remember, there is still a bug considering the year. Not all zotero entries have this in the way I implemented, this has to be fixed at some stage.
If you still have an older version of jupyter-notebook, also keep this https://github.com/jupyter/nbconvert/issues/193 upstream bug in mind.
Cool that’s some development happening there…
Let me know if you need someone for testing stuff.
On 13 Jun 2016, at 13:59, jcfschulz [email protected] wrote:
Great. iirc the only file you need to include is https://github.com/schlaicha/jupyter-publication-scripts/blob/master/extensions/pre_cite2c.py https://github.com/schlaicha/jupyter-publication-scripts/blob/master/extensions/pre_cite2c.py. Not the added dependency on the unicode_tex module, which correctly masks the non-ascii characters, since bibtex doesn't work with uff-8.
Also I remember, there is still a bug considering the year. Not all zotero entries have this in the way I implemented, this has to be fixed at some stage.
If you still have an older version of jupyter-notebook, also keep this jupyter/nbconvert#193 https://github.com/jupyter/nbconvert/issues/193 upstream bug in mind.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/takluyver/cite2c/issues/7#issuecomment-225561096, or mute the thread https://github.com/notifications/unsubscribe/ANQyV8bzyM10mX2tkgvce0HUQrAI5UkAks5qLUYZgaJpZM4C19Hc.