From f1e23104e3291ceef35d8a3ac5dcab1a92f92b11 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 20 Feb 2013 20:26:08 +0100 Subject: [PATCH] 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. --- contrib/lisp/ox-koma-letter.el | 9 ++++----- lisp/ox-beamer.el | 2 +- lisp/ox-latex.el | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 19c180718..07633e371 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -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 diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index 64bd7448f..0ded5b987 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -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) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 9d5b5c531..0eb931946 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -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) -- 2.11.4.GIT