TextMate gems

Defining the master file

Using TextMate for typesetting using Latex has many advantages. In particular if you take the time to integrate your editing workflow with a good PDF viewer such as Skim. I may write on it one day, this post is focused on how to define the master file in each of your writing projects.

I recommend that each of the papers will correspond to a TextMate project by storing all of the paper's artifacts (the text files you write, the .cls file, and so on) in its own directory.
It is often more modular to have the text of the paper divided to a number of source files such as abstract.tex, intro.tex, priorart.tex, and so on. One of these files should be designated the the master file and include all of the general instruction to Latex how to typeset your paper. If you did set up a convenient editing workflow a I suggested above you will also want to be able to compile (typeset) the document while you are editing any of the paper files (on OS X this would be ⌘R). For this to work (instead of just compiling the file you are currently editing) you need to define which one is the master file.
There are a number of ways to tell TextMate which is the master file, the easiest one is the following:

In the project directory create a file named .tm_properties and write the following instruction (the quotation marks are needed).

TM_LATEX_MASTER = "NameOfTheMasterFileOfThisProject.tex"

Back to code page