branch: externals/org
commit 50e34dde10ba6d88615b2892e2b33ac7a02e1366
Author: Hugo Heagren <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    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.
    * etc/ORG-NEWS (Beamer export supports setting frame subtitles):
    Document the new feature.
---
 doc/org-manual.org | 5 +++++
 etc/ORG-NEWS       | 4 ++++
 lisp/ox-beamer.el  | 9 +++++++++
 3 files changed, 18 insertions(+)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 5f5104f91c..2ce58abe8f 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -13104,6 +13104,11 @@ should in principle be exportable as a Beamer 
presentation.
   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/etc/ORG-NEWS b/etc/ORG-NEWS
index 9780b53a6f..b2c7067404 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -31,6 +31,10 @@ batch scripts.
 # We list the most important features, and the features that may
 # require user action to be used.
 
+*** Beamer export supports setting frame subtitles
+If a headline is exported as a frame, and has its =BEAMER_SUBTITLE=
+property set, the value is used as the subtitle.
+
 *** =ol.el=: New =shortdoc= link type
 
 You can now create links to =shortdoc= documentation groups for Emacs
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index d49cccde2b..6c6f60b360 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -500,6 +500,15 @@ used as a communication channel."
                      (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}"
+                      (org-export-data
+                       (org-element-parse-secondary-string
+                        subtitle
+                        (org-element-restriction 'keyword))
+                       info)))
            "\n"
            ;; The following workaround is required in fragile frames
            ;; as Beamer will append "\par" to the beginning of the

Reply via email to