aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-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