Org-mode beamer - How to create a short title, author, date?
Asked Answered
E

4

5

Is there any easy way in adding a short title, author, date, etc. in the .org file, without messing around with the generated .tex file?

Enclave answered 5/11, 2014 at 14:53 Comment(0)
I
6

My (in progress) Org Beamer refcard could help you.

See on https://github.com/fniessen/refcard-org-beamer, in particular the section "Creating a title page".

UPDATE -- Something like the following would do it?

#+BIND: org-latex-title-command "\\title{De leerplandoelstellingen}\n\\date[mei 2014]{9 mei 2014}\n\\maketitle"

(that's a way to fiddle with the title, but directly from the Org file...)

Intern answered 5/11, 2014 at 15:8 Comment(3)
Sorry no it doesn't help! I'm looking for short title, author date and not the normal (=long) versionEnclave
Thanks! I accepted your answer since it is at least a solution without messing around the .tex file. However, I hoped for something cleaner, like #+SHORT_TITLE, but maybe this can be defined somehow?Enclave
You could try and ask on the Org ML. However, as it'd be Beamer (or LaTeX) specific, I don't think such a thing will ever be added. But you can try.Intern
B
4

Yes you can define #+SHORT_TITLE but it involves editing 2 elisp files. You need to find your ox.el and ox-beamer.el files, mine are located in the ~/.emacs.d/elpa/org-20150330 directory. There are also some compiled files ox.elc and ox-beamer.elc. I recommend you create a backup of all these files before continuing.

In file ox.el go to line 118 and add the short_title line as shown below:

 114│    (:section-numbers nil "num" org-export-with-section-numbers)
 115│    (:select-tags "SELECT_TAGS" nil org-export-select-tags split)
 116│    (:time-stamp-file nil "timestamp" org-export-time-stamp-file)
 117│    (:title "TITLE" nil nil space)
 118│    (:short_title "SHORT_TITLE" nil nil space) ;; Additional line        
 119│    (:with-archived-trees nil "arch" org-export-with-archived-trees)
 120│    (:with-author nil "author" org-export-with-author)
 121│    (:with-clocks nil "c" org-export-with-clocks)
 122│    (:with-creator nil "creator" org-export-with-creator)

Save the file. Remove th ox.elc file (ensure you have a backup) and byte compile the file. This can be done from within emacs using M-x byte-compile-file and entering the file name, ensure it completes without error.

Then open file ox-beamer.el and make the following changes.

 860│     ;; 7. Title
 861│     (let ((short_title (plist-get info :short_title)))
 862│       (format "\\title[%s]{%s}\n" short_title title))

Save, remove the old ox-beamer.elc and byte compile. Restart emacs and you can now use #+SHORT_TITLE: as you wish.

Your line numbers may be different but I've included the surrounding code so you should be able to find/replace easily.

Bubble answered 20/6, 2015 at 10:16 Comment(0)
S
2

I use this to achieve the same effect:

#+TITLE: Short title
#+BEAMER_HEADER: \subtitle{long title}

This requires that you make the two titles play well together, so it does not look silly.

Credit: Learnt about the BEAMER_HEADER thing from https://github.com/fniessen/refcard-org-beamer

Septuagesima answered 8/9, 2016 at 20:9 Comment(0)
P
1

I understand this is an old question. I got here while searching for a solution to the same problem. And I thought others in the same boat may benefit from a cleaner solution.

Including the following before/after #+TITLE: should do the job:

#+BEAMER_HEADER: \title[short title]{long title}

Note that it replaces whatever you set in the #TITLE: line. Of course, I'm not sure if this was a possibility at the time OP asked the question.

Pectoralis answered 14/3, 2018 at 17:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.