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