Reference Sheet for a Thesis C. Layout D.6. Lists E.5. Colors with xcolor symbol with LAT X2e and KOMA-Script C.1. Changing Page Layout with geometry \begin{itemize} with bullets \item or \item[ ] E \usepackage{xcolor} ª Let KOMA-Script know of geometry by option usegeometry=true. \begin{enumerate} with numbers \item ª \definecolor{DarkBlue}{RGB}{0, 115, 207} All examples were tested with pdflatex. \begin{description} \item[word] § with bold words \colorlet{col_section}{DarkBlue} ª The package mentioned in the headings has to be included (see B.2). \usepackage[left=2cm, right=2, top=3cm, bottom=4cm, \begin{labeling}[separator ]{labelinglabel} \item[word] \textcolor{red}{text in red} or {\color{red}text} ª Compile three times after last change (esp. docs with references). bindingoffset=1cm, inlcudeheadfoot]{geometry} § \colorbox{gray!25}{color gray faded by 25\%} \begin{enumerate} ª Auto-completion determines unspecified dimensions (under or over A. LATEX Basics § \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} Fade a color with color !value between 0 and 100 ª Available units for length and dimensions: includefoot, includeheadfoot, twocolumn ª \newgeometry{ opt, opt, ... } Headings in color: \setkomafont{disposition}{\color{color }} bp point (typographic) mm millimeter in inch em width of M Changing page layout mid document: px pixel (1/72in) cm centimeter pc pica ex height of x D.7.¦ Enhanced Lists with enumitem ¥ E.6. Footnotes ª Document dependent units z\textwidth, z\linewidth, C.2. Header and Footer of Page (aka running heading) Load: \usepackage{enumitem}

z\columnwidth z\textheight z lehead cehead rehead lohead cohead rohead Example (for enumerate): \footnote{text} Print footnote marker in text and footnote at , with a percentage value, e.g. \ \ \ \ \ \ 0.55\textwidth \setlist[enumerate,1]{label=\Alph )} A) one means 55% of the actual width of the text. 6 6 6 6 6 6 * bottom of page ihead ª \baselineskip \ \setlist[enumerate,2]{label=\alph )} a) one minimum vertical space between the bottom of two chead * \footnotemark Print footnote marker in text (e.g. within tabu- \ ohead successive lines in a paragraph. \ \setlist[enumerate,3]{label=\roman*)} b) two lar or caption) ª 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 Example (for legal list): \usepackage[automark]{scrlayer-scrpage} 1. one A.2. Reserved Characters (see also E.2, cf.H) § \newlist{legal}{enumerate}{10} \clearpairofpagestyles 1.1. two E.7. References with hyperref (loads url implicitly) \ohead[]{\headmark} \ofoot[\pagemark]{\pagemark} \setlist[legal]{label*=\arabic*.,noitemsep} \ introduces a command \textbackslash 1.1.1. three Use: \begin{legal} \item ...\end{legal} \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 fora 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 \autopageref{marker } Give abbreviation of “page” and page # parameter for own command declarations \# \clearpairofpagestyles 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} \url{url} _ 2 ª In preamble place: \includeonly{file1,file2 } to run only these files. Print clickable web page ^ index/exponent only valid in math mode, e.g. a1 see E.2 \ModifyLayer[addvoffset=-.6ex]{plain.scrheadings.foot.above.line} ª Use \input{file} includes a file without starting/ending on a new \href[options]{url}{text} Print clickable link \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”. Names for autoref (package babel): setspace E. Text B.1. Documentclass (necessary) C.3.¦ Linespread with ¥ \renewcaptionname{language}{\typenameautorefname}{text}, \usepackage[onehalfspacing]{setspace} Use: \documentclass[opt,opt,. . . ]{class} Load: 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 alsoL) 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}%next5 to praeambel Complete document contents. \acsetup{list-style=longtabu,list-heading=addchap} fontsize=11pt 10pt | 12pt (e.g. 12.5pt also valid) \begin{document} \end{document} 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 ... text ^ \textasciicircum{} ... \ldots | \textbar chapterprefix=false true title page self designed: \begin{titlepage} \end{titlepage} \ac{EM} or \Ac{EM} for capitalized first letter Other symbols need packages, e.g. € \texteuro (textcomp) open=right (scrbook) any (scrartcl, scrreprt) | left \printacronyms captions=oneline nooneline D.3. Table of Contents, List of Figures (for other List of see E.8&G) E.3. Fonts captions=tablebelow,figurebelow tableabove, figureabove \tableofcontents \listoftables \listoffigures KOMAoption toc=listof (see B.1) generates entries for TOC. toc=nolistof listof | listofnumbered Command Declaration Effect ¦F. Figures & Tables (floating environments) ¥ bibliography=totoc | totocnumbered nottotoc \textrm{text} {\rmfamily text} Roman family F.1. Figures with graphicx twoside=true (scrbook) false (scrartcl, scrreprt) D.4. Headings \textsf{text} {\sffamily text} Sans serif family Load: \usepackage{graphicx} twocolumn=false true \part{title} \chapter{title} \texttt{text} {\ttfamily text} Typewriter family Use: \includegraphics[opt]{file} (png, jpg, ) 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 ª \paragraph{title} \subparagraph{title} Options of document class are passed to every loaded package. \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} and no entry in table of contents. B.2. Loading Packages \textsl{text} {\slshape text} Slanted shape Parameter: pos is a suggestion for placing, it can be ignored by TEX. options package ª Use the optional parameter for short titles in headings and table of t h b ! \usepackage[ ]{ } \textsc{text} {\scshape text} Small Caps shape Possible values are combinations of (top), (here), (bottom), (try \PassOptionsToPackage[options]{package} contents, e.g. \section[short title]{title} harder), p (separate page). More general commands: ª Use \addpart, \addchap or \addsec for unnumbered headings, but Hint: Define a path to the graphic files (no blanks in folder names; no text text Emphasized with running heading and entry in table of contents. \emph{ } {\em } folder folder B.3. Encoding Settings special characters in file names) \graphicspath{ { /}{ /}... } The * variants delete the running heading. \textnormal{text} {\normalfont text} Document font ª \graphicspath{ {img/} }%subfolder for images; set in preambel \usepackage[utf8]{inputenc}% most IDEs use UTF8 Layout of paragraph and subpargraph similar to other headings: Example: \setkomafont{section}{\scshape} \begin{figure}\centering \usepackage[T1]{fontenc}% most fonts needsT1 \RedeclareSectionCommands[afterskip=1sp]{paragraph,subparagraph} § § \setcounter{secnumdepth}{\subparagraphnumdepth} \includegraphics[width=.8\columnwidth]{pic.jpg} E.4. Font Size \setcounter{tocdepth}{\subparagraphtocdepth} \caption[Short title]{Long title}\label{fig:ff} 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 \scriptsize scriptsize ª Load: \usepackage[ngerman, main=english]{babel} \LARGE LARGE Numbering throughout the whole document (scrbook) with package Use: \selectlanguage{language} \foreignlanguage{language}{text} Environment Declaration Other \footnotesize footnotesize ¦chngcntr: \counterwithout{figure}{chapter} (same for table) ¥ \small small \huge huge ª Figure name: \renewcaptionname{language}{\figurename}{text} text text \normalsize \documentclass[italian]{scrbook}% global option \begin{center} \centering \par\vfill normalsize \renewcaptionname{language}{\figureautorefname}{text} \large \Huge Huge §\usepackage[british,main=italian]{babel}% package option \begin{flushleft} \raggedright text \hfill text large \usepackage{csquotes}% package csquotes knows italian {\small text} {\huge text\par} \begin{flushright} \raggedleft \raggedbottom, \flushbottom Use: or to limit the size change. typesetted with cmbright, August 18, 2017 Example: \setkomafont{pageheadfoot}{\small} ¦ ¥ G. Bibliography with biblatex & External Processor biber F.2. Subfigures with subcaption H.4. More Math Functions H.7.2. AMSMath alignat \usepackage{subcaption} Load: G.1. Entry types P \sum Q \prod ` \coprod \begin{alignat}{3} % 2x3-1 ’&’ are neccessary Use: \begin{subfigure}[pos]{width} ... \end{subfigure} R RR RRR H _ _ _ _ _ @article @book @inbook \int \iint \iiint \oint i {11} &=0.25 & i {12} &=i {21} & i {13} &=i {23}\\ i_{21} &=\frac{1}{3}i_{11} & i_{22} &=0.5i_{12} & i_{23} &=i_{31}\\ @collection @incollection @manual ~a \vec{a} a˙ \dot{a} a¨ \ddot{a} aˆ \hat{a} \begin{figure}[ht] \centering i_{31} &=0.33i_{22} \quad & i_{32} &=0.15i_{32} \quad @misc @online @patent § \begin{subfigure}[t]{0.5\textwidth} & i_{33} &=i_{11} \centering\includegraphics[height=1.2in]{figure-a} @phdthesis @proceedings @periodical \end{alignat} \caption{Subcaption 1}\label{fig:SubFig1}\end{subfigure} H.5. Fonts and Sizes in Math Mode (some from AMSMath) @report @techreport @thesis i = 0.25 i = i i = i \begin{subfigure}[t]{0.5\textwidth} \mathrm{}, \mathit{}, \mathbf{}, \mathsf{}, \mathtt{}, \boldmath{} 11 12 21 13 23 (1) \centering\includegraphics[height=1.2in]{figure-b} \mathbb{} e.g. AZ, \mathcal{} e.g. AZ, \mathfrak{} e.g. AZ 1 i = i i = 0.5i i = i \caption{Subcaption 2}\label{fig:SubFig2}\end{subfigure} G.2. Entry Fields (example seeL) \displaystyle, \scriptstyle, \scriptscriptstyle, \textstyle 21 11 22 12 23 31 (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 A S flalign n+1 H.7.3. M Math ¦ ¥ x x^{n+1} Ekin E_{\mathrm{kin}} F.3. Tables width aligned material \begin{flalign*} G.3. Styles a + b pn With ‘table’ the environment to place aligned material is meant. The \frac{a+b}{2} a2 + b2 \sqrt[n]{a^2+b^2} i_{11} & =0.25 & i_{12} & =i_{21} & i_{13} & =i_{23}\\ 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. chem-acs phys nature science ieee apa x1, . . . , xn x_1, \ldots, x_n x1 + ··· + xn x_1 + \cdots + x_n & i_{23} & =i_{31}\cdot\sqrt{5}\\ See https://de.sharelatex.com/learn/Biblatex_bibliography_styles i_{31} & =0.33i_{22} & i_{32} & =0.15i_{32} & i_{33} & =i_{11} \KOMAoptions{captions=tableabove}% move to praeambel  1 2 \end{flalign*} \begin{table}[htbp] \centering \left( a + \frac{1}{2} \right)^2 § a + i = 0.25 i = i i = i \caption{Table caption}\label{tab:exp} G.4. Example 2 11 12 21 13 23 (1) \begin{tabular}{@{}ll@{}} N N 1 √ % in preambel X Y i = i i = 0.5i i = i · 5 (2) \emph{Name} & \emph{Desc.}\\ \hline \sum_{i=1}^{N} \prod_{i=1}^{N} 21 3 11 22 12 23 31 tikz2pdf & Python script\\ §\usepackage[autostyle=true]{csquotes}% Load i=1 i=1 LaTable & visual table editor \usepackage[backend=biber,style=nature,language=british] i31 = 0.33i22 i32 = 0.15i32 i33 = i11 (3) lim \lim_{a \rightarrow \infty} \end{tabular} {biblatex}% Load a→∞ \addbibresource{mybibliographyfile.bib}% Define b \end{table} Z A S gather % anywhere within the document 2 H.7.4. M Math x dx \int_a^b x^2\; \mathrm{d}x 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} bibliography dx x \colon \Im z < \Im a, \ |z-a| < r \}\\ \cline{2-3} \hline KOMAoption (see B.1) generates entry for TOC. 0 Partial lines: instead of C (E, \theta, r) \equiv \bigcup_{e\in E} c (e, \theta, r) F F \myvec{F}_{\perp}1 \myvec{F}_{\parallel}1 Additional packages: array, longtable, booktabs, tabu, ¦ ¥ ⊥ k \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 ! def F.4. Colored Table bibliography tool for ‘build’ in preferences, otherwise run biber explicitly. < = \stackrel{!}{<} \stackrel{\mathrm{def}}{=} seg(a, r) ≡ {z ∈ C: =z < =a, |z − a| < r} (1) above [ C(E, θ, r) ≡ c(e, θ, r) (2) \usepackage[table]{xcolor}% move to praeambel H. Math mid mid \overset{above}{mid} \underset{below}{mid} \rowcolors{1}{}{lightblue}%{start row}{odd-row}{even-row} below e∈E § 1 \begin{tabular}{clr} ... \end{tabular} \newcommand{\myvec}[1]{\ensuremath{\underline{\boldsymbol{#1}}}} H.1. Math mode (Standard LATEX) 2 Textstyle: \(x^2 + 4\) x + 4 as part of the text. H.7.5. AMSMath matrix \[ x^2 + 4 \] amsmath Displaystyle: separat line, centered H.7. Math with (replacing standard Environments) \begin{matrix} a & b \\ c & d \end{matrix} float Equation: \begin{equation} ... \end{equation}\label{name} F.5.¦ Suppress Floating with ¥ 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 \begin{bmatrix} a & b \\ c & d \end{bmatrix} x1 multline multline* One unaligned multiple-line equation, one number tables themselves. One way is more control with placeins. Another way Z f t  ! \begin{Bmatrix} a & b \\ c & d \end{Bmatrix} 2 gather gather* Several equations without alignment \captionof λ := lim dt ≤ 1 (1) \begin{vmatrix} a & b \\ c & d \end{vmatrix} is to avoid the environments figure and table using . Quick x →∞ qn 1 t2 + sin2(t) align align* Several equations with multiple alignments \begin{Vmatrix} a & b \\ c & d \end{Vmatrix} and dirty is an additional positioning parameter using float: x0 alignat alignat* Multiple alignments, choose spacing between cols !" #( ) Load: \usepackage{float,scrhack} 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* Several equations: horizontally spread form of align * 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 \dots \ldots \cdots \vdots F.6. Source Code Listings with listings margin instead of centered. split A simple alignment within a multiple-line equation Dots: or lower dots, vertically centered dots, ª leqno reqno vertical dots, \ddots diagonal dots, \hdotsfor[cols]{dotspace} Load: \usepackage{listings} Options for positions of equation number: or . aligned A “mini-page” with multiple alignments multicolumn dots. Options: \lstset{ basicstyle=\ttfamily\small, language=Python, 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. literate literate={ä}{{\"a}}1) H.8. AMSMath cases See option for Umlauts ( + + − - ± \pm ∓ \mp ª Use \intertext{text} to set text within an amsmath environment Languages: C, C++, Java, Matlab, Python, HTML, XML, . . . \[ f(n) = \begin{cases} n/2 & \quad \text{if $n$ is even}\\ < < ≤ \le  \ll · \cdot ª Length parameter to influence vertical spacing within any amsmath Use: Environment: \begin{lstlisting} code \end{lstlisting} -(n+1)/2 & \quad \text{if $n$ is odd}\\ \end{cases} \] > > ≥ \ge  \gg × \times environment: \jot (e.g. \addtolength{\jot}{1ex}) In line: \lstinline+code+ (same start- and end char) ª Add singular vertical space for a line via \\[] (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) = (n + 1)/2 n | | ⊥ \perp | \mid k \parallel ª − if is odd 1 # Python selection 0 Length parameters (with standard values) to influence vertical white 2 secret=42 f f’ ∇ \nabla ∆ \Delta ∂ \partial 3 guess=int(input("Enter number:")) space around displayed math formulas: \abovedisplayskip=12pt, 4 if guess==secret: ∈ \in ∀ \forall ∃ \exists @ \nexists \belowdisplayskip=12pt \abovedisplayshortskip=0pt 5 print ("You won!") , , H.9. Arrows 6 elif guess \top ⊥ \bot ∞ \infty ∝ \propto \begin{align} F.7. Boxes and Rules y = d (1) ← \leftarrow ⇐ \Leftarrow \parbox[pos][height][contentpos]{width}{text} y &= d\\ Normal: or y = cx + d ←− \longleftarrow ⇐= \Longleftarrow \begin{minipage}[pos][height][contentpos]{width}text\end{minipage} y &= cx+d\nonumber\\ H.3. Math Functions (upright typeface) y &= bx^{2}+cx+d \label{eq:key} 2 ↑ \uparrow ⇑ \Uparrow Lift Text: \raisebox{lift}[height][depth]{text} y = bx + cx + d (2) \end{align} ↓ \downarrow ⇓ \Downarrow Framed Box: \fbox{text} or \framebox[width][pos]{text} \arccos \arcsin \arctan \arg \cos \cosh \cot \coth \csc \deg \det \colorbox{backgroundcolor}{text} \dim \exp \gcd \hom \inf \ker \lg \lim \liminf \limsup ↔ \leftrightarrow ⇔ \Leftrightarrow Colored Box (xcolor): \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 graphicx \scalebox{10}{Giant} \leftrightarrows \rightleftarrows Resize ( ): For other functions use (package amsmath): \operatorname{name}, e.g. y(x) &= cx+d & z &= x+1\\ y(x) = cx + d z = x + 1   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). y = bx 2 + cx z = x 2 + x + 1 \end{align*} 12 L. A Sample Document (output on next page) H.10. Delimiters I.7. Preventing Breaks J.3. Own Environments ª Protected space between words: ~ Define: \newenvironment{envname}{cmds begin}{cmds end} (.) (.) [.] [.] b.c \lfloor.\rfloor % thesis. ª Prevent line breaking within text: \mbox{text} |.| |.| {.} \{.\} d.e \lceil.\rceil Params: #1 ... #9 \documentclass[fontsize=12pt,paper=a4,open=any,parskip=half, ª Prevent page breaks: \nopagebreak[num], num between 1 and 4 envname paramsquantity cmds begin k.k \|.\| |.| \vert.\vert h.i \langle.\rangle Define: \newenvironment{ }[ ]{ #1 twoside=false,toc=listof,toc=bibliography,fleqn,leqno, ª 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 Exmp: \newenvironment{colorpar}[1]{\color{#1}}{\normalcolor} ª A missing delimiter can be added with ., e.g. \left. \usepackage[T1]{fontenc} % load early I.8. Penalties text ª For manual sizing use \big, \Big, \bigg, e.g. \Big\| \Big\lceil Use: \begin{colorpar}{violet} \end{colorpar} \usepackage[ngerman,main=british]{babel} Penalties are the main values that T X tries to minimise when line or E \usepackage[autostyle=true]{csquotes} page breaks are calculated. \usepackage{graphicx, booktabs, float, scrhack} H.11. Physical Units with siunitx J.4. Some important Variables \linepenalty=10 page break within a paragraph \usepackage{amsmath,amssymb} \usepackage[sticky-per=true, per-mode=reciprocal]{siunitx} Counters: page, section, figure, equation; to get the formatted content Load: \hyphenpenalty=50 line break at an automatic hyphen \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 \relpenalty=500 line break at a relation language=british]{biblatex} 1 Change: \setlength, \addtolength \addbibresource{thesis.bib} 7 123 456.7 × 10 \num{7123456.7e1} \clubpenalty=150 page break after first line of paragraph \PassOptionsToPackage{hyphens}{url} 4 3201000 \ang{4;32;10} ° \widowpenalty=150 page break before last line of paragraph \usepackage[hidelinks]{hyperref} % load late −2 J.5. Helpfull other Commands for defining own Commands [g] = m s [g] = \si{\meter\per\second\squared} \brokenpenalty=100 \setkomafont{disposition}{\sffamily\color{gray!70}} page break after a hyphenated line ª \ensuremath, e.g. $\tx=...$ defines \tx. by kV \begin{document} E = 1.3 E = \SI{1.3}{\kilo\volt\per\milli\meter} \tolerance=200 acceptable badness of lines after hyphenation \newcommand{\tx}{\ensuremath{\tilde{x}}} mm \frontmatter % only if you need page numbering roman ª \Declare... SI units like \degreeCelsius, \henry; prefixes like \kilo, \exa. Look for 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{} I. Typographic Issues \maketitle 4 2 \tableofcontents \listoffigures \listoftables 5 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 6 \section{Technical introduction}\label{sec:tecintro} hyphen - X-ray, in- and output Connecting words 1 FAQ (German) https://texfragen.de \subsection*{Heading without number} 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 Fonts http://www.tug.dk/FontCatalogue left 7 right \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 Notes CTAN (Packages) https://ctan.org Load: \usepackage[autostyle=true]{csquotes} 3 IDEs T XStudio (recommended) \subsection{Heading lower level}\label{sec:headingLL} Use: \enquote{text} and \foreignquote{language}{text} E 9 More text \emph{emphasized} text.\autocite{WC:2017} available are all languages loaded with babel, nesting is possible; https://texstudio.sourceforge.net \begin{table}[htp] * variants provide inner nesting style. TEXshop, TEXworks, , 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 Head & Head & Head \\ \midrule Using LATEX Online https://de.sharelatex.com Data & first & Row \\ https://www.overleaf.com I.3. Font Combinations 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} Footer Example packages: mathptmx (Times), mathpazzo (Palatino), mathpple For all packages a documentation can be found with: bottom \chapter{Method}\label{sec:ana} (Palatino text, Euler math), mathtime (Times text, Belleek math). 11 texdoc package name (or in the Help menu in IDEs) Hint: Add \KOMAoptions{DIV=last} after loading a font package. The documentation for KOMA-Script can be found with Some text, see \autoref{tab:table} for aligned material. Œ  Ž texdoc scguien or texdoc scrguide (German) 1in + \hoffset 1in + \voffset \oddsidemargin 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}} \overset{\left[\frac{0}{0}\right]}{\underset{\mathrm{H}}{=}} • \marginparwidth ○11 \footskip 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 1234567890 biblatex Bibliography \end{equation}\label{eq:lhopital} lining math layout \layout generated by loading the package and the command . booktabs Rules in tabular \newpage British American European csquotes Quotations esp. in bibliography More text. A \enquote*{quote} and a \foreignquote{ngerman}{Zitat}. J. Own Commands and Environments enumitem Lists extended 27/06/17 06/27/17 27.6.2017 \appendix % headings numbered with letters float Suppress floating, needs scrhack 27 June, 2017 June 27, 2017 27. Juni 2017 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 completely new definition. geometry Page layout, e.g. size \KOMAoptions{captions=centeredbeside} \begin{captionbeside}% ª \renewcommand works only if the command is already defined: it’s a graphicx Graphics [Example of a caption centeredbeside]% I.5. Spacing horizontally redefinition. hyperref Hyperlinks {Example of a caption beside the figure} Avoid spacing with fixed units like \hspace{0.5cm} use \quad or \qquad ª \providecommand \newcommand works like , 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 ª \AtBeginDocument{commands} can be helpful. Math Math/Text Math/Text Math/Text microtype Optical margin alignment [0.0in] % offset from left side \framebox{\begin{minipage}[t][3cm][c]{0.5\textwidth} multicols a b ab a\!b ab ab a\;b a b a b a\quad b a b Multiple columns extended J.2. Own Commands {\begin{center} A BOX\end{center}}\end{minipage}} a\>b a b a\,b a b a\ b a b a\qquad b pdfpages Including PDF pages \end{captionbeside}\label{fig:cbeside}\end{figure} a b a b a b 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.} \end{document} text setspace Control line spread, needs scrhack sometimes Use with care: \hphantom{ } \newcommand{\diff}{\mathop{}\!\mathrm{\vphantom( d}} Exmp: 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} title = {\TeX{}---Wikipedia{,} The Free Encyclopedia}, ª Avoid spacing with fixed units like \vspace{0.5cm} use rubber length tabularx | tabulary Tabular extended Copy: with letltxmacro: \LetLtxMacro{\cmdcpyname}{\cmdname} note = {\url{https://en.wikipedia.org/wiki/TeX}, \smallskip \medskip \bigskip upgreek Upright greek symbols like , or instead (see also A.1) last referenced 24-June-2017} ª \DeclareMathOperator{name}{commands} \vspace{length}; * variant \vspace*{length} space even at page start Define: 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.1. Technical introduction ...... 1 Some text in bold, some more text. Some text in emph, more text. And now some text 1.1.1. Heading lower level ...... 1 My Subtitle 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:

x 0 x Figure A.1.: Example of a caption beside e 1 [ 0 ] e 1 A BOX (2.1) lim − = lim = the figure x 0 H x 0 → 2x → 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