aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-01-23 21:03:10 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-01-23 21:03:10 -0800
commit05cf164edff9bc4ffbed443c18c15773749ca358 (patch)
tree9920c143dffe3a34d06b0fd448bb2581cef4a2d8 /src/Text/Pandoc/Writers
parent97af5767295f9bc48c8dc99303bb5b53829beb43 (diff)
downloadpandoc-05cf164edff9bc4ffbed443c18c15773749ca358.tar.gz
LaTeX beamer: Only add [fragile] to slide if it contains verbatim.
Closes #385.
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index dd7a3c940..6291300b0 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -207,7 +207,14 @@ slideToBeamer (SectionSlide lvl tit) = return [Header lvl tit]
slideToBeamer (ContentSlide tit bs) = do
tit' <- inlineListToLaTeX tit
-- note: [fragile] is required or verbatim breaks
- let slideStart = RawBlock "latex" ("\\begin{frame}[fragile]\n" ++
+ let hasCodeBlock (CodeBlock _ _) = [True]
+ hasCodeBlock _ = []
+ let hasCode (Code _ _) = [True]
+ hasCode _ = []
+ let fragile = if not $ null $ queryWith hasCodeBlock bs ++ queryWith hasCode bs
+ then "[fragile]"
+ else ""
+ let slideStart = RawBlock "latex" ("\\begin{frame}" ++ fragile ++
"\\frametitle{" ++ render Nothing tit' ++ "}")
let slideEnd = RawBlock "latex" "\\end{frame}"
-- now carve up slide into blocks if there are sections inside