[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] math in parentheses
From: |
Eric S Fraga |
Subject: |
Re: [O] math in parentheses |
Date: |
Fri, 31 Oct 2014 18:09:37 +0000 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.3 (gnu/linux) |
On Wednesday, 29 Oct 2014 at 13:24, Rasmus wrote:
[...]
> Just out of curiosity, do you actually type \(·\) or have you somehow
> remapped $·$ to insert \(·\)?
I have been using the following for quite some time:
#+begin_src emacs-lisp
;; from Nicolas Richard <address@hidden>
;; Date: Fri, 8 Mar 2013 16:23:02 +0100
;; Message-ID: <address@hidden>
(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
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.3beta-372-gdd70cf
- Re: [O] math in parentheses, (continued)
- Re: [O] math in parentheses, Nick Dokos, 2014/10/28
- Re: [O] math in parentheses, Andreas Leha, 2014/10/28
- Re: [O] math in parentheses, Rasmus, 2014/10/29
- Re: [O] math in parentheses, Nick Dokos, 2014/10/29
- Re: [O] math in parentheses,
Eric S Fraga <=