emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Change key binding in math mode only


From: Bastien
Subject: Re: [O] Change key binding in math mode only
Date: Thu, 13 Mar 2014 16:11:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Rafael,

Rafael <address@hidden> writes:

> I remembered that Org knows already if point is inside a math
> expression, so by looking at the source I came up with the following,
> that seems to work. Sorry for the noise.

That's not noise...

> #+BEGIN_SRC emacs-lisp
>    (defun org-cdlatex-real-numbers ()
>      (interactive)
>      (if (org-inside-LaTeX-fragment-p)
>          (insert "\\mathbb{R}")
>        (insert "R")
>        ))
>    
>    (add-hook 'org-mode-hook
>              (lambda ()
>                (local-set-key (kbd "R")
>                               'org-cdlatex-real-numbers
>                               )))
> #+END_SRC

... that's a contribution -- thanks for it!

-- 
 Bastien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]