LaTeX Workshop

fhLUG

Linux User Group FH Hagenberg

Overview

An updated version is available.

Reasons for LaTeX

Reasons for WYSIWYG

History

Document structure

\documentclass[10pt,a4paper]{scrartcl}

\usepackage[naustrian]{babel}

\usepackage[utf8]{inputenc}


\begin{document}
Here comes the document's content.
\end{document}

Proper punctuation

``English `quotation' marks.'' (“English ‘quotation’ marks.”)

"`Mit \glq naustrian\grq sieht das so aus"'. („Mit ‚naustrian‘ sieht das so aus“.)

Simple markup

\section{Markup}
Short sentence with \emph{markup}.

\subsection{Emphasize}
\emph{Markup can \emph{even} be nested}.

Lists

\begin{enumerate}
\item First item
\end{enumerate}

\begin{itemize}
\item Bulleted item
\end{itemize}

Including images

\usepackage{graphicx}
\DeclareGraphicsExtensions{.png,.gif,.jpg}

\includegraphics[width=\textwidth]{path/to/image}

Source code listings

\usepackage{listings}
\lstset{%
	basicstyle=\footnotesize,%
	showspaces=true,showstringspaces=false,%
	numbers=left,tabsize=2,breaklines%
}

\lstinputlisting[language=C++,caption={Source code included from file}]{path/to/file.cpp} \begin{lstlisting}[language=Java,caption={Source code in tex file}] var s = "Code can be marked up without including it from a file."; \end{lstlisting} Short source code snippets can even be inlined: \lstinline{++i;}

Tables

\begin{tabular}{l|ll}
header1 & header2  & header 3 \\
\hline
cell 1  & cell 2   & cell 3 \\
cell 4  & cell 5   & cell 6
\end{tabular}

Figures

\begin{figure}
	\centering
	\caption{This is a sample figure}
	\label{fig:sample}
	\includegraphics{path/to/file}
\end{figure}

\begin{table}
	\begin{tabular}{…}
	% table content
	\end{tabular}
\end{table}

Cross-Referencing

\usepackage{hyperref}
\renewcommand{\figureautorefname}{Abbildung}
\renewcommand{\tableautorefname}{Tabelle}

\label{fig:abc} See \autoref{fig:abc} for more information.

Bibliography management

@article{bibtexkey,
	title={LaTeX for dummies},
	author={First Author and Second Author},
	year={2012},
	publisher={O'Reilly}
}
\cite[displaytext]{bibtexkey}

\bibliographystyle{plain} \bibliography{bibfile}

Headers & footers

\usepackage{fancyhdr}
\fancyhf{} % clear default header style
\lhead{Daniel Knittl-Frank}
\rhead{Campus Hagenberg}
\cfoot{\thepage}
\pagestyle{fancy}

Mathematic formulas

\(
\sum_{i=1}^{n} = \frac{n(n+1)}{2}
\)