# Need to Typeset twice for correct compile?

Whenever I press CMD+T in TexShop, the PDF created is not always updated correctly. I usually have to re-compile it to update the Table Of Contents and other changes I have made. How can I fix this ?

Using MACOSX 10.8 - TEXSHOP 3.11

You can't. LaTeX has to build the .aux file to store the table of content (ToC) and such, because when typesetting the ToC it can't know beforehand what sections will occur. LaTeX works sequentially.

• First run: collect all sections and such and store it in .aux file.
• Second run: Use .aux file to typeset the ToC.

Actually it does both things at once: typset with the already existing .aux file (which can be empty or non-existant) and create an updated one for the next run.

There exist tools that "simulate" a "one-compile-all-get" behaviour, like Texify from MiKTeX for Windows. But normally all they do is just run the compiler twice in a row (maybe with bibtex inbetween if you use it).

I'd suggest user friendly automation tool arara: the manual is very well written for newbies! In particular, I'd like to point out that, it is possible to integrate arara with TeXShop, cf. section 4.4 pg. 41 of the linked manual.