You are on page 1of 26

Basic LaTeX

Julie Mitchell
This resource was adapted from
notes provided by Jerry Marsden
1 Basic Formatting
1.1 Beginning a document
documentclassarticle
usepackagegraphicx, amssymb
begindocument
textwidth 6.5 truein template for changing margin sizes
oddsidemargin 0 truein insert after document opener
evensidemargin -0.50 truein
topmargin -.5 truein
textheight 8.5in
title... template for title and author
author...
thanks...
date...
maketitle
beginabstract template for abstract
endabstract
1
1.2 Format
section numbered section
section* unnumbered section
subsection numbered subsection
subsection* unnumbered subsection
begincenter centers intermediate text
endcenter
centerline centers a line
hll lls line with horizontal space
beginushleft places text ush with left margin
endushleft
beginushright places text ush with right margin
endushright
beginquotation osets intermediate text by wider margins
endquotation
noindent new paragraph starts without indent
newline
newpage starts new page
% following text on same line is invisible
1.3 Basic Braces and Parentheses
open brace
closing (end) brace
, end brace for italics
( open parenthesis
) end parenthesis
[ open bracket
] end bracket
left literal braces
right literal braces
begin quotation mark
end quotation mark
langle
) rangle
2
1.4 Lists and Tables
beginenumerate makes a numbered list;
endenumerate
beginitemize makes list with bullets;
enditemize
begindescription makes an unnumbered list;
enddescription
item produces items for above lists
item[ for customized items, in enumerate lists
setcounterenumi sets counter for enumerate list
setcounter. . . . . . ll in braces (dont leave spaces)
begintabbing starts tabbing environment
endtabbing
next tab stop
begintabular[c[c[ tabular with vertical lines
endtabular
hline horizontal line
& separates columns in tabular environment
1.5 Labels, References and Bibliography
footnote footnote
index use for index entries
label to label an equation, theorem, etc.
ref to cross reference an equation, theorem, etc.
(ref ) put cursor between by hand
cite reference a bibitem entry
The following are designed for the author-year style of bibliography that is used after
beginthebibliography
and before
endthebibliography
bibitem[artref] Author [year] for articles
Title.
it Journal/ bf 11, 123223.
bibitem[bookref] Author [year] for books
it Title./ Publisher.
3
1.6 Foreign Accents
e

E e E
`e
`
E e E
a

A a A
o

O o O
u

U u U
1.7 Miscellaneous
@ @ at symbol
c _ copyright copyright
P paragraph
S section
ss german ss
1.8 Spaces
vspace0.2in vertical space 0.2in
hspace0.2in horizontal space 0.2in
quad single character space
qquad double space
, small space
: medium space; only in math mode
; thick space; only in math mode
! negative space; only in math mode
! ! negative double space; only in math mode
4
2 Basic Mathematical Formatting
2.1 Equation Commands
$ starts and terminates in-text formulas
[ displayed one line formula, not numbered
]
beginequation displayed one line formula, numbered
beginequationlabel add label
endequation
begineqnarray displayed multiline formula, numbered;
begineqnarraylabel add label
endeqnarray
begineqnarray* displayed multiline formula, not numbered
endeqnarray*
begin arrayccc produces matrices (see also 5.3)
endarray
& use between columns
& = & for aligning equals in equation arrays
nonumber suppresses numbering
mbox use before and + signs in split equations
quad mbox. . . quad for text within a formula
quad mboxandquad makes box and within a formula
begineqnarray numbered equation split over two lines,
lefteqn nonumber for equations with long lefthand sides
& & use lequs for the unnumbered version
endeqnarray
2.2 Basic Displayed Equations Examples
[
1(/) 1(o) =
_
b
a
)(r)dr
beginequation
5
1(/) 1(o) =
_
b
a
)(r)dr (1)
[ containing text
n

i=1
r
2
i
+ j
2
i
0 for all real numbers r
i
and j
i
begineqnarray*
2
= j + 1
.
2
+ 1 = n +
begineqnarray
2
= j + 1 (2)
.
2
+ 1 = n + (3)
begineqnarray beginarrayc numbered as a group
o = / + c
d = c + ) + p
(4)
begineqnarray* split (with leading minus sign on second line)
o = / + c + (c + d)
c + )
2.3 Specialized Displayed Equations Examples
beginequation beginarrayl
r = j
o = /
2
+ / + 1
_
(5)
6
beginequation beginarrayc
r = j
o = /
2
+ / + 1
_
(6)
beginequation fbox
r
2
+ 1
5
= j
(7)
evaluation of expression
)
_
t
2
_

t=0
begineqnarraylefteqn
or
2
+ 2/rj + cj
2
+ dr + cj + )
= n + + n + (8)
equation array with big brackets on dierent lines

H
c
() : =
_
D
_
1
2
(
2
)
1
+ (
e
+ ) (
e
)

(
e
)
_
drdj
equation array with big braces on dierent lines
H
s
0
(T`) =
_
H
s
(T`)

there exists an H
s
-extension

A H
s
(

T`) with A zero on



``
_
.
7
2.4 Theorem Like Environments
newtheoremcorCorollary to make new series of Corollaries
newtheoremdfnDenition to make new series of Denitions
newtheoremlemLemma to make new series of Lemmas
newtheorempropProposition to make new series of Propositions
newtheoremthmTheorem to make new series of Theorems
begincor to begin a Corollary
endcor to end a Corollary
begindfn
enddfn
beginlem
endlem
beginprop
endprop
beginthm
beginthm[Gauss Theorem] to begin a Theorem with title
endthm
Example noindentlarge bf Example,
Remarks noindentlarge bf Remarks,
Proof noindentbf Proof,
Solution noindentbf Solution,
2.5 End of Proofs, etc.
quad blacklozenge
quad $blacklozenge$
quad blacksquare end proof
quad square empty square
_ quad bigtriangledown empty triangle down
quad blacktriangledown black triangle down
8
3 Alphabets and Fonts
3.1 Greek Letters
alpha
beta
gamma Gamma
delta Delta
c epsilon
varepsilon
zeta
eta
theta Theta
vartheta
iota
kappa
lambda Lambda
j mu
nu
pi Pi
c varpi
rho
varrho
sigma Sigma
varsigma
tau
upsilon Upsilon
phi Phi
varphi
chi
psi Psi
omega Omega
3.2 Italics, Bold, etc.
example it italic type, eit to nish
example rm roman type
example bf boldface type
example sc small caps type
example sf sans serif type
example sl slanted type
example tt typewriter type
example em emphasized type
mboxboldmath$. . . $
/ cal only in math mode, only cap.letters
g mathfrac only in math mode
R mathbb only in math mode
9
3.3 Boldface Letters
bf
0 10 bf 0 bf 10
a d bf a bf d
e bf e (because of the word be)
f bf f (because of the command bf)
g x bf g bf x
y bf y (because of the word by)
z bf z
A Z bf A bf Z
e
1
bf e 1
3.4 Boldmath Symbols
mboxboldmath$. . . $
mboxboldmath$omega$
mboxboldmath$xi$
3.5 Calligraphic Letters
cal only in math mode, cap. letters
/ Z cal A cal Z
3.6 German (Fraktur) Letters
mathfrak. . . only in math mode
b mathfrak b german b,
g mathfrak g german g,
h mathfrak h german h,
k mathfrak k german k,
p mathfrak p german p,
t mathfrak t german t,
A mathfrak A german A,
G mathfrak G german G,
H mathfrak H german H,
K mathfrak K german K,
T mathfrak T german T,
X mathfrak X german X,
10
3.7 Open Letters
mathbb only in math mode
C mathbb C $
I mathbb I
R mathbb R
R
1
mathbb R1
R
2
mathbb R2
R
3
mathbb R3
R
m
mathbb Rm
R
n
mathbb Rn
T mathbb T
Z mathbb Z
11
4 Basic Mathematical Operations and Symbols
4.1 Universal Operations
frac for general fractions

sqrt universal square root

superscript universal
subscript universal
lim lim limit universal
o vec
o overline
o bar
o check
o dot
o ddot
o hat
o tilde
[ mid in-line set
[ left left. ! right[ right sized set for large displays
displaystyle for larger math mode formulas
4.2 Single Symbols included in $ Signs
o . $a$ $z$ (except: doo for $o$)
7 $A$ $Z$
1 10 $1$ $10$
a z $bf a$ $bf z$
A Z $bf A$ $bf Z$
0 10 $bf 0$ $bf 10$
4.3 Roots

2 sqrt2

sqrtpi
3

2 sqrt[3]2 cube root over 2


n

2 sqrt[n]2 n-root over 2


12
4.4 Specic Fractions
1
2
frac12
1
3
frac13
1
4
frac14
d
dt
fracddt
dn
dt
fracdudt
dr
dt
fracdxdt
dj
dt
fracdydt
d.
dt
fracdzdt

r
fracpartialpartial x

j
fracpartialpartial y
.
r
fracpartial zpartial x

2
rj
fracpartial2partial x partial y

3
rj.
fracpartial3partial x partial y partial z
4.5 Superscripts
high universal
a

z
a z (except: hee for
e
, huu for
u
)
A

Z
A Z
0

10
0 10
2
2 to avoid typing the number
3
3 to avoid typing the number
r
2
, j
2
, .
2
x2, y2, z2
1
-1
ij
ij
ijk
ijk
jk
jk
13

dagger

perp

prime

ast

star
4.6 Subscripts
low universal
a

z
a z (except: luu for
u
)
A

Z
A Z
0

10
0 10
ij
ij
ijk
ijk
jk
jk
j
n
y n
.
n
z n

ast

star
14
4.7 Overcharacters
j barp
baralpha
j dotp
j ddotp
j overlinep
j hatp
o veca

PP stackreltextstylelongrightarrowrm PP

PQ stackreltextstylelongrightarrowrm PQ;
4.8 Binary Operations and Relations
+ + plus
minus
pm plus-minus
mp minus-plus
div divide
circ composite
bullet bullet
oplus direct sum
ominus direct dierence
times times
otimes tensor product
,circledS, semi direct product
wedge wedge product
= equals
= 0 equals zero
geq greater than or equal
leq less than equal
,= neq not equal

= cong isomorphic
equiv equivalent
ll much less than
gg much greater than
approx approximately
15
4.9 Sized Parentheses
( left( The left and right commands
) right) eect the size of the braces.
[ left[ They always have to appear in pairs!
] right] Invisible braces are made with left. and right.
left
right
leftlangle
leftlangle ! leftlangle
) rightrangle
)) rightrangle ! rightrangle
left.
right.
4.10 Single Mathematical Symbols
aleph aleph
hbar Plancks constant
/ prime prime, use hpr for superscript
. at at sign, h for superscript
; sharp sharp sign, hsh for superscript
heartsuit sweetheart
propto proportional to
| [
pounds Lie derivative
pitchfork transversal
/ ell script l
| [ norm
nabla nabla
partial partial derivative
infty innity
wp Weierstrass j-function
' Re real part alternate
Im imaginary part alternate
angle angle
16
4.11 Set Theoretic Symbols
Rightarrow implies
Leftarrow implied by
Leftrightarrow equivalent to
varnothing empty set
emptyset empty set alternate
in element of
, notin not an element of
setminus set dierence
subset subset
subseteq subset or equals
supset superset
supseteq superset or equals
cap intersection

bigcap big intersection


cup union

bigcup big union


[ mid vertical bar, with spacing
exists there exists
forall for all
4.12 Arrows and Dots
mapsto arrow with tail
rightarrow rightarrow
longrightarrow longrightarrow
leftrightarrow leftrightarrow
leftarrow leftarrow
uparrow uparrow
upharpoonright upharpoonright
nearrow slanted up right
searrow slanted down right
cdot centered dot
cdots centered dots
.
.
. ddots diagonal dots
. . . ldots lower dots
.
.
. vdots vertical dots
17
4.13 Trig Functions
cos cos
cosh cosh hyperbolic cosine
cos
2
cos2 cosine squared
cos cos theta cosine of theta
cos cos phi cosine of phi
sin sin
sinh sinh hyperbolic sine
sin
2
sin2 sine squared
sin sin theta sine of theta
sin sin phi sine of phi
sech rm sech, hyperbolic sech
tan tan
tanh tanh hyperbolic tangent
4.14 Log-like Symbols
exp exp exponential
log log logarithm
ln ln natural logarithm
sup sup supremum
inf inf inmum
max max maximum
min min minimum
lim lim limit universal
liminf liminf limit inferior
limsup limsup limit superior
det det determinant
ker ker kernel
dim dim dimension
arg arg argument
gcd gcd greatest common divisor
18
4.15 Combinations of Mathematical Symbols
1 -1 minus one
|u| [ bf u [
[o[ [o[ absolute value;

i
a
Ai ;a staggered, high and low
1
A

L Amu staggered, variation 1

vA nu staggered, variation 2
g

mathfrak g ast german g star;


g

$mathfrak g ast$
so(3) mathfrakso(3)
:o(3) so(3)
oO(3) SO(3)
T

Q Tast Q
T

q
Q Tast q Q
div rm div, divergence
Aut( rm Aut( automorphism universal
Di( rm Di( dieomorphism universal
Im( rm Im( real part universal
Im(.) rm Im(z) real part of .
Re( rm Re( real part universal
Re(.) rm Re(z) real part of .
(0)
(0, 0)
(0, 0, 0)
(o
1
, o
2
, o
3
)
(r, j)
(r, j, .)
r
2
+ j
2
drdj
drdj d.
dj,dt dy/dt
dr,dt dx/dt
d.,dt dz/dt
.,j partial z/partial y
a +b bf a + bf b
a b bf a times bf b
(a b) (bf a times bf b)
19
5 Integrals, Sums, Products and Matrices
5.1 Integrals
_
int integral universal; add limits with hu and lu
__
int !!! int double integral
___
int !!!int !!!int triple integral
_
oint contour integral
_
1
0
int1 0
_
b
a
intb a
_
D
int D
_
R
3
int mathbb R3
_

intinfty infty
_
2
0
int2 pi 0
20
5.2 Sums, Limits, etc.

sum

(in-text)
n

i=1
(displayed)

n
i=1
(in-text)
n

i=1
(displayed)

n
i=1
(in-text)
n
_
i=1
(displayed)

n
i=1
(in-text)
n

i=1
(displayed)

n
i=1
(in-text)
lim
(x,y)(0,0)
(displayed) lim
(x,y)(0,0)
(in-text)
lim
a
(displayed) lim
a
(in-text)
lim
xx0
(displayed) lim
xx0
(in-text)
21
5.3 Sample Matrices
_
_
r
1
r
2
r
3
_
_
left( beginarrayc r
1
r
2
r
3
endarray right)
_
r
j
_
left[ beginarrayc x y endarray right]
_
o /
c d
_
left( beginarraycc a & b c & d endarray right)
_
o /
c d
_
left[ beginarraycc a & b c & d endarray right]
_
1 0
0 1
_
left[ beginarraycc 1 & 0 0 & 1 endarray right]
_
0 1
1 0
_
left[ beginarraycc 0 & 1 - 1 & 0 endarray right]
_
_
1 0 0
0 1 0
0 0 1
_
_
left( beginarrayccc 1 & 0 & 0 0 & 1 & 0 0 & 0 & 1 endarray right)

o / c
d c )
p / i

left[ beginarrayccc a & b & c d & e & f g & h & i endarray right[
_
_
o / c
d c )
p / i
_
_
left( beginarrayccc a & b & c d & e & f g & h & i endarray right)
_

_
o / c
d c )
p / i
_

_ left[ beginarrayccc a & b & c d & e & f g & h & i endarray right]
22
6 Boxes, Tabbing and Tabular Environment Samples
6.1 Boxes
Note: text
framed box, edit its size
type header
text
framed box, edit its size
type header
text
double framed box, edit its size
6.2 Tabbing
tabbing example 1
items for row one
items for row two
23
6.3 Tabular
tabular example 1 (5 columns)
Denition
of derivative

Partials exist and = Dierentiable = Partials exist


are continuous
tabular example 2 (2 columns within a fbox-parbox)
Box 2.1.1 Summary of Important Formulas for 2.1
Velocity
\ =

t
\
a
=

a
t

t
= \
t

1
t

a
t
= \
a
t

1
t
Covariant Derivative
D n =
w
(
w
)
a
=

a
r
b
n
b
+
a
bc
n
b

c
tabular example 3 (3 columns without a frame)
Classical Tensor Analysis Tensor Analysis on Manifolds
r
a
Coordinates r
a

c
a
=
.
i
r
a

i
i
coordinate
basis vectors

r
a
= c
a
c
a
=
r
b
r
a
c
b
c
a
=
r
a
r
b
c
b
_

_
change of
coordinates
_

r
a
=
r
b
r
a

r
b
d r
a
=
r
a
r
b
dr
b
24
tabular example 4 (2 columns with lines)
Classical Mechanics Quantum Mechanics
immersed Lagrangian manifold element of 1
2
(Q) or T

(Q)
(T

Q, )
= graph of do = exp(io,)
T

Q Hilbertspace
Lagrangian manifold (possibly unbounded)
(T

Q,
Q
) (T

1,
R
) 1
2
(1) to 1
2
(Q)
composition of canonical relations composition of operators
tabular example 5 (same as tabex4, but within a framed box)
Classical Mechanics Quantum Mechanics
immersed Lagrangian manifold element of 1
2
(Q) or T

(Q)
(T

Q, )
= graph of do = exp(io,)
T

Q Hilbertspace
Lagrangian manifold (possibly unbounded)
(T

Q,
Q
) (T

1,
R
) 1
2
(1) to 1
2
(Q)
composition of canonical relations composition of operators
tabular example 6 (3 columns with lines)
Case Conditions Connection
Unconstrained T
q
= T
q
Q /
sym
( ) = I
1
J( )
Purely Kinematic T
q
T
q
(Orb()) = 0 /
kin
( ) = 0
Horizontal symmetries T
q
T
q
(Orb())
G
= T
q
(Orb())
H
/
sym
( ) +/
kin
( ) = I
1
J
H
( )
General principal T
q
+ T
q
(Orb()) = T
q
Q /
sym
( ) +/
kin
( ) = I
1
J
nhc
( )
bundle case
25
7 Pictures
You must include the line
usepackagegraphicx
at the beginning of your document in order to use these commands.
begingure
vspace2in
hspace.4in
includegraphicsmygure.eps
caption
endgure
26

You might also like