summaryrefslogtreecommitdiff
path: root/src/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-05-11 22:58:49 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-05-11 23:00:46 -0700
commit5f889b93963dda851b3610dfd2ed74c17a3e4091 (patch)
treef48b191b5ff559225962bf7281e5c9a0c7a8bf1e /src/pandoc.hs
parent1aec24a169a37a01e446079625f79ea67796e28c (diff)
Added writerTeXLigatures to WriterOptions, `--no-tex-ligatures` option.
This is useful for those who want to use advanced OpenType features with xelatex/lualatex.
Diffstat (limited to 'src/pandoc.hs')
-rw-r--r--src/pandoc.hs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pandoc.hs b/src/pandoc.hs
index a8a70a1b4..a25e7d8d6 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -135,6 +135,7 @@ data Opt = Opt
, optSlideLevel :: Maybe Int -- ^ Header level that creates slides
, optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2
, optAscii :: Bool -- ^ Use ascii characters only in html
+ , optTeXLigatures :: Bool -- ^ Use TeX ligatures for quotes/dashes
}
-- | Defaults for command-line options.
@@ -187,6 +188,7 @@ defaultOpts = Opt
, optSlideLevel = Nothing
, optSetextHeaders = True
, optAscii = False
+ , optTeXLigatures = True
}
-- | A list of functions, each transforming the options data structure
@@ -438,6 +440,11 @@ options =
(\opt -> return opt { optNumberSections = True }))
"" -- "Number sections in LaTeX"
+ , Option "" ["no-tex-ligatures"]
+ (NoArg
+ (\opt -> return opt { optTeXLigatures = False }))
+ "" -- "Don't use tex ligatures for quotes, dashes"
+
, Option "" ["listings"]
(NoArg
(\opt -> return opt { optListings = True }))
@@ -804,6 +811,7 @@ main = do
, optSlideLevel = slideLevel
, optSetextHeaders = setextHeaders
, optAscii = ascii
+ , optTeXLigatures = texLigatures
} = opts
when dumpArgs $
@@ -918,7 +926,8 @@ main = do
lhsExtension sources,
stateStandalone = standalone',
stateCitations = map CSL.refId refs,
- stateSmart = smart || laTeXOutput || writerName' == "context",
+ stateSmart = smart || (texLigatures &&
+ (laTeXOutput || writerName' == "context")),
stateOldDashes = oldDashes,
stateColumns = columns,
stateStrict = strict,
@@ -961,7 +970,8 @@ main = do
writerSlideLevel = slideLevel,
writerHighlight = highlight,
writerHighlightStyle = highlightStyle,
- writerSetextHeaders = setextHeaders
+ writerSetextHeaders = setextHeaders,
+ writerTeXLigatures = texLigatures
}
when (writerName' `elem` nonTextFormats&& outputFile == "-") $