Basic Latex
Basic Latex
Julie Mitchell
1 Basic Formatting
\documentstyle{article}
\usepackage{graphicx, amssymb}
\begin{document}
1
1.2 Format
{ 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
h \langle
i \rangle
2
1.4 Lists and Tables
\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
\begin{thebibliography}
and before
\end{thebibliography}
3
1.6 Foreign Accents
é É \’{e} \’{E}
è È \‘{e} \‘{E}
ä Ä \”{a} \”{A}
ö Ö \”{o} \”{O}
ü Ü \”{u} \”{U}
1.7 Miscellaneous
@ @ at symbol
c \copyright copyright
¶ \P paragraph
§ \S section
ß \ss german ss
1.8 Spaces
4
2 Basic Mathematical Formatting
\[
Z b
F (b) − F (a) = f (x)dx
a
beqex \begin{equation}
5
Z b
F (b) − F (a) = f (x)dx (1)
a
\[ containing text
n
X
x2i + yi2 ≥ 0 for all real numbers xi and yi
i=1
\begin{eqnarray*}
2
= y+1
2
z +1 = u+v
\begin{eqnarray}
2
= y+1 (2)
2
z +1 = u+v (3)
a=b+c
(4)
d=e+f +g
a = b + c + (c + d)
−e+f
\begin{equation} \begin{array}{l}
)
x=y
(5)
a = b2 + b + 1
6
\begin{equation} \begin{array}{c}
)
x=y
(6)
a = b2 + b + 1
\begin{equation} \fbox{
x2 + 1
=y (7)
5
evaluation of expression
t
f
2 t=0
\begin{eqnarray}\lefteqn{ }
ax2 + 2bxy + cy 2 + dx + ey + f
= αu + βv + γw + δ (8)
Z
1
Ĥc (∆ω) : = ∆ω(−∇2 )−1 ∆ω + Φ(ωe + ∆ω) − Φ(ωe )
D 2
0
− Φ (ωe )∆ω dx dy
H0s (T M ) s
= ∈ H (T M ) there exists an H s -extension
s
X̃ ∈ H (T̃ M ) with X zero on M̃ \M .
7
2.4 Theorem Like Environments
\quad \blacklozenge
\quad $\blacklozenge$
\quad \blacksquare end proof
\quad $\blacksquare$ dollar end proof
\quad \square empty square
\quad $\square$ dollar empty square
5 \quad \bigtriangledown empty triangle down
5 \quad $\bigtriangledown$ dollar empty triangle down
H \quad \blacktriangledown black triangle down
H \quad $\blacktriangledown$ dollar black triangle down
8
3 Alphabets and Fonts
All greek letters are available as sub- and superscripts by preceding the codes below with “l” or “h”. For
example, “lxa” is “ \alpha” and “hxa” is “ˆ\alpha”. They are also available enclosed by $, for example
“dxa” produces “$\alpha $”.
α \alpha
β \beta
γ \gamma xcg Γ \Gamma
δ \delta xcd ∆ \Delta
\epsilon
ε \varepsilon
ζ \zeta
η \eta
θ \theta xcth Θ \Theta
ϑ \vartheta
ι \iota
κ \kappa
λ \lambda xcl Λ \Lambda
µ \mu
ν \nu
π \pi xcp Π \Pi
$ \varpi
ρ \rho
% \varrho
σ \sigma xcs Σ \Sigma
ς \varsigma
τ \tau
υ \upsilon xcu Υ \Upsilon
φ \phi xcph Φ \Phi
ϕ \varphi
χ \chi
ψ \psi xcps Ψ \Psi
ω \omega xco Ω \Omega
For the universal blank bricks, use “. . . u” (universal). To complete it, after typing the entry, use “eb” and
“eit”. [Note about “bi”: If you do your papers in 12pt, modify the definition of \tenbi at the beginning.]
9
example {\sl slanted type
example {\tt typewriter type
example {\em emphasized type
ξ \mbox{\boldmath$. . . $}
A {\cal only in math mode, only cap.letters
g \mathfrac only in math mode
R {\mathbb only in math mode
{\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}
e1 {\bf e} 1
\mbox{\boldmath$. . . $}
ω \mbox{\boldmath$\omega$}
ξ \mbox{\boldmath$\xi$}
10
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,
11
4 Basic Mathematical Operations and Symbols
4.3 Roots
√
√2 \sqrt{2}
√ π \sqrt{\pi}
3
√ 2 \sqrt[3]{2} cube root over 2
n
2 \sqrt[n]{2} n-root over 2
12
4.4 Specific Fractions
1
\frac{1}{2}
2
1
\frac{1}{3}
3
1
\frac{1}{4}
4
d
\frac{d}{dt}
dt
du
\frac{du}{dt}
dt
dx
\frac{dx}{dt}
dt
dy
\frac{dy}{dt}
dt
dz
\frac{dz}{dt}
dt
∂
\frac{\partial}{\partial x}
∂x
∂
\frac{\partial}{\partial y}
∂y
∂z
\frac{\partial z}{\partial x}
∂x
∂2
\frac{\partialˆ2}{\partial x \partial y}
∂x∂y
∂3
\frac{\partialˆ3}{\partial x \partial y \partial z}
∂x∂y∂z
4.5 Superscripts
All letters, capital letters and numbers from 0 to 10 are available as superscripts, by preceding the desired
letter or number with “h”. E.g. “ha” gives ˆa, “hca” gives “ˆA”, “h1” gives “ˆ1”. Exceptions, to avoid
conflict with words and the universal macro, are “hee” for superscript e, “huu” for superscript u.
ˆ{ 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
x2 , y 2 , z 2 xˆ2, yˆ2, zˆ2
13
−1
ˆ{-1}
ij ˆ
{ij}
ijk ˆ
{ijk}
jk ˆ
{jk}
†
ˆ\dagger
⊥
ˆ\perp
0
ˆ\prime
∗
ˆ\ast
?
ˆ\star
4.6 Subscripts
All letters, capital letters and numbers from 0 to 10 are available as subscripts, preceding with “l”. E.g. “la”
gives “ a”, “lca” gives “ A”, “l1” gives “ 1”.
{ low universal
a –z a– z (except: “luu” for u )
A – Z A– Z
0 – 10 0 – {10}
ij {ij}
ijk {ijk}
jk {jk}
yn yn
zn zn
∗ \ast
? \star
14
4.7 Overcharacters
p̄ \bar{p}
ᾱ \bar{\alpha}
ṗ \dot{p}
p̈ \ddot{p}
p \overline{p}
p̂ \hat{p}
~a \vec{a}
−→
PP \stackrel{\textstyle\longrightarrow}{\rm PP}
−→
PQ \stackrel{\textstyle\longrightarrow}{\rm PQ};
+ + plus
− − minus
± \pm plus-minus
∓ \mp minus-plus
÷ \div divide
◦ \circ composite
• \bullet bullet
⊕ \oplus direct sum
\ominus direct difference
× \times times
⊗ \otimes tensor product
s \,\circledS\, semi direct product
∧ \wedge wedge product
= equals
=0 equals zero
≥ \geq greater than or equal
≤ \leq less than equal
6 = \neq not equal
∼
= \cong isomorphic
≡ \equiv equivalent
\ll much less than
\gg much greater than
≈ \approx approximately
15
4.9 Sized Parentheses
ℵ \aleph aleph
~ \hbar Planck’s constant
0 \prime prime, use “hpr” for superscript
[ \flat flat sign, “hfl” for superscript
] \sharp sharp sign, “hsh” for superscript
♥ \heartsuit sweetheart
∝ \propto proportional to
k \|
£ \pounds Lie derivative
t \pitchfork transversal
` \ell script l
k \| norm
∇ \nabla nabla
∂ \partial partial derivative
∞ \infty infinity
℘ \wp Weierstrass p-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
6∈ \not\in not an element of
\ \setminus set difference
⊂ \subset subset
⊆ \subseteq subset or equals
⊃ \supset superset
⊇ \supseteq superset or equals
∩
T \cap intersection
\bigcap big intersection
∪
S \cup union
\bigcup big union
| \mid vertical bar, with spacing
∃ \exists there exists
∀ \forall for all
17
4.13 Trig Functions
cos \cos
cosh \cosh hyperbolic cosine
cos2 \cosˆ2 cosine squared
cos θ \cos \theta cosine of theta
cos φ \cos \phi cosine of phi
sin \sin
sinh \sinh hyperbolic sine
sin2 \sinˆ2 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
18
4.15 Combinations of Mathematical Symbols
−1 -1 minus one
kuk \ | {\bf u} \ |
|a| |a| absolute value;
Aia Aˆi {\;a} staggered, high and low
LA µ L A{}ˆ\mu staggered, variation 1
vA ν vˆA{} \nu staggered, variation 2
g∗ \mathfrak g ˆ{\ast} german g star;
g∗ $\mathfrak g ˆ{\ast}$
so(3) \mathfrak{so}(3)
so(3) so(3)
SO(3) SO(3)
T ∗Q Tˆ\ast Q
Tq∗ Q Tˆ{\ast} {q} Q
div {\rm div}\, divergence
Aut( {\rm Aut}( automorphism universal
Diff( {\rm Diff}( diffeomorphism universal
Im( {\rm Im}( real part universal
Im(z) {\rm Im}(z) real part of z
Re( {\rm Re}( real part universal
Re(z) {\rm Re}(z) real part of 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 dy/dt
dx/dt dx/dt
dz/dt dz/dt
∂z/∂y \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
Z
\int integral universal; add limits with “hu” and “lu”
ZZ
\int \!\!\! \int double integral
ZZZ
\int \!\!\!\int \!\!\!\int triple integral
I
\oint contour integral
Z 1
\intˆ1 0
0
Z b
\intˆb a
a
Z
\int D
D
Z
\int {{\mathbb R}ˆ3}
R3
Z ∞
\intˆ\infty {−\infty}
−∞
Z 2π
\intˆ{2 \pi} 0
0
20
5.2 Sums, Limits, etc.
X P
\sum (in-text)
n
X Pn
(displayed) i=1 (in-text)
i=1
n
Y Qn
(displayed) i=1 (in-text)
i=1
n
[ Sn
(displayed) i=1 (in-text)
i=1
n
\ Tn
(displayed) i=1 (in-text)
i=1
21
5.3 Sample Matrices
x1
x2 \left( \begin{array}{c} x1 \\ x2 \\ x3 \end{array} \right)
x3
x
\left[ \begin{array}{c} x \\ y \end{array} \right]
y
a b
\left( \begin{array}{cc} a & b \\ c & d \end{array} \right)
c d
a b
\left[ \begin{array}{cc} a & b \\ c & d \end{array} \right]
c d
1 0
\left[ \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array} \right]
0 1
0 1
\left[ \begin{array}{cc} 0 & 1 \\ - 1 & 0 \end{array} \right]
−1 0
1 0 0
0 1 0 \left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right)
0 0 1
a b c
d e
f
\left| \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right|
g h i
a b c
d e f \left( \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right)
g h i
a b c
d e f \left[ \begin{array}{ccc} a & b & c \\ d & e & f \\ g & h & i \end{array} \right]
g h i
22
6 Boxes, Tabbing and Tabular Environment Samples
6.1 Boxes
6.2 Tabbing
tabbing example 1
23
6.3 Tabular
Definition
of derivative
↓
Partials exist and =⇒ Differentiable =⇒ Partials exist
are continuous
∂φ ∂φa
V = Va =
∂t ∂t
vt = Vt ◦ φ−1
t vta = Vta ◦ φ−1
t
Covariant Derivative
∂v a b
Dv · w = ∇w v (∇w v)a = a b c
w + γbc w v
∂xb
∂z i coordinate ∂
ea = i̇i = ea
∂xa basis vectors ∂xa
∂xb ∂ ∂xb ∂
ēa = eb =
∂ x̄a ∂ x̄a ∂ x̄a ∂xb
change of
a coordinates a
∂ x̄ b
dx̄a = ∂ x̄ dxb
ēa = e
∂ x̄b ∂xb
24
tabular example 4 (2 columns with lines)
25
7 Pictures
\usepackage{graphicx}
\begin{figure}
\vspace{2in}
\hspace∗{.4in}
\includegraphics{myfigure.eps}
\caption{}
\end{figure}
26