Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Treating files with .Rtex extension like knitr/Sweave files in RStudio

Is there any way to teach RStudio to treat files with .Rtex extension as knitr/Sweave documents (i.e. like .Rnw files)?

like image 972
RoyalTS Avatar asked Oct 02 '22 21:10

RoyalTS


1 Answers

A quick look round the source makes me think that file type associations are defined here:

https://github.com/rstudio/rstudio/blob/aaee8fbd88c213a301b9f24d1cecd64ccab0df9a/src/gwt/src/org/rstudio/studio/client/common/filetypes/FileTypeRegistry.java

I suspect adding:

 register("*.rtex", SWEAVE, icons.iconRsweave());

around line 170 will do it. I don't have a machine set up for building RStudio at the moment so can't try it...

like image 176
Spacedman Avatar answered Oct 05 '22 10:10

Spacedman