From 2235d17c0bb4fcb8f5b06c4330a56e2a1732162b Mon Sep 17 00:00:00 2001 From: Rasmus Date: Thu, 2 Jun 2016 11:45:49 +0200 Subject: [PATCH 2/2] ox-beamer: Add short title metainfo properties * lisp/ox-beamer.el: (beamer :option-alist): Add :beamer-short-title, :beamer-short-subtitle, :beamer-short-author, :beamer-short-date, :beamer-institute, :beamer-short-institute (org-beamer-template): Use new properties. --- lisp/ox-beamer.el | 70 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index fc17d3e..3263d75 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -236,6 +236,12 @@ Return overlay specification, as a string, or nil." (:beamer-inner-theme "BEAMER_INNER_THEME" nil nil t) (:beamer-outer-theme "BEAMER_OUTER_THEME" nil nil t) (:beamer-header "BEAMER_HEADER" nil nil newline) + (:beamer-short-title "SHORT_TITLE" nil nil parse) + (:beamer-short-subtitle "SHORT_SUBTITLE" nil nil parse) + (:beamer-short-author "SHORT_AUTHOR" nil nil parse) + (:beamer-short-date "SHORT_DATE" nil nil parse) + (:beamer-institute "INSTITUTE" nil nil parse) + (:beamer-short-institute "SHORT_INSTITUTE" nil nil parse) (:beamer-environments-extra nil nil org-beamer-environments-extra) (:beamer-frame-default-options nil nil org-beamer-frame-default-options) (:beamer-outline-frame-options nil nil org-beamer-outline-frame-options) @@ -852,21 +858,59 @@ holding export options." (when (integerp sec-num) (format "\\setcounter{secnumdepth}{%d}\n" sec-num))) ;; Author. - (let ((author (and (plist-get info :with-author) - (let ((auth (plist-get info :author))) - (and auth (org-export-data auth info))))) - (email (and (plist-get info :with-email) - (org-export-data (plist-get info :email) info)))) - (cond ((and author email (not (string= "" email))) - (format "\\author{%s\\thanks{%s}}\n" author email)) - ((or author email) (format "\\author{%s}\n" (or author email))))) + (let* ((author (and (plist-get info :with-author) + (let ((auth (plist-get info :author))) + (and auth (org-export-data auth info))))) + (short-author (and author + (let ((short-auth (plist-get info :beamer-short-author))) + (if short-auth + (format "[%s]" + (org-export-data short-auth info)) + "")))) + (email (and (plist-get info :with-email) + (org-string-nw-p + (org-export-data (plist-get info :email) info))))) + (cond ((and author email) + (format "\\author%s{%s\\thanks{%s}}\n" + short-author author email)) + ((or author email) + (format "\\author%s{%s}\n" + short-author (or author email))))) ;; Date. - (let ((date (and (plist-get info :with-date) (org-export-get-date info)))) - (format "\\date{%s}\n" (org-export-data date info))) - ;; Title - (format "\\title{%s}\n" title) + (let* ((date (and (plist-get info :with-date) (org-export-get-date info))) + (short-date (and date (org-export-data + (org-export-get-date + (plist-put info :date + (plist-get info :beamer-short-date))) + info)))) + (format "\\date%s{%s}\n" (if (org-string-nw-p short-date) + (format "[%s]" short-date) + "") + (org-export-data date info))) + ;; Title. + (let ((short-title (and title (plist-get info :beamer-short-title)))) + (format "\\title%s{%s}\n" + (if short-title + (format "[%s]" (org-export-data short-title info)) + "") + title)) + ;; Subtitle. (when (org-string-nw-p subtitle) - (concat (format (plist-get info :beamer-subtitle-format) subtitle) "\n")) + (let ((short-subtitle (plist-get info :beamer-short-subtitle))) + (format "\\subtitle%s{%s}\n" + (if short-subtitle + (format "[%s]" (org-export-data short-subtitle info)) + "") + subtitle))) + ;; Institute. + (let ((institute (plist-get info :beamer-institute)) + (short-institute (plist-get info :beamer-short-institute))) + (when institute + (format "\\institute%s{%s}\n" + (if short-institute + (format "[%s]" (org-export-data short-institute info)) + "") + (org-export-data institute info)))) ;; Beamer-header (let ((beamer-header (plist-get info :beamer-header))) (when beamer-header -- 2.10.0