6

I worked and compiled a document and create a new one. I attempt "Build & View" newly created document but TeXstudio compiles only old one.

  • please add the code to make us understand what you say – Vaibhav Feb 28 '14 at 10:07
  • Mostly your document is not getting compiled. Remove pdf file manually and again compile and see if you get errors – Vaibhav Feb 28 '14 at 10:08
  • You can add a master file to your project. file -> close all should do the trick – Johannes_B Feb 28 '14 at 10:13
  • Sounds like something that could happen if the old document was still open, and defined as a Master document. Is the old one still open? To set the new one as master, do Options --> Define Current document as Master document. – Torbjørn T. Mar 1 '14 at 9:06
  • @SteveSamuels: Sorry, I cannot figure out how to do it – Harvester Mar 11 '14 at 8:54
12

TeXstudio allows you to define a given file as a master document. The purpose of this is to ease compiling when working with multiple files. For example when writing a document where each chapter is in a separate file, one still has to compile the main file where the preamble is found, not the chapter file (starting with \chapter). My defining the main file as a master document under Options --> Root document (in older versions of TeXstudio this is Options --> Define Current Document as Master Document), one doesn't have to switch to this before compiling.

Hence, if you still have your old file open and this is selected as master document, when you try to compile the new file, the old one will be compiled. To fix this, set the new file as master document instead.

  • Yes, now I understand the need for such organization. Actually I really needed a option "Online Preview". – Harvester Mar 11 '14 at 9:01
  • In new versions (such as TeXstudio 2.12.0), this options has been renamed to Root Document and it's available under Options menu. – jiun Mar 25 '17 at 10:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.