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

Load configuration when setting up handlers #297

Closed
ryanlovett opened this issue Apr 21, 2016 · 2 comments
Closed

Load configuration when setting up handlers #297

ryanlovett opened this issue Apr 21, 2016 · 2 comments

Comments

@ryanlovett
Copy link

One can configure the nbconvert application via command-line or config file, e.g.
$ jupyter nbconvert --PDFExporter.latex_command='["xelatex", "{filename}"]' --to pdf has_unicode.ipynb

or

$ cat ~/.jupyter/jupyter_nbconvert_config.py                                               
c.PDFExporter.latex_command = [u"xelatex", u"{filename}"]
$ jupyter nbconvert --to pdf has_unicode.ipynb

however this does not affect the notebook handler (File > Download as > PDF via LaTeX (.pdf)).
From @minrk at https://gitter.im/jupyter/notebook?at=5718d4f2b129b59c56da3552:

the nbconvert config file isn't loaded because config loading is done at the "application" level, in this case "notebook".

We should load nbconvert config when setting up the nbconvert handlers, though.

@mpacer
Copy link
Member

mpacer commented Mar 30, 2017

I know that the notebooks server does not load jupyter_nbconvert_config.py if it is local, and I believe it will also defer to its use if it's lower in the config hierarchy. I'm going to close this, but if this is still an issue @ryanlovett I'm happy to reopen.

@mpacer mpacer closed this as completed Mar 30, 2017
@ryanlovett
Copy link
Author

Hi @mpacer, this is an issue for us again. In #947 we need to return an error if latex does so that the user doesn't believe the generated PDF is valid when it isn't. However this has exposed that bibtex's return code is effectively ignored. With the current behavior this never mattered, but it would if we checked the output. If we try to bypass bibtex by setting c.PDFExporter.bib_command = ['true'] in jupyter_nbconvert_config.py, it will work when nbconvert is run from the command-line but not when run from Jupyter File > Download as.

I think the real issue affecting us is the handling of the return codes, but enabling Jupyter to know about the nbconvert config would give us a workaround until it is addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants