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

template settings in pdf converter not found when used as library. #954

Closed
paultopia opened this issue Feb 7, 2019 · 3 comments · Fixed by #958
Closed

template settings in pdf converter not found when used as library. #954

paultopia opened this issue Feb 7, 2019 · 3 comments · Fixed by #958

Comments

@paultopia
Copy link
Contributor

The documentation for pdf on the command line suggests it supports the same template options as latex, which include a basic template; the example for converting to html as a library in the documentation suggests that in order to select a template, one sets the template_file property of an exporter to a string.

So I would have expected the following code to work:

exporter = nbconvert.PDFExporter()
exporter.template_file = 'basic'
nb = nbformat.read("foo.ipynb", 4)
pdf, resources = exporter.from_notebook_node(nb)
with open("test.pdf", "wb") as tp:
    tp.write(pdf)

but it actually throws jinja2.exceptions.TemplateNotFound: basic

this is under nbconvert version 5.4.0, in case this is a known bug.

@paultopia
Copy link
Contributor Author

Aaah, actually, this seems to be a documentation error---looking through the repo, there appears to be no basic latex template at all, so there probably shouldn't be one listed as an option in the docs.

@MSeal
Copy link
Contributor

MSeal commented Feb 16, 2019

Would you mind making a PR to correct this doc issue?

@paultopia
Copy link
Contributor Author

Sure, happy to do it.

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

Successfully merging a pull request may close this issue.

2 participants