From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Issues with nested begin..end blocks in inline math environments Date: Sun, 15 Dec 2019 09:58:57 +0100 Message-ID: <87blsaarse.fsf@nicolasgoaziou.fr> References: <87d0d0e5kg.fsf@ucl.ac.uk> <87sglmw820.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41714) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igPk1-0005On-A4 for emacs-orgmode@gnu.org; Sun, 15 Dec 2019 03:59:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igPjy-0004tD-Rj for emacs-orgmode@gnu.org; Sun, 15 Dec 2019 03:59:04 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:47111) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igPjy-0004rT-2k for emacs-orgmode@gnu.org; Sun, 15 Dec 2019 03:59:02 -0500 In-Reply-To: <87sglmw820.fsf@gmail.com> (Matt Huszagh's message of "Sat, 14 Dec 2019 20:01:59 -0800") 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" To: Matt Huszagh Cc: "emacs-orgmode@gnu.org" , "Fraga, Eric" Hello, Matt Huszagh writes: > I'm submitting this as a patch. I've used it on hundreds of latex > fragments over the past week or so and haven't experienced any issues > (which is expected since the change is small). > > From a699b699ed4132839c39f1152868bb13364422c7 Mon Sep 17 00:00:00 2001 > From: Matt Huszagh > Date: Sat, 14 Dec 2019 19:54:41 -0800 > Subject: [PATCH] org-element.el: allow environment blocks in math delimiters > > * lisp/org-element.el (org-element--latex-begin-environment): Add a > non-capturing block for `\(' or `$' so that previously recognized > latex environments can also appear within an inline math environment. > > * lisp/org-element.el (org-element--latex-end-environment): Match the > begin environment noncapturing block with `$' or `\)'. I don't think this patch is a good idea, as it mixes elements from different types: LaTeX fragment (inline), and LaTeX environment (block). For example, the regexp you modify is used as a paragraph separator, which doesn't make sense for inline LaTeX. As a reminder, Org does not claim to support raw LaTeX syntax besides very simple constructs. If you want to insert elaborate LaTeX code, you can always use: #+begin_export latex ... #+end_export Regards, -- Nicolas Goaziou