From 504bf3f8e79bd502f406264e2cc2794b129a26c0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 15 Oct 2015 15:11:07 -0700 Subject: [PATCH] Support all frame attributes in Beamer. --- README | 10 ++++++++-- src/Text/Pandoc/Writers/LaTeX.hs | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README b/README index d91b39e11..f10de123c 100644 --- a/README +++ b/README @@ -64,6 +64,7 @@ Markdown can be expected to be lossy. [XHTML]: http://www.w3.org/TR/xhtml1/ [LaTeX]: http://latex-project.org [`beamer`]: https://ctan.org/pkg/beamer +[Beamer User's Guide]: http://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/beamer/doc/beameruserguide.pdf [ConTeXt]: http://pragma-ade.nl [RTF]: http://en.wikipedia.org/wiki/Rich_Text_Format [DocBook]: http://docbook.org @@ -3407,8 +3408,8 @@ 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 ----------------------------------- +Frame attributes in beamer +-------------------------- Sometimes it is necessary to add the LaTeX `[fragile]` option to a frame in beamer (for example, when using the `minted` environment). @@ -3417,6 +3418,11 @@ introducing the slide: # Fragile slide {.fragile} +All of the other frame attributes described in Section 8.1 of +the [Beamer User's Guide] may also be used: `allowdisplaybreaks`, +`allowframebreaks`, `b`, `c`, `t`, `environment`, `label`, `plain`, +`shrink`. + EPUB Metadata ============= diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index b2e7dc1ba..770a674b7 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -300,9 +300,12 @@ elementToBeamer slideLevel (Sec lvl _num (ident,classes,kvs) tit elts) if writerListings opts then query hasCode elts else []) - let allowframebreaks = "allowframebreaks" `elem` classes + let frameoptions = ["allowdisplaybreaks", "allowframebreaks", + "b", "c", "t", "environment", + "label", "plain", "shrink"] let optionslist = ["fragile" | fragile] ++ - ["allowframebreaks" | allowframebreaks] + [k | k <- classes, k `elem` frameoptions] ++ + [k ++ "=" ++ v | (k,v) <- kvs, k `elem` frameoptions] let options = if null optionslist then "" else "[" ++ intercalate "," optionslist ++ "]"