emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: emanuel.charpentier@gmail.com
To: e.fraga@ucl.ac.uk
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Latex single dollar math delimiter question
Date: Thu, 08 Aug 2019 19:00:03 +0200	[thread overview]
Message-ID: <ceeb96657f2ec8c6fca22d06fe95a90fa30a53b3.camel@gmail.com> (raw)
In-Reply-To: 87lfw9kuba.fsf@ucl.ac.uk

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

             reply	other threads:[~2019-08-08 17:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08 17:00 emanuel.charpentier [this message]
2019-08-09  8:56 ` Latex single dollar math delimiter question Fraga, Eric
  -- strict thread matches above, loose matches on Subject: below --
2019-08-04  5:31 Jarmo Hurri
2019-08-04 12:07 ` Fraga, Eric
2019-08-05  8:58   ` Jarmo Hurri
2019-08-05 10:35     ` Nicolas Goaziou
2019-08-05 11:04     ` Fraga, Eric

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=ceeb96657f2ec8c6fca22d06fe95a90fa30a53b3.camel@gmail.com \
    --to=emanuel.charpentier@gmail.com \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /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).