From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [bug?, org-element] latex-environment delimiters must be at BOL Date: Wed, 16 Jul 2014 15:04:40 +0200 Message-ID: <87iomxjvyv.fsf@nicolasgoaziou.fr> References: <877g3ltomt.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33379) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7OsR-0006Ym-Df for emacs-orgmode@gnu.org; Wed, 16 Jul 2014 09:04:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X7OsI-0000it-7B for emacs-orgmode@gnu.org; Wed, 16 Jul 2014 09:04:07 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:47835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X7OsI-0000il-0d for emacs-orgmode@gnu.org; Wed, 16 Jul 2014 09:03:58 -0400 In-Reply-To: <877g3ltomt.fsf@gmx.us> (rasmus@gmx.us's message of "Thu, 10 Jul 2014 13:54:50 +0200") 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: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: > Looking at org-element-latex-environment-parser LaTeX environments are > recognized as "[ \t]*\\\\begin{\\([A-Za-z0-9]+\\*?\\)}" (for start) > and "^[ \t]*\\\\end{%s}[ \t]*$" (for the end). > > However, for e.g. small equations one might want to write > > (*) \begin{equation} PLACEHOLDER \end{equation}, > > i.e. in one line. This fails to be recognized as the latter regexp is > not satisfied. For code generated by humans this is not an issue. > However, e.g. SymPy generates code in the (*) format. Prefixing (*) > with "#+LATEX:" will prevent ox-html from recognizing it. > > Should org-element try to catch one-line environments as the one > above? Or is it "a can of worms"? I think allowing them is possible, as long as \end{equation} ends the last line (with trailing whitespaces tolerated). I assume that, for simplicity, PLACEHOLDER could be longer than one line, too. If Bastien agrees and if you want to provide a patch, please be sure to include tests in test-org-element.el, and appropriate changes to "Org Syntax" document. The manual may need to be updated, too. Regards, -- Nicolas Goaziou