[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Depreciating TeX-style LaTeX fragments
From: |
Eric S Fraga |
Subject: |
Re: Depreciating TeX-style LaTeX fragments |
Date: |
Sun, 16 Jan 2022 12:10:30 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
On Sunday, 16 Jan 2022 at 00:36, Timothy wrote:
> Hmm. Not sure about this. Keystroke wise we’re comparing $$
> to \(. The latter can be completed by smartparens, but since
> single dollars are reasonable Org content the former can’t.
> At this point the only argument is muscle memory, and if
As an aside, I will suggest including the following code in your Emacs
customization:
#+begin_src emacs-lisp :tangle "esf-org.el"
;; from Nicolas Richard <theonewiththeevillook@yahoo.fr>
;; 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
I've been using this for years now and it works very well: I also had
$...$ in my muscle memory.
The only time it can be annoying is if you wish to edit/write org table
expressions directly instead of using org's features for this, such as
editing the equation (C-c ') or inserting one (C-c = with or without
C-u).
--
: Eric S Fraga, with org release_9.5.2-306-g9623da in Emacs 29.0.50
- Re: Org Syntax Specification, (continued)
- Re: Org Syntax Specification, Sébastien Miquel, 2022/01/15
- Re: Depreciating TeX-style LaTeX fragments (was: Org Syntax Specification), Timothy, 2022/01/15
- Re: Depreciating TeX-style LaTeX fragments (was: Org Syntax Specification), Sébastien Miquel, 2022/01/16
- Re: Depreciating TeX-style LaTeX fragments, Martin Steffen, 2022/01/16
- Re: Depreciating TeX-style LaTeX fragments, Colin Baxter 😺, 2022/01/16
- Re: Depreciating TeX-style LaTeX fragments, Tim Cross, 2022/01/16
- Re: Depreciating TeX-style LaTeX fragments, Juan Manuel Macías, 2022/01/16
- Re: Depreciating TeX-style LaTeX fragments, Colin Baxter 😺, 2022/01/16
- Re: Depreciating TeX-style LaTeX fragments, Greg Minshall, 2022/01/16
- Re: Depreciating TeX-style LaTeX fragments, Rudolf Adamkovič, 2022/01/16
- Re: Depreciating TeX-style LaTeX fragments,
Eric S Fraga <=
- Re: Depreciating TeX-style LaTeX fragments, Anthony Cowley, 2022/01/16
Re: Org Syntax Specification, Tom Gillespie, 2022/01/17