From 4266eb097cfd0a886abe81a67a3409b93f23e094 2013-08-01 22:26:50 From: Min RK Date: 2013-08-01 22:26:50 Subject: [PATCH] Merge pull request #3865 from astrofrog/fix-nbconvert-pdflatex-spaces use `command` list instead of compiler string in PDFPostProcessor avoids issues with spaces --- diff --git a/IPython/nbconvert/post_processors/pdf.py b/IPython/nbconvert/post_processors/pdf.py index 679eeb5..db81310 100644 --- a/IPython/nbconvert/post_processors/pdf.py +++ b/IPython/nbconvert/post_processors/pdf.py @@ -16,7 +16,7 @@ Contains writer for writing nbconvert output to PDF. import subprocess import os -from IPython.utils.traitlets import Integer, Unicode, Bool +from IPython.utils.traitlets import Integer, List, Bool from .base import PostProcessorBase @@ -30,7 +30,7 @@ class PDFPostProcessor(PostProcessorBase): How many times pdflatex will be called. """) - compiler = Unicode(u'pdflatex {0}', config=True, help=""" + command = List(["pdflatex", "{filename}"], config=True, help=""" Shell command used to compile PDF.""") verbose = Bool(False, config=True, help=""" @@ -42,8 +42,8 @@ class PDFPostProcessor(PostProcessorBase): Consume and write Jinja output a PDF. See files.py for more... """ - command = self.compiler.format(input) - self.log.info("Building PDF: `%s`", command) + command = [c.format(filename=input) for c in self.command] + self.log.info("Building PDF: `%s`", ' '.join(command)) for index in range(self.iteration_count): if self.verbose: subprocess.Popen(command, shell=True)