6 ms·
You probably know, but the reason there are multiple passes is because once a page is typeset, you can't go back and "fix" it. TeX is very page-centric. So refe
by petrilli 16y ago
You probably know, but the reason there are multiple passes is because once a page is typeset, you can't go back and "fix" it. TeX is very page-centric. So references, for example, aren't "knowable" until you've typeset all the pages. Then the next pass goes through and updates the forward references.
It could be done another way, but in the era that TeX was developed, it would have required more memory than was realistically available most of the time. I find that once I've run it twice, I can get away with single runs usually after that until I'm ready for the "definitive" version. Until then, I'm less concerned with whether the cross-reference is right, than whether there is a cross-reference in that location at all.
- shasta 16y agoYou know, gcc uses multiple passes, too, internally. If gcc were to use latex's model, you'd have to run it multiple times to get a working executable. Mind you, it would produce an executable every time, but those first ones would just crash. Latex can produce some nice looking documents, but as a technology, it's shoe strings and bubble gum.
- mturmon 16y agoThe only problem is that the cross-references may be out of sync. This is usually not a serious barrier to readability. Another gcc analogy is a dependence on a third-party library whose API keeps changing. Then you'd have to run gcc once to regenerate the library, and once on the client using the library. Peeling that back a level, the analogy is between files like libfoo.a and foo_defs.h (for gcc) and files like section1.aux and document.bbl (for latex).
- aeroevan 16y agoLaTeX will warn you when the references are out of sync, and there is no reason why it can't make a second (or third) pass internally without having to call (pdf)latex manually again and throwing .aux .log .other_random_stuff files everywhere.
- parfe 16y agoSo whip up a shell script and call it "better_latex" mark it +x and call the real exe multiple times. Now it's an improved version that does it internally, just like gcc
- neilc 16y agoI just use LaTeX-Mk or a similar package, which takes care of multiple runs of LaTeX fairly well. http://latex-mk.sourceforge.net/ http://latex-mk.sourceforge.net/