LaTeX beamer: Only add [fragile] to slide if it contains verbatim.

Closes #385.
This commit is contained in:
John MacFarlane
2012-01-23 21:03:10 -08:00
parent 97af576729
commit 05cf164edf
+8 -1
View File
@@ -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