Skip to content

Commit

Permalink
LaTeX(Beamer) writer: include contents under headers < slidelevel.
Browse files Browse the repository at this point in the history
Currently we keep the fancy title slide and add a new
slide with the same title and whatever content was under the
header.

This changes behavior of slides, but is consistent with the
new behavior of the revealjs and other HTML slide show writers.

See #4317.
  • Loading branch information
jgm committed Mar 2, 2019
1 parent 5990f14 commit f431f67
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Text/Pandoc/Writers/LaTeX.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f431f67

Please sign in to comment.