ox-latex: Allow to span documentclass options accross multiple lines in template

* contrib/lisp/ox-koma-letter.el (org-koma-letter-template): Allow to
  span documentclass options accross multiple lines in template.
* lisp/ox-beamer.el (org-beamer-template): Allow to span documentclass
  options accross multiple lines in template.
* lisp/ox-latex.el (org-latex-template): Allow to span documentclass
  options accross multiple lines in template.

Thanks to Michael Strey for reporting this bug.
This commit is contained in:
Nicolas Goaziou 2013-02-20 20:26:08 +01:00
parent 6e1bac2430
commit f1e23104e3
3 changed files with 6 additions and 7 deletions

View File

@ -183,11 +183,10 @@ holding export options."
(let* ((header (nth 1 (assoc class org-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)))))
(if (not document-class-string)
(user-error "Unknown LaTeX class `%s'")
(org-latex-guess-babel-language

View File

@ -841,7 +841,7 @@ holding export options."
(and (stringp header)
(if (not class-options) header
(replace-regexp-in-string
"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
"^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
class-options header t nil 1)))))
(if (not document-class-string)
(user-error "Unknown LaTeX class `%s'" class)

View File

@ -1109,7 +1109,7 @@ holding export options."
(and (stringp header)
(if (not class-options) header
(replace-regexp-in-string
"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
"^[ \t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
class-options header t nil 1)))))
(if (not document-class-string)
(user-error "Unknown LaTeX class `%s'" class)