From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: #+LaTeX_CLASS regex too restrictive? Date: Sat, 29 Oct 2011 14:44:56 +0200 Message-ID: <87y5w46k6v.fsf@gnu.org> References: <877h3om4eq.wl%richard.lewis@gold.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK8Ga-0004IZ-3r for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 08:44:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RK8GZ-0002iP-5R for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 08:44:04 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:64601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RK8GY-0002iG-Ue for emacs-orgmode@gnu.org; Sat, 29 Oct 2011 08:44:03 -0400 Received: by wyg34 with SMTP id 34so5689481wyg.0 for ; Sat, 29 Oct 2011 05:44:02 -0700 (PDT) In-Reply-To: <877h3om4eq.wl%richard.lewis@gold.ac.uk> (Richard Lewis's message of "Sat, 29 Oct 2011 12:19:09 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Richard Lewis Cc: emacs-orgmode@gnu.org Hi Richard, Richard Lewis 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