# Two neat LaTex tricks that will make life easier

### 1. Typesetting modularized LaTex files

So you modularized your really long tex file, using includes or input. You find it a bit annoying that every time you change a chapter you have to typeset the main file, you can’t just press the typeset button on the chapter file. It turns out that if you just put the following on the first line in your sub chapter file

%!TEX root = ./main.tex

where root equals the relative path to your main.tex file, then when typesetting the sub chapter file TexShop will update the whole file. Pretty neat!

### 2. Removing all those pesky help files that Latex creates when typesetting

LaTex outputs a lot of annoying extra files when typesetting. Especially if you have many chapters in different files it can quite annoying trying to find the file you want to edit, especially if you are using MacOS Finder… There is a neat solution to this that can be found here. What you do is add the following option when typesetting, which will tell TexShop to output to a sub directory.

-output-directory=SOME_OTHER_DIR

The line can be added under the engine tab in TexShop. The directory must already exist for it to work. And the if you are using pdflatex the pdf file will of course be in the subdirectory.