aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/PDF.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/PDF.hs')
-rw-r--r--src/Text/Pandoc/PDF.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index defe70181..d547835b5 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -56,10 +56,11 @@ tex2pdf' :: FilePath -- ^ temp directory for output
-> IO (Either ByteString ByteString)
tex2pdf' tmpDir program source = do
(exit, log', mbPdf) <- runTeXProgram program 3 tmpDir source
+ let msg = "Error producing PDF from TeX source."
case (exit, mbPdf) of
- (ExitFailure _, _) -> return $ Left $ extractMsg log'
- (ExitSuccess, Nothing) -> return $ Left
- "tex2pdf: ExitSuccess but no PDF created!"
+ (ExitFailure _, _) -> return $ Left $
+ msg <> "\n" <> extractMsg log'
+ (ExitSuccess, Nothing) -> return $ Left msg
(ExitSuccess, Just pdf) -> return $ Right pdf
data TeXProgram = PDFLaTeX
@@ -70,6 +71,9 @@ data TeXProgram = PDFLaTeX
| PDFTeX
deriving (Show, Read)
+(<>) :: ByteString -> ByteString -> ByteString
+(<>) = B.append
+
-- parsing output
extractMsg :: ByteString -> ByteString