aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-28 03:58:09 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-28 03:58:09 +0000
commit94ed30cf15bef8d5e6743769144eac23707df2df (patch)
treec91f57e7d953f17cd58e1cdce4e81e5c65f0edbe
parentad31ae693bb04ad1c35eba9682f1e6cfe1e7fece (diff)
downloadpandoc-94ed30cf15bef8d5e6743769144eac23707df2df.tar.gz
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
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 739b60133..ef96cf7b7 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -130,9 +130,10 @@ blockToLaTeX (BlockQuote lst) = do
return $ "\\begin{quote}\n" ++ contents ++ "\\end{quote}\n"
blockToLaTeX (CodeBlock str) = do
st <- get
- let verbEnv = if stInNote st then "Verbatim" else "verbatim"
- return $ "\\begin{" ++ verbEnv ++ "}\n" ++ str ++
- "\n\\end{" ++ verbEnv ++ "}\n"
+ if stInNote st
+ then do addToHeader "\\usepackage{fancyvrb}"
+ return $ "\\begin{Verbatim}\n" ++ str ++ "\n\\end{Verbatim}\n"
+ else return $ "\\begin{verbatim}\n" ++ str ++ "\n\\end{verbatim}\n"
blockToLaTeX (RawHtml str) = return ""
blockToLaTeX (BulletList lst) = do
items <- mapM listItemToLaTeX lst
@@ -259,5 +260,4 @@ inlineToLaTeX (Note contents) = do
contents' <- blockListToLaTeX contents
st <- get
put (st {stInNote = False})
- addToHeader "\\usepackage{fancyvrb}"
return $ "\\footnote{" ++ stripTrailingNewlines contents' ++ "}"