You are on page 1of 26

Basic LaTeX

Julie Mitchell
This resource was adapted from
notes provided by Jerry Marsden

1
1.1

Basic Formatting
Beginning a document

\documentclass{article}
\usepackage{graphicx, amssymb}
\begin{document}
\textwidth 6.5 truein
\oddsidemargin 0 truein
\evensidemargin -0.50 truein
\topmargin -.5 truein
\textheight 8.5in

template for changing margin sizes


insert after document opener

\title{...}
\author{...}
\thanks{...}
\date{...}
\maketitle

template for title and author

\begin{abstract}
\end{abstract}

template for abstract

1.2

Format

\section{
\section*{
\subsection{
\subsection*{
\begin{center}
\end{center}
\centerline{
\hfill
\begin{flushleft}
\end{flushleft}
\begin{flushright}
\end{flushright}
\begin{quotation}
\end{quotation}
\noindent
\\
\newpage
%

1.3
{
}
\/}
(
)
[
]
\{
\}

h
i

numbered section
unnumbered section
numbered subsection
unnumbered subsection
centers intermediate text
centers a line
fills line with horizontal space
places text flush with left margin
places text flush with right margin
offsets intermediate text by wider margins
new paragraph starts without indent
newline
starts new page
following text on same line is invisible

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

1.4

Lists and Tables

\begin{enumerate}
\end{enumerate}
\begin{itemize}
\end{itemize}
\begin{description}
\end{description}
\item
\item[
\setcounter{enumi}{
\setcounter{. . . }{. . . }
\begin{tabbing}
\end{tabbing}
\>
\begin{tabular}{|c|c|}
\end{tabular}
\hline
&

1.5

makes a numbered list;


makes list with bullets;
makes an unnumbered list;
produces items for above lists
for customized items, in enumerate lists
sets counter for enumerate list
fill in braces (dont leave spaces)
starts tabbing environment
next tab stop
tabular with vertical lines
horizontal line
separates columns in tabular environment

Labels, References and Bibliography

\footnote{
\index{
\label{
\ref{
(\ref{ })
\cite{ }

footnote
use for index entries
to label an equation, theorem, etc.
to cross reference an equation, theorem, etc.
put cursor between { } by hand
reference a bibitem entry

The following are designed for the author-year style of bibliography that is used after
\begin{thebibliography}
and before
\end{thebibliography}

\bibitem[artref] Author [year]


Title.
{\it Journal\/} {\bf 11}, 123223.

for articles

\bibitem[bookref] Author [year]


{\it Title.\/} Publisher.

for books

1.6
e
`e
a

Foreign Accents

E
`
E

1.7

\{e}
\{e}
\{a}
\{o}
\{u}

Miscellaneous

@
c

1.8

\{E}
\{E}
\{A}
\{O}
\{U}

@
\copyright
\P
\S
\ss

at symbol
copyright
paragraph
section
german ss

Spaces

\vspace{0.2in}
\hspace{0.2in}
\quad
\qquad
\,

vertical space 0.2in


horizontal space 0.2in
single character space
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

2
2.1

Basic Mathematical Formatting


Equation Commands

starts and terminates in-text formulas

\[
\]

displayed one line formula, not numbered

\begin{equation}
\begin{equation}\label{
\end{equation}

displayed one line formula, numbered


add label

\begin{eqnarray}
\begin{eqnarray}\label{
\end{eqnarray}

displayed multiline formula, numbered;


add label

\begin{eqnarray*}
\end{eqnarray*}

displayed multiline formula, not numbered

\begin {array}{ccc}
\end{array}

produces matrices (see also 5.3)

&
&=&
\nonumber
\mbox{ }
\quad \mbox{. . . }\quad
\quad \mbox{and}\quad

use between columns


for aligning equals in equation arrays
suppresses numbering
use before and + signs in split equations
for text within a formula
makes box and within a formula

\begin{eqnarray}
\lefteqn{ } \nonumber \\
&&
\end\{eqnarray}

numbered equation split over two lines,


for equations with long lefthand sides
use lequs for the unnumbered version

2.2

Basic Displayed Equations Examples

\[

Z
F (b) F (a) =

f (x)dx
a

\begin{equation}

Z
F (b) F (a) =

f (x)dx

(1)

\[ containing text

n
X

x2i + yi2 0

for all real numbers xi and yi

i=1

\begin{eqnarray*}

= y+1

z +1

u+v

\begin{eqnarray}

2
2

z +1

= y+1

(2)

(3)

u+v

\begin{eqnarray} \begin{array}{c} numbered as a group

a=b+c

(4)

d=e+f +g

\begin{eqnarray*} split (with leading minus sign on second line)

= b + c + (c + d)
e+f

2.3

Specialized Displayed Equations Examples

\begin{equation} \begin{array}{l}

x=y
a = b2 + b + 1

(5)

\begin{equation} \begin{array}{c}

x=y

a = b2 + b + 1

(6)

\begin{equation} \fbox{

x2 + 1
=y
5

(7)

evaluation of expression

 
t
2 t=0

\begin{eqnarray}\lefteqn{ }

ax2 + 2bxy + cy 2 + dx + ey + f
=

u + v + w +

equation array with big brackets on different lines

c () :
H

Z 
=
D

1
(2 )1 + (e + ) (e )
2

0
(e ) dx dy

equation array with big braces on different lines

H0s (T M )


=



H (T M ) there exists an H s -extension

s

X H (T M ) with X zero on M \M .
s

(8)

2.4

Theorem Like Environments

\newtheorem{cor}{Corollary}
\newtheorem{dfn}{Definition}
\newtheorem{lem}{Lemma}
\newtheorem{prop}{Proposition}
\newtheorem{thm}{Theorem}

to
to
to
to
to

\begin{cor}
\end{cor}
\begin{dfn}
\end{dfn}
\begin{lem}
\end{lem}
\begin{prop}
\end{prop}
\begin{thm}
\begin{thm}[Gauss Theorem]
\end{thm}

to begin a Corollary
to end a Corollary

Example
Remarks

\noindent{\large \bf Example\,}


\noindent{\large \bf Remarks\,}
\noindent{\bf Proof\,}
\noindent{\bf Solution\,}

Proof
Solution

2.5




5
H

make
make
make
make
make

new
new
new
new
new

series
series
series
series
series

of
of
of
of
of

to begin a Theorem with title

End of Proofs, etc.


\quad
\quad
\quad
\quad
\quad
\quad

\blacklozenge
$\blacklozenge$
\blacksquare
\square
\bigtriangledown
\blacktriangledown

Corollaries
Definitions
Lemmas
Propositions
Theorems

end proof
empty square
empty triangle down
black triangle down

3
3.1

Alphabets and Fonts


Greek Letters
\alpha
\beta
\gamma
\delta
\epsilon
\varepsilon
\zeta
\eta
\theta
\vartheta
\iota
\kappa
\lambda
\mu
\nu
\pi
\varpi
\rho
\varrho
\sigma
\varsigma
\tau
\upsilon
\phi
\varphi
\chi
\psi
\omega

3.2

\Gamma
\Delta

\Theta

\Lambda

\Pi

\Sigma

\Upsilon
\Phi

\Psi
\Omega

Italics, Bold, etc.

example
example
example
example
example
example
example
example

A
g
R

{\it
{\rm
{\bf
{\sc
{\sf
{\sl
{\tt
{\em
\mbox{\boldmath$. . . $}
{\cal
\mathfrac
{\mathbb

italic type, eit to finish


roman type
boldface type
small caps type
sans serif type
slanted type
typewriter type
emphasized type
only in math mode, only cap.letters
only in math mode
only in math mode

3.3

0 10
ad
e
f
gx
y
z
AZ
e1

3.4

3.5

AZ

3.6

b
g
h
k
p
t
A
G
H
K
T
X

Boldface Letters
{\bf
{\bf
{\bf
{\bf
{\bf
{\bf
{\bf
{\bf
{\bf
{\bf

0} {\bf 10}
a} {\bf d}
e}
f}
g} {\bf x}
y}
z}
A} {\bf Z}
e} 1

(because of the word be)


(because of the command bf)
(because of the word by)

Boldmath Symbols
\mbox{\boldmath$. . . $}
\mbox{\boldmath$\omega$}
\mbox{\boldmath$\xi$}

Calligraphic Letters
{\cal
{\cal A} {\cal Z}

only in math mode, cap. letters

German (Fraktur) Letters


\mathfrak. . .
\mathfrak b
\mathfrak g
\mathfrak h
\mathfrak k
\mathfrak p
\mathfrak t
\mathfrak A
\mathfrak G
\mathfrak H
\mathfrak K
\mathfrak T
\mathfrak X

only in math mode


german b,
german g,
german h,
german k,
german p,
german t,
german A,
german G,
german H,
german K,
german T,
german X,

10

3.7

C
I
R
R1
R2
R3
Rm
Rn
T
Z

Open Letters
{\mathbb
{\mathbb
{\mathbb
{\mathbb
{\mathbb
{\mathbb
{\mathbb
{\mathbb
{\mathbb
{\mathbb
{\mathbb

C}
I}
R}
R}1
R}2
R}3
R}m
R}n
T}
Z}

only in math mode


$

11

Basic Mathematical Operations and Symbols

4.1

lim
~a
a
a

a
a

{|}
{|}

4.2
az
AZ
1 10
az
AZ
0 10

4.3

3
2

n
2

Universal Operations
\frac{ }{}
\sqrt{
{

for general fractions


universal square root
superscript universal
subscript universal
limit universal

{
\lim {
\vec{
\overline{
\bar{
\check{
\dot{
\ddot{
\hat{
\tilde{
{\mid}
in-line set
\left\{ \left. \! \right| \right\} sized set for large displays
{\displaystyle
for larger math mode formulas

Single Symbols included in $ Signs


$a$ $z$
$A$ $Z$
$1$ $10$
${\bf a}$ ${\bf z}$
${\bf A}$ ${\bf Z}$
${\bf 0}$ ${\bf 10}$

(except: doo for $o$)

Roots
\sqrt{2}
\sqrt{\pi}
\sqrt[3]{2}
\sqrt[n]{2}

cube root over 2


n-root over 2

12

4.4

Specific Fractions

1
2

\frac{1}{2}

1
3

\frac{1}{3}

1
4

\frac{1}{4}

d
dt

\frac{d}{dt}

du
dt

\frac{du}{dt}

dx
dt

\frac{dx}{dt}

dy
dt

\frac{dy}{dt}

dz
dt

\frac{dz}{dt}

\frac{\partial}{\partial x}

\frac{\partial}{\partial y}

z
x

\frac{\partial z}{\partial x}

2
xy

\frac{\partial2}{\partial x \partial y}

3
xyz

\frac{\partial3}{\partial x \partial y \partial z}

4.5

Superscripts

{
a
z
A
Z
0
10
2
3

x2 , y 2 , z 2
1
ij
ijk
jk

a z
A Z
0 {10}
2
3
x2, y2, z2
{-1}

{ij}

{ijk}

{jk}

high universal
(except: hee for e , huu for u )

to avoid typing the number


to avoid typing the number

13

4.6
{
z
A Z
0 10
a

ij
ijk
jk

yn
zn

\dagger
\perp
\prime
\ast
\star

Subscripts

a z
A Z
0 {10}
{ij}
{ijk}
{jk}
yn
zn
\ast
\star

low universal
(except: luu for u )

14

4.7
p

p
p
p
p
~a

PP

PQ

4.8
+

=
=0

6
=




Overcharacters
\bar{p}
\bar{\alpha}
\dot{p}
\ddot{p}
\overline{p}
\hat{p}
\vec{a}
\stackrel{\textstyle\longrightarrow}{\rm PP}
\stackrel{\textstyle\longrightarrow}{\rm PQ};

Binary Operations and Relations


+

\pm
\mp
\div
\circ
\bullet
\oplus
\ominus
\times
\otimes
\,\circledS\,
\wedge

plus
minus
plus-minus
minus-plus
divide
composite
bullet
direct sum
direct difference
times
tensor product
semi direct product
wedge product

\geq
\leq
\neq
\cong
\equiv
\ll
\gg
\approx

equals
equals zero
greater than or equal
less than equal
not equal
isomorphic
equivalent
much less than
much greater than
approximately

15

4.9
(
)
[
]
{
}
h
hh
i
ii

4.10

~
0
[
]

t
`
k

<
=

Sized Parentheses
\left(
The left and right commands
\right)
effect the size of the braces.
\left[
They always have to appear in pairs!
\right]
Invisible braces are made with \left. and \right.
\left\{
\right\}
\left\langle
\left\langle \! \left\langle
\right\rangle
\right\rangle \! \right\rangle
\left.
\right.

Single Mathematical Symbols


\aleph
\hbar
\prime
\flat
\sharp
\heartsuit
\propto
\|
\pounds
\pitchfork
\ell
\|
\nabla
\partial
\infty
\wp
\Re
\Im
\angle

aleph
Plancks constant
prime, use hpr for superscript
flat sign, hfl for superscript
sharp sign, hsh for superscript
sweetheart
proportional to
Lie derivative
transversal
script l
norm
nabla
partial derivative
infinity
Weierstrass p-function
real part alternate
imaginary part alternate
angle

16

4.11

6
\

S
|

4.12
7


%
&

..
.
...
..
.

Set Theoretic Symbols


\Rightarrow
\Leftarrow
\Leftrightarrow
\varnothing
\emptyset
\in
\not\in
\setminus
\subset
\subseteq
\supset
\supseteq
\cap
\bigcap
\cup
\bigcup
\mid
\exists
\forall

implies
implied by
equivalent to
empty set
empty set alternate
element of
not an element of
set difference
subset
subset or equals
superset
superset or equals
intersection
big intersection
union
big union
vertical bar, with spacing
there exists
for all

Arrows and Dots


\mapsto
\rightarrow
\longrightarrow
\leftrightarrow
\leftarrow
\uparrow
\upharpoonright
\nearrow
\searrow
\cdot
\cdots

arrow with tail


rightarrow
longrightarrow
leftrightarrow
leftarrow
uparrow
upharpoonright
slanted up right
slanted down right
centered dot
centered dots

\ddots
\ldots

diagonal dots
lower dots

\vdots

vertical dots

17

4.13

Trig Functions

cos
cosh
cos2
cos
cos
sin
sinh
sin2
sin
sin
sech
tan
tanh

\cos
\cosh
\cos2
\cos \theta
\cos \phi
\sin
\sinh
\sin2
\sin \theta
\sin \phi
{\rm sech}\,
\tan
\tanh

4.14

Log-like Symbols

exp
log
ln
sup
inf
max
min
lim
lim inf
lim sup
det
ker
dim
arg
gcd

\exp
\log
\ln
\sup
\inf
\max
\min
\lim
\liminf
\limsup
\det
\ker
\dim
\arg
\gcd

hyperbolic cosine
cosine squared
cosine of theta
cosine of phi
hyperbolic sine
sine squared
sine of theta
sine of phi
hyperbolic sech
hyperbolic tangent

exponential
logarithm
natural logarithm
supremum
infimum
maximum
minimum
limit universal
limit inferior
limit superior
determinant
kernel
dimension
argument
greatest common divisor

18

4.15

Combinations of Mathematical Symbols

1
kuk
|a|
Aia
LA
vA
g
g
so(3)
so(3)
SO(3)
T Q
Tq Q
div
Aut(
Diff(
Im(
Im(z)
Re(
Re(z)
(0)
(0, 0)
(0, 0, 0)
(a1 , a2 , a3 )
(x, y)
(x, y, z)
x2 + y 2
dx dy
dx dy dz
dy/dt
dx/dt
dz/dt
z/y
a+b
ab
(a b)

-1
\ | {\bf u} \ |
|a|
Ai {\;a}
L A{}\mu
vA{} \nu
\mathfrak g {\ast}
$\mathfrak g {\ast}$
\mathfrak{so}(3)
so(3)
SO(3)
T\ast Q
T{\ast} {q} Q
{\rm div}\,
{\rm Aut}(
{\rm Diff}(
{\rm Im}(
{\rm Im}(z)
{\rm Re}(
{\rm Re}(z)

minus one
absolute value;
staggered, high and low
staggered, variation 1
staggered, variation 2
german g star;

divergence
automorphism universal
diffeomorphism universal
real part universal
real part of z
real part universal
real part of z

dy/dt
dx/dt
dz/dt
\partial z/\partial y
{\bf a} + {\bf b}
{\bf a} \times {\bf b}
({\bf a} \times {\bf b})

19

Integrals, Sums, Products and Matrices

5.1

Integrals

Z
\int

integral universal; add limits with hu and lu

\int \!\!\! \int

double integral

ZZ

ZZZ
\int \!\!\!\int \!\!\!\int triple integral
I
\oint
Z

contour integral

\int1 0
0

\intb a
a

Z
\int D
D

Z
\int {{\mathbb R}3}
R3

\int\infty {\infty}

\int{2 \pi} 0
0

20

5.2

Sums, Limits, etc.

\sum

(in-text)

(displayed)

Pn

(in-text)

(displayed)

Qn

(in-text)

(displayed)

Sn

(in-text)

(displayed)

Tn

(in-text)

(displayed)

lim(x,y)(0,0)

(in-text)

lim

(displayed)

lima

(in-text)

lim

(displayed)

limxx0

(in-text)

n
X

i=1

i=1
n
Y

i=1

i=1
n
[

i=1

i=1
n
\

i=1

i=1

lim
(x,y)(0,0)

xx0

21

5.3

Sample Matrices

x1
x2
x3


x
y

\left( \begin{array}{c} x1 \\ x2 \\ x3 \end{array} \right)


\left[ \begin{array}{c} x \\ y \end{array} \right]

a
c

b
d

a
c

b
d

1
0

0
1

0
1

1
0
0

a

d

g

\left( \begin{array}{cc} a & b \\ c & d \end{array} \right)

\left[ \begin{array}{cc} a & b \\ c & d \end{array} \right]

\left[ \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array} \right]


1
0

0
1
0
b
e
h


\left[ \begin{array}{cc} 0 & 1 \\ - 1 & 0 \end{array} \right]

0
0
1

\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right)

\left| \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right|

\left( \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right)

c
f
i

a
d
g

b
e
h

c
f
i

\left[ \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right]

22

Boxes, Tabbing and Tabular Environment Samples

6.1

Boxes

Note:

framed box, edit its size

text

type header

framed box, edit its size

text

type header

double framed box, edit its size

text

6.2

Tabbing
tabbing example 1

items
items

for
for

row
row

one
two

23

6.3

Tabular
tabular example 1 (5 columns)

Partials exist and


are continuous

Definition
of derivative

Differentiable = Partials exist

tabular example 2 (2 columns within a fbox-parbox)

Summary of Important Formulas for 2.1

Box 2.1.1
Velocity
V =

Va =

vt = Vt 1
t

a
t

vta = Vta 1
t

Covariant Derivative
Dv w = w v

(w v)a =

v a b
a b c
w + bc
w v
xb

tabular example 3 (3 columns without a frame)

Classical Tensor Analysis


{xa }
ea =

z i
ii
xa

xb
ea =
eb
x
a
a

x
b

ea =
e
b
x

Tensor Analysis on Manifolds


Coordinates

{xa }

coordinate
basis vectors

= ea
xa

xb

x
a
x
a xb

x
a b

d
xa =
dx
xb

change of
coordinates

24

tabular example 4 (2 columns with lines)

Classical Mechanics
immersed Lagrangian manifold
(T Q, )
= graph of dS
T Q
Lagrangian manifold
(T Q, Q ) (T R, R )
composition of canonical relations

Quantum Mechanics
element of L2 (Q) or D0 (Q)
= exp(iS/~)
Hilbertspace
(possibly unbounded)
L2 (R) to L2 (Q)
composition of operators

tabular example 5 (same as tabex4, but within a framed box)

Classical Mechanics
immersed Lagrangian manifold
(T Q, )
= graph of dS
T Q
Lagrangian manifold
(T Q, Q ) (T R, R )
composition of canonical relations

Quantum Mechanics
element of L2 (Q) or D0 (Q)
= exp(iS/~)
Hilbertspace
(possibly unbounded)
L2 (R) to L2 (Q)
composition of operators

tabular example 6 (3 columns with lines)

Case
Unconstrained
Purely Kinematic
Horizontal symmetries
General principal
bundle case

Conditions
Dq = Tq Q

Connection
Asym (q)
= I1 J(q)

Dq Tq (Orb(q)) = {0}

Akin (q)
=0

Dq Tq (Orb(q))G = Tq (Orb(q))H

Asym (q)
+ Akin (q)
= I1 JH (q)

Dq + Tq (Orb(q)) = Tq Q

Asym (q)
+ Akin (q)
= I1 J nhc (q)

25

Pictures

You must include the line

\usepackage{graphicx}

at the beginning of your document in order to use these commands.

\begin{figure}
\vspace{2in}
\hspace{.4in}
\includegraphics{myfigure.eps}
\caption{}
\end{figure}

26

You might also like