From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: Timothy <tecosaur@gmail.com>
Cc: sebastien.miquel@posteo.eu, org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: Depreciating TeX-style LaTeX fragments
Date: Sun, 16 Jan 2022 12:10:30 +0000 [thread overview]
Message-ID: <87k0ezdgp5.fsf@ucl.ac.uk> (raw)
In-Reply-To: <87lezgly20.fsf@gmail.com> (Timothy's message of "Sun, 16 Jan 2022 00:36:35 +0800")
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
next prev parent reply other threads:[~2022-01-16 12:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-09 18:02 Org Syntax Specification Timothy
2022-01-15 12:40 ` Sébastien Miquel
2022-01-15 16:36 ` Depreciating TeX-style LaTeX fragments (was: Org Syntax Specification) Timothy
2022-01-16 8:08 ` Sébastien Miquel
2022-01-16 9:23 ` Depreciating TeX-style LaTeX fragments Martin Steffen
2022-01-16 9:46 ` Colin Baxter 😺
2022-01-16 11:11 ` Tim Cross
2022-01-16 13:26 ` Juan Manuel Macías
2022-01-16 14:43 ` Colin Baxter 😺
2022-01-16 15:16 ` Greg Minshall
2022-01-16 17:45 ` Rudolf Adamkovič
2022-01-16 12:10 ` Eric S Fraga [this message]
2022-01-16 14:30 ` Anthony Cowley
2022-01-18 0:54 ` Org Syntax Specification Tom Gillespie
2022-01-18 12:09 ` Ihor Radchenko
2022-01-19 1:22 ` Tom Gillespie
2022-01-19 11:58 ` Ihor Radchenko
2022-09-25 9:09 ` Bastien
2022-09-25 21:28 ` Rohit Patnaik
2022-11-26 2:41 ` Ihor Radchenko
2022-11-26 6:24 ` Bastien
2022-11-26 6:05 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87k0ezdgp5.fsf@ucl.ac.uk \
--to=e.fraga@ucl.ac.uk \
--cc=emacs-orgmode@gnu.org \
--cc=sebastien.miquel@posteo.eu \
--cc=tecosaur@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).