PDF: Add suggestion to use --latex-engine=xelatex on encoding error.

This commit is contained in:
John MacFarlane
2013-08-11 16:16:24 -07:00
parent e279175ea5
commit 7b975c2bcc
+8 -2
View File
@@ -109,8 +109,14 @@ tex2pdf' tmpDir program source = do
(exit, log', mbPdf) <- runTeXProgram program numruns tmpDir source
let msg = "Error producing PDF from TeX source."
case (exit, mbPdf) of
(ExitFailure _, _) -> return $ Left $
msg <> "\n" <> extractMsg log'
(ExitFailure _, _) -> do
let logmsg = extractMsg log'
let extramsg =
case logmsg of
x | "! Package inputenc Error" `BC.isPrefixOf` x ->
"\nTry running pandoc with --latex-engine=xelatex."
_ -> ""
return $ Left $ msg <> "\n" <> extractMsg log' <> extramsg
(ExitSuccess, Nothing) -> return $ Left msg
(ExitSuccess, Just pdf) -> return $ Right pdf