Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set BIBINPUTS and BSTINPUTS environment variables when making PDF #676

Merged
merged 3 commits into from
Sep 16, 2017

Conversation

takluyver
Copy link
Member

@sobester had some difficulties converting a notebook to PDF using bibtex references. Converting to tex and then running latex manually worked. My guess is that bibtex couldn't find the .bib file because nbconvert doesn't copy it to the temporary directory from which it runs latex.

While looking through this code today, I noticed that we use an environment variable TEXINPUTS to tell Latex to look for related files in the directory where the original notebook is. A bit of searching reveals that bibtex uses two similar environment variables, BIBINPUTS (for bibliography files) and BSTINPUTS (for style files). If my guess is correct, adding the notebook directory to these should resolve the problem with using bibtex.

@takluyver takluyver added the format:LaTeX pertains to exporting to the LaTeX format label Sep 15, 2017
@takluyver
Copy link
Member Author

I couldn't find any good docs about these environment variables, but they're described in various posts, e.g. this SE answer.

@mpacer
Copy link
Member

mpacer commented Sep 16, 2017

This looks fine, but I'd still like a way to directly inform both LaTeXExporter and PDFExporter about where the bib file is directly (i.e., without using environment variables as a signalling mechanism).

@mpacer mpacer merged commit 8f8ac1a into jupyter:master Sep 16, 2017
@mpacer mpacer added this to the 5.4 milestone Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:LaTeX pertains to exporting to the LaTeX format
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants