git.iko.soy/typeable/pandoc
on master help sign in
Use defaultLatexEngine instead of `head latexEngines`.
6509501John MacFarlane
src/Text/Pandoc/App.hs+9−3
@@ -124,9 +124,15 @@ parseOptions options' defaults = do
124latexEngines :: [String]
124latexEngines :: [String]
125latexEngines = ["pdflatex", "lualatex", "xelatex"]
125latexEngines = ["pdflatex", "lualatex", "xelatex"]
126
126
127+defaultLatexEngine :: String
128+defaultLatexEngine = "pdflatex"
129+
127htmlEngines :: [String]
130htmlEngines :: [String]
128htmlEngines = ["wkhtmltopdf", "weasyprint", "prince"]
131htmlEngines = ["wkhtmltopdf", "weasyprint", "prince"]
129
132
133+defaultHtmlEngine :: String
134+defaultHtmlEngine = "wkhtmltopdf"
135+
130pdfEngines :: [String]
136pdfEngines :: [String]
131pdfEngines = latexEngines ++ htmlEngines ++ ["context", "pdfroff"]
137pdfEngines = latexEngines ++ htmlEngines ++ ["context", "pdfroff"]
132
138
@@ -140,7 +146,7 @@ pdfWriterAndProg mWriter mEngine = do
140 (Left err, _) -> panErr err
146 (Left err, _) -> panErr err
141 (_, Left err) -> panErr err
147 (_, Left err) -> panErr err
142 where
148 where
143− go Nothing Nothing = (Right "latex", Right $ head latexEngines)
149+ go Nothing Nothing = (Right "latex", Right defaultLatexEngine)
144 go (Just writer) Nothing = (Right writer, engineForWriter writer)
150 go (Just writer) Nothing = (Right writer, engineForWriter writer)
145 go Nothing (Just engine) = (writerForEngine engine, Right engine)
151 go Nothing (Just engine) = (writerForEngine engine, Right engine)
146 go (Just writer) (Just engine) =
152 go (Just writer) (Just engine) =
@@ -162,9 +168,9 @@ pdfWriterAndProg mWriter mEngine = do
162
168
163 engineForWriter "context" = Right "context"
169 engineForWriter "context" = Right "context"
164 engineForWriter "ms" = Right "pdfroff"
170 engineForWriter "ms" = Right "pdfroff"
165− engineForWriter "latex" = Right $ head latexEngines
171+ engineForWriter "latex" = Right defaultLatexEngine
166 engineForWriter format
172 engineForWriter format
167− | format `elem` ["html", "html5"] = Right $ head htmlEngines
173+ | format `elem` ["html", "html5"] = Right defaultHtmlEngine
168 | otherwise = Left $ "cannot produce pdf output with output format " ++ format
174 | otherwise = Left $ "cannot produce pdf output with output format " ++ format
169
175
170
176