emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: parsing latex ``$\mathit{math}$'' in export [9.0.5 (release


From: Eric S Fraga
Subject: Re: [O] Bug: parsing latex ``$\mathit{math}$'' in export [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]
Date: Fri, 12 May 2017 19:57:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

On Friday, 12 May 2017 at 18:06, Joe Corneli wrote:
> On Fri, May 12, 2017 at 4:37 PM, Nicolas Goaziou <address@hidden> wrote:
>
>
>> I'm not convinced it is worth changing the syntax class of "'" or even
>> making a special case for "'". You can get rid of this problem using
>> \(P\) instead.
>
> Thanks for suggesting this work around, I didn't know that bit of syntax!

And if typing $...$ is hardwired, as it is for me, or because it's
easier to type than the alternative, you can use this code snippet to
change a $ when typed on the fly to \(..\):

#+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

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.6-425-gf4fca1

Attachment: signature.asc
Description: PGP signature


reply via email to

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