From mboxrd@z Thu Jan 1 00:00:00 1970 From: emanuel.charpentier@gmail.com Subject: Re: Latex single dollar math delimiter question Date: Thu, 08 Aug 2019 19:00:03 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:57975) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvllp-00017H-I0 for emacs-orgmode@gnu.org; Thu, 08 Aug 2019 13:00:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvllo-0007cF-IL for emacs-orgmode@gnu.org; Thu, 08 Aug 2019 13:00:09 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:55725) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hvllo-0007b8-CW for emacs-orgmode@gnu.org; Thu, 08 Aug 2019 13:00:08 -0400 Received: by mail-wm1-x334.google.com with SMTP id f72so3078580wmf.5 for ; Thu, 08 Aug 2019 10:00:07 -0700 (PDT) In-Reply-To: 87lfw9kuba.fsf@ucl.ac.uk 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: e.fraga@ucl.ac.uk Cc: emacs-orgmode On Sun, 4 Aug 2019, Eric S Fraga had the gall to write : > By the way, you might be interested in the following configuration > snippet which makes org insert \(\) when you type a single $ (and a $ > if you type 2 of them in a row). > > #+begin_src emacs-lisp :tangle "esf-org.el" > ;; from Nicolas Richard > ;; Date: Fri, 8 Mar 2013 16:23:02 +0100 > ;; Message-ID: > (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 A bitt too much reminescent of this xkcd [horror]( https://www.xkcd.com/1806/)... HTH(BASIWn't) -- Emmanuel Charpentier