# What types of code patterns will increase the number of required runs of the latex command?

It is known that references require an additional run of LaTeX and that these references may depend on BibTeX, which in turn depends on at least one previous compilation of the document source. I have also encountered a statement on the web that certain LaTeX source files might require more compilations.

This makes me curious: What coding patterns (or nestings thereof) will increase the required number of latex runs to generate the final document? Ideally an answer will be a coding pattern (or set of coding patterns) that can be used to increase the number of required compilations by 1.

There are two reasons for asking:

1. As long as I am not using one of the tools mentioned in the references mentioned in related questions about automated LaTeX (re)compilation (e.g., here and here), I might want to know the answer without needing to inspect the log-file. (On how to properly do that, see my other question here.)
2. Just as a fun intellectual exercise, it would be interesting to know how to (recursively or otherwise) generate LaTeX source files requiring an arbitrary number of compilations. (For this specific question I have created a separate post, so please put your answers there.)
-

Tikz code that involve co-ordinate calculations needs at least two runs. For example:

\documentclass[twoside]{article}

\usepackage{tikz}               % you know what this does!
\usetikzlibrary{calc}

\usepackage{fancyhdr}             % put things headers and footers and we plan misuse it ;)
\usepackage{lipsum}               % for sample text

\pagestyle{fancy}
\fancyhf{}
\begin{tikzpicture}[overlay,remember picture]
\fill [color=blue]
(current page.north west)
rectangle
($(current page.south west) + (1cm,0cm)$);
\end{tikzpicture}
}
\begin{tikzpicture}[overlay,remember picture]
\fill [color=orange]
(current page.north east)
rectangle
($(current page.south east) + (-1cm,0cm)$);
\end{tikzpicture}
}
\fancyfoot[C]{\thepage}
\renewcommand{\footrulewidth}{0pt}

\begin{document}
\lipsum

\lipsum

\lipsum

\end{document}


involves such calculations and needs two compilations to get the side lines correct.

-