From: Bastien <bzg@altern.org>
To: Richard Lewis <richardlewis@fastmail.co.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: #+LaTeX_CLASS regex too restrictive?
Date: Sat, 29 Oct 2011 14:44:56 +0200 [thread overview]
Message-ID: <87y5w46k6v.fsf@gnu.org> (raw)
In-Reply-To: <877h3om4eq.wl%richard.lewis@gold.ac.uk> (Richard Lewis's message of "Sat, 29 Oct 2011 12:19:09 +0100")
Hi Richard,
Richard Lewis <richardlewis@fastmail.co.uk> 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
next prev parent reply other threads:[~2011-10-29 12:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-29 11:19 #+LaTeX_CLASS regex too restrictive? Richard Lewis
2011-10-29 12:44 ` Bastien [this message]
2011-10-29 16:34 ` Nick Dokos
2011-10-29 16:52 ` Richard Lewis
2011-10-29 17:59 ` Nick Dokos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y5w46k6v.fsf@gnu.org \
--to=bzg@altern.org \
--cc=emacs-orgmode@gnu.org \
--cc=richardlewis@fastmail.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.