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
This commit is contained in:
fiddlosopher
2007-07-28 03:58:09 +00:00
parent ad31ae693b
commit 94ed30cf15
+4 -4
View File
@@ -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' ++ "}"