You are on page 1of 4

Reference Sheet for a Thesis C.

Layout
D.6. Lists E.5. Colors with xcolor
with LATEX2e and KOMA - Script C.1. Changing Page Layout with geometry \begin{itemize} with bullets \item or \item[ symbol ] 
\begin{enumerate} with numbers \item \usepackage{xcolor}
ß Let KOMA - Script know of geometry by option usegeometry=true.
ß All examples were tested with pdflatex.  \begin{description} with bold words \item[ word ]
\definecolor{DarkBlue}{RGB}{0, 115, 207}
ß The package mentioned in the headings has to be included (see B.2). \colorlet{col_section}{DarkBlue}
\usepackage[left=2cm, right=2, top=3cm, bottom=4cm, \begin{labeling}[ separator ]{labelinglabel} \item[ word ]
ß Compile three times after last change (esp. docs with references). bindingoffset=1cm, inlcudeheadfoot]{geometry}  \textcolor{red}{text in red} or {\color{red}text}
  \begin{enumerate} 
\colorbox{gray!25}{color gray faded by 25\%}

A. LATEX Basics ß Auto-completion determines unspecified dimensions (under or over \item First item Predefined colors:
specified as well), here width and height of text (see I.9). \item Second item\label{it:second} % see References
white gray black red green blue cyan magenta yellow
A.1. Units ß Other options: paper=a4paper, landscape|portrait, includehead, \end{enumerate}
ß Available units for length and dimensions: includefoot, includeheadfoot, twocolumn   Fade a color with color !value between 0 and 100
ß Changing page layout mid document: \newgeometry{ opt, opt, ... } Headings in color: \setkomafont{disposition}{\color{color }}
bp point (typographic) mm millimeter in inch em width of M
px pixel (1/72in) cm centimeter pc pica ex height of x D.7. Enhanced Lists with enumitem
C.2. Header and Footer of Page (aka running heading) Load: \usepackage{enumitem} E.6. Footnotes
ß Document dependent units z \textwidth, z \linewidth,
z \columnwidth, z \textheight with z a percentage value, e.g. \lehead \cehead \rehead \lohead \cohead \rohead Example (for enumerate): \footnote{text } Print footnote marker in text and footnote at
0.55\textwidth means 55% of the actual width of the text. \setlist[enumerate,1]{label=\Alph*)} A) one bottom of page
6 6 6 6 6 6
ß \baselineskip minimum vertical space between the bottom of two \ihead
\chead
\setlist[enumerate,2]{label=\alph*)} a) one \footnotemark Print footnote marker in text (e.g. within tabu-
successive lines in a paragraph. \setlist[enumerate,3]{label=\roman*)} b) two lar or caption)

\ohead

ß Amounts like \smallskipamount, \medskipamount, \bigskipamount. \setlist[enumerate,4]{label=\arabic*)} B) two \footnotetext{text } Print footnote at bottom of page
% delete default settings and define your own
\usepackage[automark]{scrlayer-scrpage} Example (for legal list):
A.2. Reserved Characters (see also E.2, cf. H) 1. one
\clearpairofpagestyles \newlist{legal}{enumerate}{10}
1.1. two E.7. References with hyperref (loads url implicitly)
\ introduces a command \ohead[]{\headmark} \ofoot[\pagemark]{\pagemark} \setlist[legal]{label*=\arabic*.,noitemsep}
\textbackslash
  Use: \begin{legal} \item ...\end{legal}
1.1.1. three \autocite{citekey } Cite a bibliographic reference (package biblatex)
{ } embraces arguments, creates logical parts \{ \}  1.1.2. strawberry
\label{marker } Set a marker for cross reference, often if the form
[ ] embraces optional arguments [ ]
% Variant for a thesis with horizontal rules at head and foot \label{sec:item} or \label{fig:diag1}
% comments: code after % will be ignored. \% \usepackage[headsepline=0.005pt:,footsepline=0.005pt:, D.8. Separate Files
\autoref{marker } Give type name and number of marker
& separates columns in tabular-like environments \& plainfootsepline,automark]{scrlayer-scrpage} ß After preamble within the text place:\include{file } Text starts and
\clearpairofpagestyles \autopageref{marker } Give abbreviation of “page” and page
# parameter for own command declarations \# ends on a new page. file has to be in the same directory as the
\ohead[]{\headmark} \ofoot[\pagemark]{\pagemark} number of marker
$ text style math mode (abbr. for \( . . . \) ) \$ master file. Otherwise specify a path: \include{path/file }
\ModifyLayer[addvoffset=-.6ex]{scrheadings.foot.above.line}
ß In preamble place: \includeonly{file1,file2 } to run only these files. \url{url } Print clickable web page
_^ index/exponent only valid in math mode, e.g. a12 see E.2 \ModifyLayer[addvoffset=-.6ex]{plain.scrheadings.foot.above.line} \href[options ]{url }{text } Print clickable link
ß Use \input{file } includes a file without starting/ending on a new
\setkomafont{pageheadfoot}{\small}
  page (\includeonly not valid). \hyperref[marker ]{text } Print clickable reference
B. Preamble (before \begin{document}) Style: \urlstyle{xx } with xx a style like “tt”, “rm”, “sf” or “same”.
E. Text Names for autoref (package babel):
B.1. Documentclass (necessary) C.3. Linespread with setspace \renewcaptionname{language }{\typename autorefname}{text },
Use: \documentclass[opt,opt,. . . ]{class } Load: \usepackage[onehalfspacing]{setspace} for 1.5 line spacing. E.1. Paragraphs (≈ “new idea in content”) e.g. \renewcaptionname{english}{\subsectionautorefname}{section}
Recommended classes: scrartcl, scrreprt, scrbook, scrlttr2 Paragraphs are separated by an empty line in the code or by \par.
Non-KOMA - Script classes: beamer, koma-moderncvclassic D. Document Structure (see also L) A \\ produces a new line – use sparingly, seldom needed outside tabulars. E.8. Acronyms with acro
Correct Overfull Box Warnings with more than 4pt (look into log file). 
Common options with default Values available (subtotal) D.1. Start Document \usepackage{acro,hyperref,longtable,tabu} %next 5 to praeambel
fontsize=11pt 10pt | 12pt (e.g. 12.5pt also valid) \begin{document} Complete document contents. \end{document} \acsetup{list-style=longtabu,list-heading=addchap}
E.2. Text Symbols/Characters (see also A.2)
\DeclareAcroListStyle{longtabu}{table}{table=longtabu,
paper=a4, paper=portrait a3 | a5 | b4 | letter, landscape A lot of diacritic symbols can be typed directly, e.g. è é ê ñ ç
table-spec=@{}>{\bfseries}lX@{}}
parskip=no half | full D.2. Title
§ \S _ \textunderscore{} ~ \textasciitilde{} \DeclareAcronym{ecm}{short=EM,long=Electro Machining}
headings=big small | normal simple title: \author{text } \title{text } \date{\today} \maketitle ...
^ \textasciicircum{} . . . \ldots | \textbar
chapterprefix=false true title page self designed: \begin{titlepage} text \end{titlepage} \ac{EM} or \Ac{EM} for capitalized first letter
Other symbols need packages, e.g. € \texteuro (textcomp) \printacronyms
open=right (scrbook)
captions=oneline
any (scrartcl, scrreprt) | left
nooneline D.3. Table of Contents, List of Figures (for other List of see E.8 & G)  
\tableofcontents \listoftables \listoffigures E.3. Fonts
captions=tablebelow,figurebelow tableabove, figureabove
KOMAoption toc=listof (see B.1) generates entries for TOC. Command Declaration Effect F. Figures & Tables (floating environments)
toc=nolistof listof | listofnumbered
bibliography=totoc | totocnumbered nottotoc \textrm{ text} {\rmfamily
text} Roman family
D.4. Headings F.1. Figures with graphicx
twoside=true (scrbook) false (scrartcl, scrreprt) \textsf{ text} {\sffamily text} Sans serif family Load: \usepackage{graphicx}
twocolumn=false true \part{ title} \chapter{ title} Typewriter family
\texttt{ text} {\ttfamily text} Use: \includegraphics[opt ]{file } (png, jpg, pdf)
draft=false true (show overfull boxes) \section{ title} \subsection{ title} \subsubsection{ title} \textmd{ text} {\mdseries text} Medium series With ‘figure’ the environment to place a graphic is meant. The figure
ß Options of document class are passed to every loaded package. \paragraph{ title} \subparagraph{ title} \textbf{ text} {\bfseries text} Bold series caption is printed where the caption command is placed in the input.
ß Set or change options later in file, e.g. \KOMAoptions{twoside=true} ß \chapter only valid in documentclass scrbook and scrreprt \textup{ text} {\upshape text} Upright shape Extra vertical space is controlled by the KOMAoption captions (see B.1).
ß Use * variants for headings without numbering, no change in counter \textit{ text} {\itshape text} Italic shape Use: \begin{figure}[pos ] ..\caption{..}\label{fig:x} \end{figure}
B.2. Loading Packages and no entry in table of contents. \textsl{ text} {\slshape text} Slanted shape Parameter: pos is a suggestion for placing, it can be ignored by TEX.
\usepackage[options ]{package } ß Use the optional parameter for short titles in headings and table of Possible values are combinations of t (top), h (here), b (bottom), ! (try
\textsc{ text} {\scshape text} Small Caps shape
\PassOptionsToPackage[options ]{package } contents, e.g. \section[short title ]{title } harder), p (separate page).
ß Use \addpart, \addchap or \addsec for unnumbered headings, but More general commands:
Hint: Define a path to the graphic files (no blanks in folder names; no
with running heading and entry in table of contents. \emph{ text} {\em text} Emphasized
special characters in file names) \graphicspath{ {folder /}{folder /}. . . }
B.3. Encoding Settings
 The * variants delete the running heading. \textnormal{ text} {\normalfont text} Document font 
\usepackage[utf8]{inputenc} % most IDEs use UTF8 ß Layout of paragraph and subpargraph similar to other headings: Example: \setkomafont{section}{\scshape} \graphicspath{ {img/} } %subfolder for images; set in preambel
\RedeclareSectionCommands[afterskip=1sp]{paragraph,subparagraph} \begin{figure}\centering
\usepackage[T1]{fontenc} % most fonts needs T1
  \setcounter{secnumdepth}{\subparagraphnumdepth}
E.4. Font Size
\includegraphics[width=.8\columnwidth]{pic.jpg}
\caption[Short title]{Long title}\label{fig:ff}
\setcounter{tocdepth}{\subparagraphtocdepth}
Font size is relative to the base font size, specified in the document class. \end{figure}
B.4. Language Settings with babel \tiny tiny \Large Large  
D.5. Justification
Load: \usepackage[ngerman, main=english]{babel} \scriptsize scriptsize
\footnotesize footnotesize
\LARGE LARGE ß Numbering throughout the whole document (scrbook) with package
Use: \selectlanguage{language } \foreignlanguage{language }{text } chngcntr: \counterwithout{figure}{chapter} (same for table)
 Environment Declaration Other
\small small \huge huge ß Figure name: \renewcaptionname{language }{\figurename}{text }
\documentclass[italian]{scrbook} % global option \begin{center} \centering text \par\vfill text \normalsize normalsize
\usepackage[british,main=italian]{babel} % package option \begin{flushleft} \raggedright text \hfill text \large large \Huge Huge \renewcaptionname{language }{\figureautorefname}{text }

\usepackage{csquotes} % package csquotes knows italian \raggedbottom , \flushbottom Use: {\small text } or {\huge text \par} to limit the size change.
  \begin{flushright} \raggedleft
Example: \setkomafont{pageheadfoot}{\small}
typesetted with cmbright, August 18, 2017
G. Bibliography with biblatex & External Processor biber
F.2. Subfigures with subcaption H.4. More Math Functions H.7.2. AMSMath alignat
Load: \usepackage{subcaption} G.1. Entry types
P
\sum
Q
\prod
`
\coprod \begin{alignat}{3} % 2x3-1 ’&’ are neccessary
Use: \begin{subfigure}[pos ]{width} . . . \end{subfigure}
 @article @book @inbook _
\oint i {11} &=0.25 & i_{12} &=i_{21} & i_{13} &=i_{23}\\
R RR RRR H
\int \iint \iiint
@collection @incollection @manual i_{21} &=\frac{1}{3}i_{11} & i_{22} &=0.5i_{12} & i_{23} &=i_{31}\\
\begin{figure}[ht] \centering a
~ \vec{a} ȧ \dot{a} ä \ddot{a} â \hat{a} _
i {31} &=0.33i_{22} \quad & i_{32} &=0.15i_{32} \quad
\begin{subfigure}[t]{0.5\textwidth} @misc @online @patent
& i_{33} &=i_{11}
\centering \includegraphics[height=1.2in]{figure-a} @phdthesis @proceedings @periodical \end{alignat}
\caption{Subcaption 1}\label{fig:SubFig1}\end{subfigure} @report @techreport @thesis H.5. Fonts and Sizes in Math Mode (some from AMSMath)
\begin{subfigure}[t]{0.5\textwidth} \mathrm{}, \mathit{}, \mathbf{}, \mathsf{}, \mathtt{}, \boldmath{} i11 = 0.25 i12 = i21 i13 = i23 (1)
\centering \includegraphics[height=1.2in]{figure-b} \mathbb{} e.g. AZ, \mathcal{} e.g. AZ, \mathfrak{} e.g. AZ 1
\caption{Subcaption 2}\label{fig:SubFig2}\end{subfigure} G.2. Entry Fields (example see L) \displaystyle, \scriptstyle, \scriptscriptstyle, \textstyle i21 = i11 i22 = 0.5i12 i23 = i31 (2)
\caption{Caption of complete figure}\label{fig:Fig1} 3
author title journal year volume \boldsymbol{}
\end{figure} i31 = 0.33i22 i32 = 0.15i32 i33 = i11 (3)
  editor publisher institution school series
pages organization number note key H.6. Often used Math Expressions
H.7.3. AMSMath flalign
F.3. Tables width aligned material x n+1 x^{n+1} Ekin E_{\mathrm{kin}}
\begin{flalign*}
With ‘table’ the environment to place aligned material is meant. The G.3. Styles a+b n 2 i_{11} & =0.25 & i_{12} & =i_{21} & i_{13} & =i_{23}\\
p
\frac{a+b}{2} a + b2 \sqrt[n]{a^2+b^2}
table caption is printed where the caption command is placed in the alphabetic authoryear authortitle numeric mla verbose 2 i_{21} & =\frac{1}{3}i_{11} & i_{22} & =0.5i_{12}
input. For positioning options see F.1. x_1, \ldots, x_n x_1 + \cdots + x_n & i_{23} & =i_{31}\cdot\sqrt{5}\\
 chem-acs phys nature science ieee apa
See https://de.sharelatex.com/learn/Biblatex_bibliography_styles
x1 , . . . , xn x1 + · · · + xn
i_{31} & =0.33i_{22} & i_{32} & =0.15i_{32} & i_{33} & =i_{11}
\KOMAoptions{captions=tableabove} % move to praeambel  2 \end{flalign*}
\begin{table}[htbp] \centering
1 \left( a + \frac{1}{2} \right)^2
a+ i11 = 0.25 i12 = i21 i13 = i23 (1)
G.4. Example
\caption{Table caption}\label{tab:exp}
\begin{tabular}{@{}ll@{}}
 N
2
N 1 √
5 (2)
X Y
\emph{Name} & \emph{Desc.}\\ \hline % in preambel \sum_{i=1}^{N} \prod_{i=1}^{N} i21 = i11 i22 = 0.5i12 i23 = i31 ·
\usepackage[autostyle=true]{csquotes} % Load 3
tikz2pdf & Python script\\ i=1 i=1
LaTable & visual table editor \usepackage[backend=biber,style=nature,language=british] i31 = 0.33i22 i32 = 0.15i32 i33 = i11 (3)
{biblatex} % Load lim \lim_{a \rightarrow \infty}
\end{tabular} a→∞
\end{table} \addbibresource{mybibliographyfile.bib} % Define Zb
  % anywhere within the document
x2 dx \int_a^b x^2\; \mathrm{d}x
H.7.4. AMSMath gather
Use: \begin{tabular}[c b t]{@{} l r c | p{unit }} \autocite{citekey} % Use \begin{gather}
\printbibliography % Print a D(a,r) \equiv \{z \in \mathbf{C} \colon |z-a| < r \} \notag\\
Column separation: @{\hspace{unit }} or \setlength{\tabcolsep}{unit }
 

df \operatorname{seg} (a,r) \equiv \{ z \in \mathbf{C}
Row separation: \\[unit ] or \renewcommand{\arraystretch}{unit } \left. \frac{\mathrm{d}f}{\mathrm{d}x} \right|_{x_0}
KOMAoption bibliography (see B.1) generates entry for TOC. dx x \colon \Im z < \Im a, \ |z-a| < r \}\\
Partial lines: \cline{2-3} instead of \hline 0
C (E, \theta, r) \equiv \bigcup_{e\in E} c (e, \theta, r)
\myvec{F}_{\perp}
1 \myvec{F}_{\parallel}
1
Additional packages: array, longtable, booktabs, tabu, F⊥ Fk
\end{gather}
xcolor with option table, tabularx, tabulary G.5. External Processor 1
a > A† A∗ \myvec{a}^{\top} A^{\dagger} \boldmath{A}^{*} D(a, r ) ≡ {z ∈ C : |z − a| < r }
IDEs like TEXstudio include the external processor, select biber as
!
F.4. Colored Table bibliography tool for ‘build’ in preferences, otherwise run biber explicitly. def
seg(a, r ) ≡ {z ∈ C : =z < =a, |z − a| < r } (1)

< = \stackrel{!}{<} \stackrel{\mathrm{def}}{=}
abov e [
\usepackage[table]{xcolor} % move to praeambel C(E, θ, r ) ≡ c(e, θ, r ) (2)
H. Math mid mid \overset{above}{mid} \underset{below}{mid}
below
\rowcolors{1}{}{lightblue} % {start row}{odd-row}{even-row} e∈E
1 \newcommand{\myvec}[1]{\ensuremath{\underline{\boldsymbol{#1}}}}
\begin{tabular}{clr} ... \end{tabular} H.1. Math mode (Standard LATEX)
  Textstyle: \(x^2 + 4\) x 2 + 4 as part of the text. H.7.5. AMSMath matrix
Displaystyle: \[ x^2 + 4 \] separat line, centered H.7. Math with amsmath (replacing standard Environments) \begin{matrix} a & b \\ c & d \end{matrix}
F.5. Suppress Floating with float Equation: \begin{equation} . . . \end{equation}\label{name }
equation equation* One line, one equation \begin{pmatrix} a & b \\ c & d \end{pmatrix}
For a thesis most students want to control the placing of figures and multline multline* One unaligned multiple-line equation, one number \begin{bmatrix} a & b \\ c & d \end{bmatrix}
tables themselves. One way is more control with placeins. Another way Zx1 t \begin{Bmatrix} a & b \\ c & d \end{Bmatrix}
f 2
!
gather gather* Several equations without alignment
is to avoid the environments figure and table using \captionof. Quick λ := lim q dt ≤ 1 (1) \begin{vmatrix} a & b \\ c & d \end{vmatrix}
and dirty is an additional positioning parameter using float:
x1 →∞ n
t 2 + sin2 (t) align align* Several equations with multiple alignments \begin{Vmatrix} a & b \\ c & d \end{Vmatrix}
x0
Load: \usepackage{float,scrhack} alignat alignat* Multiple alignments, choose spacing between cols ! " # ( )
Several equations: horizontally spread form of align a b a b a b a b a b a b
Use: \begin{figure}[H], \begin{table}[H] ß Use * variant for unnumbered equation (without label). flalign flalign*
c d c d c d c d c d c d

ß Package option for equation position: fleqn fixed indent from the left cases Alignment for cases
F.6. Source Code Listings with listings margin instead of centered. split A simple alignment within a multiple-line equation Dots: \dots or \ldots lower dots, \cdots vertically centered dots, \vdots
Load: \usepackage{listings} ß Options for positions of equation number: leqno or reqno. aligned A “mini-page” with multiple alignments vertical dots, \ddots diagonal dots, \hdotsfor[cols ]{dotspace }
Options: \lstset{ basicstyle=\ttfamily\small, language=Python, multicolumn dots.
gathered A “mini-page” with unaligned equations
numbers=left, keywordstyle=\color{blue}\bfseries } H.2. Important Symbols in Math ß The content is automatically placed in math mode.
See option literate for Umlauts (literate={ä}{{\"a}}1) H.8. AMSMath cases
+ + − - ± \pm ∓ \mp ß Use \intertext{text } to set text within an amsmath environment
Languages: C, C++, Java, Matlab, Python, HTML, XML, . . . ß Length parameter to influence vertical spacing within any amsmath \[ f(n) = \begin{cases} n/2 & \quad \text{if $n$ is even}\\
< < ≤ \le  \ll · \cdot
Use: Environment: \begin{lstlisting} code \end{lstlisting} environment: \jot (e.g. \addtolength{\jot}{1ex}) -(n+1)/2 & \quad \text{if $n$ is odd}\\ \end{cases} \]
> > ≥ \ge  \gg × \times
In line: \lstinline+ code+ (same start- and end char) ß Add singular vertical space for a line via \\[<amount>] (see A.1)
(
= = 6 = \ne ≡ \equiv ≈ \approx n/2 if n is even
File: \lstinputlisting{ filename} ß Use the spreadlines environment from the mathtools package f (n) =
| | ⊥ \perp | \mid k \parallel −(n + 1)/2 if n is odd
1
ß Length parameters (with standard values) to influence vertical white
f0
# Python selection
2 secret=42 f’ ∇ \nabla ∆ \Delta ∂ \partial space around displayed math formulas: \abovedisplayskip=12pt,
3 guess=int(input("Enter number: "))
4 if guess==secret: ∈ \in ∀ \forall ∃ \exists @ \nexists \belowdisplayskip=12pt, \abovedisplayshortskip=0pt,
5 print ("You won!") H.9. Arrows
6
7
elif guess<secret:
print ("No, secret number bigger.")
∩ \cap ∪ \cup ∈
/ \notin \ \setminus \belowdisplayshortskip=7pt
8 7→ \mapsto \leadsto
9
else:
print ("No, secret number is smaller.") ` \ell ∠ \angle ◦ \circ ∅ \emptyset
→ \rightarrow ⇒ \Rightarrow
∨ \lor ∧ \land ¬ \lnot ∅ \varnothing H.7.1. AMSMath align
−→ \longrightarrow =⇒ \Longrightarrow
> \top ⊥ \bot ∞ \infty ∝ \propto
F.7. Boxes and Rules \begin{align} y =d (1) ← \leftarrow ⇐ \Leftarrow
Normal: \parbox[pos][height][contentpos]{width}{text} or y &= d\\
y &= cx+d\nonumber\\ y = cx + d ←− \longleftarrow ⇐= \Longleftarrow
\begin{minipage}[pos][height][contentpos]{width}text\end{minipage} H.3. Math Functions (upright typeface) y &= bx^{2}+cx+d \label{eq:key} ↑ \uparrow ⇑ \Uparrow
Lift Text: \raisebox{lift}[height][depth]{text} y = bx 2 + cx + d (2)
\arccos \arcsin \arctan \arg \cos \cosh \cot \coth \csc \deg \det \end{align} ↓ \downarrow ⇓ \Downarrow
Framed Box: \fbox{text} or \framebox[width][pos]{text}
Colored Box (xcolor): \colorbox{backgroundcolor}{text} \dim \exp \gcd \hom \inf \ker \lg \lim \liminf \limsup ↔ \leftrightarrow ⇔ \Leftrightarrow
\begin{align*}
Framed colored Box: \fcolorbox{bordercolor}{backgroundcolor}{text} \ln \log \max \min \Pr \sec \sin \sinh \sup \tan \tanh y &= d & z &= 1\\ y =d z =1 ⇔ \leftleftarrows ⇒ \rightrightarrows
Resize (graphicx): \scalebox{10}{Giant} For other functions use (package amsmath): \operatorname{name }, e.g. y(x) &= cx+d & z &= x+1\\ y (x) = cx + d z =x +1  \leftrightarrows  \rightleftarrows
Lengths: \setlength{\fboxsep}{unit }, \setlength{\fboxrule}{unit } y_{12} &= bx^2+cx & z &= x^2+x+1 \leftrightharpoons
\rightleftharpoons
\operatorname{arcsinh} (see also J.2). 2 2
\end{align*} y12 = bx + cx z =x +x +1
L. A Sample Document (output on next page)
H.10. Delimiters I.7. Preventing Breaks J.3. Own Environments
(.) (.) [.] [.] b.c \lfloor.\rfloor ß Protected space between words: ~ Define: \newenvironment{ envname}{ cmds begin}{ cmds end}
% thesis.tex
ß Prevent line breaking within text: \mbox{text} Params: #1 . . . #9
|.| |.| {.} \{.\} d.e \lceil.\rceil \documentclass[fontsize=12pt,paper=a4,open=any,parskip=half,
ß Prevent page breaks: \nopagebreak[num], num between 1 and 4 Define: \newenvironment{ envname}[ paramsquantity ]{cmds begin #1 twoside=false,toc=listof,toc=bibliography,fleqn,leqno,
k.k \|.\| |.| \vert.\vert h.i \langle.\rangle ß Cheat a bit on page size: \enlargethispage{unit } (see A.1)
. . . }{ cmds end #2 . . . } captions=nooneline,captions=tableabove,british]{scrbook}
ß Use \left expr \right to stretch delimiters to the height of expr \usepackage[utf8]{inputenc} % load early
ß A missing delimiter can be added with ., e.g. \left. Exmp: \newenvironment{colorpar}[1]{\color{#1}}{\normalcolor}
I.8. Penalties \usepackage[T1]{fontenc} % load early
ß For manual sizing use \big, \Big, \bigg, e.g. \Big\| \Big\lceil Use: \begin{colorpar}{violet} text \end{colorpar} \usepackage[ngerman,main=british]{babel}
Penalties are the main values that TEX tries to minimise when line or
\usepackage[autostyle=true]{csquotes}
page breaks are calculated.
\usepackage{graphicx, booktabs, float, scrhack}
H.11. Physical Units with siunitx \linepenalty=10 page break within a paragraph J.4. Some important Variables
\usepackage{amsmath,amssymb}
Load: \usepackage[sticky-per=true, per-mode=reciprocal]{siunitx} \hyphenpenalty=50 line break at an automatic hyphen
Counters: page, section, figure, equation; to get the formatted content
\usepackage[automark]{scrlayer-scrpage}
Options: \sisetup{output-decimal-marker={,}, per-mode=symbol} of a counter add \the, e.g. \thepage
\binoppenalty=700 line break at a binary operator \usepackage[backend=biber,style=verbose,sortcase=false,
Use: \num{number }, \si{unit }, \SI{number }{unit }, \ang{deg ;min;sec } Lengths: \textwidth, \linewidth, \columnwidth, \parindent, \parskip language=british]{biblatex}
\relpenalty=500 line break at a relation Change: \setlength, \addtolength
7 123 456.7 × 101 \num{7123456.7e1} \addbibresource{thesis.bib}
\clubpenalty=150 page break after first line of paragraph \PassOptionsToPackage{hyphens}{url}
4°320 1000 \ang{4;32;10} \widowpenalty=150 page break before last line of paragraph
J.5. Helpfull other Commands for defining own Commands \usepackage[hidelinks]{hyperref} % load late
[g] = m s−2 [g] = \si{\meter\per\second\squared} \brokenpenalty=100 page break after a hyphenated line \setkomafont{disposition}{\sffamily\color{gray!70}}
ß \ensuremath, e.g. $\tx=...$ defines \tx. by
E = 1.3 kV
E = \SI{1.3}{\kilo\volt\per\milli\meter} \tolerance=200 acceptable badness of lines after hyphenation \begin{document}
mm \newcommand{\tx}{\ensuremath{\tilde{x}}}
\frontmatter % only if you need page numbering roman
SI units like \degreeCelsius, \henry; prefixes like \kilo, \exa. ß Look for \Declare... in package documentations. \titlehead{\hfill\includegraphics[width=2cm]{logo}}
I.9. Page Layout ß Packages: etoolbox, xparse, xkeyval, calc; see also tocbasic. \title{My Title} \subtitle{My Subtitle} \author{N.\,N.} \date{}
\maketitle
I. Typographic Issues 4 5 2 \tableofcontents \listoffigures \listoftables
top K. Useful Weblinks and Summary of Packages
I.1. Hyphen and Dashes (for Minus see H.2)
Header Forum http://latex.org \mainmatter % page numbering arabic, starting by 1 again
Name Source Example Use \chapter[Intro]{Introduction}\label{sec:intro}
Forum (German) http://golatex.de http://texwelt.de \section{Technical introduction}\label{sec:tecintro}
6
hyphen - X-ray, in- and output Connecting words FAQ (German) https://texfragen.de \subsection*{Heading without number}
1
en-dash -- 1–5, Paris–Rome Range or Toward 10 PhD Thesis https://www.dickimaw-books.com/latex/thesis Some text in \textbf{bold}, some more text.
en-dash -- Paris – except Rome European dash Math https://meta.wikimedia.org/wiki/Help:Displaying_a_formula Some text in \emph{emph}, more text.
And now some text in German language
em-dash --- Paris—except Rome American dash left right Fonts http://www.tug.dk/FontCatalogue
7 \foreignlanguage{ngerman}{Hier kommt eine Formel:} \(2+2=5\)
Symbols https://ctan.org/pkg/comprehensive
Download (Software) https://tug.org/texlive A new paragraph, viz. a new idea, a new thought.
I.2. Quotation Marks with csquotes Body Margin
3 Notes CTAN (Packages) https://ctan.org
Load: \usepackage[autostyle=true]{csquotes} \subsection{Heading lower level}\label{sec:headingLL}
Use: \enquote{text } and \foreignquote{language }{text } IDEs TEXStudio (recommended)
More text \emph{emphasized} text.\autocite{WC:2017}
available are all languages loaded with babel, nesting is possible;
9 https://texstudio.sourceforge.net \begin{table}[htp]
* variants provide inner nesting style. TEXshop, TEXworks, Kile, Lyx, . . . \caption{Table caption}\label{tab:table}
Exmp: “Some ‘english’.” / „Ein Deutscher Text“ / « parler français » 8 TU Dresden CD https://github.com/tud-cd/tudscr \begin{tabular}{l@{\qquad}cr} \toprule
Using LATEX Online https://de.sharelatex.com Head & Head & Head \\ \midrule
Data & first & Row \\
I.3. Font Combinations https://www.overleaf.com
Data & second & Row \\ \bottomrule
Rule: Use serif fonts for long body text and sans-serif for headings. DANTE e.V. https://www.dante.de \end{tabular}
Hint: Load fonts with combined math fonts. \end{table}
Example packages: mathptmx (Times), mathpazzo (Palatino), mathpple Footer
For all packages a documentation can be found with:
(Palatino text, Euler math), mathtime (Times text, Belleek math). bottom texdoc package name (or in the Help menu in IDEs) \chapter{Method}\label{sec:ana}
11 Some text, see \autoref{tab:table} for aligned material.
Hint: Add \KOMAoptions{DIV=last} after loading a font package. The documentation for KOMA - Script can be found with
À 1in + \hoffset Á 1in + \voffset  \oddsidemargin texdoc scguien or texdoc scrguide (German)
L’Hôpital’s rule:
I.4. Numbers and Dates à \topmargin Ä \headheight Å \headsep acro Acronyms, Glossary \begin{equation}
Numbers Style Use Æ \textheight Ç \textwidth È \marginparwidth amsmath,amssymb Math extended, Math symbols extended \lim_{x\to 0}{\frac{e^x-1}{2x}}
É \marginparwidth ○ 11 \footskip \overset{\left[\frac{0}{0}\right]}{\underset{\mathrm{H}}{=}}
babel Language depend issues
old-style  text, dates \lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}}
Hint: This image with the current values of the specific document can be biblatex Bibliography
lining 1234567890 math \end{equation}\label{eq:lhopital}
generated by loading the package layout and the command \layout. booktabs Rules in tabular \newpage
British American European csquotes Quotations esp. in bibliography More text. A \enquote*{quote} and a \foreignquote{ngerman}{Zitat}.

27/06/17 06/27/17 27.6.2017


J. Own Commands and Environments enumitem Lists extended
\appendix % headings numbered with letters
27 June, 2017 June 27, 2017 27. Juni 2017 float Suppress floating, needs scrhack
J.1. Own Commands in General \chapter{Appendix}\label{sec:app}
ß \newcommand doesn’t work if the command is already defined: so it’s a fontenc,inputenc Font encoding, input encoding \begin{figure}[H]
International notation (ISO 8601): yyyy-mm-dd: 2017-06-27 geometry Page layout, e.g. size \KOMAoptions{captions=centeredbeside}
completely new definition.
Graphics \begin{captionbeside}%
ß \renewcommand works only if the command is already defined: it’s a graphicx
I.5. Spacing horizontally [Example of a caption centeredbeside]%
redefinition. hyperref Hyperlinks {Example of a caption beside the figure}
Avoid spacing with fixed units like \hspace{0.5cm} use \quad or \qquad ß \providecommand works like \newcommand, but if the command is listings Source code listings, needs scrhack sometimes [o] % position left/right/inner/outer
instead (see also A.1). Spacing in math is almost always right! already defined, the (re)definition is ignored. longtable Tables longer than a page [\linewidth] % width of figure+caption
Math Math/Text Math/Text Math/Text ß \AtBeginDocument{commands } can be helpful. [0.0in] % offset from left side
microtype Optical margin alignment
\framebox{\begin{minipage}[t][3cm][c]{0.5\textwidth}
a b ab a\!b ab ab a\;b ab ab a\quad b a b multicols Multiple columns extended
J.2. Own Commands {\begin{center} A BOX\end{center}}\end{minipage}}
a\>b ab a\,b a b a b a\ b a b a b a\qquad b a b pdfpages Including PDF pages \end{captionbeside}\label{fig:cbeside}\end{figure}
Define: \newcommand{\ cmdname}{ commands}
scrlayer-scrpage Page layout, e.g. headings, watermarking \printbibliography
\hspace{length}; * variant \hspace*{length} space even at line start Exmp: \newcommand{\mytext}{Some text which I need very often.}
Use with care: \hphantom{text } setspace Control line spread, needs scrhack sometimes \end{document}
Exmp: \newcommand{\diff}{\mathop{}\!\mathrm{\vphantom( d}}
scrhack Avoid warnings from float, listings, setspace
Params: #1 . . . #9 # thesis.bib
subcaption Multiple figures with multiple captions @misc{ WC:2017,
I.6. Spacing vertically Define: \newcommand[ paramsquantity ]{\cmdname}{ cmds #1. . .}
ß Vertical space is only effective between paragraphs (see E.1). textcomp Text symbols extended author = {Wikipedia},
Redefine: \renewcommand[ paramsquantity ]{\cmdname}{ commands}
tabularx | tabulary Tabular extended title = {\TeX{}---Wikipedia{,} The Free Encyclopedia},
ß Avoid spacing with fixed units like \vspace{0.5cm} use rubber length
Copy: with letltxmacro: \LetLtxMacro{\ cmdcpyname}{\ cmdname} upgreek Upright greek symbols note = {\url{https://en.wikipedia.org/wiki/TeX},
like \smallskip, \medskip or \bigskip instead (see also A.1) last referenced 24-June-2017}
ß \vspace{length}; * variant \vspace*{length} space even at page start Define: \DeclareMathOperator{ name}{ commands} wrapfig | floatflt Graphic surrounded by text }
ß \\[unit ] (see A.1) Exmp: \DeclareMathOperator{\dirac}{\ensuremath{\delta}} xcolor Color
ß Use with care: \vphantom{text } Exmp: \DeclareMathOperator{\acrsinh}{arcsinh}
Contents List of Figures List of Tables 1. Introduction
List of Figures iii A.1. Example of a caption centeredbeside . . . . . . . . . . . . . . . . . . . . 4 1.1. Table caption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1. Technical introduction
List of Tables iv
Heading without number
My Title 1. Intro
1.1. Technical introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1
Some text in bold, some more text. Some text in emph, more text. And now some text
My Subtitle 1.1.1. Heading lower level . . . . . . . . . . . . . . . . . . . . . . . . . . 1
in German language Hier kommt eine Formel: 2 + 2 = 5
2. Method 2 A new paragraph, viz. a new idea, a new thought.
N. N. A. Appendix 4
1.1.1. Heading lower level
Bibliography 5
More text emphasized text.1

Table 1.1.: Table caption

Head Head Head


Data first Row
Data second Row

1
Wikipedia. TEX—Wikipedia, The Free Encyclopedia. https://en.wikipedia.org/wiki/TeX, last
referenced 24-June-2017.

ii iii iv 1

2. Method

More text. A “quote” and a „Zitat“.

2. Method A. Appendix Bibliography


Some text, see Table 1.1 for aligned material. Wikipedia. TEX—Wikipedia, The Free Encyclopedia. https : / / en . wikipedia . org /
wiki/TeX, last referenced 24-June-2017.
L’Hôpital’s rule:
Figure A.1.: Example of a caption beside
ex − 1 [ 00 ] ex 1 A BOX
(2.1) lim = lim = the figure
x→0 2x H x→0 2 2

License
Reference Sheet, Version 1.2, August 2017
This Cheat Sheet is free under the terms and conditions of the LATEX Project Public
License Version 1.3c.
Authors: Marion Lammarsch, University of Heidelberg, and Elke Schubert, Stutensee
Credit for the layout and content ideas goes to
(a) Emanuel Regnath, “LATEX Cheat Sheet” LATEX4EI, 2013
http://www.latex4ei.de/downloads/LaTeX_CheatSheet.pdf
(b) Tammo Schwindt, DHBW Mosbach, “LaTeX Sheet German”, Ed. 2014
http://mirror.ctan.org/tex-archive/info/latexcheat/latexcheat-de/
The logo with the TEX lion is sketched by Duane Bibby, https://mirror.ctan.org/
lion/files; the graphic of a header of a page is from the KOMA-Script documentation,
file scrlayer-scrpage.tex; the page layout image is done by using the package layout and
the command \layout and the red lines and red text added with a graphics program.

Acknowledgements
We would like to thank Markus Kohm, Ulrike Fischer, Martin Sievers, and Herbert Voß
for their useful hints and suggestions.
Not naming all the female and male students which with their intrigued questions helped
to improve this reference sheet.

2 3 4 5

You might also like