git.iko.soy/typeable/pandoc
on master help sign in
PDF via wkhtmltopdf: put user-specified options last.

Certain options (e.g. "cover") need to come after flags on the command line. Closes #6171.

commit43711ade22dfd90600a0b2bdfd04fd0936e4052b authorJohn MacFarlane <jgm@berkeley.edu> dateMon 2 Mar 2020, 15:26 (7 years ago) parent2c09b15
1 file changed+2−2
src/Text/Pandoc/PDF.hs+2−2
src/Text/Pandoc/PDF.hs+2−2
@@ -142,7 +142,7 @@ makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do
142142 (return . literal . stringify)
143143 meta
144144 let toArgs (f, mbd) = maybe [] (\d -> ["--" <> f, T.unpack d]) mbd
145− let args = pdfargs ++ mathArgs ++ concatMap toArgs
145+ let args = mathArgs ++ concatMap toArgs
146146 [("page-size", getField "papersize" meta')
147147 ,("title", getField "title" meta')
148148 ,("margin-bottom", Just $ fromMaybe "1.2in"
@@ -155,7 +155,7 @@ makeWithWkhtmltopdf program pdfargs writer opts doc@(Pandoc meta _) = do
155155 (getField "margin-left" meta'))
156156 ,("footer-html", getField "footer-html" meta')
157157 ,("header-html", getField "header-html" meta')
158− ]
158+ ] ++ pdfargs
159159 source <- writer opts doc
160160 verbosity <- getVerbosity
161161 liftIO $ html2pdf verbosity program args source