aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 9f381ce3c..2bfde42cf 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -448,7 +448,14 @@ elementToBeamer slideLevel (Sec lvl _num (ident,classes,kvs) tit elts)
: tit ++ [RawInline "latex" "}"] )
: bs ++ [RawBlock "latex" "\\end{block}"]
| lvl < slideLevel = do
- bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts
+ let isSec Sec{} = True
+ isSec _ = False
+ let (contentElts, secElts) = break isSec elts
+ let elts' = if null contentElts
+ then secElts
+ else Sec slideLevel [] nullAttr tit contentElts :
+ secElts
+ bs <- concat `fmap` mapM (elementToBeamer slideLevel) elts'
return $ Header lvl (ident,classes,kvs) tit : bs
| otherwise = do -- lvl == slideLevel
-- note: [fragile] is required or verbatim breaks