Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 285
Sebastian Avatar asked Nov 05 '14 14:11

Sebastian


4 Answers

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...)

like image 72
fniessen Avatar answered Oct 06 '22 01:10

fniessen


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.

like image 37
Wajid Avatar answered Oct 05 '22 23:10

Wajid


I use this to achieve the same effect:

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

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

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

like image 41
biocyberman Avatar answered Oct 06 '22 00:10

biocyberman


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.

like image 29
amir Avatar answered Oct 06 '22 01:10

amir