[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Inline LaTeX formulae
From: |
Eric S Fraga |
Subject: |
Re: [O] Inline LaTeX formulae |
Date: |
Thu, 7 May 2015 08:42:12 +0100 |
User-agent: |
Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4 (gnu/linux) |
On Wednesday, 6 May 2015 at 13:35, Titus von der Malsburg wrote:
[...]
> So if the problem is only due to mistaken optimization, it would perhaps
> be best to just revert to the previous code.
Or if the "optimisation" was key to getting acceptable performance,
maybe discourage the use of $...$ and emphasise the use of \(...\). The
latter is less fragile and is easy to generate by typing $ using the
following function and binding:
#+begin_src emacs-lisp
;; 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
The problem with $ in org mode is that it is a valid standalone
character (i.e. currency symbol). Having it perform two functions
(symbol and LaTeX directive) makes it difficult to optimise
performance.
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.1, Org release_8.3beta-820-gd92ef9
- [O] Inline LaTeX formulae, Titus von der Malsburg, 2015/05/05
- Re: [O] Inline LaTeX formulae, Rasmus, 2015/05/05
- Re: [O] Inline LaTeX formulae, Marcin Borkowski, 2015/05/05
- Re: [O] Inline LaTeX formulae, Titus von der Malsburg, 2015/05/05
- Re: [O] Inline LaTeX formulae, Marcin Borkowski, 2015/05/05
- Re: [O] Inline LaTeX formulae, Rasmus, 2015/05/06
- Re: [O] Inline LaTeX formulae, Titus von der Malsburg, 2015/05/06
- Re: [O] Inline LaTeX formulae,
Eric S Fraga <=
- Re: [O] Inline LaTeX formulae, Titus von der Malsburg, 2015/05/07
- Re: [O] Inline LaTeX formulae, Nicolas Goaziou, 2015/05/07
- Re: [O] Inline LaTeX formulae, Titus von der Malsburg, 2015/05/08
- Re: [O] Inline LaTeX formulae, Nicolas Goaziou, 2015/05/08
- Re: [O] Inline LaTeX formulae, Titus von der Malsburg, 2015/05/08
- Re: [O] Inline LaTeX formulae, Nicolas Goaziou, 2015/05/09