org-e-latex/org-e-beamer: Allow inserting class option when there was none

* contrib/lisp/org-e-beamer.el (org-e-beamer-template): Allow
  inserting class option when there was none.
* contrib/lisp/org-e-latex.el (org-e-latex-template): Allow inserting
  class option when there was none.

Thanks to Fabrice Popineau for suggesting this.
This commit is contained in:
Nicolas Goaziou 2012-08-30 15:54:33 +02:00
parent 152ad3362e
commit 43c0ae945e
2 changed files with 8 additions and 10 deletions

View File

@ -743,11 +743,10 @@ holding export options."
(let* ((header (nth 1 (assoc class org-e-latex-classes)))
(document-class-string
(and (stringp header)
(if class-options
(if (not class-options) header
(replace-regexp-in-string
"^[ \t]*\\\\documentclass\\(\\[.*?\\]\\)"
class-options header t nil 1)
header))))
"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
class-options header t nil 1)))))
(when document-class-string
(org-e-latex--guess-babel-language
(org-e-latex--guess-inputenc

View File

@ -1009,11 +1009,10 @@ holding export options."
(let* ((header (nth 1 (assoc class org-e-latex-classes)))
(document-class-string
(and (stringp header)
(if class-options
(if (not class-options) header
(replace-regexp-in-string
"^[ \t]*\\\\documentclass\\(\\[.*?\\]\\)"
class-options header t nil 1)
header))))
"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
class-options header t nil 1)))))
(when document-class-string
(org-e-latex--guess-babel-language
(org-e-latex--guess-inputenc