Merge branch 'master' of https://github.com/AndreasLoow/pandoc into AndreasLoow-master

This commit is contained in:
John MacFarlane 2015-12-19 00:07:28 -08:00
commit 4c103f67f9
2 changed files with 13 additions and 7 deletions

13
README
View file

@ -184,10 +184,10 @@ document contains images), [`hyperref`], [`ulem`],
[`mathspec`], [`polyglossia`] (with `lang`), [`xecjk`], and
[`bidi`] (with the `dir` variable set). The [`upquote`] and
[`microtype`] packages are used if available, and [`csquotes`] will
be used for [smart punctuation] if added to the template. The
[`natbib`], [`biblatex`], [`bibtex`], and [`biber`] packages can
optionally be used for [citation rendering]. These are included with
all recent versions of [TeX Live].
be used for [smart punctuation] if added to the template or included in
any header file. The [`natbib`], [`biblatex`], [`bibtex`], and [`biber`]
packages can optionally be used for [citation rendering]. These are
included with all recent versions of [TeX Live].
Alternatively, pandoc can use ConTeXt to create a PDF.
To do this, specify an output file with a `.pdf` extension,
@ -2473,8 +2473,9 @@ correct output, converting straight quotes to curly quotes, `---` to
em-dashes, `--` to en-dashes, and `...` to ellipses. Nonbreaking spaces
are inserted after certain abbreviations, such as "Mr."
Note: if your LaTeX template calls for the [`csquotes`] package, pandoc will
detect this automatically and use `\enquote{...}` for quoted text.
Note: if your LaTeX template or any included header file call for the
[`csquotes`] package, pandoc will detect this automatically and use
`\enquote{...}` for quoted text.
Inline formatting
-----------------

View file

@ -130,7 +130,12 @@ pandocToLaTeX options (Pandoc meta blocks) = do
| otherwise -> return ()
-- check for \usepackage...{csquotes}; if present, we'll use
-- \enquote{...} for smart quotes:
when ("{csquotes}" `isInfixOf` template) $
let headerIncludesField :: FromJSON a => Maybe a
headerIncludesField = getField "header-includes" metadata
let headerIncludes = fromMaybe [] $ mplus
(fmap return headerIncludesField)
headerIncludesField
when (any (isInfixOf "{csquotes}") (template : headerIncludes)) $
modify $ \s -> s{stCsquotes = True}
let (blocks'', lastHeader) = if writerCiteMethod options == Citeproc then
(blocks', [])