diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2011-07-22 13:17:41 -0700 | 
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2011-07-22 13:17:41 -0700 | 
| commit | fecbceb61025b5e9f5f2217aaf5d21ffdf3fde48 (patch) | |
| tree | 72a6ddaf66f07c457db4b43ed98f44e1603a871c | |
| parent | 18306c74fb40184560f7ac18f35bea4c48aa4cec (diff) | |
| download | pandoc-fecbceb61025b5e9f5f2217aaf5d21ffdf3fde48.tar.gz | |
Added `--luatex` option to markdown2pdf.
This uses lualatex to create the PDF.
| -rw-r--r-- | man/man1/markdown2pdf.1.md | 3 | ||||
| -rw-r--r-- | src/markdown2pdf.hs | 11 | 
2 files changed, 10 insertions, 4 deletions
| diff --git a/man/man1/markdown2pdf.1.md b/man/man1/markdown2pdf.1.md index d3d30c119..8b8da6880 100644 --- a/man/man1/markdown2pdf.1.md +++ b/man/man1/markdown2pdf.1.md @@ -109,6 +109,9 @@ packages are not included in your latex setup, they can be obtained from  \--xetex  :   Use xelatex instead of pdflatex to create the PDF. +\--luatex +:   Use lualatex instead of pdflatex to create the PDF. +  # SEE ALSO  `pandoc`(1), `pdflatex`(1) diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs index 9b855537d..10b97cbc1 100644 --- a/src/markdown2pdf.hs +++ b/src/markdown2pdf.hs @@ -194,7 +194,7 @@ main = bracket      let goodopts = ["-f","-r","-N", "-p","-R","-H","-B","-A", "-C","-o","-V"]      let goodoptslong = ["--from","--read","--strict",                     "--preserve-tabs","--tab-stop","--parse-raw", -                   "--toc","--table-of-contents", "--xetex", +                   "--toc","--table-of-contents", "--xetex", "--luatex",                     "--number-sections","--include-in-header",                     "--include-before-body","--include-after-body",                     "--custom-header","--output", @@ -206,20 +206,23 @@ main = bracket      -- note that a long option can come in this form: --opt=val      let isGoodopt x = x `elem` (goodopts ++ goodoptslong) ||                        any (\o -> (o ++ "=") `isPrefixOf` x) goodoptslong +    let markdown2pdfOpts = ["--xetex","--luatex"]      unless (all isGoodopt opts) $ do        (code, out, _err) <- readProcessWithExitCode "pandoc" ["--help"] ""        UTF8.putStrLn "markdown2pdf [OPTIONS] [FILES]\nOptions:"        UTF8.putStr $ unlines $                   filter (\l -> any (`isInfixOf` l) goodoptslong) (lines out) -                 ++ [replicate 24 ' ' ++ "--xetex"] +                 ++ map (replicate 24 ' ' ++) markdown2pdfOpts        exitWith code -    let args' = filter (/= "--xetex") args +    let args' = filter (`notElem` markdown2pdfOpts) args      -- check for executable files      let latexProgram = if "--xetex" `elem` opts                            then "xelatex" -                          else "pdflatex" +                          else if "--luatex" `elem` opts +                                  then "lualatex" +                                  else "pdflatex"      let execs = ["pandoc", latexProgram, "bibtex"]      paths <- mapM findExecutable execs      let miss = map snd $ filter (isNothing . fst) $ zip paths execs | 
