4 ms·
The definition of insanity is doing the same thing twice and expecting different results. By coincidence, this is the basic way to compile latex.
by shusaku 1y ago
The definition of insanity is doing the same thing twice and expecting different results.
By coincidence, this is the basic way to compile latex.
- tom_ 1y agoMy makefiles ran it 4 times, i think. I still preferred it to Word.
- lblume 1y agoAnything is preferable to Microsoft Word.
- SkiFire13 1y agoTBF 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.
- a5c11 1y agoLast time I checked, flipping a coin twice gave different results.
- _Algernon_ 1y agoDid you flip the coin in the exact same way? Probably not.
- a5c11 1y agoThat'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 1y agoIf you flip it an infinite number of times, you will get the same results anyway. Call when you're finished :P
- Diti 1y agoAren’t getting different results the norm in programming anyway? Developers usually don’t make the effort to include idempotency and make builds reproducible.
- MajimasEyepatch 1y agoNormally, 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 1y agoI 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.
- almostgotcaught 1y agoAlmost every compiler is a multipass compiler.
- owlstuffing 1y agoBut in this case the passes are manual!
- almostgotcaught 1y agoso?
- yunohn 1y agoDunno - 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 1y agoImagine 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
- someuser2345 1y agoThat's not the definition of insanity, that's the definition of practicing.