From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: LaTeX-export: letters after $..$ turn off math-mode Date: Sat, 16 Feb 2013 12:48:16 +0100 Message-ID: <87r4kg5vjz.fsf@gmail.com> References: <85272.1359978716@greg-minshalls-mbp.local> <87mwv58c8n.fsf@bzg.ath.cx> <87bobk7m9l.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6gFt-0001bX-8Z for emacs-orgmode@gnu.org; Sat, 16 Feb 2013 06:48:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U6gFs-00068D-5F for emacs-orgmode@gnu.org; Sat, 16 Feb 2013 06:48:33 -0500 Received: from mail-wi0-f172.google.com ([209.85.212.172]:51142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U6gFr-000685-Uq for emacs-orgmode@gnu.org; Sat, 16 Feb 2013 06:48:32 -0500 Received: by mail-wi0-f172.google.com with SMTP id ez12so2029129wid.5 for ; Sat, 16 Feb 2013 03:48:31 -0800 (PST) In-Reply-To: <87bobk7m9l.fsf@gmail.com> (Nicolas Goaziou's message of "Sat, 16 Feb 2013 08:25:58 +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: Bastien Cc: Greg Minshall , emacs-orgmode@gnu.org Completing myself, > IMO, I would call that an Org limitation. Org is not LaTeX, even if it > provides many LaTeX facilities. Also, the OP's problem can be solved in > many ways under Emacs. For example, I use "mt" (both "m" and "t" are on > my home row) as a snippet to insert "\(\)" in an Org buffer and put > point inside. I would even go further. The following text has been in documentation for years: * Text within the usual LaTeX math delimiters. To avoid conflicts with currency specifications, single `$' characters are only recognized as math delimiters if the enclosed text contains at most two line breaks, is directly attached to the `$' characters with no whitespace in between, and if the closing `$' is followed by whitespace, punctuation or a dash. For the other delimiters, there is no such restriction, so when in doubt, use `\(...\)' as inline math delimiters. and so has been this excerpt from `org-inside-LaTeX-fragment-p' docstring: Even though the matchers for math are configurable, this function assumes that \\begin, \\(, \\[, and $$ are always used. Only the single dollar delimiters are skipped when they have been removed by customization. This function does a reasonably good job, but can locally be fooled by for example currency specifications. For example it will assume being in inline math after \"$22.34\". The LaTeX fragment formatter will only format fragments that are properly closed, but during editing, we have to live with the uncertainty caused by missing closing delimiters. We cannot afford two maintain two implementations, one of them being frail, of the _same concept_. It's way better to focus on one of them, and make sure it is solid. It also means a slightly lighter Org, and less code to debug, which is always good. Thus, I suggest to announce that $ (both $ and $$, even though $$ don't have problems /per se/) symbols for should be avoided. Then, in a year or so, we can remove them completely from code base. Regards, -- Nicolas Goaziou