git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: include fancyvrb and \VerbatimFootnotes

line in header only if absolutely needed -- that is, only if there is actually a code block in a footnote. git-svn-id: https://pandoc.googlecode.com/svn/trunk@815 788f1e2b-df1e-0410-8736-df70ead52e1b

commit94ed30cf15bef8d5e6743769144eac23707df2df authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 28 Jul 2007, 03:58 (19 years ago) parentad31ae6
1 file changed+4−4
src/Text/Pandoc/Writers/LaTeX.hs+4−4
src/Text/Pandoc/Writers/LaTeX.hs+4−4
@@ -130,9 +130,10 @@ blockToLaTeX (BlockQuote lst) = do
130130 return $ "\\begin{quote}\n" ++ contents ++ "\\end{quote}\n"
131131blockToLaTeX (CodeBlock str) = do
132132 st <- get
133− let verbEnv = if stInNote st then "Verbatim" else "verbatim"
134− return $ "\\begin{" ++ verbEnv ++ "}\n" ++ str ++
135− "\n\\end{" ++ verbEnv ++ "}\n"
133+ if stInNote st
134+ then do addToHeader "\\usepackage{fancyvrb}"
135+ return $ "\\begin{Verbatim}\n" ++ str ++ "\n\\end{Verbatim}\n"
136+ else return $ "\\begin{verbatim}\n" ++ str ++ "\n\\end{verbatim}\n"
136137blockToLaTeX (RawHtml str) = return ""
137138blockToLaTeX (BulletList lst) = do
138139 items <- mapM listItemToLaTeX lst
@@ -259,5 +260,4 @@ inlineToLaTeX (Note contents) = do
259260 contents' <- blockListToLaTeX contents
260261 st <- get
261262 put (st {stInNote = False})
262− addToHeader "\\usepackage{fancyvrb}"
263263 return $ "\\footnote{" ++ stripTrailingNewlines contents' ++ "}"