From 7fbce82f2f7b69e88b23cf138ea6cd3a86786b91 Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Thu, 27 Jan 2022 14:07:16 -0800 Subject: [PATCH] LaTeX writer: allow arbitrary frameoptions to be passed... to a beamer frame, using the frameoptions attribute. Updated manual. See #7869. --- MANUAL.txt | 25 ++++++++++++++++--------- src/Text/Pandoc/Writers/LaTeX.hs | 3 ++- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/MANUAL.txt b/MANUAL.txt index 6b688f8c1..4a4df01c5 100644 --- a/MANUAL.txt +++ b/MANUAL.txt @@ -5987,13 +5987,10 @@ To style beamer slides, you can specify a `theme`, `colortheme`, Note that heading attributes will turn into slide attributes (on a `<div>` or `<section>`) in HTML slide formats, allowing you -to style individual slides. In beamer, the only heading attribute -that affects slides is the `allowframebreaks` class, which sets the -`allowframebreaks` option, causing multiple slides to be created -if the content overfills the frame. This is recommended especially for -bibliographies: - - # References {.allowframebreaks} +to style individual slides. In beamer, a number of heading +classes and attributes are recognized as frame options and +will be passed through as options to the frame: see +[Frame attributes in beamer], below. ## Speaker notes @@ -6077,8 +6074,18 @@ introducing the slide: 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`, `standout`, `noframenumbering`. +`allowframebreaks`, `b`, `c`, `s`, `t`, `environment`, `label`, `plain`, +`shrink`, `standout`, `noframenumbering`, `squeeze`. +`allowframebreaks` is recommended especially for bibliographies, as +it allows multiple slides to be created if the content overfills the +frame: + + # References {.allowframebreaks} + +In addition, the `frameoptions` attribute may be used to +pass arbitrary frame options to a beamer slide: + + # Heading {frameoptions="squeeze,shrink,customoption=foobar"} ## Background in reveal.js, beamer, and pptx diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index 8c8bd50de..3756b8b75 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -291,7 +291,8 @@ blockToLaTeX (Div (identifier,"slide":dclasses,dkvs) , isNothing (lookup "fragile" kvs) , "fragile" `notElem` classes] ++ [k | k <- classes, k `elem` frameoptions] ++ - [k <> "=" <> v | (k,v) <- kvs, k `elem` frameoptions] + [k <> "=" <> v | (k,v) <- kvs, k `elem` frameoptions] ++ + [v | ("frameoptions", v) <- kvs] let options = if null optionslist then empty else brackets (literal (T.intercalate "," optionslist))