### 6.3 Compiling multiple times

Most LaTeX compilers need to be re-run several times in several commonly occurring situations in order to get a final camera ready copy. For example, when \label's change, when new \cite commands are added etc. If the target format you are compiling to requires multiple compilations, then you will need to include the format in the g:Tex_MultipleCompileFormats setting. This is a comma separated string of formats which need multiple compilations to be generated correctly.

By default, this setting contains just the dvi format. If you use the pdflatex compiler to generate pdf files, then you might want to also include pdf into the above setting.

For every format included in the g:Tex_MultipleCompileFormats setting described above, Latex-Suite will use the following logic to generate the file. Note that although the following description uses latex to refer to the compiler, it could be some other compiler such as pdflatex for generating pdf output.

1. If there was a .idx file, then remember its contents.
2. Run latex.
3. If the .idx file changed due to the latex compiler, then run makeindex to redo the .ind file and then remember to rerun latex.
4. If the .aux file generated by the latex compiler contains a \bibdata line, then it means that we are using a .bib file. Therefore, run bibtex.

### Note

This means that we will always run bibtex whenever we use the \bibliography command whether or not we actually need to. At this time, Latex-Suite does not parse the .aux file before and after the latex compiler to see if we are required to rerun bibtex.

5. If the .bbl file changes because of this, then remember to rerun latex again.
6. Also, we check to see if the LaTeX compiler gives certain standard warnings which notify that we need to compile once again. In this case also, remember to rerun LaTeX.
7. If we found we had to rerun latex, then we repeat the steps above but not running makeindex or bibtex again.

The LaTeX file is compiled atmost 5 times using this logic. These steps will ensure that on most platforms/environments, you will get a clean output with all the cross-references, citations etc correctly labelled and ordered.