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.
This commit is contained in:
John MacFarlane
2018-04-21 12:27:30 -07:00
parent ec30d56e19
commit cd51983afe
+5 -3
View File
@@ -130,9 +130,11 @@ makePDF "pdfroff" pdfargs writer opts doc = do
verbosity <- getVerbosity
liftIO $ ms2pdf verbosity args source
makePDF program pdfargs writer opts doc = do
let withTemp = if takeBaseName program == "context"
then withTempDirectory "."
else withTempDir
-- With context and latex, we create a temp directory within
-- the working directory, since pdflatex sometimes tries to
-- use tools like epstopdf.pl, which are restricted if run
-- on files outside the working directory.
let withTemp = withTempDirectory "."
commonState <- getCommonState
verbosity <- getVerbosity
liftIO $ withTemp "tex2pdf." $ \tmpdir -> do