TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.)
share|improve this question

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


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

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

  \begin{tikzpicture}[overlay,remember picture]
      \fill [color=blue]
        (current page.north west)
        ($ (current page.south west) + (1cm,0cm) $);
\begin{tikzpicture}[overlay,remember picture]
      \fill [color=orange]
        (current page.north east)
        ($ (current page.south east) + (-1cm,0cm) $);





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

share|improve this answer

Your Answer


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.