From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] curly nested latex fragments Date: Sun, 06 Jul 2014 22:11:43 +0200 Message-ID: <87pphixn5s.fsf@nicolasgoaziou.fr> References: <86simqocpz.fsf@moguhome00.in.awa.tohoku.ac.jp> <878uoiy3bd.fsf@nicolasgoaziou.fr> <86pphshr82.fsf_-_@moguhome00.in.awa.tohoku.ac.jp> <87simng6tw.fsf@nicolasgoaziou.fr> <86k37zi63g.fsf@moguhome00.in.awa.tohoku.ac.jp> <87pphqmvdr.fsf@nicolasgoaziou.fr> <86r426gj8k.fsf@moguhome00.in.awa.tohoku.ac.jp> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3smI-0002b1-5B for emacs-orgmode@gnu.org; Sun, 06 Jul 2014 16:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3smA-0006hb-C5 for emacs-orgmode@gnu.org; Sun, 06 Jul 2014 16:11:14 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:c:538::197]:38048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3smA-0006h2-4p for emacs-orgmode@gnu.org; Sun, 06 Jul 2014 16:11:06 -0400 In-Reply-To: <86r426gj8k.fsf@moguhome00.in.awa.tohoku.ac.jp> (heroxbd@gentoo.org's message of "Tue, 01 Jul 2014 06:50:19 +0900") 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: heroxbd@gentoo.org Cc: emacs-orgmode@gnu.org Hello, heroxbd@gentoo.org writes: > Nicolas Goaziou writes: >> Unfortunately, this is ambiguous with Org macro syntax. For example, it >> would match: >> >> \alpha{{{macro(arg)}}} >> >> which is an entity followed by a macro. > > Err, insert a white space? > > \alpha {{{macro(arg)}}} Well, it may not be equivalent, depending on the macro. Also, this is not the point. \alpha{{{macro(arg)}}} is valid, so we have to parse it as something. In this case, there are two possible interpretations. I want to avoid it. > Or expand the macro before latex-or-entity matching. Macro expansion only happens at the beginning of the export process. The problem you want to solve isn't necessarily tied to the export mechanism. Also, as you mention "latex-or-entity", which doesn't exist anymore, you should look at the parsing code in master instead of maint, in particular to `org-element-latex-fragment-parser'. Maybe the mechanism used to find a macro can be improved to match more of them without matching anything else. Regards, -- Nicolas Goaziou