# Ensuring correct LaTeX compilation on different systems

I'm currently writing a document collaboratively and I need to make sure that the compilation is executed correctly on every possible system (e.g., that the document encoding - UTF-8 - is detected by most editors - if not all - the .tex file is opened in, that all packages are found during compilation, and so on).

The final version of the LaTeX document will be compiled by other people, and I don't know which TeX distribution, platforms and editors will be used; for this reason, I'm in search of a general solution to the problem.

What are the current best practices to achieve this goal? At present, I've thought about:

• inserting appropriate modelines into the preamble (like the TeXShop one `% !TEX encoding = UTF-8`) to solve the encoding problem, and
• using the `snapshot` package to get a list of all required dependencies and putting them along my LaTeX file in the RCS I'm using.

Are there other points I'm missing?

-
As well, there're many ways how to produce a document: `XeLaTeX`, `LuaLaTeX`, `pdfLaTeX`, `latex>dvips>pdf`, `latex>dvipdfm`, etc. You have to make this clear as well somehow. – yo' Nov 16 '12 at 12:53
Sorry, forgot to add that - I can assume that `pdflatex` is always going to be used. – elgaton Nov 16 '12 at 18:33
@elgaton:Happy? – Dr. Manuel Kuehner Nov 21 '12 at 10:24
@ManuelKuehner: Sorry for the late reply - I think both you and tohecz have addressed the problem. I've marked yours as the accepted answer as it's the most detailed one. – elgaton Nov 24 '12 at 13:00
@elgaton: Alright! – Dr. Manuel Kuehner Nov 26 '12 at 16:50

I would recommend this minimal preamble:

``````\documentclass[10pt,a4paper]{article}

\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
``````

You can specify the oldest version to be used for each package by:

``````\usepackage[T1]{fontenc}[YYYY/MM/DD]
``````

e. g.

``````\usepackage[T1]{fontenc}[2011/06/21]
``````

Reference:

http://tug.org/docs/html/eplain/The-_005cusepackage-command.html

In addition maybe it is better you use a mighty document class like the KOMA classes (e. g. scrbook). This combines the features of many packages in one document class. Therefore there is less chance to run into problems because of using may packages with maybe different versions.

-

Yes, you are certainly missing a point about default paper size, which is `a4paper` for European systems and `letter` for American systems.

So: always use

``````\documentclass[a4paper,...]{...}
``````

or similar.

-
the default at that level (in TeX for the standard classes) is always usletter. The driver probably defaults to a4 or use letter for positioning the typeset area on a physical page though. – David Carlisle Nov 16 '12 at 13:03