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.

  • You can try WinEdt with its R-Sweave plugin. May 25, 2013 at 15:41
  • Have you tried RStudio? It also has a previewer, and the SyncTeX reverse search, if set up properly, will take you to the .Rnw file.
    – krlmlr
    May 25, 2013 at 16:43
  • @krimir I use rstudio all the time, but I am not sure that I have seen what you are talking about... May 25, 2013 at 22:51

1 Answer 1


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.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .