[Tex/LaTex] %!TEX root = to parent directory


Currently, I am writing a large report. In my previous ones, I always had the chapters and the main file (thesis.tex) in the same directory as the individual chapters. This time, however, I created a subfolder called "chapters" and put the chapter .tex files in there. But obviously, the command

%!TEX root = thesis.tex"`

which I previously put at the beginning of each chapter.tex, does not work anymore. Since I work on the report from different locations, I can not define an absolute path but need to define a relative one. I tried %!TEX root = ../thesis.tex and /%!TEX root = thesis.tex, both of which do not work.

I found threads and solutions for \input and other commands, none of which solve by problem, though. If anyone was able to shed some light here, I'd be very thankful!

Best Answer

Try %!TEX root = ../thesis.tex