nbconvert-examples
nbconvert-examples copied to clipboard
citations example does not work in nbconvert 4.0
The citations are not generated in the output pdf.
This does not work for the example (seems there is an issue with the .bib file), but work elsewhere for me:
make sure you have installed:
texlive-latex-extra texlive-bibtex-extra
Open jupyter notebook:
%%bash
jupyter nbconvert LifecycleTools.ipynb --to latex --template citations
latex LifecycleTools.tex
bibtex LifecycleTools.aux
pdflatex LifecycleTools.tex
pdflatex LifecycleTools.tex
pdflatex LifecycleTools.tex
The example should definetly be updated since it is also referenced in the documentation of nbconvert: http://nbconvert.readthedocs.org/en/latest/latex_citations.html
I did a little digging and it looks like the working directory that bibtex is executed in is a temp folder that does not contain ipython.bib
(this file is in /nbconvert-examples/citations
, but doesn't make it to the temp folder).
Sorry, but I am nowhere near expert enough to try and code up a solution, but it should be in the form of either:
- make sure the
XXX.bib
file is copied over to the temp folder (probably the better way, but how easy is it to find the right.bib
file to copy?), or - leave
XXX.bib
wherever it is and point bibtex to it (strikes me as a cludge).
Here is my log (I added the cwd line to the debugger). Note that bibtex fails because it can't see ipython.bib
, and the cwd is /tmp/tmp8vqimrmo
.
...
[NbConvertApp] WARNING | bibtex had problems, most likely because there were no citations
[NbConvertApp] bibtex output: ['bibtex', 'notebook']
This is BibTeX, Version 0.99d (TeX Live 2016)
The top-level auxiliary file: notebook.aux
The style file: unsrt.bst
I couldn't open database file ipython.bib
---line 32 of file notebook.aux
: \bibdata{ipython
: }
I'm skipping whatever remains of this command
I found no database files---while reading file notebook.aux
Warning--I didn't find a database entry for "4th-paradigm"
Warning--I didn't find a database entry for "Hef10"
Warning--I didn't find a database entry for "Cou10"
Warning--I didn't find a database entry for "PER-GRA:2007"
Warning--I didn't find a database entry for "Perez2011"
Warning--I didn't find a database entry for "ganga09"
Warning--I didn't find a database entry for "SST"
(There were 2 error messages)
cwd: /tmp/tmp8vqimrmo
[NbConvertApp] PDF successfully created
[NbConvertApp] Writing 197458 bytes to LifecycleTools.pdf
@Siggenx Great! It works though I don't understand why.