Deprecated --xetex option - it is no longer needed.

Deprecated `writerXeTeX` and the `--xetex` option.
The latex writer now produces a file that can be processed
by latex, pdflatex, lualatex, or xelatex, so this option isn't
needed.

The option is still neded in markdown2pdf, however, which
has been modified to take some options that aren't in pandoc.
This commit is contained in:
John MacFarlane 2011-07-22 13:11:46 -07:00
parent 0590d7e4c2
commit 18306c74fb
6 changed files with 16 additions and 14 deletions

3
README
View file

@ -265,9 +265,6 @@ Options
show in the output, so that the slide show will work even when no
internet connection is available.
`--xetex`
: Create LaTeX outut suitable for processing by XeTeX.
`--chapters`
: Treat top-level headers as chapters in LaTeX, ConTeXt, and DocBook
output.

View file

@ -42,9 +42,6 @@ packages are not included in your latex setup, they can be obtained from
\--strict
: Use strict markdown syntax, with no extensions or variants.
\--xetex
: Use xelatex instead of pdflatex to create the PDF.
-N, \--number-sections
: Number section headings in LaTeX output. (Default is not to number them.)
@ -109,6 +106,9 @@ packages are not included in your latex setup, they can be obtained from
or `s5` directory placed in this directory will override pandoc's
normal defaults.
\--xetex
: Use xelatex instead of pdflatex to create the PDF.
# SEE ALSO
`pandoc`(1), `pdflatex`(1)

View file

@ -493,6 +493,7 @@ data WriterOptions = WriterOptions
, writerAscii :: Bool -- ^ Avoid non-ascii characters
} deriving Show
{-# DEPRECATED writerXeTeX "writerXeTeX no longer does anything" #-}
-- | Default writer options.
defaultWriterOptions :: WriterOptions
defaultWriterOptions =

View file

@ -111,7 +111,6 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
, ("title", titletext)
, ("date", dateText) ] ++
[ ("author", a) | a <- authorsText ] ++
[ ("xetex", "yes") | writerXeTeX options ] ++
[ ("verbatim-in-note", "yes") | stVerbInNote st ] ++
[ ("fancy-enums", "yes") | stEnumerate st ] ++
[ ("tables", "yes") | stTable st ] ++

View file

@ -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

View file

@ -309,7 +309,10 @@ options =
, Option "" ["xetex"]
(NoArg
(\opt -> return opt { optXeTeX = True }))
(\opt -> do
UTF8.hPutStrLn stderr $ "pandoc: --xetex is deprecated. "
++ "It is no longer needed for use with XeTeX."
return opt { optXeTeX = True }))
"" -- "Format latex for processing by XeTeX"
, Option "" ["chapters"]
@ -675,7 +678,6 @@ main = do
, optSectionDivs = sectionDivs
, optIncremental = incremental
, optOffline = offline
, optXeTeX = xetex
, optSmart = smart
, optHtml5 = html5
, optChapters = chapters
@ -786,7 +788,8 @@ main = do
stateIndentedCodeClasses = codeBlockClasses,
stateApplyMacros = writerName' `notElem` ["latex", "latex+lhs"] }
let writerOptions = WriterOptions { writerStandalone = standalone',
let writerOptions = defaultWriterOptions
{ writerStandalone = standalone',
writerTemplate = if null template
then defaultTemplate
else template,
@ -798,7 +801,6 @@ main = do
writerHTMLMathMethod = mathMethod,
writerSlideVariant = slideVariant,
writerIncremental = incremental,
writerXeTeX = xetex,
writerCiteMethod = citeMethod,
writerBiblioFiles = reffiles,
writerIgnoreNotes = False,