The Problem: This is neiter an issue of TeXstudio nor of Sumatra PDF. Instead it's a result of the combination of Synctex and the build chain is rnw -> tex -> pdf
. Synctex is originally designed to provide a connection between the tex file and the pdf. It does not know anything about the rnw.
Towards a Solution: I'm not an R user and therefore have no ready solution. However the package patchDVI seems to be the thing to look for. Additionally, this description may help: http://starlinq.livejournal.com/5762.html
Use any simple.TeX Ctrl+Shift+P (Build)
SumatraPDF should have fired up with the compiled PDF
Go To Settings > Advanced Options
and going down the entries check or change the following
ReuseInstance = true
ReloadModifiedDocuments = true
InverseSearchCmdLine = "C:\Program Files\Sublime Text 3\sublime_text.exe" "%f:%l"
EnableTeXEnhancements = true
UseTabs = true
In SumatraPDF Settings > Advanced options there are other settings for color of forward search highlight etc. I recommend you set HighlightPermanent = true
DONT FORGET TO CTRL+S (File Save)
Now a double click in the PDF should take you back to Sublime Text either in an included file or the main file. IF not, check the syntax of the InverseSearchCmdLine = matches YOUR location for sublime_text.exe
Be aware in some languages the path may be translated from a different localised one.
If you have a whatever.pdf, whatever.synctex(.gz) and whatever.tex file in the same folder then you can start by opening the PDF and a double click anywhere will open the tex editor with the cursor at the right file position even if the editor was not started first.
If the file keeps opening a fresh tex file then one or more of the following needs fixing
1) The path to sublime is incorrect
2) The synctex file is incorrect (check the synctex file time is the same as the PDF)
3) The editor is not set correctly so as to reopen the focused file.
There are several settings in Sublime LaTeX that can change behaviour
for one affecting focus control see SumatraPDF automatically returns to Sublime Text 3
If you are still having problems with LaTeXTools you need to raise them at https://github.com/SublimeText/LaTeXTools
Best Answer
You have an error in your command line. The
\
afterTeXnicCenter.exe
has to be before"
. So please correct the call for SumatraPDF to:With the current versions of SumatraPDF (version 3.0) and TeXnicCenter (version 2.2) the inverse search runs like a charm.
If you have installed the 64 bit version of TeXnicCenter please change
C:\Program Files (x86)\TeXnicCenter
toC:\Program Files\TeXnicCenter
.