diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-12-04 04:14:16 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-12-04 04:14:16 +0000 |
commit | 13b1b87efcebaa6c6a41ad95d591f1b1da063725 (patch) | |
tree | 9edbb5237649c8f321a526c0ebdda92796ba08eb /Text/Pandoc/Writers | |
parent | 3dc0a9141c2e56e619d3da15d0d7859098a38cde (diff) | |
download | pandoc-13b1b87efcebaa6c6a41ad95d591f1b1da063725.tar.gz |
Improvements to LaTeX and ConTeXt footnote handling:
+ ConTeXt: } at end of footnote now occurs on a new line when the
footnote ends with \stoptyping, just as in LaTeX writer.
+ LaTeX and ConTeXt: \footnote is no longer indented. The indentation
causes problems with wrapping, as it makes the line too long.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1137 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text/Pandoc/Writers')
-rw-r--r-- | Text/Pandoc/Writers/ConTeXt.hs | 10 | ||||
-rw-r--r-- | Text/Pandoc/Writers/LaTeX.hs | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Text/Pandoc/Writers/ConTeXt.hs b/Text/Pandoc/Writers/ConTeXt.hs index 1ea17272d..73f5123c5 100644 --- a/Text/Pandoc/Writers/ConTeXt.hs +++ b/Text/Pandoc/Writers/ConTeXt.hs @@ -31,7 +31,7 @@ module Text.Pandoc.Writers.ConTeXt ( writeConTeXt ) where import Text.Pandoc.Definition import Text.Pandoc.Shared import Text.Printf ( printf ) -import Data.List ( (\\), intersperse ) +import Data.List ( (\\), intersperse, isSuffixOf ) import Control.Monad.State import Text.PrettyPrint.HughesPJ hiding ( Str ) @@ -292,7 +292,9 @@ inlineToConTeXt (Image alternate (src, tit)) = do text tit <> text "}\n{\\externalfigure[" <> text src <> text "]}" inlineToConTeXt (Note contents) = do contents' <- blockListToConTeXt contents - return $ text " \\footnote{" <> - text (stripTrailingNewlines $ render contents') <> - char '}' + let rawnote = stripTrailingNewlines $ render contents' + -- note: a \n before } is needed when note ends with a \stoptyping + let optNewline = "\\stoptyping" `isSuffixOf` rawnote + return $ text "\\footnote{" <> + text rawnote <> (if optNewline then char '\n' else empty) <> char '}' diff --git a/Text/Pandoc/Writers/LaTeX.hs b/Text/Pandoc/Writers/LaTeX.hs index d66a66941..01c4de58a 100644 --- a/Text/Pandoc/Writers/LaTeX.hs +++ b/Text/Pandoc/Writers/LaTeX.hs @@ -315,5 +315,5 @@ inlineToLaTeX (Note contents) = do let rawnote = stripTrailingNewlines $ render contents' -- note: a \n before } is needed when note ends with a Verbatim environment let optNewline = "\\end{Verbatim}" `isSuffixOf` rawnote - return $ text " \\footnote{" <> + return $ text "\\footnote{" <> text rawnote <> (if optNewline then char '\n' else empty) <> char '}' |