emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: emacs-orgmode@gnu.org
Subject: Re: 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	[thread overview]
Message-ID: <87zieh7vim.fsf@t3610> (raw)
In-Reply-To: <108e9a8cdc924e71afc3324c4bd4d1eb@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> (Joe Corneli's message of "Fri, 12 May 2017 18:06:44 +0000")

[-- Attachment #1: Type: text/plain, Size: 1272 bytes --]

On Friday, 12 May 2017 at 18:06, Joe Corneli wrote:
> On Fri, May 12, 2017 at 4:37 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> 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 <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

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 194 bytes --]

      parent reply	other threads:[~2017-05-12 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-12 13:41 Bug: parsing latex ``$\mathit{math}$'' in export [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)] Joe Corneli
2017-05-12 15:37 ` Nicolas Goaziou
2017-05-12 18:06   ` Joe Corneli
2017-05-13  7:24     ` Nicolas Goaziou
     [not found]   ` <108e9a8cdc924e71afc3324c4bd4d1eb@HE1PR01MB1898.eurprd01.prod.exchangelabs.com>
2017-05-12 18:57     ` Eric S Fraga [this message]

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=87zieh7vim.fsf@t3610 \
    --to=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).