diff --git a/README b/README index b4f037efa..4225da89e 100644 --- a/README +++ b/README @@ -3159,6 +3159,16 @@ To show the notes window, press `s` while viewing the presentation. Notes are not yet supported for other slide formats, but the notes will not appear on the slides themselves. +Marking frames "fragile" in beamer +---------------------------------- + +Sometimes it is necessary to add the LaTeX `[fragile]` option to +a frame in beamer (for example, when using the `minted` environment). +This can be forced by adding the `fragile` class to the header +introducing the slide: + + # Fragile slide {.fragile} + EPUB Metadata ============= diff --git a/changelog b/changelog index 17f198bcb..6174594c6 100644 --- a/changelog +++ b/changelog @@ -96,6 +96,8 @@ pandoc (1.14) Harriott). Previously, pandoc hard-coded some commands to make tight lists in LaTeX. Now we use a custom command instead, allowing the styling to be changed in a macro in the header. + + Beamer output: if the header introducing a slide has the + class `fragile`, add the `[fragile]` option to the slide (#2119). * MediaWiki writer: diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 70280aaec..a785e1edc 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -274,10 +274,11 @@ elementToBeamer slideLevel (Sec lvl _num (ident,classes,kvs) tit elts) let hasCode (Code _ _) = [True] hasCode _ = [] opts <- gets stOptions - let fragile = not $ null $ query hasCodeBlock elts ++ + let fragile = "fragile" `elem` classes || + not (null $ query hasCodeBlock elts ++ if writerListings opts then query hasCode elts - else [] + else []) let allowframebreaks = "allowframebreaks" `elem` classes let optionslist = ["fragile" | fragile] ++ ["allowframebreaks" | allowframebreaks]