@@ -124,9 +124,15 @@ parseOptions options' defaults = do
124124latexEngines :: [String]
125125latexEngines = ["pdflatex", "lualatex", "xelatex"]
126126
127+defaultLatexEngine :: String
128+defaultLatexEngine = "pdflatex"
129+
127130htmlEngines :: [String]
128131htmlEngines = ["wkhtmltopdf", "weasyprint", "prince"]
129132
133+defaultHtmlEngine :: String
134+defaultHtmlEngine = "wkhtmltopdf"
135+
130136pdfEngines :: [String]
131137pdfEngines = latexEngines ++ htmlEngines ++ ["context", "pdfroff"]
132138
@@ -140,7 +146,7 @@ pdfWriterAndProg mWriter mEngine = do
140146 (Left err, _) -> panErr err
141147 (_, Left err) -> panErr err
142148 where
143− go Nothing Nothing = (Right "latex", Right $ head latexEngines)
149+ go Nothing Nothing = (Right "latex", Right defaultLatexEngine)
144150 go (Just writer) Nothing = (Right writer, engineForWriter writer)
145151 go Nothing (Just engine) = (writerForEngine engine, Right engine)
146152 go (Just writer) (Just engine) =
@@ -162,9 +168,9 @@ pdfWriterAndProg mWriter mEngine = do
162168
163169 engineForWriter "context" = Right "context"
164170 engineForWriter "ms" = Right "pdfroff"
165− engineForWriter "latex" = Right $ head latexEngines
171+ engineForWriter "latex" = Right defaultLatexEngine
166172 engineForWriter format
167− | format `elem` ["html", "html5"] = Right $ head htmlEngines
173+ | format `elem` ["html", "html5"] = Right defaultHtmlEngine
168174 | otherwise = Left $ "cannot produce pdf output with output format " ++ format
169175
170176