Preferences

The definition of insanity is doing the same thing twice and expecting different results.

By coincidence, this is the basic way to compile latex.


SkiFire13
TBF Typst internally also recompiles a bunch of times until a fixpoint is reached, however it is designed to limit what parts can depend on the previous iterations and to reuse previous results for parts that definitely didn't change.
tom_
My makefiles ran it 4 times, i think. I still preferred it to Word.
lblume
Anything is preferable to Microsoft Word.
a5c11
Last time I checked, flipping a coin twice gave different results.
_Algernon_
Did you flip the coin in the exact same way? Probably not.
That's the clue - you never repeat the same activity exactly the same way.

Seemingly identical action, from the performer's point of view, is performed in a different environment each time it is repeated. Unless you are the Laplace's Daemon, you can't say for sure you repeat the same action over and over because the environment could change in the meantime in an unimaginable way, and that could influence the outcome.

I just really hate that quote because it is detached from reality.

pantulis
If you flip it an infinite number of times, you will get the same results anyway. Call when you're finished :P
I'm finished, the result was different 50% of time :).
pantulis
That's 18 hours to go to infinity and back... nice roundtrip!
Diti
Aren’t getting different results the norm in programming anyway? Developers usually don’t make the effort to include idempotency and make builds reproducible.
MajimasEyepatch
Normally, if you compile the same code twice on the same machine, you'll get the same result, even if it's not truly reproducible across machines or large gaps in time. And differences between machines or across time are usually small enough that they don't impact the observed behavior of the code, especially if you pin your dependencies.

However, with LaTeX, the output of the first run is often an input to the second run, so you get notably different results if you only compile it once vs. compiling twice. When I last wrote LaTeX about ten years ago, I usually encountered this with page numbers and tables of context, since the page numbers couldn't be determined until the layout was complete. So the first pass would get the bulk of the layout and content in place, and then the second pass would do it all again, but this time with real page numbers. You would never expect to see something like this in a modern compiler, at least not in a way that's visible to the user.

(That said, it's been ten years, and I never compiled anything as long or complex as a PhD thesis, so I could be wrong about why you have to compile twice.)

BrandoElFollito
I wrote my PhD (physics) in LaTeX and I indeed needed to compile twice (at least) to have a correct DVI file.

It was 25 years ago, though, but apparently this part did not change.

This said, I was at least sure that I would get an excellent result and not be like my friend who used MS Word and one day his file was "locked". He could not add a letter to it and had to retype everything.

Compared to that my concern about where a figure would land in the final document was nothing.

someuser2345
That's not the definition of insanity, that's the definition of practicing.
almostgotcaught
Almost every compiler is a multipass compiler.
owlstuffing
But in this case the passes are manual!
almostgotcaught
so?
yunohn
Dunno - to me it feels like the latex compiler should just run whatever it needs to for however many times until the output is done/usable, like basically all other compilers?
optionalsquid
Imagine that your C or C++ compiler gave incorrect output, until you had run it some number of times. And that the number of runs required wasn’t obvious to the average user, so people just ran it again and again, to be safe. It’s absurd, yet we accept it for latex

This item has no comments currently.