使用.Rtex扩展名处理文件,例如RStudio中的knitr/Sweave文件

Roy*_*lTS 5 latex r rstudio knitr

有没有办法教RStudio处理.Rtex扩展名为knitr/Sweave文件的文件(比如.Rnw文件)?

Spa*_*man 4

快速浏览一下源代码让我认为文件类型关联是在这里定义的:

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

我怀疑添加:

 register("*.rtex", SWEAVE, icons.iconRsweave());
Run Code Online (Sandbox Code Playgroud)

170号线左右就可以了。我目前没有设置用于构建 RStudio 的机器,因此无法尝试......