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 flag does not override config file #774

Open
t-makaro opened this issue Mar 4, 2018 · 1 comment
Open

template flag does not override config file #774

t-makaro opened this issue Mar 4, 2018 · 1 comment

Comments

@t-makaro
Copy link
Contributor

t-makaro commented Mar 4, 2018

To change the default template I added:

c.LatexExporter.template_file = 'mytemplate.tplx'

to my jupyter_nbconvert_config.py file.

So, running:

jupyter nbconvert --to pdf somenotebook.ipynb

will use mytemplate.tplx as expected.

Occasionally, I still need to use a different template, so I run:

jupyter nbconvert --to pdf somenotebook.ipynb --template myothertemplate.tplx

But that still compiles using mytemplate.tplx instead. If I remove the line from the config file, then the --template flag works as expected.

@takluyver
Copy link
Member

I think what's happening is that the --template option is equivalent to configuring TemplateExporter.template_file. LatexExporter subclasses TemplateExporter, so the more specific config field wins.

I don't see any general fix for that. We could probably hack a specific workaround for --template, but every such hack just makes configuration still more confusing.

@t-makaro t-makaro mentioned this issue Jun 10, 2019
4 tasks
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