0

I have a project which consists of multiple .tex files, which I am typesetting using Texworks. Clicking the source code in any file while holding the Alt key shows correctly the corresponding position in the pdf and vice versa. However, clicking the typeset button only works in main.tex or main.pdf but does not work e.g. in chapter1.tex (does not have the header and is not a standalone .tex file and Texworks does not realize it needs to start building main.tex which includes chapter1.tex).

It is quite upsetting as I am mostly editing the chapters and clicking the button in the toolbar just gives me errors and then I have to go and search for main.tex and click it there. Is there a way to script Texworks or annotate the .tex files so that the typeset button works from any file?

For now I have hidden the toolbar in the chapter windows so that I dont click it by mistake but it is still not very user-friendly.

3
  • 1
    See e.g. tex.stackexchange.com/questions/287056/…: you are I think looking for %!TEX root =main.tex as a 'magic comment' in each chapter file.
    – Joseph Wright
    Commented Feb 23, 2016 at 10:17
  • On that basis I've marked as a dupe: more for the answer than the question!
    – Joseph Wright
    Commented Feb 23, 2016 at 10:36
  • @JosephWright Sure.
    – the swine
    Commented Feb 23, 2016 at 10:44

0

Browse other questions tagged .