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