MMSE101A: Latex UNACCO College
L ATEX
LATEX (usually pronounced “LAY teck,” sometimes “LAH teck,” and never “LAY tex”) is a format, or collection of macro commands,
for TEX, the standard for most professional mathematics and scientific writing. TEX is a powerful typesetting engine created by Donald
Knuth of Stanford University (his first version appeared in 1978). Leslie Lamport was responsible for creating LATEX, a popular set of
user commands for TEX.
M ATHEMATICS
In properly typeset mathematics, the variables appear in italics (for example, f (x) = x2 +2x−3). The exception to this rule is predefined
functions (for example, sin(x)). Thus it is important to always treat text, variables, and functions correctly. See the difference between
and x, −1 and -1, and sin(x) and sin(x). There are two ways to present a mathematical expression – inline or as a display.
I NLINE MATHEMATICAL EXPRESSIONS
Inline math expressions occur as part of the normal To produce an inline expression, place the math expression between dollar signs ($).
π
For example, typing $90ˆ{\circ}\$ is same as $\frac{\pi}{2} radian$ yield 90◦ is same as
2
D ISPLAYED MATHEMATICAL EXPRESSIONS
Displays are mathematical expressions that are given their own line and are centered on the page. These are usually used for important
equations that deserve to be showcased on their own line or for large equations that cannot fit inline. To produce displayed mathematics,
place the mathematical expression between the symbols and. Typing \[x=\frac{-b\pm\sqrt{bˆ2-4ac}}{2a}\] yields
√
−b ± b2 − 4ac
x=
2a
D ISPLAY S TYLE
To get full-size inline math, use \displaystyle. Typing this $\displaystyle \sum_{n=1}ˆ{\infty} \frac{1}{n}$
∞
X 1 P∞
and not $\sum_{n=1}ˆ{\infty} \frac{1}{n}$ yield this and not n=1 n1
n=1
n
I MAGES
We can put images (pdf, png, jpg, or gif) in our document. They need to be in the same location of our .tex file when we compile the
document. Omit width = .5in if we want the image to be full sized.
\begin{figure}[tbp]
\includegraphics[width=.5in]{imagename.jpg}
\caption{The (optional) caption goes here.}
\end{figure}
T EXT DECORATION
Out text can be italic (\textit{italic}), bold (\textbf{bold}) or underline (\underline{underline}). Math can
contain bold, R (\mathbf{R}). We may want to used these to express the set of real numbers(R), integer (Z), rational number (Q)
and natural number (N). For text appearing inside a math expression use \text.
• Without the text command it treats ”and” as three variables:
(0, 1] = {x ∈ R : x > 0andx ≤ 1}
S PACES AND NEW LINE
Latex ignore extra spaces and new lines. For example,
This sentence will look
fine after it is compile. will give the following output
This sentence will look fine after it is compile
Leave one full empty line between two paragraphs. Place \\ at the end of the line to create new line (but not create a new paragraph).
Use \noindent to prevent paragraph from indenting.
Department of Computer Science Page 1
MMSE101A: Latex UNACCO College
C OMMENTS
Use % to create a comment. Nothing on the line after % will be typeset.
$f(x) = \sin x $ %this is the sine function yields
f (x) = sin x
D ELIMITER
description command output
parenthesis (x) (x)
square brackets [x] [x]
parenthesis \{x)\} {x}
To automatically
make ∞ delimiter large enough to fit the content, use them together with \right and \left. For example, \left\{ \displ
1
produces sin
n n
Curly brackets are non-printing characters that are used to gather text that has more than one character. Observe the difference
between xˆ2, xˆ{2}, xˆ2t, xˆ{2t} when typeset: x2 , x2 , x2 t, x2t
L IST
We can produce ordered and unordered list
description command output
begin{itemize}
\item Thing1 • Thing1
unordered list \item Thing2
\end{itemize} • Thing2
begin{enumerate}
\item Thing1 1. Thing1
ordered list \item Thing2
\end{enumerate} 2. Thing2
S YMBOLS MATH MODE
description command output
addition $+$ +
subtraction $-$ −
plus or minus $\pm$ ±
multiplication(times) $\times$ ×
multiplication(dot) $\cdot$ ·
division symbol $\div$ ÷
division (slash) $ / $ /
circle plus $\oplus$ ⊕
circle times $\otimes$ ⊗
equal $=$ =
not equal $neq$ ̸=
less than $<$ <
Department of Computer Science Page 2
MMSE101A: Latex UNACCO College
description command output
greater than $>$ >
less than or equal to $\leq$ ≤
greater than or equal to $\geq$ ≥
approximately equal to $\approx$ ≈
infinity $\infty$ ∞
ldots $1, 2, 3, \ldots$ 1, 2, 3, . . .
1+2+3+
cdots $1+2+3+ \cdots$
···
a
fraction $\frac{a}{b} $ √b
square root $\sqrt{x}$ √ x
nth root $\sqrt[n]{x}$ n
x
exponentiation $aˆb$ ab
subscript $a_b$ ab
absolute value |x| |x|
natural log \ln(x) ln(x)
ex =
exponential function eˆ{x} = \exp(x)
exp(x)
degree deg(f) deg(f )
F UNCTION
description command output
map to \to →
composition \circ ◦
|x| = \begin{cases}
x & x \geq 0\\
(
piecewise function x x≥0
-x & x \leq 0 |x| =
\end{cases} −x x≤0
G REEK AND H EBREW L ANGUAGE
command output command output
\alpha α \tau τ
\beta β \theta θ
\chi χ \upsilon υ
\delta δ \xi ξ
\epsilon ϵ \zeta ζ
\varepsilon ε \Delta ∆
\eta η \Gamma Γ
\gamma γ \Lambda Λ
\iota ι \Omega Ω
\kappa κ \Phi Φ
\lambda λ \Pi Π
\mu µ \Psi Ψ
\nu ν \Sigma Σ
\omega ω \Theta Θ
\phi ϕ \Upsilon Υ
\varphi φ \Xi Ξ
\phi ϕ \aleph ℵ
\psi ψ \beth ℶ
\rho ρ \daleth ℸ
\sigma σ gimel ג
Department of Computer Science Page 3
MMSE101A: Latex UNACCO College
S ET THEORY
description command output
set brackets \{1, 2, 3 \} {1, 2, 3}
element of \in ∈
not an element of \not\in ̸∈
subset of \subset ⊂
subset of \subseteq ⊆
not a subset of \not\subset ̸⊂
contains \supset ⊃
contains \supseteq ⊇
union \cup ∪
intersection \cap ∩
S10
big union \bigcup_{n=1}ˆ{10}A_{n} An
Tn=1
10
big intersection \bigcap_{n=1}ˆ{10}A_{n} n=1 An
empty set \emptyset ∅
power set \mathcal{P} P
minimum \min min
maximum \max max
infimum \inf inf
limit superior \limsup lim sup
limit inferior \liminf lim inf
closure \overline{A} A
C ALCULUS
description command output
derivative \frac{df}{dx} df
dx
derivative f’ f′
partial derivative \frac{\partial f}{\partial x} ∂f
∂x
Z
integral \int
ZZ
double integral \iint
ZZZ
triple integral \iiint
limits \lim_{x \to \infty} lim
x→∞
∞
summation \sum_{n=1}ˆ{\infty}a_{n}
X
an
n=1
∞
product \prod_{n=1}ˆ{\infty}a_{n}
Y
an
n=1
Department of Computer Science Page 4
MMSE101A: Latex UNACCO College
L OGIC
description command output
not \sim ∼
and \land ∧
or \lor ∨
if...then \to →
if and only if \leftrightarrow ↔
logical equivalent \equiv ≡
therefore \therefore ∴
there exist \exists ∃
for all \forall ∀
implies \Rightarrow ⇒
equivalent \Leftrightarrow ⇔
L INEAR A LGEBRA
description command output
vector \vec{v} ⃗v
vector \mathbf{v} v
\left[
\begin{array}{ccc}
1 & 2 & 3 \\
4 & 5 & 6 \\ 1 2 3
matrix 4
7 & 8 & 9 5 6
\end{array} 7 8 9
\right]
\left|
\begin{array}{ccc}
1 & 2 & 3 \\
4 & 5 & 6 \\ 1 2 3
matrix
7 & 8 & 9 4 5 6
\end{array} 7 8 9
\right|
determinant \det(A) det(A)
dimension \dim(V) dim(V )
N UMBER T HEORY
description command output
divides \mid |
does not divide \not \mid ̸|
mod \mod mod
greatest common divisor \gcd gcd
ceiling \lceil x \rceil ⌈x⌉
floor \lfloor x \rfloor ⌊x⌋
Department of Computer Science Page 5
MMSE101A: Latex UNACCO College
G EOMETRY AND TRIGONOMETRY
description command output
angle \angle ABC ∠ABC
degree 90ˆ{\circ} 90◦
triangle \triangle ABC △ABC
segement \overline{AB} AB
sine \sin sin
cosine \cos cos
tangent \tan tan
cotangent \cot cot
secant \sec sec
cosecant \csc csc
inverse sine \arcsin arcsin
inverse cosine \arccos arccos
inverse tangent \arctan arctan
S YMBOLS ( IN text MODE )
description command output
dollar sign \$ $
percent \% %
ampersand \& &
pound \# #
backslash \textbackslash \
left quote marks ‘‘ “
right quote marks ’’ ”
single left quote ‘ ‘
single right quote ’ ’
hyphen X-ray X-ray
en-dash pp. 5--15 pp. 5–15
em-dash Yes---or no? Yes—or no?
Department of Computer Science Page 6