[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] #+LaTeX_CLASS regex too restrictive?
From: |
Bastien |
Subject: |
Re: [O] #+LaTeX_CLASS regex too restrictive? |
Date: |
Sat, 29 Oct 2011 14:44:56 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) |
Hi Richard,
Richard Lewis <address@hidden> writes:
> I updated my org-mode repository last night and found today that my
> LaTeX export wasn't working anymore because it couldn't find the LaTeX
> class: "No definition for class `%s' in `org-export-latex-classes'".
>
> The class name I'm using includes "/" characters. However, the regex
> for matching #+LaTeX_CLASS allows only alphabetic characters or
> "-". The following change fixed this for me, but perhaps it's now a
> little too inclusive?
>
> diff --git a/lisp/org-latex.el b/lisp/org-latex.el
> index 649e4a7..e9502ae 100644
> --- a/lisp/org-latex.el
> +++ b/lisp/org-latex.el
> @@ -1346,7 +1346,7 @@ LEVEL indicates the default depth for export."
> (save-restriction
> (widen)
> (goto-char (point-min))
> - (and (re-search-forward "^#\\+LaTeX_CLASS:[
> \t]*\\([-a-zA-Z]+\\)" nil t)
> + (and (re-search-forward "^#\\+LaTeX_CLASS:[ \t]*\\(.+\\)$"
> nil t)
> (match-string 1))))
> (plist-get org-export-latex-options-plist :latex-class)
> org-export-latex-default-class)
Yes, this is a bit too inclusive, as the (match-string 1) would also
contain spaces, for example. I've pushed a commit allowing "/" chars
for LaTeX classes -- please test it and let me know.
Thanks,
--
Bastien