When I type an underscore _
in org-mode
, it automatically generates math mode, i.e. $_{}$
and it puts the cursor between the braces. Is there a way to disable this when in edit mode but not in math mode?
At the end my question is not very smart. I am using cdlatex
to type equations and math easily in orgmode
. Then the answer is in the documentation under "PAIR INSERTION of (), [], {}, and $$":
Also, the keys _ and ^ will insert "_{}" and "^{}", respectively, and, if necessary, also a pair of dollar signs to switch to math mode.
I didn't assume that this layer operates outside of equations, so I did not know this is the issue.
I am not sure if this is the desired behavior of cdlatex
or not. Personally, I would prefer to be able to write underscores without the automatic addition of _${}$
.
UPDATE
I got the behavior I wanted by setting up properly smartparens
and by using org-cdlatex-mode
(note that it is not cdlatex-mode
). In this way the cdlatex
behavior regarding underscores described above is only implemented inside equations (namely, inside $ $
, \( \)
, latex equations etc). When typing text, it does not generate any extra characters when typing _
.
See the proper configuration in the answer of my other question here.
C-h c _ RET
say? It should say_ runs the command org-self-insert-command
. If you have any minor modes enabled, what are they? What do you mean byedit mode
andmath mode
in this context? What IS the context? – NickD Mar 10 '20 at 18:07emacs -Q
. We cannot help you if you do not tell us what in your setup causes that behavior. On the other hand I assume that if you tell us the cause the solution will be quite simple. – Tobias Mar 10 '20 at 22:35cdlatex
layer I am using. Therefore the question is kind of redundant. Do you think it is better to simply delete it? – bobsacameno Mar 11 '20 at 18:40