Maths in Linux DTWARM2020
Maths in Linux DTWARM2020
Vineet Sahula
I TUG-India, https://www.tug.org/tutorials/tugindia/
I Bridgeman
I Stefan M Moser, How to Typeset Equations in LATEX;
http://moser-isi.ethz.ch/
I Hebert Voss, Math mode, CTAN://macros/latex/base/lppl.txt;
([email protected])
I Timothy Love, Latex Math & Graphics, University of Cambridge;
([email protected])
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
Mathematical Symbols
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
Outline
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
Reserved set
https://en.wikibooks.org/wiki/LaTeX
https://en.wikibooks.org/wiki/LaTeX
Outline
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
Displaymath environment
OR maybe out of paragraph as following which is outside paragraphs
\begin{displaymath}
\end{displaymath} \\
OR
\[
(a+b)^2 = a^2 + 2ab + b^2
\]
Outline
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
Outline
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
Keyboard symbols
\end{displaymath}
Keyboard symbols
\end{displaymath}
Exponents
x^2 x2
a_n an
x_i^n xin
x^{2n} x 2n
x2
A^{x_i^2}_{j^{2n}_{n,m}} Aj 2ni
n,m
Outline
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
Fractions
\[ \frac{numerator}{denomintor} \] numerator
denomintor
\frac{1}{x+y} 1
x+y
a −b2
2
\frac{a^2-b^2}{a+b}=a-b a+b = a − b
\frac{\frac{}{}+\frac{}{}}{1+\frac{a-b}{a+b}} x 2n
10
\frac{\frac{10}{7}}{35} 7
35
\frac{10}{\frac{7}{35}} 10
7
35
Roots
√
\[ \sqrt[n]{arg} \] √ arg
n
\sqrt{a} √ a
\sqrt[3]{8} = 2 3
8=2
q
\sqrt[3]{-q + \sqrt{q^2 + p^3}} 3
p
−q + q 2 + p3
Outline
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
a
2\sum_{i=1}^n a_i \\ n Z b
\int^b_a f_i(x)g_i(x)\,\mathrm{d}x 2 ∑ ai fi (x)gi (x) dx
\] i=1 a
Outline
Elementary
Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots
Continuation dots
Mathematical Symbols
Outline
Mathematical Symbols
Greek Symbols
Binary Operators
Relations
Relations negations
Arrows
\sum \bigcap
T \
∑ ∑
Z
\int \bigcup
R S [
I
\oint \bigsqcup
H F G
\prod \bigvee
W _
∏ ∏
Advanced Elements
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
\left| X \right| |X |
3
\left\{ 2\left(x(\frac{3}{4}+y)\right) \right\} 2 x( + y )
4
\{ 2(x(\frac{3}{4}+y)) \} 3
{2(x( + y ))}
4
\cos( \frac{\pi}{2}x^2 )
π
cos( x 2 )
2
\cos\left( \frac{\pi}{2}x^2 \right)
π
cos x2
\[ y = \left\{ 2
\begin{array}{r@{\quad:\quad}l}
-1 & x<0 \\ 0 & x=0 \\ +1 & x>0
\end{array}
−1 : x < 0
right. \] y= 0 : x =0
+1 : x > 0
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
\begin{displaymath}
\begin{array}{ccccc}
a_{11} & a_{12} & a_{13} & \cdots & a_{1n}\\
a_{21} & a_{22} & a_{23} & \cdots & a_{2n}\\
\vdots & \vdots & \vdots & \ddots & \vdots\\
a_{n1} & a_{n2} & a_{n3} & \cdots & a_{nn}
\end{array}
\end{displaymath}
\begin{displaymath}
\begin{array}{*{3}{c@{\:+\:}}c@{\;=\;}c}
a_{11}x_1 & a_{12}x_2 & \cdots & a_{1n}x_n & b_1 \\
a_{22}x_1 & a_{22}x_2 & \cdots & a_{2n}x_n & b_2 \\
\multicolumn{5}{c}{\dotfill} \\
a_{n1}x_1 & a_{n2}x_2 & \cdots & a_{nn}x_n & b_n
\end{array}
\end{displaymath}
\ begin { d i s p l a y m a t h }
\ sum_ { p_1<p_2 < \ cdots <p_ { n−k } } ^ { ( 1 , 2 , \ l d o t s , n ) }
\ D e l t a _ { \ begin { a r r a y } { l } p_1p_2 \ c d o t s p_ { n−k } \ \
p_1p_2 \ c d o t s p_ { n−k }
\ end { a r r a y } }
\ sum_ { q_1<q_2 < \ c d o t s q_k }
\ l e f t | \ begin { a r r a y } { l l c l }
a_ { q_1q_1 } & a_ { q_1q_2 } & \ c d o t s & a_ { q_1q_k }
a_ { q_2q_1 } & a_ { q_2q_2 } & \ c d o t s & a_ { q_2q_k }
\ multicolumn { 4 } { c } \ d o t f i l l \ \
a_ { q_kq_1 } & a_ { q_kq_2 } & \ c d o t s & a_ { q_kq_k }
\ end { a r r a y } \ r i g h t |
\ end { d i s p l a y m a t h }
aq1 q1 aq1 q2 · · · aq1 qk
(1,2,...,n)
aq2 q1 aq2 q2 · · · aq2 qk
∑ ∆ ∑
p1 <p2 <···<pn−k
p1 p2 · · · pn−k q1 <q2 <···qk .......................
p1 p2 · · · pn−k aqk q1 aqk q2 · · · aqk qk
f (x) = n
cn (z − a) = + c−1 (z − a)−1 + c−2 (z − a)−2 + · · ·
⎪
⎩
n=−∞ + c−n (z − a)−n + · · ·
Tip: the right-hand side of the equation can be created with an array environment
consisting of only one column. What is its formatting argument?
Exercise 5.14: The shortest distance between two straight lines represented by
the equations
x − x1 y − y1 z − z1 x − x2 y − y2 z − z2
= = and = =
136 Chapter 5.l1Mathematical
m1 n1
Formulas l2 m2 n2
x1 − x2 y1 − y2 z1 − z2
± l1 m1 n1
l2 m2 n2
2 2 2
n
l1 m1 m1 n1 1 l1
+ +
l2 m2 m2 n2 n2 l2
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
a2 + xy + z
z }| {
\overline{sub form} and \underline{sub form} a+b + c
| {z } +d
\overline{\overline{a}^2 + \underline{xy}
+ \overline{\overline{z}}}
\overbrace{a + \underbrace{b+c} + d}
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
~x def
= (x1 , ..., xn )
α0 β0
\stackrel{upper sym}{lower sym} A −→ B ←− C
A \stackrel{\alpha'}{\longrightarrow} B
\stackrel{\beta'}{\longleftarrow} C
\binom{top}{bottom}
n+1 n n
= +
k k k −1
n+1 n n
= +
k k k −1
{n+1 \choose k} = {n \choose k} + {n \choose k-1}
\prod_{j\ge0}\left(
\sum_{k\ge0} a_{jk}z^k \right) = \sum_{n\ge0} z^n
\left(
\sum_{k_0,k_1\ldots\ge0 \atop k_0+k_1+\cdots=0}
a_{0k_0} a_{1k_1}\ldots
\right)
!
∏ ∑ ajk z k = ∑ zn ∑ a0k0 a1k1 . . .
j≥0 k ≥0 n≥0 k0 ,k1 ...≥0
k0 +k1 +···=0
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
Use \usepackage{IEEEtrantools}
\begin{eqnarray}
(x+y)(x-y) & = & x^2-xy+xy-y^2 \nonumber\\
& = & x^2 - y^2 \\
(x+y)^2 & = & x^2 + 2xy + y^2
\end{eqnarray}
(x + y )(x − y ) = x 2 − xy + xy − y 2
= x2 − y2 (1)
2 2 2
(x + y ) = x + 2xy + y (2)
\begin{eqnarray}
{\cal M}^2(\hat{\theta},\theta) &=& E[(\hat{\theta} - \theta)^2
{\cal M}^2(\hat{\theta},\theta) &=& {\rm var}^2(\hat{\theta}) +
\end{eqnarray}
M 2 (θ̂ , θ ) = E[(θ̂ − θ )2 ]
M 2 (θ̂ , θ ) = var2 (θ̂ ) + B 2 (θ̂ ). (3)
\begin{eqnarray}
{\cal B}(t,\omega)
& \approx &
{1 \over 4\pi} {\cal D}_t^2 W_{\bf S}(t, \omega) {{{\scriptstyl
&& + {1 \over 4\pi} {\cal D}_\omega^2 W_{\bf S}(t, \omega) {{{\
\end{eqnarray}
Z ∞Z
1 2
B(t, ω) ≈ D W (t, ω) t12 φ (t1 , ω1 ) dt1 dω1
4π t S −∞
Z ∞Z
1
+ Dω2 WS (t, ω) ω12 φ (t1 , ω1 ) dt1 dω1 . (4)
4π −∞
\begin{eqnarray*}
x_nu_1 + \cdots + x_{n+t-1}u_t & = & x_nu_1 + (ax_n + c)u_2 + \
& & + \left(a^{t-1}x_n + c(a^{t-2} + \cdots+1)\right)u_t\\
& = & (u_1 + au_2 + \cdots + a^{t-1}u_t)x_n + h(u_1,\ldots,u_t)
\end{eqnarray*}
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
\begin{eqnarray*}
x_nu_1 + \cdots + x_{n+t-1}u_t & = & x_nu_1 + (ax_n + c)u_2 + \
& & + \left(a^{t-1}x_n + c(a^{t-2} + \cdots+1)\right)u_t\\
& = & (u_1 + au_2 + \cdots + a^{t-1}u_t)x_n + h(u_1,\ldots,u_t)
\end{eqnarray*}
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
Spacing Elements
\thinmuskip=3mu
\medmuskip=4mu
\thickmuskip=5mu
Here, 1 mu is mathematical unit, equivalent to 1/18 of em
1
mu = em
18
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
\begin{equation}
x = a_0 + \frac{1}{a_1 + \frac{1}{a_2 + \frac{1}{a_3 + a_4}}}
\end{equation}
1
x = a0 + 1
a1 + a 1
2 + a +a
3 4
1
x = a0 +
1
a1 +
1
a2 +
a3 + a4
Outline
Advanced Elements
Sizing of brackets
Text in formula
Matrices
Lines- over & under Formulae
Stacked symbols
Multiline equations
Side-by-side formulae and Bold face letters
Spacing
Font sizes in Formulae
Manual sizing of brackets
\Biggl\{2\Bigl(x(3+y)\Bigr)\Biggr\}
(x + iy )
R
{ x}
Thanks!
Thanks! Queries?