From 88b04892fd270989980c5d34595213e67d8c8f3a Mon Sep 17 00:00:00 2001 From: Hugo Heagren Date: Fri, 5 Jul 2024 22:13:19 +0100 Subject: [PATCH] ox-beamer: allow setting frame subtitle with headline property * lisp/ox-beamer.el (org-beamer--format-frame): allow a frame subtitle to be specified in the BEAMER_SUBTITLE property. If specified, put it in the second non-optional argument to \begin{frame}. * doc/org-manual.org (Frames and Blocks in Beamer): document above behaviour. --- doc/org-manual.org | 5 +++++ lisp/ox-beamer.el | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/doc/org-manual.org b/doc/org-manual.org index ad584d7a5..cfa1e4b85 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -12653,6 +12653,11 @@ *** Frames and Blocks in Beamer frames. It is also useful for properly closing a =column= environment. + #+cindex: @samp{BEAMER_SUBTITLE}, property + If =BEAMER_SUBTITLE= is set, org exports its value as the subtitle + for the headline's frame. This property has no effect on headlines + which are not exported as frames. + #+cindex: @samp{BEAMER_ACT}, property #+cindex: @samp{BEAMER_OPT}, property When =BEAMER_ACT= is set for a headline, Org export translates that diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index 51684448d..6925c8092 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -470,6 +470,10 @@ (defun org-beamer--format-frame (headline contents info) (if (and env (equal (downcase env) "fullframe")) "" (org-export-data (org-element-property :title headline) info)))) + ;; Subtitle + (when-let ((subtitle + (org-element-property :BEAMER_SUBTITLE headline))) + (format "{%s}" subtitle)) "\n" ;; The following workaround is required in fragile frames ;; as Beamer will append "\par" to the beginning of the -- 2.20.1