I'm working with a Sweave (.Rnw) file in TeXStudio (2.11.0). I have set up custom build commands to knit the Sweave file to LaTeX, with the idea to work on the .Rnw file exclusively.

My problem is that TeXStudio automatically opens the corresponding .tex file, when I examine the preview PDF. As both .Rnw and .tex look about the same, it is very easy to inadvertently continue editing the .tex file instead of the .Rnw, and get the recent changes overwritten at a later stage, when the .Rnw is knit to .tex. I try to keep this in mind, but accidents still occur now and then, despite my best efforts. Only a small extra tab appears when the .tex file is opened, and when you have many windows open, this is easy to miss.

I have tried disabling the "Cursor follows scrolling" and its opposite option at the bottom of the preview pane; that did not work. I also could not find anything in the Settings to prevent the .tex from opening automatically.

I wonder if there is a solution to prevent the .tex file from opening automatically. Thank you!

  • "Cursor follows scrolling" disables opening the corresponding .tex file if you're just scrolling through the pdf preview. But if you are also searching in the pdf, you need to disable (uncheck) Sync in the search window. – alwaysask Aug 10 '16 at 12:46
  • @alwaysask And how does one go about that? Thank you. – Maxim.K Aug 10 '16 at 12:59
  • 1
    Click in the pdf preview window, press Ctrl+F and uncheck the rectangle before 'Sync' which is to the right side of the search window. – alwaysask Aug 10 '16 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.