aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-01-21 00:50:21 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-01-21 00:50:21 -0800
commit58f9b3bc38df1e2f07e9317388988107858aa53c (patch)
tree2473bceae5667a87831ecafb62da728d5b10e02d
parent275a5af61bac60ad99387c186922715e18cb0713 (diff)
downloadpandoc-58f9b3bc38df1e2f07e9317388988107858aa53c.tar.gz
pandoc: Added optLaTeXProgram.
-rw-r--r--src/pandoc.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index f92a3a18f..b986c6528 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -130,6 +130,7 @@ data Opt = Opt
, optCslFile :: FilePath
, optAbbrevsFile :: Maybe FilePath
, optListings :: Bool -- ^ Use listings package for code blocks
+ , optLaTeXProgram :: String -- ^ Program to use for latex -> pdf
}
-- | Defaults for command-line options.
@@ -178,6 +179,7 @@ defaultOpts = Opt
, optCslFile = ""
, optAbbrevsFile = Nothing
, optListings = False
+ , optLaTeXProgram = "pdflatex"
}
-- | A list of functions, each transforming the options data structure
@@ -783,6 +785,7 @@ main = do
, optAbbrevsFile = cslabbrevs
, optCiteMethod = citeMethod
, optListings = listings
+ , optLaTeXProgram = latexProgram
} = opts
when dumpArgs $
@@ -965,8 +968,6 @@ main = do
processBiblio cslfile' cslabbrevs refs doc1
else return doc1
- let latexProgram = "pdflatex"
-
case lookup writerName' writers of
Nothing | writerName' == "epub" ->
writeEPUB epubStylesheet writerOptions doc2 >>= writeBinary
@@ -981,7 +982,7 @@ main = do
Nothing -> err 41 $
latexProgram ++ " not found" -- TODO improve
Just pgm -> do
- res <- tex2pdf latexProgram $ writeLaTeX writerOptions doc2
+ res <- tex2pdf pgm $ writeLaTeX writerOptions doc2
case res of
Right pdf -> writeBinary pdf
Left err' -> err 43 $ toString err'