mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-26 10:16:32 +00:00
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:
@@ -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' ++ "}"
|
||||
|
||||
Reference in New Issue
Block a user