pdflatex; how many times do you run it?

1,557 views
Skip to first unread message

Paul Johnson

unread,
May 26, 2010, 11:33:45 PM5/26/10
to latexus...@googlegroups.com
Just a curiosity. When I compile a tex document with latex, I have to run

latex
bibtex
latex
latex

But if I run the same with pdflatex, it seems to usually come out fine
without running it over and over. However, I have been working on
Beamer presentations with a table of contents and it seems to me that
running pdflatex one time is not enough anymore to get the table of
contents updated. Running it again fixes that.

I'm wondering if I was just lucky before when it worked when run once,
or if I'm doing something else wrong that makes it require two runs.

?

--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas

Abel Siqueira

unread,
May 26, 2010, 11:39:14 PM5/26/10
to latexus...@googlegroups.com
I've always used pdflatex, and whenever I change (add/remove) a reference or similar, I have to compile twice to update correctly, whether I use Beamer or not.

2010/5/27 Paul Johnson <paulj...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.


Peter Flynn

unread,
May 27, 2010, 4:21:12 AM5/27/10
to latexus...@googlegroups.com
On Thu, May 27, 2010 at 4:33 AM, Paul Johnson <paulj...@gmail.com> wrote:
Just a curiosity.  When I compile a tex document with latex, I have to run

latex
bibtex
latex
latex

Mine goes latex;bibtex;latex;makeindex;latex, but yes, that is the convention for the final output.
 
But if I run the same with pdflatex, it seems to usually come out fine
without running it over and over.

Do you have evidence of this? LaTeX and pdflatex work the same way, so they will need exactly the same number of runs to produce the same output.
 
However, I have been working on
Beamer presentations with a table of contents and it seems to me that
running pdflatex one time is not enough anymore to get the table of
contents updated.

It never has been. No TeX program (that I am aware of) can do a ToC at the start of the document in one pass.
 
Running it again fixes that.

This is always true of all implementations. The way the ToC is produced (generated in one run, used in the next) means that you must run the program at least twice to get a ToC.

I'm wondering if I was just lucky before when it worked when run once,
or if I'm doing something else wrong that makes it require two runs.

Two runs is normal. There simply isn't any way that it will work in a single run. Perhaps you had already run (plain) LaTeX on the document before changing to pdflatex (or vice versa)? That would mean that there was already a .toc file there, from the previous run.

///Peter

Reply all
Reply to author
Forward
0 new messages