[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Latex single dollar math delimiter question
From: |
emanuel . charpentier |
Subject: |
Re: [O] Latex single dollar math delimiter question |
Date: |
Thu, 08 Aug 2019 19:00:03 +0200 |
User-agent: |
Evolution 3.30.5-1.1 |
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 <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
A bitt too much reminescent of this xkcd [horror](
https://www.xkcd.com/1806/)...
HTH(BASIWn't)
--
Emmanuel Charpentier