I use Eclipse, StatET and the Sweave plugin to write my R and Latex code. The cool thing is that R and Latex code can be put together into one file, however you end up with a syntax highlighting problem.
我使用Eclipse,StatET和Sweave插件来编写我的R和Latex代码。很酷的是R和Latex代码可以放在一个文件中,但最终会出现语法突出问题。
I have loads of R code and I very much like the Eclipse R syntax highlighting. But now combining R and Latex means that I have to work with .Rnw files where there is no particular syntax highlighting for R.
我有大量的R代码,我非常喜欢Eclipse R语法高亮。但现在结合使用R和Latex意味着我必须使用.Rnw文件,其中没有特定语法高亮显示R.
When I go to Eclipse -> Preferences -> Content Types I can add *.Rnw to "R script file" which makes Eclipse to open the .Rnw files with the standard R Editor. However, this means that I do not have syntax highlighting for Sweave any longer. In addition, the Sweave code is shown as an error in the R editor.
当我转到Eclipse - > Preferences - > Content Types时,我可以将* .Rnw添加到“R script file”,这使得Eclipse可以使用标准R Editor打开.Rnw文件。但是,这意味着我不再使用Sweave语法高亮显示。此外,Sweave代码在R编辑器中显示为错误。
My question is whether it is possible to combine different syntax highlighting styles in an easy way?
我的问题是,是否可以轻松地组合不同的语法高亮样式?
1 个解决方案
#1
1
I don't think any Eclipse plugins/editors really support mixing up several syntaxes inside one editor. At any rate it is not currently supported in Eclipse Platform.
我认为任何Eclipse插件/编辑器都不支持在一个编辑器中混合使用多个语法。无论如何,Eclipse Platform目前不支持它。
However you can try Eclipse Colorer plugin. It allows to switch coloring style for the current editor. It may mot support both R and Latex syntax, but you can create your own highlighting by adding your own HRC file.
但是,您可以尝试Eclipse Colorer插件。它允许切换当前编辑器的着色样式。它可能支持R和Latex语法,但您可以通过添加自己的HRC文件来创建自己的突出显示。
#1
1
I don't think any Eclipse plugins/editors really support mixing up several syntaxes inside one editor. At any rate it is not currently supported in Eclipse Platform.
我认为任何Eclipse插件/编辑器都不支持在一个编辑器中混合使用多个语法。无论如何,Eclipse Platform目前不支持它。
However you can try Eclipse Colorer plugin. It allows to switch coloring style for the current editor. It may mot support both R and Latex syntax, but you can create your own highlighting by adding your own HRC file.
但是,您可以尝试Eclipse Colorer插件。它允许切换当前编辑器的着色样式。它可能支持R和Latex语法,但您可以通过添加自己的HRC文件来创建自己的突出显示。