emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Gidden <gidden@wisc.edu>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] Adding a BEAMER_HEADER_EXTRA tag, allows short titles, etc.
Date: Mon, 9 Mar 2015 16:56:36 -0500	[thread overview]
Message-ID: <CAHRdPFyMdn78VLuPufFU9oNd1CLrF8M-+4nP7y-4eyJfBvCtSA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 999 bytes --]

Hi folks,

I ran into the issue that many others have cited: an inability to add short
titles, etc., to org-mode-generated Beamer presentations [1, 2, 3]. This
patch allows such capability through a BEAMER_HEADER_EXTRA tag, which is
placed after title, author, etc., but before `\begin{document}`.  Short
titles, for example, can now be added via

```
#+BEAMER_HEADER_EXTRA: \title[A Short Title]{ \inserttitle }
```

Something like this appears to have been in the original org-beamer.el, but
was not present in the current master HEAD ox-beamer.el. If the
community/BD deems this to be worthy, I'd be happy to clean it up as needed.

Cheers,
Matt

[1] http://comments.gmane.org/gmane.emacs.orgmode/57450
[2] https://lists.gnu.org/archive/html/emacs-orgmode/2011-01/msg00176.html
[3]
http://stackoverflow.com/questions/26760125/org-mode-beamer-how-to-create-a-short-title-author-date


-- 
Matthew Gidden
Ph.D. Candidate, Nuclear Engineering
The University of Wisconsin -- Madison
Ph. 225.892.3192

[-- Attachment #1.2: Type: text/html, Size: 1577 bytes --]

[-- Attachment #2: 0001-adds-a-BEAMER_HEADER_EXTRA-tag-that-can-be-used-to-i.patch --]
[-- Type: text/x-patch, Size: 3407 bytes --]

From e666fc06512dad866a10dd763c3d42117dfff31f Mon Sep 17 00:00:00 2001
From: Matthew Gidden <matthew.gidden@gmail.com>
Date: Mon, 9 Mar 2015 16:25:15 -0500
Subject: [PATCH] adds a BEAMER_HEADER_EXTRA tag that can be used to inject
 code after title, author, etc. but before \begin{document}

---
 lisp/ox-beamer.el | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index e10d36c..d15e5b0 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -239,7 +239,8 @@ Return overlay specification, as a string, or nil."
     (:beamer-font-theme "BEAMER_FONT_THEME" nil nil t)
     (:beamer-inner-theme "BEAMER_INNER_THEME" nil nil t)
     (:beamer-outer-theme "BEAMER_OUTER_THEME" nil nil t)
-    (:beamer-header-extra "BEAMER_HEADER" nil nil newline)
+    (:beamer-header "BEAMER_HEADER" nil nil newline)
+    (:beamer-header-extra "BEAMER_HEADER_EXTRA" nil nil newline)
     (: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)
@@ -826,7 +827,7 @@ holding export options."
 		      (plist-get info :latex-header))
 		     (org-element-normalize-string
 		      (plist-get info :latex-header-extra))
-		     (plist-get info :beamer-header-extra)))))
+		     (plist-get info :beamer-header)))))
 	  info)))
      ;; 3. Insert themes.
      (let ((format-theme
@@ -866,16 +867,20 @@ holding export options."
        (format "\\date{%s}\n" (org-export-data date info)))
      ;; 7. Title
      (format "\\title{%s}\n" title)
-     ;; 8. Hyperref options.
+     ;; 8. Beamer-header-extras
+     (let ((beamer-header-extra (plist-get info :beamer-header-extra)))
+       (when beamer-header-extra
+	 (format "%s\n" (plist-get info :beamer-header-extra))))
+     ;; 9. Hyperref options.
      (when (plist-get info :latex-hyperref-p)
        (format "\\hypersetup{\n  pdfkeywords={%s},\n  pdfsubject={%s},\n  pdfcreator={%s}}\n"
 	       (or (plist-get info :keywords) "")
 	       (or (plist-get info :description) "")
 	       (if (not (plist-get info :with-creator)) ""
 		 (plist-get info :creator))))
-     ;; 9. Document start.
+     ;; 10. Document start.
      "\\begin{document}\n\n"
-     ;; 10. Title command.
+     ;; 11. Title command.
      (org-element-normalize-string
       (cond ((not (plist-get info :with-title)) nil)
 	    ((string= "" title) nil)
@@ -884,7 +889,7 @@ holding export options."
 			   org-latex-title-command)
 	     (format org-latex-title-command title))
 	    (t org-latex-title-command)))
-     ;; 11. Table of contents.
+     ;; 12. Table of contents.
      (let ((depth (plist-get info :with-toc)))
        (when depth
 	 (concat
@@ -896,16 +901,16 @@ holding export options."
 	    (format "\\setcounter{tocdepth}{%d}\n" depth))
 	  "\\tableofcontents\n"
 	  "\\end{frame}\n\n")))
-     ;; 12. Document's body.
+     ;; 13. Document's body.
      contents
-     ;; 13. Creator.
+     ;; 14. Creator.
      (let ((creator-info (plist-get info :with-creator)))
        (cond
 	((not creator-info) "")
 	((eq creator-info 'comment)
 	 (format "%% %s\n" (plist-get info :creator)))
 	(t (concat (plist-get info :creator) "\n"))))
-     ;; 14. Document end.
+     ;; 15. Document end.
      "\\end{document}")))
 
 
-- 
1.9.1


             reply	other threads:[~2015-03-09 21:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 21:56 Matthew Gidden [this message]
2015-03-09 23:19 ` [PATCH] Adding a BEAMER_HEADER_EXTRA tag, allows short titles, etc Nicolas Goaziou
2015-03-09 23:46   ` Matthew Gidden
2015-03-10 14:44     ` Nicolas Goaziou
2015-03-10 14:45       ` Matthew Gidden
2015-03-10 15:15         ` Matthew Gidden
2015-03-10 15:44           ` Nicolas Goaziou
2015-03-10 16:10             ` Matthew Gidden
2015-03-10 20:22               ` Nicolas Goaziou
2015-03-09 23:50 ` Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHRdPFyMdn78VLuPufFU9oNd1CLrF8M-+4nP7y-4eyJfBvCtSA@mail.gmail.com \
    --to=gidden@wisc.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).