LaTeX writer:
+ Leave extra blank line after \maketitle + Insert \tableofcontents if --toc option was selected Test suite: + extra blank line after \maketitle in writer.latex git-svn-id: https://pandoc.googlecode.com/svn/trunk@649 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
608b22e9dd
commit
e58a55eb41
2 changed files with 12 additions and 6 deletions
|
@ -40,12 +40,17 @@ writeLaTeX :: WriterOptions -> Pandoc -> String
|
|||
writeLaTeX options (Pandoc meta blocks) =
|
||||
let body = (writerIncludeBefore options) ++
|
||||
(concatMap blockToLaTeX blocks) ++
|
||||
(writerIncludeAfter options) in
|
||||
let head = if writerStandalone options
|
||||
(writerIncludeAfter options)
|
||||
head = if writerStandalone options
|
||||
then latexHeader options meta
|
||||
else "" in
|
||||
let foot = if writerStandalone options then "\n\\end{document}\n" else "" in
|
||||
head ++ body ++ foot
|
||||
else ""
|
||||
toc = if writerTableOfContents options
|
||||
then "\\tableofcontents\n\n"
|
||||
else ""
|
||||
foot = if writerStandalone options
|
||||
then "\n\\end{document}\n"
|
||||
else ""
|
||||
in head ++ toc ++ body ++ foot
|
||||
|
||||
-- | Insert bibliographic information into LaTeX header.
|
||||
latexHeader :: WriterOptions -- ^ Options, including LaTeX header
|
||||
|
@ -62,7 +67,7 @@ latexHeader options (Meta title authors date) =
|
|||
datetext = if date == ""
|
||||
then ""
|
||||
else "\\date{" ++ stringToLaTeX date ++ "}\n"
|
||||
maketitle = if null title then "" else "\\maketitle\n"
|
||||
maketitle = if null title then "" else "\\maketitle\n\n"
|
||||
secnumline = if (writerNumberSections options)
|
||||
then ""
|
||||
else "\\setcounter{secnumdepth}{0}\n"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
\date{July 17, 2006}
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.
|
||||
|
||||
\begin{center}\rule{3in}{0.4pt}\end{center}
|
||||
|
|
Loading…
Add table
Reference in a new issue