aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.hs5
-rw-r--r--src/Text/Pandoc/PDF.hs5
2 files changed, 6 insertions, 4 deletions
diff --git a/pandoc.hs b/pandoc.hs
index 709b5a777..4a4e53bdd 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -1172,7 +1172,10 @@ main = do
res <- makePDF latexEngine f writerOptions doc2
case res of
Right pdf -> writeBinary pdf
- Left err' -> err 43 $ UTF8.toStringLazy err'
+ Left err' -> do
+ B.hPutStr stderr $ err'
+ B.hPut stderr $ B.pack [10]
+ err 43 "Error producing PDF from TeX source"
| otherwise -> selfcontain (f writerOptions doc2 ++
['\n' | not standalone'])
>>= writerFn outputFile . handleEntities
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index a5f1597bd..608cad2e9 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -116,7 +116,6 @@ tex2pdf' tmpDir program source = do
then 3 -- to get page numbers
else 2 -- 1 run won't give you PDF bookmarks
(exit, log', mbPdf) <- runTeXProgram program numruns tmpDir source
- let msg = "Error producing PDF from TeX source.\n"
case (exit, mbPdf) of
(ExitFailure _, _) -> do
let logmsg = extractMsg log'
@@ -125,8 +124,8 @@ tex2pdf' tmpDir program source = do
x | "! Package inputenc Error" `BC.isPrefixOf` x ->
"\nTry running pandoc with --latex-engine=xelatex."
_ -> ""
- return $ Left $ msg <> logmsg <> extramsg
- (ExitSuccess, Nothing) -> return $ Left msg
+ return $ Left $ logmsg <> extramsg
+ (ExitSuccess, Nothing) -> return $ Left ""
(ExitSuccess, Just pdf) -> return $ Right pdf
(<>) :: ByteString -> ByteString -> ByteString