TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My problem is that I want to have different .tex files for the preamble, the presentation aroundings (my target is a beamer PDF file) and the content of the presentation.

Mostly I'll be working on the content file. I even think about partitioning this content .tex file into several chapter files for a better overview. My problem with this solution is that I have to open the presentation.tex file to typeset the whole beamer PDF for looking at the results of my previous changes on the content files. (My presentation.tex file includes the preamble and the content.)

Is there any way to get TeXShop to always typeset one particular file (my presentation.tex) although I'm currently working on a different one (e.g. the content.tex)?

A shortcut? A command in the .tex file? An option in TeXShop? Anything?

share|improve this question
I know that TeXnicCentre does this through creating a project, but that doesn't work on a Mac. – Werner Dec 23 '11 at 20:24
up vote 23 down vote accepted

TeXshop, like TeXworks, allows you to define some stuff by special comments at the beginning of a file. To define a master file, add

% !TEX root = path/to/root.tex

to the beginning of your file. This will cause root.tex to be compiled instead of the current file.

share|improve this answer
Thank you very much, this solves the main problem! :) I'm just missing one little thing: how can I prevent the presenation.tex file from opening while typesetting the content.tex? – CGee Dec 23 '11 at 20:33
@Dschee I'm afraid I can't help there. (I don't even have a Mac myself.) – Torbjørn T. Dec 23 '11 at 20:44
OK, doesn't matter. After the first start it's resting in background so there's no problem. Thanks again! And merry christmas. :) – CGee Dec 23 '11 at 20:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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