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

Fix pdf exporter inheriting the wrong file extension #1000

Merged
merged 3 commits into from
Apr 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion nbconvert/exporters/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import sys

from ipython_genutils.py3compat import which, cast_bytes_py2, getcwd
from traitlets import Integer, List, Bool, Instance, Unicode
from traitlets import Integer, List, Bool, Instance, Unicode, default
from testpath.tempdir import TemporaryWorkingDirectory
from .latex import LatexExporter

Expand Down Expand Up @@ -69,6 +69,10 @@ class PDFExporter(LatexExporter):

_captured_output = List()

@default('file_extension')
def _file_extension_default(self):
return '.pdf'

def run_command(self, command_list, filename, count, log_function):
"""Run command_list count times.

Expand Down Expand Up @@ -168,6 +172,7 @@ def from_notebook_node(self, nb, resources=None, **kw):
self._captured_outputs = []
with TemporaryWorkingDirectory():
notebook_name = 'notebook'
resources['output_extension'] = '.tex'
tex_file = self.writer.write(latex, resources, notebook_name=notebook_name)
self.log.info("Building PDF")
rc = self.run_latex(tex_file)
Expand Down