瀏覽代碼

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.
Nicolas Goaziou 12 年之前
父節點
當前提交
43c0ae945e
共有 2 個文件被更改,包括 8 次插入10 次删除
  1. 4 5
      contrib/lisp/org-e-beamer.el
  2. 4 5
      contrib/lisp/org-e-latex.el

+ 4 - 5
contrib/lisp/org-e-beamer.el

@@ -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
-			 (replace-regexp-in-string
-			  "^[ \t]*\\\\documentclass\\(\\[.*?\\]\\)"
-			  class-options header t nil 1)
-		       header))))
+		     (if (not class-options) header
+		       (replace-regexp-in-string
+			"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
+			class-options header t nil 1)))))
 	  (when document-class-string
 	    (org-e-latex--guess-babel-language
 	     (org-e-latex--guess-inputenc

+ 4 - 5
contrib/lisp/org-e-latex.el

@@ -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
-			 (replace-regexp-in-string
-			  "^[ \t]*\\\\documentclass\\(\\[.*?\\]\\)"
-			  class-options header t nil 1)
-		       header))))
+		     (if (not class-options) header
+		       (replace-regexp-in-string
+			"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
+			class-options header t nil 1)))))
 	  (when document-class-string
 	    (org-e-latex--guess-babel-language
 	     (org-e-latex--guess-inputenc