git.iko.soy/typeable/pandoc
on master help sign in
makePDF: For pdflatex, use a temp dir in the working directory.

Otherwise we can have problems with things like epstopdf.pl, which pdflatex runs to convert eps files and which won't run on a file above the working directory in restricted mode.

commitcd51983afe08697d627ecb091d42e40d897470b9 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 21 Apr 2018, 12:27 (8 years ago) parentec30d56
1 file changed+5−3
src/Text/Pandoc/PDF.hs+5−3
src/Text/Pandoc/PDF.hs+5−3
@@ -130,9 +130,11 @@ makePDF "pdfroff" pdfargs writer opts doc = do
130130 verbosity <- getVerbosity
131131 liftIO $ ms2pdf verbosity args source
132132makePDF program pdfargs writer opts doc = do
133− let withTemp = if takeBaseName program == "context"
134− then withTempDirectory "."
135− else withTempDir
133+ -- With context and latex, we create a temp directory within
134+ -- the working directory, since pdflatex sometimes tries to
135+ -- use tools like epstopdf.pl, which are restricted if run
136+ -- on files outside the working directory.
137+ let withTemp = withTempDirectory "."
136138 commonState <- getCommonState
137139 verbosity <- getVerbosity
138140 liftIO $ withTemp "tex2pdf." $ \tmpdir -> do