From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Inline LaTeX formulae Date: Thu, 7 May 2015 08:42:12 +0100 Message-ID: <87bnhwq1ez.fsf@delle7240.chemeng.ucl.ac.uk> References: <876186zsrc.fsf@posteo.de> <874mnqzp4t.fsf@posteo.de> <87wq0mc8bc.fsf@gmx.us> <87vbg5xx4z.fsf@posteo.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqIaP-0002Yo-N1 for emacs-orgmode@gnu.org; Thu, 07 May 2015 05:59:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YqI8y-0001Vb-Du for emacs-orgmode@gnu.org; Thu, 07 May 2015 05:31:16 -0400 Received: from mail-db3on0136.outbound.protection.outlook.com ([157.55.234.136]:22076 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YqI8y-0001Sg-46 for emacs-orgmode@gnu.org; Thu, 07 May 2015 05:31:00 -0400 In-Reply-To: <87vbg5xx4z.fsf@posteo.de> (Titus von der Malsburg's message of "Wed, 6 May 2015 13:35:08 -0700") 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: Titus von der Malsburg Cc: emacs-orgmode@gnu.org, Rasmus On Wednesday, 6 May 2015 at 13:35, Titus von der Malsburg wrote: [...] > So if the problem is only due to mistaken optimization, it would perhaps > be best to just revert to the previous code. Or if the "optimisation" was key to getting acceptable performance, maybe discourage the use of $...$ and emphasise the use of \(...\). The latter is less fragile and is easy to generate by typing $ using the following function and binding: #+begin_src emacs-lisp ;; from Nicolas Richard ;; Date: Fri, 8 Mar 2013 16:23:02 +0100 ;; Message-ID: <87vc913oh5.fsf@yahoo.fr> (defun yf/org-electric-dollar nil "When called once, insert \\(\\) and leave point in between. When called twice, replace the previously inserted \\(\\) by one $." (interactive) (if (and (looking-at "\\\\)") (looking-back "\\\\(")) (progn (delete-char 2) (delete-char -2) (insert "$")) (insert "\\(\\)") (backward-char 2))) (define-key org-mode-map (kbd "$") 'yf/org-electric-dollar) #+end_src The problem with $ in org mode is that it is a valid standalone character (i.e. currency symbol). Having it perform two functions (symbol and LaTeX directive) makes it difficult to optimise performance. -- : Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-820-gd92ef9