From b7157cc6661833fbd17b791458f1f6ce965328ae Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 6 Jul 2010 14:55:47 +0200 Subject: [PATCH] Beamer: Put extra header last in header MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-beamer.el (org-beamer-amend-header): Put extra header last in header. Tassilo Horn writes: > I'm doing a LaTeX beamer presentation with org. The org doc starts with > these lines: > > --8<---------------cut here---------------start------------->8--- > #+STARTUP: beamer > #+LaTeX_CLASS: beamer > #+TITLE: Implementieren, Integrieren, Installieren > #+AUTHOR: Tassilo Horn > #+EMAIL: horn@uni-koblenz.de > #+LANGUAGE: de > #+BEAMER_FRAME_LEVEL: 2 > #+LaTeX_CLASS_OPTIONS: [presentation] > #+BEAMER_HEADER_EXTRA: \usetheme[secheader]{Boadilla} \institute{Universität Koblenz, IST} > --8<---------------cut here---------------end--------------->8--- > > In the presentation, the ä in Universität is printed as an A with a ~ on > top, followed by a d'. The reason is that the BEAMER_HEADER_EXTRA is > put before the input encoding declaration. To be clear, org produces a > TeX file that starts with > > --8<---------------cut here---------------start------------->8--- > % Created 2010-07-06 Tue 08:57 > \documentclass[presentation]{beamer} > \usetheme[secheader]{Boadilla} \institute{Universität Koblenz, IST} > \usepackage[utf8]{inputenc} > \usepackage[T1]{fontenc} > --8<---------------cut here---------------end--------------->8--- > > but it should be at least: > > --8<---------------cut here---------------start------------->8--- > % Created 2010-07-06 Tue 08:57 > \documentclass[presentation]{beamer} > \usepackage[utf8]{inputenc} > \usetheme[secheader]{Boadilla} \institute{Universität Koblenz, IST} > \usepackage[T1]{fontenc} > --8<---------------cut here---------------end--------------->8--- > > In general, I'd say that it would be even more safe to put the extra > headers below all default headers. --- lisp/org-beamer.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-beamer.el b/lisp/org-beamer.el index af7887f3c..1530bfcdb 100644 --- a/lisp/org-beamer.el +++ b/lisp/org-beamer.el @@ -390,8 +390,8 @@ the value will be inserted right after the documentclass statement." ((re-search-forward "^[ \t]*BEAMER-HEADER-EXTRA-HERE[ \t]*$" nil t) (replace-match org-beamer-header-extra t t) (or (bolp) (insert "\n"))) - ((re-search-forward "^[ \t]*\\\\documentclass\\>" nil t) - (beginning-of-line 2) + ((re-search-forward "^[ \t]*\\\\begin{document}" nil t) + (beginning-of-line 1) (insert org-beamer-header-extra) (or (bolp) (insert "\n"))))))