diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-12-31 01:12:59 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-12-31 01:12:59 +0000 |
commit | 1f580fb70189f91894ec757dd00cd4286d0da8a6 (patch) | |
tree | 04f6a64233bca673b1e749599e14ad4ab9a60acf /src/Text/Pandoc/Writers/LaTeX.hs | |
parent | 3ec8772daff7d76097d7435c4e8da1df5ee4cc6a (diff) | |
download | pandoc-1f580fb70189f91894ec757dd00cd4286d0da8a6.tar.gz |
Restored writerIncludeBefore, writerIncludeAfter.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1700 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Writers/LaTeX.hs')
-rw-r--r-- | src/Text/Pandoc/Writers/LaTeX.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index f119598a6..6782cc14e 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -52,7 +52,14 @@ writeLaTeX options document = pandocToLaTeX :: WriterOptions -> Pandoc -> State WriterState String pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do - main <- liftM render $ blockListToLaTeX blocks + body <- blockListToLaTeX blocks + let before = if null (writerIncludeBefore options) + then empty + else text $ writerIncludeBefore options + let after = if null (writerIncludeAfter options) + then empty + else text $ writerIncludeAfter options + let main = render $ before $$ body $$ after titletext <- liftM render $ inlineListToLaTeX title authorsText <- mapM (liftM render . inlineListToLaTeX) authors dateText <- liftM render $ inlineListToLaTeX date @@ -62,7 +69,9 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do , ("title", titletext) , ("authors", intercalate "\\\\" authorsText) , ("date", dateText) ] - return $ renderTemplate context $ writerTemplate options + return $ if writerStandalone options + then renderTemplate context $ writerTemplate options + else main -- escape things as needed for LaTeX |