@@ -130,6 +130,7 @@ data Opt = Opt
130130 , optCslFile :: FilePath
131131 , optAbbrevsFile :: Maybe FilePath
132132 , optListings :: Bool -- ^ Use listings package for code blocks
133+ , optLaTeXProgram :: String -- ^ Program to use for latex -> pdf
133134 }
134135
135136-- | Defaults for command-line options.
@@ -178,6 +179,7 @@ defaultOpts = Opt
178179 , optCslFile = ""
179180 , optAbbrevsFile = Nothing
180181 , optListings = False
182+ , optLaTeXProgram = "pdflatex"
181183 }
182184
183185-- | A list of functions, each transforming the options data structure
@@ -783,6 +785,7 @@ main = do
783785 , optAbbrevsFile = cslabbrevs
784786 , optCiteMethod = citeMethod
785787 , optListings = listings
788+ , optLaTeXProgram = latexProgram
786789 } = opts
787790
788791 when dumpArgs $
@@ -965,8 +968,6 @@ main = do
965968 processBiblio cslfile' cslabbrevs refs doc1
966969 else return doc1
967970
968− let latexProgram = "pdflatex"
969−
970971 case lookup writerName' writers of
971972 Nothing | writerName' == "epub" ->
972973 writeEPUB epubStylesheet writerOptions doc2 >>= writeBinary
@@ -981,7 +982,7 @@ main = do
981982 Nothing -> err 41 $
982983 latexProgram ++ " not found" -- TODO improve
983984 Just pgm -> do
984− res <- tex2pdf latexProgram $ writeLaTeX writerOptions doc2
985+ res <- tex2pdf pgm $ writeLaTeX writerOptions doc2
985986 case res of
986987 Right pdf -> writeBinary pdf
987988 Left err' -> err 43 $ toString err'