git.iko.soy/typeable/pandoc
on master help sign in
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

commite58a55eb41b3f8e9c3a2a2a91ca12b8ec24a15fd authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 8 Jul 2007, 03:48 (19 years ago) parent608b22e
2 files changed+12−6
src/Text/Pandoc/Writers/LaTeX.hs+11−6 tests/writer.latex+1
src/Text/Pandoc/Writers/LaTeX.hs+11−6
@@ -40,12 +40,17 @@ writeLaTeX :: WriterOptions -> Pandoc -> String
4040writeLaTeX options (Pandoc meta blocks) =
4141 let body = (writerIncludeBefore options) ++
4242 (concatMap blockToLaTeX blocks) ++
43− (writerIncludeAfter options) in
44− let head = if writerStandalone options
43+ (writerIncludeAfter options)
44+ head = if writerStandalone options
4545 then latexHeader options meta
46− else "" in
47− let foot = if writerStandalone options then "\n\\end{document}\n" else "" in
48− head ++ body ++ foot
46+ else ""
47+ toc = if writerTableOfContents options
48+ then "\\tableofcontents\n\n"
49+ else ""
50+ foot = if writerStandalone options
51+ then "\n\\end{document}\n"
52+ else ""
53+ in head ++ toc ++ body ++ foot
4954
5055-- | Insert bibliographic information into LaTeX header.
5156latexHeader :: WriterOptions -- ^ Options, including LaTeX header
@@ -62,7 +67,7 @@ latexHeader options (Meta title authors date) =
6267 datetext = if date == ""
6368 then ""
6469 else "\\date{" ++ stringToLaTeX date ++ "}\n"
65− maketitle = if null title then "" else "\\maketitle\n"
70+ maketitle = if null title then "" else "\\maketitle\n\n"
6671 secnumline = if (writerNumberSections options)
6772 then ""
6873 else "\\setcounter{secnumdepth}{0}\n"
tests/writer.latex+1
@@ -18,6 +18,7 @@
1818\date{July 17, 2006}
1919\begin{document}
2020\maketitle
21+
2122This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.
2223
2324\begin{center}\rule{3in}{0.4pt}\end{center}