aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs14
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs6
2 files changed, 10 insertions, 10 deletions
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 55105f786..776f8c6dd 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -57,6 +57,13 @@ writeConTeXt options document =
pandocToConTeXt :: WriterOptions -> Pandoc -> State WriterState String
pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do
+ titletext <- if null title
+ then return ""
+ else liftM render $ inlineListToConTeXt title
+ authorstext <- mapM (liftM render . inlineListToConTeXt) authors
+ datetext <- if null date
+ then return ""
+ else liftM render $ inlineListToConTeXt date
body <- blockListToConTeXt blocks
let before = if null (writerIncludeBefore options)
then empty
@@ -65,13 +72,6 @@ pandocToConTeXt options (Pandoc (Meta title authors date) blocks) = do
then empty
else text $ writerIncludeAfter options
let main = render $ before $$ body $$ after
- titletext <- if null title
- then return ""
- else liftM render $ inlineListToConTeXt title
- authorstext <- mapM (liftM render . inlineListToConTeXt) authors
- datetext <- if null date
- then return ""
- else liftM render $ inlineListToConTeXt date
let context = writerVariables options ++
[ ("toc", if writerTableOfContents options then "yes" else "")
, ("body", main)
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 412d774e9..2da632798 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -52,6 +52,9 @@ writeLaTeX options document =
pandocToLaTeX :: WriterOptions -> Pandoc -> State WriterState String
pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
+ titletext <- liftM render $ inlineListToLaTeX title
+ authorsText <- mapM (liftM render . inlineListToLaTeX) authors
+ dateText <- liftM render $ inlineListToLaTeX date
body <- blockListToLaTeX blocks
let before = if null (writerIncludeBefore options)
then empty
@@ -60,9 +63,6 @@ pandocToLaTeX options (Pandoc (Meta title authors date) blocks) = do
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
let context = writerVariables options ++
[ ("toc", if writerTableOfContents options then "yes" else "")
, ("body", main)