Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

LATEX Cheatsheet

Snippet 1: Default page setup


\ d o c u m e n t c l a s s [ a4 paper ] { a r t i c l e }

% This i s how you i n s e r t a comment


\ u s e p a c k a g e { . . . } % With t h i s command you can i n c l u d e g r a p h i c s

\ t i t l e {The t i t l e
\ a u t h o r {The a u t h o r }
\ d a t e {The d a t e o f \ today }

\ b e g i n { document }
\ maketitle % Print the t i t l e etc

\ s e c t i o n { Chapter 1}
Tekst o f c h a p t e r 1

% And so on

\ section { . . . }
...
\end{ document }

Snippet 2: Chapters
\ p a r t { . . . } % Only i n book and r e p o r t d o c u m e n t c l a s s
\ c h a p t e r { . . . } % Only i n book and r e p o r t d o c u m e n t c l a s s
\ section { . . . }
\ subsection { . . . }
\ subsubsection { . . . }
\ paragraph { . . . }
\ subparagraph { . . . }

Snippet 3: Inserting image


%B e g i n n i n g o f document
\ usepackage { graphicx }

%In t h e document
\ begin { f i g u r e }[ p ]
\ centering
\ i n c l u d e g r a p h i c s [ width =0.8\ t e x t w i d t h ] { image . png}
\ c a p t i o n {Awesome Image }
\ l a b e l { f i g : awesome image }
\end{ f i g u r e }

1
Snippet 4: Insert table
\ begin { table }
\ centering
\ l a b e l { tab : your t a b l e }
\ c a p t i o n { Caption o f t h e t a b l e }
\ begin { tabular }{| l | | c | r |}
\ hline
Text l e f t & Text middle & Text r i g h t \\
\ hline
More t e x t & even more t e x t & more and more t e x t \\
\ hline
\end{ t a b u l a r }
\end{ t a b l e }

Table 1: Table of snippet 4


Text left Text middle Text right
More text even more text more and more text

Snippet 5: Math equations


This i s an in−l i n e e q u a t i o n : $ f ( x ) = x ˆ2 + 5 x + 3 $ .
And t h i s i s a s e p e r a t e e q u a t i o n :
\ begin { equation }
\ l a b e l { eq : maxwell }
\ oint \ mathbf {E} \cdot d \ mathbf {A} = \ f r a c {q { enc }}{\ epsilon 0 }
\end{ e q u a t i o n }

Will look like this:


This is an in-line equation: f (x) = x2 + 5x + 3. And this is a seperate equation:
I
qenc
E · dA = (1)
ϵ0

A few usefull mathematical operators


LATEX Compiled Note
\frac{a}{b} a
b
\alpha ... \omega α ... ω
A ... \Omega A ... Ω Latin letters have no seperate notation.
V {out}, xˆ{a+b} a+b
∑ ∏, x∫ H
V out
\sum, \prod, \int, \oint , , ,
\cdot, \times, \partial, \angle ·×∂̸

2
Snippet 6: Standard mark-up
\ t e x t b f { Bold t e x t } , {\ bf Also b o l d t e x t }
\ t e x t i t { I t a l i c t e x t } , {\ i t Also i t a l i c t e x t }
\ underline { U n d e r l i n e d t e x t }
\ textsuperscript { Superscript }
\ textsubscript { Subscript }

Snippet 7: References
%P l a c e l a b e l s under f o r example s e c t i o n s , s u b s e c t i o n s or f i g u r e s
\ l a b e l { your l a b e l h e r e }
%To r e f e r e n c e t h e l a b e l i n t h e f i g u r e / t a b l e / e t c .
\ r e f { your l a b e l h e r e }

Snippet 8: Bibliography
%P l a c e t h i s a t t h e bottom o f your document , j u s t b e f o r e \ end { document }
\ b e g i n { t h e b i b l i o g r a p h y }{9}

\ b i b i t e m { your r e f e r e n c e }
L e s l i e Lamport ,
\emph{\LaTeX : a document p r e p a r a t i o n system } ,
Addison Wesley , M a s s a c h u s e t t s ,
2nd e d i t i o n ,
1994.

\end{ t h e b i b l i o g r a p h y }

%To c i t e t h e b i b l i o g r a p h y
\ c i t e { your r e f e r e n c e }
\ c i t e [ p . 1 4 6 ] { your r e f e r e n c e } %Or l i k e t h i s

Snippet 9: Code insertion


%Bovenaan j e document z e t j e h e t v o l g e n d e
\ usepackage { l i s t i n g s }
%En d i t , waar j e i n s t e l l i n g e n kan z e t t e n
\ l s t s e t { frame = l r t b , l a n g u a g e=c }

%Daarna g e b r u i k j e h e t v o l g e n d e
\ begin { l s t l i s t i n g }
#i n c l u d e <s t d i o . h>

i n t main ( ) {
// Test
return 0;
}
\end{ l s t l i s t i n g }

Snippet 10: Other


\ input { l a t e x f i l e . t e x } % I n c l u d e o t h e r l a t e x f i l e s
\ tableofcontents % Insert the t a b l e of contents
\ c l e a r p a g e o f \ newpage % Force new page
\noindent % P r e v e n t a s i n g l e l i n e from i n d e n t i n g

You might also like