tags:

views:

70

answers:

1

When editing .Rnw files with emacs, sometimes it gets confused as to if I am in math mode or not. Then, the syntax highlighting gets messed up, and C-f-i inserts \textit{} and \mathit{} opposite to how it normally should. Is seems like there is some bool storing the state of math mode or not, and it gets inadvertently flipped. Is there a way I can manually flip it back?

A: 

I've noticed that this usually corrects itself if I insert a new R chunk and then delete it. Not an elegant solution, but it works for me.

Ista
Thanks. Yes, not elegant, and I can't always get that to fix it. I need to figure out how to reproduce the problem and try to isolate it. I think the first step is to be very close for an important document... :)
stevejb