emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: Problems with sub/super-script when using: org-cdlatex + or


From: Anders Johansson
Subject: Re: [O] Bug: Problems with sub/super-script when using: org-cdlatex + org-pretty-entities + org-catch-invisible-edits
Date: Sat, 15 Mar 2014 14:54:52 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

2014-02-23 16:20, Anders Johansson wrote:

Hi,
I used the configuration:

org-catch-invisible-edits 'show
org-pretty-entities t

together with org-cdlatex. This breaks the insertion of subscripts
and superscripts through org-cdlatex because _{} is fontified and the
{} are hidden so typing for example: "a _ bc" results in "a_{b}c" (or
sometimes "a_bc", but should be "a_{bc}") and gives the message
"Unfolding invisible region around point before editing".

Setting org-catch-invisible-edits to nil let's cdlatex do it's work
so I guess an easy solution would be to "let" that in
org-cdlatex-underscore-caret.

Hi,
I realized that my solution won't work since
"org-check-before-invisible-edit" does it's work after
"org-cdlatex-underscore-caret" has called "cdlatex-sub-superscript"
and inserted "_{}".

Maybe then org-catch-invisible-edits should be nil all the time in
org-cdlatex-mode? But this would be unexpected. Maybe this can be
treated as a special case in "org-check-before-invisible-edit" in some
way?

Digging into it some more it's actually the "pretty entities" folding
which is the problem, regardless of org-check-before-invisible-edit. The
cursor jumps out of the {}-brackets after the first character, when the
hiding/folding is done. I have no idea what should be done about this.



In case anyone has the same problem, my current workaraound for this is disabling "pretty entities" for sub/superscript when using cdlatex:

(add-hook 'cdlatex-mode-hook
 (lambda () (when (eq major-mode 'org-mode)
  (make-local-variable 'org-pretty-entities-include-sub-superscripts)
   (setq org-pretty-entities-include-sub-superscripts nil))))


Cheers,
Anders Johansson



reply via email to

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