Basics Typesetting Math rich tables

Typesetting Mathematics in LaTeX
Getting your hands dirty

Suddhasheel Ghosh
1 Department of Civil Engineering
MGM’s Jawaharlal Nehru Engineering College,
Aurangabad, MH
2 MGM

- Institute of Biosciences and Technology
Aurangabad, MH

The LaTeX workshop

shudh

Mathematics
Basics Typesetting Math rich tables

Outline

1

Preliminary commands

2

Inline and display math
Setting up equations
Step-wise functions or case based functions
Matrices and determinants

3

Math rich tables

shudh

Mathematics
Basics Typesetting Math rich tables

Outline

1

Preliminary commands

2

Inline and display math
Setting up equations
Step-wise functions or case based functions
Matrices and determinants

3

Math rich tables

shudh

Mathematics
Basics Typesetting Math rich tables

Preamble settings
Necessary requirement for typesetting math

In the preamble, set the following
usepackage{amssymb, amsmath}

shudh

Mathematics
Basics Typesetting Math rich tables

Basic commands
It is necessary to enclose all math by the $ sign.
n

$sum_{i=1}^n
a_n x^n = 0$

an xn = 0
i=1
n

$prod_{i=1}^n
a_n x^n = 1$

an xn = 1
i=1

$int x^n dx =
frac{x^{n+1}}{n+1}$

xn dx =
∞

xn dx =

$int_0^infty x^n dx =
frac{1}{n+1} left[
x^{n+1}right]_0^infty$

0

shudh

1
xn+1
n+1
4
2

${4}choose{2}$
Mathematics

xn+1
n+1
∞
0
Basics Typesetting Math rich tables

Our greeky friends
The small ones:
alpha, beta, gamma, dots, chi, pi, phi, psi, xi
provide:
α, β, γ, . . . , χ, π, φ, ψ, ξ
On the other hand, the capital ones:
A, B, gamma, dots, X, pi, phi, psi, xi
provide:
A, B, Γ, . . . , X, Π, Φ, Ψ, Ξ

shudh

Mathematics
Basics Typesetting Math rich tables

Our wonderful roots
The Euclidean distance between two points $mathbf{p}
(x_1, y_1)$ and $mathbf{q}(x_2,y_2)$ is given by:
$$ d(mathbf{p}, mathbf{q}) = sqrt{(x_1-x_2)^2
+ (y_1 - y_2)^2}$$
and the Minkowski’s distance with the $p$-norm is given as
$$d_p(mathbf{p}, mathbf{q}) = sqrt[p]{vert x_1-x_2
vert ^p + vert y_1 - y_2 vert ^p}$$
produces:
The Euclidean distance between two points p(x1 , y1 ) and
q(x2 , y2 ) is given by:
d(p, q) =

(x1 − x2 )2 + (y1 − y2 )2

and the Minkowski’s distance with the p-norm is given as
dp (p, q) =

p

|x1 − x2 |p + |y1 − y2 |p
shudh

Mathematics
Basics Typesetting Math rich tables

Symbols we love
±
∀
⊃
≤
≥
∼
≡
∩
×
→
←
¯
x

pm
forall
supset
le
ge
sim
nsim
equiv
cap
times
ll
rightarrow
leftarrow
bar{x}

∈
⊂

≈

∪
÷
⇒
⇐
x

mp
in
subset
nleq
ngeq
approx
napprox
nequiv
cup
div
gg
Rightarrow
Leftarrow
vec{x}

All symbols require math mode. The math expressions must
be surrounded by the $ sign on both sides.
shudh

Mathematics
Basics Typesetting Math rich tables

That’s the limit !

$lim_{x rightarrow 5} frac{x^2 - 25}{x - 5} = 10$
produces:
x2 − 25
= 10
x→5 x − 5
lim

shudh

Mathematics
Basics Typesetting Math rich tables

Equations Cases Matrices and determinants

Outline

1

Preliminary commands

2

Inline and display math
Setting up equations
Step-wise functions or case based functions
Matrices and determinants

3

Math rich tables

shudh

Mathematics
Basics Typesetting Math rich tables

Equations Cases Matrices and determinants

Typesetting math
Inline and display modes

The equation of a straight line is given by $y = m x + c$, where $m$
denotes the slope, and $c$ denotes the $y$-intercept.
produces:
The equation of a straight line is given by y = mx + c, where m
denotes the slope, and c denotes the y-intercept.
The Fourier transform of a function $f:mathbb{R}rightarrow
mathbb{C}$ is given by:
$$
hat f(xi) = int_{-infty}^{infty} f(x) e^{-2pi i x xi} dx
$$
produces:
The Fourier transform of a function f : R → C is given by:
∞

ˆ
f (ξ) =

f (x)e−2πixξ dx
−∞
shudh

Mathematics
Basics Typesetting Math rich tables

Equations Cases Matrices and determinants

Typesetting math
Equations

begin{equation}
sum_{i=0}^n a_i cos theta + b_i sin theta
= mathcal{F}
end{equation}
n

ai cos θ + bi sin θ = F
i=0

shudh

Mathematics

(1)
Basics Typesetting Math rich tables

Equations Cases Matrices and determinants

Typesetting math
Piecewise functions or case based functions

$$
f(x) =
begin{cases}
0 & xinmathbb{Q} 
1 & xinmathbb{I}
end{cases}
$$


0


f (x) = 
1


shudh

Mathematics

x∈Q
x∈I
Basics Typesetting Math rich tables

Equations Cases Matrices and determinants

Typesetting math
Matrices

$$
begin{bmatrix}
1 &2 &3 &4 
6 &7 &9 &10 
5 &6 &3 &1 
4 &2 &8 &2
end{bmatrix}
begin{bmatrix}
x  y  z  t
end{bmatrix}
=
begin{bmatrix}
4  5  5  2
end{bmatrix}
$$


1


6



5




4

shudh

Mathematics

2
7
6
2

   
3 4  x 4
   
   
   
9 10 y 5
  =  
   
   
3 1  z 5
   
   
   
8 2 t
2
Basics Typesetting Math rich tables

Equations Cases Matrices and determinants

Typesetting math
Determinants

$$
begin{vmatrix}
1 & 2 & 3 
4 & 5 & 6 
7 & 8 & 9
end{vmatrix}
= 0
$$

1 2 3
4 5 6 =0
7 8 9

shudh

Mathematics
Basics Typesetting Math rich tables

Outline

1

Preliminary commands

2

Inline and display math
Setting up equations
Step-wise functions or case based functions
Matrices and determinants

3

Math rich tables

shudh

Mathematics
Basics Typesetting Math rich tables

Tables with mathematical expressions
begin{table}
begin{tabular}{|c|l|c|l|}
hline
S. No. &Type &Degree
&Expression 
hline
S. No.
1 & Algebraic & 1 & $x$ 
1
hline
2
2 &Algebraic &2
3
&$x^2 + x + 1$ 
hline
3 &Algebraic &3
&$x^3 + x^2 + x + 1$ 
hline
end{tabular}
end{table}
shudh

Type
Algebraic
Algebraic
Algebraic

Mathematics

Degree
1
2
3

Expression
x
x2 + x + 1
x3 + x2 + x + 1

The LaTeX Workshop: Typesetting Mathematics with LaTeX

  • 1.
    Basics Typesetting Mathrich tables Typesetting Mathematics in LaTeX Getting your hands dirty Suddhasheel Ghosh 1 Department of Civil Engineering MGM’s Jawaharlal Nehru Engineering College, Aurangabad, MH 2 MGM - Institute of Biosciences and Technology Aurangabad, MH The LaTeX workshop shudh Mathematics
  • 2.
    Basics Typesetting Mathrich tables Outline 1 Preliminary commands 2 Inline and display math Setting up equations Step-wise functions or case based functions Matrices and determinants 3 Math rich tables shudh Mathematics
  • 3.
    Basics Typesetting Mathrich tables Outline 1 Preliminary commands 2 Inline and display math Setting up equations Step-wise functions or case based functions Matrices and determinants 3 Math rich tables shudh Mathematics
  • 4.
    Basics Typesetting Mathrich tables Preamble settings Necessary requirement for typesetting math In the preamble, set the following usepackage{amssymb, amsmath} shudh Mathematics
  • 5.
    Basics Typesetting Mathrich tables Basic commands It is necessary to enclose all math by the $ sign. n $sum_{i=1}^n a_n x^n = 0$ an xn = 0 i=1 n $prod_{i=1}^n a_n x^n = 1$ an xn = 1 i=1 $int x^n dx = frac{x^{n+1}}{n+1}$ xn dx = ∞ xn dx = $int_0^infty x^n dx = frac{1}{n+1} left[ x^{n+1}right]_0^infty$ 0 shudh 1 xn+1 n+1 4 2 ${4}choose{2}$ Mathematics xn+1 n+1 ∞ 0
  • 6.
    Basics Typesetting Mathrich tables Our greeky friends The small ones: alpha, beta, gamma, dots, chi, pi, phi, psi, xi provide: α, β, γ, . . . , χ, π, φ, ψ, ξ On the other hand, the capital ones: A, B, gamma, dots, X, pi, phi, psi, xi provide: A, B, Γ, . . . , X, Π, Φ, Ψ, Ξ shudh Mathematics
  • 7.
    Basics Typesetting Mathrich tables Our wonderful roots The Euclidean distance between two points $mathbf{p} (x_1, y_1)$ and $mathbf{q}(x_2,y_2)$ is given by: $$ d(mathbf{p}, mathbf{q}) = sqrt{(x_1-x_2)^2 + (y_1 - y_2)^2}$$ and the Minkowski’s distance with the $p$-norm is given as $$d_p(mathbf{p}, mathbf{q}) = sqrt[p]{vert x_1-x_2 vert ^p + vert y_1 - y_2 vert ^p}$$ produces: The Euclidean distance between two points p(x1 , y1 ) and q(x2 , y2 ) is given by: d(p, q) = (x1 − x2 )2 + (y1 − y2 )2 and the Minkowski’s distance with the p-norm is given as dp (p, q) = p |x1 − x2 |p + |y1 − y2 |p shudh Mathematics
  • 8.
    Basics Typesetting Mathrich tables Symbols we love ± ∀ ⊃ ≤ ≥ ∼ ≡ ∩ × → ← ¯ x pm forall supset le ge sim nsim equiv cap times ll rightarrow leftarrow bar{x} ∈ ⊂ ≈ ∪ ÷ ⇒ ⇐ x mp in subset nleq ngeq approx napprox nequiv cup div gg Rightarrow Leftarrow vec{x} All symbols require math mode. The math expressions must be surrounded by the $ sign on both sides. shudh Mathematics
  • 9.
    Basics Typesetting Mathrich tables That’s the limit ! $lim_{x rightarrow 5} frac{x^2 - 25}{x - 5} = 10$ produces: x2 − 25 = 10 x→5 x − 5 lim shudh Mathematics
  • 10.
    Basics Typesetting Mathrich tables Equations Cases Matrices and determinants Outline 1 Preliminary commands 2 Inline and display math Setting up equations Step-wise functions or case based functions Matrices and determinants 3 Math rich tables shudh Mathematics
  • 11.
    Basics Typesetting Mathrich tables Equations Cases Matrices and determinants Typesetting math Inline and display modes The equation of a straight line is given by $y = m x + c$, where $m$ denotes the slope, and $c$ denotes the $y$-intercept. produces: The equation of a straight line is given by y = mx + c, where m denotes the slope, and c denotes the y-intercept. The Fourier transform of a function $f:mathbb{R}rightarrow mathbb{C}$ is given by: $$ hat f(xi) = int_{-infty}^{infty} f(x) e^{-2pi i x xi} dx $$ produces: The Fourier transform of a function f : R → C is given by: ∞ ˆ f (ξ) = f (x)e−2πixξ dx −∞ shudh Mathematics
  • 12.
    Basics Typesetting Mathrich tables Equations Cases Matrices and determinants Typesetting math Equations begin{equation} sum_{i=0}^n a_i cos theta + b_i sin theta = mathcal{F} end{equation} n ai cos θ + bi sin θ = F i=0 shudh Mathematics (1)
  • 13.
    Basics Typesetting Mathrich tables Equations Cases Matrices and determinants Typesetting math Piecewise functions or case based functions $$ f(x) = begin{cases} 0 & xinmathbb{Q} 1 & xinmathbb{I} end{cases} $$  0   f (x) =  1  shudh Mathematics x∈Q x∈I
  • 14.
    Basics Typesetting Mathrich tables Equations Cases Matrices and determinants Typesetting math Matrices $$ begin{bmatrix} 1 &2 &3 &4 6 &7 &9 &10 5 &6 &3 &1 4 &2 &8 &2 end{bmatrix} begin{bmatrix} x y z t end{bmatrix} = begin{bmatrix} 4 5 5 2 end{bmatrix} $$  1   6    5     4 shudh Mathematics 2 7 6 2     3 4  x 4             9 10 y 5   =           3 1  z 5             8 2 t 2
  • 15.
    Basics Typesetting Mathrich tables Equations Cases Matrices and determinants Typesetting math Determinants $$ begin{vmatrix} 1 & 2 & 3 4 & 5 & 6 7 & 8 & 9 end{vmatrix} = 0 $$ 1 2 3 4 5 6 =0 7 8 9 shudh Mathematics
  • 16.
    Basics Typesetting Mathrich tables Outline 1 Preliminary commands 2 Inline and display math Setting up equations Step-wise functions or case based functions Matrices and determinants 3 Math rich tables shudh Mathematics
  • 17.
    Basics Typesetting Mathrich tables Tables with mathematical expressions begin{table} begin{tabular}{|c|l|c|l|} hline S. No. &Type &Degree &Expression hline S. No. 1 & Algebraic & 1 & $x$ 1 hline 2 2 &Algebraic &2 3 &$x^2 + x + 1$ hline 3 &Algebraic &3 &$x^3 + x^2 + x + 1$ hline end{tabular} end{table} shudh Type Algebraic Algebraic Algebraic Mathematics Degree 1 2 3 Expression x x2 + x + 1 x3 + x2 + x + 1