[Tex/LaTex] Texstudio and Rnw Files


Is there any way in Texstudio, for the document tree to detect Rnw files called within a knitr chunk?

For example, the following would be ignored:


However, the following is a bit of a hack, the commented out input command still gets picked up in the tree, but naturally, it isn't used when the document is typeset.


Even though the above workaround does the job, it is annoying me having all these commented out files scattered around my documents….

Incidentally, if someone from Texstudio is reading this, one of the great features of Texstudio is the search feature within the document preview, ie you can search, then press alt and click on any word and it will take you to the exact point in the source file, however, this is problematic when Rnw files are involved, since it takes you to the .tex equivalent of the Rnw file, not the Rnw file which ultimately "produces" the tex file.

Best Answer

TeXstudio is mainly focused on LaTeX. Rnw is only supported in the syntax highlighting (because this was quite easy to implement), but it is not explicitly handled in the semantic parsing or the workflow.

You cannot make TeXstudio recognize these commands without modifying the source code, because these things are partly hard-coded into TXS.

Of course, you are welcome to post a feature request at http://sourceforge.net/p/texstudio/feature-requests/. But since we have limited resources, I cannot comment if and when we'll implement this.