[TxMt] Re: Syntax highlighting problem with .rnw file (SWeave bundle)

Peter Cowan cowan.pd at gmail.com
Tue Aug 30 16:39:38 UTC 2011


On Wed, Aug 24, 2011 at 7:23 AM, Gregory Penn <gregory.penn at gmail.com> wrote:
> Thanks to Eric Cheng, I was able to update my SWeave bundle from github and it's commands seem to be working correctly. So on to the next problem . . .
>
> TextMate's syntax highlighting in foo.rnw isn't recognizing R code between the "<<>>=" and "@" tags that delimit it, instead it is treated as LaTeX code. This is a problem because R makes frequent use of the "$" symbol, which toggles math-mode in LaTeX. As a result, where I have an odd number of "$"s in a chunk of R code, any LaTeX following that R code will appear highlighted green, as though it were in math mode.
>
> I've read the documentation for scopes and languages, but didn't understand it well enough to figure out where this is going wrong and how to fix it.
>

I assume that you have the R bundle installed?  Are you sure that the
language is set to SWeave when you open .Rnw file?  Have you tried
putting empty lines before and after both "<<>>=" and "@" tags?  I
seem to remember a small issue with that in the SWeave bundle, if that
is the issue I might have a fix I can dig out.

HTH

Peter

> Thanks in advance,
> Gregory Penn
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
>


More information about the textmate mailing list