diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-08 03:48:07 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-08 03:48:07 +0000 |
commit | e58a55eb41b3f8e9c3a2a2a91ca12b8ec24a15fd (patch) | |
tree | 24f5b08924eb206abee90031b15746b5d4790a2a /src | |
parent | 608b22e9ddc93d7ef0443822dd2fefc48a24bbd6 (diff) | |
download | pandoc-e58a55eb41b3f8e9c3a2a2a91ca12b8ec24a15fd.tar.gz |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 30a277691..41c98c9f0 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -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" |