diff options
Diffstat (limited to 'src/markdown2pdf.hs')
-rw-r--r-- | src/markdown2pdf.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs index 4866b4163..9b855537d 100644 --- a/src/markdown2pdf.hs +++ b/src/markdown2pdf.hs @@ -210,9 +210,12 @@ main = bracket (code, out, _err) <- readProcessWithExitCode "pandoc" ["--help"] "" UTF8.putStrLn "markdown2pdf [OPTIONS] [FILES]\nOptions:" UTF8.putStr $ unlines $ - filter (\l -> any (`isInfixOf` l) goodoptslong) $ lines out + filter (\l -> any (`isInfixOf` l) goodoptslong) (lines out) + ++ [replicate 24 ' ' ++ "--xetex"] exitWith code + let args' = filter (/= "--xetex") args + -- check for executable files let latexProgram = if "--xetex" `elem` opts then "xelatex" @@ -224,7 +227,7 @@ main = bracket -- parse arguments -- if no input given, use 'stdin' - pandocArgs <- parsePandocArgs args + pandocArgs <- parsePandocArgs args' (input, output) <- case pandocArgs of Nothing -> exit "Could not parse arguments" Just ([],out) -> do @@ -235,7 +238,7 @@ main = bracket -- no need because we'll pass all arguments to pandoc Just (_ ,out) -> return ([], out) -- run pandoc - pandocRes <- runPandoc (input ++ args) $ replaceDirectory output tmp + pandocRes <- runPandoc (input ++ args') $ replaceDirectory output tmp case pandocRes of Left err -> exit err Right texFile -> do |