aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-04-21 12:27:30 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-04-21 12:27:30 -0700
commitcd51983afe08697d627ecb091d42e40d897470b9 (patch)
treee1b54d982cd36772c671910800d4cefd9c519d33 /src
parentec30d56e1948166a979a33b1befade3cd37fbd82 (diff)
downloadpandoc-cd51983afe08697d627ecb091d42e40d897470b9.tar.gz
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.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/PDF.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index bb575d13f..fce463d34 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -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