title: Get Emacs to ignore contents of \Sexpr{} command in Sweave document to prevent incorrect $-based syntax highlighting
body: <p>When editing an Sweave document in LaTeX (using the Noweb mode), Emacs knows to "ignore" code that is in &lt;&lt;>>= blocks. However, for interstitial \Sexpr{} blocks, this isn't the case. Given that R references by columns via '$' and LaTeX uses $ to set-off equations, these \Sexpr{} blocks often break the syntax highlighting, like so: </p>
  
  <p><img src="https://i.stack.imgur.com/RH5tg.png" alt="Emacs highlighting issue when using Sweave"></p>
  
  <p>I have a very rudimentary understanding the elisp &amp; Emacs syntax highlighting, but my hope is that it might be possible to add something to .emacs that will disable any parsing/$ detection within \Sexpr{}'s.   </p>