ox-latex/ox-beamer: Provide an error when LaTeX class is invalid

* lisp/ox-beamer.el (org-beamer-template): Provide an error when LaTeX
  class is invalid.
* lisp/ox-latex.el (org-latex-template): Provide an error when LaTeX
  class is invalid.

Patch suggested by Sébastien Vauban
This commit is contained in:
Nicolas Goaziou 2013-02-06 19:47:35 +01:00
parent 918c8a6c8f
commit ce79e36ff0
2 changed files with 4 additions and 2 deletions

View File

@ -828,7 +828,8 @@ holding export options."
(replace-regexp-in-string
"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
class-options header t nil 1)))))
(when document-class-string
(if (not document-class-string)
(user-error "Unknown LaTeX class `%s'")
(org-latex-guess-babel-language
(org-latex-guess-inputenc
(org-splice-latex-header

View File

@ -1108,7 +1108,8 @@ holding export options."
(replace-regexp-in-string
"^[ \t]*\\\\documentclass\\(\\(\\[.*\\]\\)?\\)"
class-options header t nil 1)))))
(when document-class-string
(if (not document-class-string)
(user-error "Unknown LaTeX class `%s'")
(org-latex-guess-babel-language
(org-latex-guess-inputenc
(org-splice-latex-header