# What does the output of TeX/LaTeX depend on (in the sense of version and distribution)

I knew in advance that the output of `tex`, `pdftex`, `latex`, `pdflatex` and so on, depends on the version of that given program. This, of course, makes a lot of sense. Until now, I have not given it a lot of thought because I suspect that the difference in how the output looks does not change that much from version to version. But, lately I am in a situation where it does matters and I am faced with the question:

On what does the output depend?

I feel that it must necessarily depend on the version of the program, let's say `pdflatex` from now on since this is the one I use in this case. But what about the choice of distribution, that is, TeX Live versus MacTeX versus MiKTeX versus any other possibility, and what about the version of that distribution. Does the output depend on these factors?

Obviously the output might depend on the version of a package I am using, and the packages I install myself (in `~/texmf`) I can easily keep track of the version on. Most of the files loaded by `pdflatex` though (I have realised that there are a lot) must depend in some way of factors as the ones mentioned above.

When I look at my log files, they have have a header like

``````This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2013.4.4)  13 MAY 2014 13:59
``````

or

``````This is pdfTeX, Version 3.1415926-1.40.11 (TeX Live 2010/Arch Linux) (format=pdflatex 2011.4.11)  17 DEC 2013 01:28
``````

How do I decipher these headers?

There are several number systems in work here, as far as I can see, and as I said, I do not know which ones the output depend on.

In the specific case that I am in, we are three people who need to compile the document, but one uses Windows and the other two uses Linux.

Is it even possible to ensure that two persons produce the same output?

The answer to this question is of course yes if the two persons both use Linux, because then a portable TeX Live installation would do that (I believe), but is always possible, that is the question.

-
Assuming (i) you use "just" PlainTeX, LaTeX209 (dreadfully obsolete), or pdfLaTeX (which builds on the LaTeX2e format, which has been around since 1994) and (ii) the packages (say, `geometry`, `hyperref`, and various font packages) and class files you use are the same across the TeX distributions and operating systems you have access to, the output (dvi or pdf file) should be pretty much independent of the operating system and TeX distribution you use. By the way, in the examples you cite, you seem to be using a rather out-of-date version of TeXLive. Any chance of upgrading to TeXLive2013? – Mico May 15 '14 at 20:11
@Mico: The Tex Live is going to be updated :) In the last question you are allowed to install/reinstall all that you want. In the specific example the documentclass is `memoir` and the packages loaded are `amsfonts`, `amssymb`, `amsthm`, `babel`, `color`, `enumitem`, `fix-cm`, `fontenc`, `framed`, `inputenc`, `soul` and `tikz`. Though, when the files whas compiled with `pdflatex` on another system it gave a different result. I even tried to copy all files listed in the log file to the other system, but without luck. The main problem was vertical space being different sizes. – Kristian May 15 '14 at 20:22
It is highly unlikely that you get any visible (or even measurable) differences due to different distributions or the number of digits of pi in the tex version number. Differences in the macro files (eg tikz just had an update) are of course always a possible source of difference. – David Carlisle May 15 '14 at 20:30

How do I decipher these headers?

``````This is pdfTeX,
``````

It's PDFTeX, an extension to Knuth's original TeX system to produce PDF output rather than DVI (along with some other extensions)

``````Version 3.1415926
``````

Every few (or not so few) years Knuth addresses accumulated bugs and revises TeX, adding another digit. These bugs are harder and harder to find and if you have any TeX from around 3.14 (last century sometime) there's unlikely to be any differences in output unless you write a test document specifically to show the bug that was fixed.

``````-1.40.11
``````

This is the pdftex version number. There was a period when pdftex was more experimental and likely to change than classic TeX ,but now it's pretty stable (not least because I think Hàn Thế Thành is looking more to luatex these days).

``````(TeX Live 2010/Arch Linux)
``````

So you have that TL build

`````` (format=pdflatex 2011.4.11)
``````

and a format using latex that was built on that date (the date the format was dumped, not the date of the latex format). Latex format (unlike latex packages) is very stable (the new 2014 release is identical to the 2011 one apart from the date, for example).

If you get different results from the same document on two machines, don't look to these headers, add

``````\listfiles
``````

to the preamble and then look at the list of packages and version numbers that appears in the log. Differences in package versions are almost always the cause.

-
Thanks. This `\listfiles` command is very neat. I belive, after having looked at it again, that the difference in output was actually due to a difference in the version of memoir. I guess that I did not succed in using the same files on the different systems. How can you make sure that some specific files are used to ensure that the output is the same? – Kristian May 20 '14 at 14:50
@Kristian zip up the memoir directory on one of the machines and unzip it on the other, putting the resulting directory at the start of the TEXINPUTS path variable. or make sure both machines are using a managed system like texlive or miktex and make sure they are both up to date. – David Carlisle May 20 '14 at 14:57
This was what I originally tried to do. I looked at this question and put the directory in TEXINPUTS in the terminal before running `pdflatex`. I will give it one more try. Thanks. – Kristian May 20 '14 at 15:05
You should probably note that the version number is based on pi. So one version before `3.14` was not `3.13` but `3.1` (as far as I know). – Martin Thoma May 22 '14 at 7:59
@moose yes it was more conventional before that: 1,2,3 -> pi (on Knuth's death it will become pi and not change at all) – David Carlisle May 22 '14 at 8:48

Contrary to your guess, the truth is that the version of the compiling tool (`tex`, `latex`, `pdflatex`, etc) is pretty much irrelevant.

In my experience, the main sources of possible differences are:

1. Different version of included packages. Although most standard package are backwards compatible, sometimes it can happen (specially if you use new and experimental packages) that this compatibility is broken among verions. Unlikely, but it may happen.
2. Different fonts. If some fonts your document uses are not available in another system, LaTeX can "silently" replace them for other suitable ones (not really silently, because lots of warnings are dumped in the `log` file). If the replaced font has different metrics, the resulting line breaks and page breaks can be different, not to mention the look of the fonts itself.
3. Even if you stick to standard fonts, if you use `\usepackage[T1]{fontenc}` the selected font can be different in different systems. If `cmsuper` fonts are available, those will be used. If not, EC fonts will be used. The first ones are vectorial fonts, crispy at any resolution. The second ones are bitmap fonts, and some renders shows them very blurry and jagged on screen. In print they should look the same, though.
4. Different format files. When TeX is installed, several format files are created. Those format files are "precompiled versions" of standard sets of macros. For example "plain tex", "latex" or "context" are examples of such sets. In fact, when you compile using `tex` or using `latex`, the same program is run under the hood, and the only difference is the format file loaded.

The problem is that not only a set of macros is present in a format file. Also the "hyphenation rules" which tell TeX which are the appropiate points to break a word among lines and insert a hyphen. These rules are language dependant, and the format file contains rules for different languages, which can be selected later from the document (for example using babel). However, if the document selects a language which is not present in the format file, then TeX defaults to english.

In my experience this is the main source of problems and differences among platforms. In one platform the format file was created including the language your document uses. The lines are broken at the right hyphenation points for your language. Move the document to a different platform using the same TeX version, latex, and packages, but in that platform the format file does not include your language. The lines are broken at different places (and wrong places for your language), because english rules are used by default.

The format file is created one single time, and later used for all your latex complations, unless you re-create it and include additional language rules. The way to do this is distro-dependant, and not always easy.

-
Thanks for your reply. I will Keep in mind your point about the format files :) – Kristian May 20 '14 at 14:52