git.iko.soy/typeable/pandoc
on master help sign in
Beamer: mark slide as `[fragile]` if header has `fragile` class.

Closes #2119.

commit75cfa7b4624bfbf06c8a47761620bd756ddab254 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 13 May 2015, 20:10 (11 years ago) parent1f358cc
3 files changed+15−2
README+10 changelog+2 src/Text/Pandoc/Writers/LaTeX.hs+3−2
README+10
@@ -3159,6 +3159,16 @@ To show the notes window, press `s` while viewing the presentation.
31593159Notes are not yet supported for other slide formats, but the notes
31603160will not appear on the slides themselves.
31613161
3162+Marking frames "fragile" in beamer
3163+----------------------------------
3164+
3165+Sometimes it is necessary to add the LaTeX `[fragile]` option to
3166+a frame in beamer (for example, when using the `minted` environment).
3167+This can be forced by adding the `fragile` class to the header
3168+introducing the slide:
3169+
3170+ # Fragile slide {.fragile}
3171+
31623172EPUB Metadata
31633173=============
31643174
changelog+2
@@ -96,6 +96,8 @@ pandoc (1.14)
9696 Harriott). Previously, pandoc hard-coded some commands to make
9797 tight lists in LaTeX. Now we use a custom command instead,
9898 allowing the styling to be changed in a macro in the header.
99+ + Beamer output: if the header introducing a slide has the
100+ class `fragile`, add the `[fragile]` option to the slide (#2119).
99101
100102 * MediaWiki writer:
101103
src/Text/Pandoc/Writers/LaTeX.hs+3−2
@@ -274,10 +274,11 @@ elementToBeamer slideLevel (Sec lvl _num (ident,classes,kvs) tit elts)
274274 let hasCode (Code _ _) = [True]
275275 hasCode _ = []
276276 opts <- gets stOptions
277− let fragile = not $ null $ query hasCodeBlock elts ++
277+ let fragile = "fragile" `elem` classes ||
278+ not (null $ query hasCodeBlock elts ++
278279 if writerListings opts
279280 then query hasCode elts
280− else []
281+ else [])
281282 let allowframebreaks = "allowframebreaks" `elem` classes
282283 let optionslist = ["fragile" | fragile] ++
283284 ["allowframebreaks" | allowframebreaks]