@@ -40,12 +40,17 @@ writeLaTeX :: WriterOptions -> Pandoc -> String
40writeLaTeX options (Pandoc meta blocks) =
40writeLaTeX options (Pandoc meta blocks) =
41 let body = (writerIncludeBefore options) ++
41 let body = (writerIncludeBefore options) ++
42 (concatMap blockToLaTeX blocks) ++
42 (concatMap blockToLaTeX blocks) ++
43− (writerIncludeAfter options) in
43+ (writerIncludeAfter options)
44− let head = if writerStandalone options
44+ head = if writerStandalone options
45 then latexHeader options meta
45 then latexHeader options meta
46− else "" in
46+ else ""
47+ toc = if writerTableOfContents options
48+ then "\\tableofcontents\n\n"
47− let foot = if writerStandalone options then "\n\\end{document}\n" else "" in
50+ foot = if writerStandalone options
51+ then "\n\\end{document}\n"
48− head ++ body ++ foot
53+ in head ++ toc ++ body ++ foot
50-- | Insert bibliographic information into LaTeX header.
55-- | Insert bibliographic information into LaTeX header.
51latexHeader :: WriterOptions -- ^ Options, including LaTeX header
56latexHeader :: WriterOptions -- ^ Options, including LaTeX header
@@ -62,7 +67,7 @@ latexHeader options (Meta title authors date) =
62 datetext = if date == ""
67 datetext = if date == ""
64 else "\\date{" ++ stringToLaTeX date ++ "}\n"
69 else "\\date{" ++ stringToLaTeX date ++ "}\n"
65− maketitle = if null title then "" else "\\maketitle\n"
70+ maketitle = if null title then "" else "\\maketitle\n\n"
66 secnumline = if (writerNumberSections options)
71 secnumline = if (writerNumberSections options)
68 else "\\setcounter{secnumdepth}{0}\n"
73 else "\\setcounter{secnumdepth}{0}\n"