Gernot Walzl

LaTeX

LaTeX is a typesetting software to produce high-quality documents
like articles, books, letters, and also presentations.
It allows the writer to focus on the content rather than its formatting.

Contents

Installation

Different LaTeX distributions exist. Debian includes TeX Live.
To install TeX Live and LaTeX packages, execute the following command:

sudo apt install texlive texlive-latex-recommended texlive-latex-extra

To add support for specific languages, install corresponding packages:

sudo apt install texlive-lang-english texlive-lang-german

Kile is a user-friendly LaTeX editor:

sudo apt install kile

Generating PDFs

Given a TeX file, pdflatex generates a PDF file:

pdflatex document.tex

To get all cross-references right, pdflatex needs to be invoked multiple times.

Document Classes

Here are a few examples of various types of documents.
These examples can be used as templates.

The generated output (PDF) is found below each example.

Article

article.tex
\documentclass[a4paper]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[english,ngerman]{babel}
\usepackage{hyperref}

\title{My Article}
\author{John Doe}
\date{2020-10-20}

\begin{document}
\selectlanguage{english}

\maketitle
\tableofcontents

\section{Introduction}
\label{sec:introduction}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.

\begin{equation}
  \label{eq:pythagoras}
  a^2 + b^2 = c^2
\end{equation}

\end{document}

Output: article.pdf

Presentation

presentation.tex
\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage[english,ngerman]{babel}

\usetheme{Warsaw}

\title{My Presentation}
\author{John Doe}
\date{2020-10-20}

\begin{document}
\selectlanguage{english}

\maketitle

\begin{frame}{Contents}
  \tableofcontents
\end{frame}

\section{Introduction}

\begin{frame}{First Slide}
  \begin{block}{Important things}
    \begin{itemize}
      \item First
      \item Second
      \item Third
    \end{itemize}
  \end{block}
  \begin{block}{Pythagorean theorem}
    \begin{equation*}
      a^2 + b^2 = c^2
    \end{equation*}
  \end{block}
\end{frame}

\end{document}

Output: presentation.pdf

Letter

letter.tex
\documentclass[a4paper,fromalign=right]{scrlttr2}

\usepackage[utf8]{inputenc}
\usepackage[english,ngerman]{babel}

\setkomavar{fromname}{Max Mustermann}
\setkomavar{fromaddress}{%
  Hauptstraße 1\\
  8020 Graz\\
  Austria%
}
\setkomavar{place}{Graz}
\setkomavar{date}{2020-10-20}
\setkomavar{subject}{Lorem Ipsum}

\begin{document}
\selectlanguage{english}

\begin{letter}{%
  John Doe\\
  123 Maple Street\\
  Anytown, PA 17101\\
  United States%
}

\opening{Dear John,}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
no sea takimata sanctus est Lorem ipsum dolor sit amet.

\closing{Best regards,}

\encl{Instructions}

\end{letter}
\end{document}

Output: letter.pdf

CONTENT.html source 2022-12-11 5.2 KB
article.pdf sha256 2022-12-11 49.1 KB
letter.pdf sha256 2022-12-11 35.8 KB
presentation.pdf sha256 2022-12-11 49.7 KB