Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How can I set the main file in Textmate 2 in order to make it compile my complete dissertation and not the file I am editing?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You need to tell your Latex editor where the main file of your dissertation is placed, in regard to the document you are editing. To define it, add this command to the header of the .tex file that you are editing:

%!TEX root = ../Main.tex

Just edit the path to your main file (in this example "../Main.tex") from the file you are editing. I usually have a file "main.tex" as master document and I link the chapters or sections of the document which are placed in sub-folder.

To try it out, open the menu Bundles -> Latex -> Project Management -> Open Master File With this line in the head the main.tex file will open. Then you can compile it directly from the included .tex file with Bundles -> Latex -> Typeset and View

share|improve this answer
    
It worked perfect, Gbugnard. Thanks a lot! –  grandeabobora May 30 '13 at 16:46
add comment

Alternatively to the above suggested way, you could set a TextMate Variable that should be called TM_LATEX_MASTER and point it to your main latex document (copy the path into the variable value field next to the variable name).

The place where you can set TextMate's variables is under TextMate's Preferences (cmd+,) and go to the "Variables" section.

share|improve this answer
add comment

Your Answer

 
discard

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.