Note: This will pick up on \tableofcontents even if it's
in a verbatim environment. But the worst that can happen is
that the document takes a bit longer to build.
We no longer try to parse the log file to determine whether latex
needs to be rerun. Instead, we run latex twice -- which should be
enough for table of contents and hyperrefs.
Closes#402.