Tech TeX

What the.. TeX? The basics about TeX and LaTeX

If you want to write an academic article or even an academic thesis for your bachelor, master or doctoral degree, you may have came across TeX or at least heard about it. TeX is a typeset language designed by Donald E. Knuth, who is famous in computer sciences for his books “The Art of Computer Programming”. He was so upset by typesetting systems in the 197os that he decided to work out a better typesetting system – TeX was born.

But what is LaTeX and what is the difference between TeX and LaTeX? TeX is both, a program for typesetting (tex-core) and a set of macros (plain-tex). But TeX is a very basic set of macros. As a non-advanced user of TeX, you typically do not want to write a lot of TeX macro to set a chapter header or to insert references into your document. Therefore, LaTeX provides a more extensive standardized set of macros. When one talks about LaTeX, one nowadays means LaTeX2ewhich is an extension of the old LaTeX2. On top of that, you can use packages for LaTex which provide you further functionalities. E.g. the hyperref package allows you to insert cross-section links within your document or weblinks.

A page at describes the different levels of TeX:

  1. The heart of typesetting is the engine. The engine implements the TeX variant and is responsible to typeset your document code into an output formats. Most common are TeX and pdfTeX (provides PDF  and DVI output format).
    The LaTeX compiler originally compiles a document to DVI output format. If you type latex document.tex in a terminal, the DVI file document.dvi is generated. To compile the document to PDF output format, you have to use the pdflatex command like pdflatex document.tex to create document.pdf.
    If documents have cross references, a documents needs to be compiled to the output format two or even more times: in the first compilation run, the compiler assigns a marker to each section and in the second run, it resolves the cross-references.
  2. Formats are the TeX dialects in which you write your documents. Most common are TeX and LaTeX.
  3. Classes are the natures (or types) of document you want to write, e.g. books, articles, letters, and so on. Classes have a .cls extension. They provide macros and options that help the author to easily write the respective type of document. Advanced users can write their own classes.
  4. Packages such as the already-mentioned hyperref are independent of classes and provide some extra bit of functionality so that an author does not have to write macros on his own. A package may or may not work with any engine and/or format. Most of times, they are designed to work with LaTeX because they depend on the LaTeX macros which are not available in TeX. Packages have a .sty file extension. The CTAN is the most famous repository of packages.
  5. Distributions are software bundles that provide you with an engine and editors. If you want to install TeX on your computer, you have to download a distribution that is suits your operating system and install it. Most common are
    1. MiKTeX for Microsoft Windows operating systems.
    2. TeX Live for Linux and other UNIX operating systems.
    3. MacTeX redistribution of TeX Live for Mac OS X operation systems.
  6. Front ends or editors can edit TeX documents. Basically, you can use any editor but there are front ends that provide you with syntax highlighting, autocompletion and predefined code templates.

Further good resources are the Wikibook on LaTeX, the TeX StackExchange for an extensive Q&A on TeX and LaTeX Templates.

Leave a Reply