git.iko.soy/typeable/pandoc
on master help sign in
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

commit13b1b87efcebaa6c6a41ad95d591f1b1da063725 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 4 Dec 2007, 04:14 (19 years ago) parent3dc0a91
2 files changed+7−5
Text/Pandoc/Writers/ConTeXt.hs+6−4 Text/Pandoc/Writers/LaTeX.hs+1−1
Text/Pandoc/Writers/ConTeXt.hs+6−4
@@ -31,7 +31,7 @@ module Text.Pandoc.Writers.ConTeXt ( writeConTeXt ) where
3131import Text.Pandoc.Definition
3232import Text.Pandoc.Shared
3333import Text.Printf ( printf )
34−import Data.List ( (\\), intersperse )
34+import Data.List ( (\\), intersperse, isSuffixOf )
3535import Control.Monad.State
3636import Text.PrettyPrint.HughesPJ hiding ( Str )
3737
@@ -292,7 +292,9 @@ inlineToConTeXt (Image alternate (src, tit)) = do
292292 text tit <> text "}\n{\\externalfigure[" <> text src <> text "]}"
293293inlineToConTeXt (Note contents) = do
294294 contents' <- blockListToConTeXt contents
295− return $ text " \\footnote{" <>
296− text (stripTrailingNewlines $ render contents') <>
297− char '}'
295+ let rawnote = stripTrailingNewlines $ render contents'
296+ -- note: a \n before } is needed when note ends with a \stoptyping
297+ let optNewline = "\\stoptyping" `isSuffixOf` rawnote
298+ return $ text "\\footnote{" <>
299+ text rawnote <> (if optNewline then char '\n' else empty) <> char '}'
298300
Text/Pandoc/Writers/LaTeX.hs+1−1
@@ -315,5 +315,5 @@ inlineToLaTeX (Note contents) = do
315315 let rawnote = stripTrailingNewlines $ render contents'
316316 -- note: a \n before } is needed when note ends with a Verbatim environment
317317 let optNewline = "\\end{Verbatim}" `isSuffixOf` rawnote
318− return $ text " \\footnote{" <>
318+ return $ text "\\footnote{" <>
319319 text rawnote <> (if optNewline then char '\n' else empty) <> char '}'