The following minimal document can be used if a reasonably up-to-date TeX distribution is used and also an editor is used where the encoding is set to UTF8. This is the case for TeXmaker, TeXworks, TeXstudio and TeXnicCenter 2 (but not version 1!) by default. For those who are unsure: If in the example document the umlauts generate error messages or the umlauts are not displayed correctly in the PDF, either the editor is not set correctly or a totally outdated LaTeX installation from before April 2018 is used. In this case, the editor setting should therefore be checked or the TeX distribution should be updated.
Already the following minimal document presented by me contains optional parts. Perhaps you can see from this how difficult it actually is to create a universal template.
\documentclass[UKenglish]{scrartcl}% see <https://komascript.de> \usepackage{babel}% The example document is in British English, % so it is created using the babel package and its option % UKenglish, which however has been specified as a global % option, to use English terms and at the same time % hyphenation patterns according to the English spelling % rules. Alternatives and other languages are % available (see <http://ctan.org/pkg/babel>). \usepackage[T1]{fontenc}% use western 256-bit encoding for fonts % (also switches to the European Computer Modern % font families) \usepackage{lmodern}% use the Latin Modern font families instead \begin{document} % ---------------------------------------------------------------------------- % title (to be used only after \begin{document}, so that babel is already fully active: \titlehead{head above title with chair etc.}% optional. \subject{type of document}% optional \title{title of the document}% mandatory \subtitle{subtitle}% optional \author{this is me}% mandatory \date{e.g. the deadline}% reasonable \publishers{place for supervisor or similar}% optional \maketitle% uses the previously given information to design a title % ---------------------------------------------------------------------------- % table of contents: \tableofcontents % ---------------------------------------------------------------------------- % Outline and text: \section{motivation} \label{sec:motivation} This section should address the task. It can also cover basics. However, it may be useful to use a separate section for the basics. The text may also contain many special characters such as the German umlauts: äöü. \section{implementation} \label{sec:implementation} Here you tell now what you have done. \section{conclusion} \label{sec:conclusion} This is the conclusion and, if necessary, the outlook on further things that could be done. \end{document}
Two LaTeX runs are needed until the correct result with table of contents is available. In the example, the \label
statements use a reduced character set. Although LaTeX now also allows umlauts and various other special characters in the argument of \label
, it is recommended to limit yourself to letters, digits and a few punctuation marks at this point. Depending on your chosen language, some punctuation characters may also be problematic.
If you write your document in English, you should use the setting for the corresponding English for babel
, for example UKenglish
or USenglish
. See the babel
manual for details (see also “How to find the manual for [...] packages”.
For documents in languages other than US or UK English, the character set of the default Computer Modern (CM) font is not sufficient. Therefore, the font encoding for the use of German umlauts was extended with \usepackage[T1]{fontenc}
. The then used standard fonts of the European Computer Modern Famlien (EC) are not very attractive. If you still want to use them, you should install the package cm-super
. For details, see the package manager instructions for the TeX installation. I recommend instead to use the Latin Modern families (LM) via \usepackage{lmodern}
as in the example shown. But there are also a lot of other font packages for LaTeX. For commercial fonts there are also some packages.
Wiki (English): HowTo_Manual
Wiki (English): HowTo_Template
Wiki (English): HowTo_Template_LuaLaTeX_XeLaTeX