17

Click here to load reader

The LaTeX Workshop: Typesetting Mathematics with LaTeX

Embed Size (px)

DESCRIPTION

Part of a series of lectures to be delivered on typesetting documents and presentations with LaTeX. Provided as a Creative Commons Document

Citation preview

Page 1: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

Typesetting Mathematics in LaTeXGetting your hands dirty

Suddhasheel Ghosh

1Department of Civil EngineeringMGM’s Jawaharlal Nehru Engineering College,

Aurangabad, MH

2MGM - Institute of Biosciences and TechnologyAurangabad, MH

The LaTeX workshop

shudh Mathematics

Page 2: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

Outline

1 Preliminary commands

2 Inline and display mathSetting up equationsStep-wise functions or case based functionsMatrices and determinants

3 Math rich tables

shudh Mathematics

Page 3: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

Outline

1 Preliminary commands

2 Inline and display mathSetting up equationsStep-wise functions or case based functionsMatrices and determinants

3 Math rich tables

shudh Mathematics

Page 4: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

Preamble settingsNecessary requirement for typesetting math

In the preamble, set the following

\usepackage{amssymb, amsmath}

shudh Mathematics

Page 5: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

Basic commands

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

$\sum_{i=1}^na_n x^n = 0$

$\prod_{i=1}^na_n x^n = 1$

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

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

${4}\choose{2}$

n∑i=1

anxn = 0

n∏i=1

anxn = 1

∫xndx =

xn+1

n + 1∫∞

0xndx =

1n + 1

[xn+1

]∞0(

42

)

shudh Mathematics

Page 6: The LaTeX Workshop: Typesetting Mathematics with LaTeX

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

Page 7: The LaTeX Workshop: Typesetting Mathematics with LaTeX

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) andq(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

Page 8: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

Symbols we love

± \pm ∓ \mp∀ \forall ∈ \in⊃ \supset ⊂ \subset≤ \le � \nleq≥ \ge � \ngeq∼ \sim ≈ \approx/ \nsim 0 \napprox≡ \equiv . \nequiv∩ \cap ∪ \cup× \times ÷ \div� \ll � \gg→ \rightarrow ⇒ \Rightarrow← \leftarrow ⇐ \Leftarrowx̄ \bar{x} ~x \vec{x}

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

shudh Mathematics

Page 9: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

That’s the limit !

$\lim_{x \rightarrow 5} \frac{x^2 - 25}{x - 5} = 10$

produces:

limx→5

x2− 25

x − 5= 10

shudh Mathematics

Page 10: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables Equations Cases Matrices and determinants

Outline

1 Preliminary commands

2 Inline and display mathSetting up equationsStep-wise functions or case based functionsMatrices and determinants

3 Math rich tables

shudh Mathematics

Page 11: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables Equations Cases Matrices and determinants

Typesetting mathInline 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 mdenotes 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^{-2\pi 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

Page 12: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables Equations Cases Matrices and determinants

Typesetting mathEquations

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

n∑i=0

ai cosθ + bi sinθ = F (1)

shudh Mathematics

Page 13: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables Equations Cases Matrices and determinants

Typesetting mathPiecewise functions or case based functions

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

f (x) =

0 x ∈ Q1 x ∈ I

shudh Mathematics

Page 14: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables Equations Cases Matrices and determinants

Typesetting mathMatrices

$$\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 2 3 46 7 9 105 6 3 14 2 8 2

xyzt

=

4552

shudh Mathematics

Page 15: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables Equations Cases Matrices and determinants

Typesetting mathDeterminants

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

∣∣∣∣∣∣∣∣1 2 34 5 67 8 9

∣∣∣∣∣∣∣∣ = 0

shudh Mathematics

Page 16: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

Outline

1 Preliminary commands

2 Inline and display mathSetting up equationsStep-wise functions or case based functionsMatrices and determinants

3 Math rich tables

shudh Mathematics

Page 17: The LaTeX Workshop: Typesetting Mathematics with LaTeX

Basics Typesetting Math rich tables

Tables with mathematical expressions

\begin{table}\begin{tabular}{|c|l|c|l|}\hlineS. No. &Type &Degree&Expression \\\hline1 & Algebraic & 1 & $x$ \\\hline2 &Algebraic &2&$x^2 + x + 1$ \\\hline3 &Algebraic &3&$x^3 + x^2 + x + 1$ \\\hline\end{tabular}\end{table}

S. No. Type Degree Expression1 Algebraic 1 x2 Algebraic 2 x2 + x + 13 Algebraic 3 x3 + x2 + x + 1

shudh Mathematics