Sie sind auf Seite 1von 2

4

3. Layout 4. Structure the Document 6. Math Equations


ei
*
LATEX Cheat Sheet 3.1. Pagelayout with geometry package 4.1. Title with titlepage Textstyle: $x^2 + 4$, x2 + 4 as part of the text.
* kann Spuren von Katzen enthalten
nicht fr Humorallergiker geeignet
alle Angaben ohne Gewehr
Write clear & beautiful english with LATEX!
Usage: \geometry{ opt, opt, ... } default: \author{text}, \title{text}, \date{\today}, \maketitle Disyplaystyle: \begin{equation} x^2 + 4 \end{equation}
titlepage: \begin{titlepage} text \end{titlepage}
x1
 
f 2 t
!
4 5 2 := lim dt 1 (1)
1. LaTeX Basics top 4.2. Table of Content, List of . . . x1 n 2
p
t + sin2 (t)
x0
Header \tableofcontents \listoftables \listoffigures
You have to include the package mentioned in the headings e.g. to for numbered equations. use the * variant for unnumbered equations.
\printglossaries (needs glossaries package)
use \definecolor you have to include the xcolor package with
\usepackage{xcolor} in the preamble 6
4.3. Headings 6.1. Fonts and Sizes in Math Mode
Available units for lengths and dimensions: 1
points pt millimeter mm inch in m width em
10 \part{title} \subsubsection{title}
\scriptscriptstyle, \scriptstyle, \textstyle, \displaystyle
\mathrm, \mathit, \mathbb, \mathcal, \mathfrak
pixel px centimeter cm pica pc x height ex \chapter{title} \paragraph{title}
\section{title} \subparagraph{title}
left 7 right 6.2. Often used math expressions
1.1. Special Characters \subsection{title}
n+1
*: no numbering, no entry in ToC x x^{n+1} Ekin E_{\mathrm{kin}}
\part and \chapter only in dcumentcalss book or report a+b
\ Body Margin n 2
p
introduces a command (in text \textbackslash) \frac{a+b}{2} a + b2 \sqrt[n]{a^2+b^2}
{ } embraces arguments, creates logical parts ($\{ \}$) 3 Notes 2
[ ] embraces optional command parameters ($\[ \]$) 4.4. Lists x1 , . . . , xn x_1 , \ldots, x_n
% comments: code after % will be ignored. (\%) 9 \begin{itemize} with bullet \item or \item[symbol] x1 + + xn x_1 + \cdots + x_n
separates columns in tables (\&) \begin{enumerate} with numbered \item
& 1 2
 
8 \begin{description} with bold \item[word] a+ \left( a + \frac12 \right)^2
# parameter for own command declarations (\#) 2
_ ^ indizes and exponents in mathmode. e.g. a21 (\_ \^) \ begin { enumerate }\ itemsep 0 pt N N
X
,
Y \sum\limits_{i=1}^{N},
\ item First Argument
\prod\limits_{i=1}^{N}
\ item Second Argument i=1 i=1
\ end { enumerate } F , F k
2. Preamble before \begin{document} \vec F_{\perp}, \vec F_{\parallel}
lim \lim\limits_{a \rightarrow \infty}
Footer a
2.1. Documentclass (necessary) b
Usage: \documentclass[opt,opt]{class} bottom 5. Text 2
11 x dx \int\limits_a^b x^2\; \mathrm{d}x
Common classes: a
scrartcl (article), scrreprt (report), scrbook (book) 1 1in + \hoffset 2 1in + \voffset 5.1. Fonts df

\left.\frac{\mathrm df}{\mathrm dx}
Common Options: 3 \oddsidemargin 4 \topmargin dx x0
\right|_{x_0}
Command Declaration Effect
10pt/11pt/12pt Font size. 5 \headheight 6 \headsep >
a ,A ,A \vec a^\top, A^\dagger, A^*
letterpaper/a4paper Paper size. 7 \textheight 8 \textwidth \textrm{text} {\rmfamily text} Roman family
! def
9 \marginparwidth 10 \marginparwidth \textsf{text} {\sffamily text} Sans serif family <, = \stackrel{!}{<}, \stackrel{\rm def}{=}
twocolumn Use two columns.
twoside Set margins for two-sided.
11 \footskip \texttt{text} {\ttfamily text} Typewriter family
landscape Landscape orientation. Additional paramter: left,right,top,bottom, paper=a4paper, \textmd{text} {\mdseries text} Medium series 6.3. Math function names (upright, correct spacing)
landscape|portrait, includehead,includefoot, twocolumn \textbf{text} {\bfseries text} Bold series
\sin \sinh \arcsin \csc \ln \min
\textup{text} {\upshape text} Upright shape
2.2. Load Packages (they do all the magic) \cos \cosh \arccos \sec \lg \max
3.2. Header and Footer with fancyhdr \textit{text} {\itshape text} Italic shape
\tan \tanh \arctan \cot \log \lim
Usage: \usepackage[opt, opt]{package} \textsl{text} {\slshape text} Slanted shape
\ usepackage { fancyhdr } \exp \det \tr \dim \ker \Pr
\PassOptionsToPackage{opt, opt}{package} \textsc{text} {\scshape text} Small Caps shape
\ pagestyle { fancy } % use fancyhdr pagestyle
\ fancyhf {} % clear header and footer \emph{text} {\em text} Emphasized
\ fancyhead [ RE ]{} % even page right header \textnormal{text} {\normalfont text} Document font 6.4. Important Math functions
2.3. Penalties P Q
\underline{text} Underline \sum \prod \int
Penalties are the main values that TEXtries to minimise when line or page
breakes are calculated. \int \iint \iiint \oint
\linepenalty=10 breaking a page within a paragraph 3.3. Colors with xcolor a \vec a
.
a \dot a
..
a \ddot a a \hat a
\hyphenpenalty=50 line breaking at an automatic hyphen 5.2. Font size
\ usepackage { xcolor }
\binoppenalty=700 breaking a line at a binary operator \tiny tiny
6.5. Important Symbols in Mathmode
\relpenalty=500 breaking a line at a relation
\ definecolor { tum _ blue }{ RGB }{0 , 115 , 207}
\scriptsize scriptsize
\Large Large
\ colorlet { col _ section }{ tum _ blue }
\clubpenalty=150 *breaking after first line of a paragraph \footnotesize footnotesize
\LARGE LARGE + + - \pm \mp

\widowpenalty=150 *breaking before last line of a paragraph Predefined colors:


white, gray, black, red, green, blue, cyan, magenta, yellow
\small small \huge huge <
>
<
>


\le
\ge


\ll
\gg


\cdot
\times
\brokenpenalty=100 page breaking after a hyphenated line
Fade a color with !value between 0 and 100, e.g. \color{gray!70}
Usage in Text: \textcolor{red}{text} or {\color{red}text}
\normalsize
\large
normalsize
large
\Huge Huge = = 6= \ne \equiv \approx
| | \perp | \mid k \parallel
2.4. Language Settings with babel f0 f \nabla \Delta \partial
\usepackage[ngerman, english]{babel} (last language default) 5.3. Justification \in \forall \exists @ \nexists
\selectlanguage{language} \foreignlanguage{language}{text}
Environment Declaration Other \cap \cup
/ \notin \ \setminus
\begin{center} \centering text \vfill text ` \ell \angle \circ \emptyset
2.5. Glossar and Nomenclature with glossaries \begin{flushleft} \raggedright text \hfill text \lor \land \lnot \varnothing
Load \usepackage[acronym]{glossaries}
\begin{flushright} \raggedleft > \top \bot \infty \propto
Define: \newacronym{label}{ABB}{written-out}
\newglossaryentry{label}{name=..., description=...}
Use: \gls{label}, \glspl{label}

Homepage: www.latex4ei.de please report misstakes immediately. by Emanuel Regnath, contact emanuel.regnath@tum.de Created 17. November 2013 at 16:54 1
6.6. Delimeters
8. Floating Environments 9.2. Quotation Marks 10.2. References with hyperref
(.) (.) [.] [.] b.c \lfloor.\rfloor 8.1. Figures with graphicx \cite{key } Cite a reference
Language Symbols LaTeX
|.| |.| {.} \{.\} d.e \lceil.\rceil \label{marker } Set a marker for cross-reference, of-
k.k \|.\| |.| \vert.\vert h.i \langle.\rangle \ begin { figure } German ... \glqq \glq ... \grq \grqq ten of the form \label{sec:item} like

Use \left( expr \right) to stretch any delimeter to the height of expr \ centering English ... \lq ... \rq \label{fig:diag1}.
Or \big, \Big, \bigg for manual sizing e.g. \Big\| \Big\| \ includegraphics [ width =9 cm ]{./ img / diagram . pdf } <. . . > \ref{marker } Give section/body number of marker.
France \flqq \flq ... \frq \frqq
\ caption [ title for LOF ]{ this is the long title }
\pageref{marker } Give page number of marker.
\ label { fig : example 1} I think, said Anna, he shouted This is Larss car!, when I saw him.
6.7. Arrows \ end { figure } \footnote{text} Print footnote at bottom of page.
Every combination of left,right,up,down with arrow(s) \url{url} Creates click-able web-adress.
Load image: \includegraphics[width=x]{file}
9.3. Numbers and Dates
7 \mapsto \leadsto \href[options]{url}{text} click-able link
Alter numbering: \renewcommand\thefigure{\arabic{figure}} Numbers Look Usage \hyperref[marker ]{text} click-able ref
\rightarrow \Rightarrow
8.1.1 Subfigures with subfigure
\longrightarrow = \Longrightarrow old-style as part of text, dates
Usage \subfigure[caption]{graphic, label} 10.3. Reference management software supporting BibTEX
\leftarrow \Leftarrow lining 1234567890 as math value
Mendeley: free, Win/Linux/Mac, import from several websites
\longleftarrow = \Longleftarrow Citavi: free, Win
\uparrow \Uparrow
8.2. Tables British American German
\downarrow \Downarrow \ begin { table } 27/06/93 06/27/93 27.06.1993 11. Include beautiful Matlab Plots
\leftrightarrow \Leftrightarrow \ centering 27 June, 1993 June 27, 1993 27. Juni 1993 Same font, line width, vector graphic
\leftleftarrows \rightrightarrows \ begin { tabular }{ ll }
International notation (ISO 8601): yyyy-mm-dd: 1993-06-27
 \leftrightarrows  \rightleftarrows \ textsc { Name } & \ textsc { Desc .}\\ \ hline
\leftrightharpoons
\rightleftharpoons
test 1 & is no good idea &\\ 12. Own Commands and Writing Packages
bla 2 & even worse &\\ 9.4. Spacing
\ end { tabular } \usepackage[options]{package} load package
a\!b ab a\,b ab a\;b ab a\quad b a b
6.8. Physical Units with siunitx \ caption { My first Table } \newcommand[paranum]{\newcmd}{tex #1} define command
\ label { tab : example 1} ab ab a\>b ab a\ b ab a\qquad b a b
Use the package siunitx for correct display of numbers and units. \hspace{length}, \vspace{length} *: even at line start \renewcommand{\cmd}{ latex #1,#2 } alter command
It provide the commands \num{<number>}, \si{<unit>}, and \ end { table }
\phantom{text}, \vphantom{text} \let\cmdcopy\cmd copy a command
\SI{<number>}{<unit>}. Some examples: Protected space ~ Read this document CTAN
Usage: \begin{tabular}[htbp]{@{}lrc|p{3cm}}
Column distance: \setlength{\tabcolsep}{5pt}
7.123 456 1012 \num{7.123456e12} Some important variables:
Adjust row distance: \renewcommand{\arraystretch}{1.5} 9.5. Boxes and Rules
[g] = m s2 [g] = \si{\meter \per \second \squared} Partial lines: \cline{2-3} instead of \hline
Normal: \parbox[pos][height][contentpos]{width}{text} or
Counters: \thepage, \thesection, \thefigure
Additional packages: longtable, booktabs, colortbl Lengths: \textwidth, \parindent, \parskip
E = 1.3 mm kV E = \SI{1.3}{\kilo\volt\per\milli\meter} \begin{minipage}[pos][height][contentpos]{width} text

You can use all SI units (pascal, henry, ...) and not only the 8.3. Source Code Listings with listings Prevent line breaking: \mbox{text}
base units. It is also possible to change the style of display with Options: \lstset{basicstyle=\tt, language=C} Lift Text: \raisebox{lift}[height][depth]{text} 12.1. Plain TEX
\sisetup{per-mode=reciprocal} or \sisetup{per-mode=fraction}: Languages: C,C++,Java,Matlab,Python,HTML,XML,bash,... Framed Box: \framebox[width][pos]{text} or \fbox{text} These plain TEX commands should be used carfully
Prefixes like \kilo,\deca,\mega,\micro Resize: \scalebox{10}{Giant} Fonts \rm, \sf, \sc, \sl, \it, \tt
Environment: \begin{lstlisting} code \end{lstlisting} Lengths: \setlength{\fboxsep}{10pt}, \setlength{\fboxrule}{2pt} Definitions \def\newcmd{texcode}, \let\newcmd\cmd
Inline: \lstinline?code?
7. LaTeX4EI classes & packages If \ifnum\counter<10 true text \else false text \fi

latex4ei_thesis: layout with TUM colors \ begin { lstlisting } 10. Bibliography with BibTEX
scientific: useful scientific macros int i =0; 13. Useful Weblinks
dx \diff x N, R,!
C \N, \R, \C for ( i = 0; i < 10; i ++){ 10.1. BibTEX entry types
x1 printf ( " Line % i " , i ); LaTeX4EI www.latex4ei.de
x \vec x \vect{ x_1 \\ x_2 } @article Journal or magazine article.
x2 } Font & Symbols https://de.wikipedia.org/wiki/Hilfe:TeX
\ end { ltlisting } % missing s ! fields: author, title, journal, year, volume Color Schemes http://colorschemedesigner.com
" #
1 2 @book Book with publisher. Tipps for Package Writers:
A \ma A \mat{ 1 & 2 \\ 3 & 4}
e 3 4 fields: author/editor, title, publisher, year
9. Correct Typography
bF r \FT b r
DT F
\DTFT
@techreport Tech report, usually numbered in series.
fields: author, title, institution, year
bL r \LT bZ r \ZT 9.1. Hyphen and Dashes
@phdthesis PhD. or other thesis.
Additional function names (upright, correct spacing): Rule: The hyphen is never placed between two spaces!
fields: author, title, school, year
\const, \sinc, \grad, \rot, \div, \tri, \rect, \erf
Name Source Example Usage
\ b ibl iog raph yst yle { alphadin }
hyphen - X-ray, in- and output connect words \ bibliography { < bibliographyfile . bib >}
en-dash -- 1 5, Paris Rom seperate numbers.
em-dash --- Yesor no? Punctuation.
minus $-$ 53=2 Equations.

Homepage: www.latex4ei.de please report misstakes immediately. by Emanuel Regnath, contact emanuel.regnath@tum.de Created 17. November 2013 at 16:54 2

Das könnte Ihnen auch gefallen