0% found this document useful (0 votes)
54 views93 pages

Maths in Linux DTWARM2020

The document provides an overview and outline of topics for a presentation on typesetting mathematics in LaTeX. It includes an introduction, acknowledgments and references section. The outline discusses elementary mathematics notation, mathematical symbols, and advanced elements that will be covered in the presentation in three parts. Key terms related to LaTeX are also defined in a glossary.

Uploaded by

Suresh Vickey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views93 pages

Maths in Linux DTWARM2020

The document provides an overview and outline of topics for a presentation on typesetting mathematics in LaTeX. It includes an introduction, acknowledgments and references section. The outline discusses elementary mathematics notation, mathematical symbols, and advanced elements that will be covered in the presentation in three parts. Key terms related to LaTeX are also defined in a glossary.

Uploaded by

Suresh Vickey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 93

Mathematics in Latex

Vineet Sahula

Professor, Department of ECE


Malaviya National Institute of Technology Jaipur
vsahula.ece @ mnit.ac.in

Digital Tools for Writing

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 1 / 83


Courtesy & Acknowledgment

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])

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 2 / 83


References

1. https://www.latextemplates.com/ (A comprehensive repository of


Examples/templates)
2. https://en.wikibooks.org/wiki/LaTeX (A comprehensive open
documentation)
3. https://en.wikibooks.org/wiki/LaTeX/FAQ

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 3 / 83


Outline of Part- 1:

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 4 / 83


Outline of Part- 2:

Mathematical Symbols

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 5 / 83


Outline of Part- 3:

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 6 / 83


Part I

Mathematics to start with

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 7 / 83


Outline of Part- 1: Mathematics to start with

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 8 / 83


Glossary of Terms in Latex

group is everything after an opening brace and before the


matching closing brace.
token is a character, a control sequence, or a group.
control sequence is anything that begins with a \ . It is not printed
as is, it is expanded by theTeX engine according to its
type.
command (or function or macro ) is a control sequence that may
expand to text, to (re)definitionof control sequences, etc.
primitive is a command that is hard coded in the TeX engine, i.e. it
is not written in Plain TeX.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 9 / 83


Glossary of Terms in Latex

group is everything after an opening brace and before the


matching closing brace.
token is a character, a control sequence, or a group.
control sequence is anything that begins with a \ . It is not printed
as is, it is expanded by theTeX engine according to its
type.
command (or function or macro ) is a control sequence that may
expand to text, to (re)definitionof control sequences, etc.
primitive is a command that is hard coded in the TeX engine, i.e. it
is not written in Plain TeX.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 9 / 83


Glossary of Terms in Latex

group is everything after an opening brace and before the


matching closing brace.
token is a character, a control sequence, or a group.
control sequence is anything that begins with a \ . It is not printed
as is, it is expanded by theTeX engine according to its
type.
command (or function or macro ) is a control sequence that may
expand to text, to (re)definitionof control sequences, etc.
primitive is a command that is hard coded in the TeX engine, i.e. it
is not written in Plain TeX.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 9 / 83


Glossary of Terms in Latex

group is everything after an opening brace and before the


matching closing brace.
token is a character, a control sequence, or a group.
control sequence is anything that begins with a \ . It is not printed
as is, it is expanded by theTeX engine according to its
type.
command (or function or macro ) is a control sequence that may
expand to text, to (re)definitionof control sequences, etc.
primitive is a command that is hard coded in the TeX engine, i.e. it
is not written in Plain TeX.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 9 / 83


Glossary of Terms in Latex

group is everything after an opening brace and before the


matching closing brace.
token is a character, a control sequence, or a group.
control sequence is anything that begins with a \ . It is not printed
as is, it is expanded by theTeX engine according to its
type.
command (or function or macro ) is a control sequence that may
expand to text, to (re)definitionof control sequences, etc.
primitive is a command that is hard coded in the TeX engine, i.e. it
is not written in Plain TeX.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 9 / 83


Glossary of Terms ...

register is the TeX way to handle variables. They are limited in


numbers
length is a control sequence that contains a length (a number
followed by a unit).
font is a control sequence that refers to a font file.
box is an object that is made for printing. Anything that ends
on the paper is a box: letters,paragraphs, pages
glue is a certain amount of space that is put between boxes
when they are being concatenated.
counter is a register containing a number.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 10 / 83


Glossary of Terms ...

register is the TeX way to handle variables. They are limited in


numbers
length is a control sequence that contains a length (a number
followed by a unit).
font is a control sequence that refers to a font file.
box is an object that is made for printing. Anything that ends
on the paper is a box: letters,paragraphs, pages
glue is a certain amount of space that is put between boxes
when they are being concatenated.
counter is a register containing a number.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 10 / 83


Glossary of Terms ...

register is the TeX way to handle variables. They are limited in


numbers
length is a control sequence that contains a length (a number
followed by a unit).
font is a control sequence that refers to a font file.
box is an object that is made for printing. Anything that ends
on the paper is a box: letters,paragraphs, pages
glue is a certain amount of space that is put between boxes
when they are being concatenated.
counter is a register containing a number.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 10 / 83


Glossary of Terms ...

register is the TeX way to handle variables. They are limited in


numbers
length is a control sequence that contains a length (a number
followed by a unit).
font is a control sequence that refers to a font file.
box is an object that is made for printing. Anything that ends
on the paper is a box: letters,paragraphs, pages
glue is a certain amount of space that is put between boxes
when they are being concatenated.
counter is a register containing a number.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 10 / 83


Glossary of Terms ...

register is the TeX way to handle variables. They are limited in


numbers
length is a control sequence that contains a length (a number
followed by a unit).
font is a control sequence that refers to a font file.
box is an object that is made for printing. Anything that ends
on the paper is a box: letters,paragraphs, pages
glue is a certain amount of space that is put between boxes
when they are being concatenated.
counter is a register containing a number.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 10 / 83


Glossary of Terms ...

register is the TeX way to handle variables. They are limited in


numbers
length is a control sequence that contains a length (a number
followed by a unit).
font is a control sequence that refers to a font file.
box is an object that is made for printing. Anything that ends
on the paper is a box: letters,paragraphs, pages
glue is a certain amount of space that is put between boxes
when they are being concatenated.
counter is a register containing a number.

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 10 / 83


Elementary

Outline

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 11 / 83


Elementary

Reserved set

Description set Description set


Beginning of group { Superscript ^
End of group } Subscript _
Alignment tab & Comment character %

https://en.wikibooks.org/wiki/LaTeX

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 12 / 83


Elementary

Reserved set Examples

Description set Description set


Table \begin{tabular} Superscript, $a^n$ an
Table \end{tabular} Subscript, $b_m$ bm
Comment (not processed) %This is comment Alignment tab &

https://en.wikibooks.org/wiki/LaTeX

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 13 / 83


Environment- Simple & DISPLAYMATH

Outline

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 14 / 83


Environment- Simple & DISPLAYMATH

Simple Math environment

\begin{math} formula text \end{math} Mathematical formulas may


occur (a + b)2 = a2 + 2ab +
\( (a+b)^2 = a^2 + 2ab + b^2 \) b2 like this within a line of
text, as

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 15 / 83


Environment- Simple & DISPLAYMATH

Displaymath environment
OR maybe out of paragraph as following which is outside paragraphs

\begin{displaymath}

(a+b)^2 = a^2 + 2ab + b^2 (a + b)2 = a2 + 2ab + b2

\end{displaymath} \\
OR
\[
(a+b)^2 = a^2 + 2ab + b^2
\]

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 16 / 83


Main elements

Outline

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 17 / 83


Main elements Constants, Variables, exponents, indices

Outline

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 18 / 83


Main elements Constants, Variables, exponents, indices

Keyboard symbols

\( y'' = c \textcolor{red}{\{} f[y',y(x)]+g(x) \)

\end{displaymath}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 19 / 83


Main elements Constants, Variables, exponents, indices

Keyboard symbols

\( y'' = c \textcolor{red}{\{} f[y',y(x)]+g(x) \)

\end{displaymath}

Using curly braces inside formula


y 00 = c{f [y 0 , y (x)] + g(x)}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 19 / 83


Main elements Constants, Variables, exponents, indices

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 20 / 83


Main elements Fractions & roots

Outline

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 21 / 83


Main elements Fractions & roots

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 22 / 83


Main elements Fractions & roots

Roots


\[ \sqrt[n]{arg} \] √ arg
n

\sqrt{a} √ a
\sqrt[3]{8} = 2 3
8=2

\sqrt{x^2 + y^2 + 2xy} = x+y


p
x 2 + y 2 + 2xy = x + y
q
xˆn−y ˆn
\sqrt[n]{\frac{x^n - y^n}{1 + u^{2n}}} n
1+uˆ2n

q
\sqrt[3]{-q + \sqrt{q^2 + p^3}} 3
p
−q + q 2 + p3

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 23 / 83


Main elements Sums & integrals

Outline

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 24 / 83


Main elements Sums & integrals

Sums & Integrals

In a text formula \sum_{i=1}^n In a text formula


Rb
they appearas
and \int_a^b produce n
∑i=1 and a

In a display formula they appear In display environment, they ap-


as follows pear as follows-
n
\[
\sum_{i=1}^n

i=1
\int_a^b Z b
\]
a

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 25 / 83


Main elements Sums & integrals

Sums & Integrals ...


In a text formula, we may want In a text formula, we may want
limits outside, n Rb
limits outside, ∑ and
\sum\limits_{i=1}^n and i=1 a
\int\limits_a^b
In a display formula we may
want limits inside, appearing as
In a display formula we may want
follows
limits inside,
\[ n
\sum\nolimits_{i=1}^n and ∑i=1
\int\nolimits_a^b Z b

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 26 / 83


Main elements Continuation dots

Outline

Elementary

Environment- Simple & DISPLAYMATH

Main elements
Constants, Variables, exponents, indices
Fractions & roots
Sums & integrals
Continuation dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 27 / 83


Main elements Continuation dots

Continuation dots

\ldots ... low dots


..
\vdots . vertical dots
\cdots ··· centre dots
..
\ddots . diagonal dots
a_0,a_1,\ldots,a_n a0 , a1 , . . . , an low dots
a_0 + a_1 + \cdots + a_n a0 + a1 + · · · + an centre dots

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 28 / 83


Part II

Mathematical Symbols

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 29 / 83


Mathematical Symbols

Outline

Mathematical Symbols

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 30 / 83


Mathematical Symbols

Greek Symbols

α \alpha β \beta γ \gamma δ \delta ε \epsilon


ζ \zeta η \eta θ \theta ι \iota κ \kappa
λ \lambda µ \mu ν \nu ξ \xi o o
π \pi ρ \rho σ \sigma τ \tau υ \upsilon
φ \phi χ \chi ψ \psi ω \omega Γ \Gamma
∆ \Delta Θ \Theta Λ \Lambda Ξ \Xi Π \Pi
Σ \Sigma Υ \Upsilon Φ \Phi Ψ \Psi Ω \Omega

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 31 / 83


Mathematical Symbols

Greek Symbols in Capitals

Γ \Gamma ∆ \Delta Θ \Theta


Θ \Theta Λ \Lambda Ξ \Xi
Ψ \Psi Π \Pi Σ \Sigma
.. .. .. .. .. ..
. . . . . .

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 32 / 83


Mathematical Symbols

Binary Operators

± \pm ∓ \mp × \times


÷ \div ∗ \ast ? \star
◦ \circ • \bullet · \cdot
⊕ \oplus \bigoplus \ominus
L

⊗ \otimes \bigotimes \oslash


N

\odot \bigodot \bigcirc


J

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 33 / 83


Mathematical Symbols

Relations

≤ \leq  \ll ⊂ \subset


∈ \in ` \vdash ≥ \geq
 \succ 3 \ni ∈ \in
≡ \equiv 6 = \neq ` \ell
∂ \partial ∞ \infty ∃ \exists

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 34 / 83


Mathematical Symbols

Relations negations

6≤ \not\le 6> \not> 6⊂ \not\subset


6∈ \not\in ` \vdash 6 ≥ \not\ge
6  \not\succ 6 3 \not\ni 6 = \not=
6 ≡ \not\equiv 6 ∼ \not\sim 6 ≈ \not\approx

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 35 / 83


Mathematical Symbols

Arrows

← \leftarrow ⇐ \Leftarrow → \rightarrow


⇒ \Rightarrow ↔ \leftrightarrow ⇔ \Leftrightarrow
7 → \mapsto ←- \hookleftarrow ( \leftharpoonup
) \leftharpoondown
\rightleftharpoons ←− \longleftarrow
⇐= \Longleftarrow −→ \longrightarrow =⇒ \Longrightarrow
←→ \longleftrightarrow ⇐⇒ \Longleftrightarrow 7−→ \longmapsto
,→ \hookrightarrow * \rightharpoonup + \rightharpoondown
↑ \uparrow ⇑ \Uparrow ↓ \downarrow
⇓ \Downarrow l \updownarrow % \nearrow
& \searrow . \swarrow - \nwarrow

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 36 / 83


Mathematical Symbols

Symbols with two sizes

\sum \bigcap
T \
∑ ∑
Z
\int \bigcup
R S [
I
\oint \bigsqcup
H F G

\prod \bigvee
W _
∏ ∏

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 37 / 83


Mathematical Symbols

Functions including Trigonometric

\arccos \arcsin \arctan \arg \cos \cosh \cot


\coth \csc \deg \det \dim \exp \gcd
\hom \inf \ker \lg \lim \liminf \ln
\log \max \min \Pr \sec \sin \sinh
\sup \tan \tanh
arccos arcsin arctan arg cos cosh cot
coth csc deg det dim exp gcd
hom inf ker lg lim lim inf ln
log max min Pr sec sin sinh
sup tan tanh

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 38 / 83


Mathematical Symbols

Mathematical Accents- character modifiers

\hat{e} ê \widehat{easy} easy


[
\tilde{e} ẽ \widetilde{easy} easy
]
\check{e} ě \breve{e} ĕ
\acute{e} é \grave{e} è
\bar{e} ē \vec{e} ~e
\dot{e} ė \ddot{e} ë
\not e 6e

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 39 / 83


Part III

Advanced Elements

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 40 / 83


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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 41 / 83


Advanced Elements 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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 42 / 83


Advanced Elements Sizing of brackets

Delimiters- Left & Right

these are made by these and these are made by these


( ( ) )
[ [ ] ]
{ \{ } \}
b \lfloor c \rfloor
d \lceil e \rceil
h \langle i \rangle
/ / \ \backslash
| | k \|
↑ \uparrow ⇑ \Uparrow
↓ \downarrow ⇓ \Downarrow
l \updownarrow m \Updownarrow

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 43 / 83


Advanced Elements Sizing of brackets

Delimiters- Left & Right

\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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 44 / 83


Advanced Elements Sizing of brackets

Delimiters- Left & Right

\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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 45 / 83


Advanced Elements Text in formula

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 46 / 83


Advanced Elements Text in formula

Use of Delimiters- Left & Right

\[ X_n = X_k \qquad\mbox{if and only if}\qquad Y_n = Y_k


\quad\mbox{and}\quad Z_n = Z_k \]

Xn = Xk if and only if Yn = Yk and Zn = Zk

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 47 / 83


Advanced Elements Matrices

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 48 / 83


Advanced Elements Matrices

Using \array for Matrices-Example-1

\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}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 49 / 83


Advanced Elements Matrices

Using \array for Matrices-Example-1 ...

a11 a12 a13 · · · a1n


a21 a22 a23 · · · a2n
.. .. .. .. ..
. . . . .
an1 an2 an3 · · · ann

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 50 / 83


Advanced Elements Matrices

Using \array for Matrices- Example-2

\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}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 51 / 83


Advanced Elements Matrices

Using \array for Matrices- Example-2 ...

a11 x1 + a12 x2 + · · · + a1n xn = b1


a22 x1 + a22 x2 + · · · + a2n xn = b2
...............................
an1 x1 + an2 x2 + · · · + ann xn = bn

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 52 / 83


Advanced Elements Matrices

Using \array for Matrices- Example-3


 
x11 x12

 x21 x22 
 
 y 
\ begin { d i s p l a y m a t h } z
\ l e f t ( \ begin { a r r a y } { c } \ l e f t |
\ begin { a r r a y } { cc }
x_ { 1 1 } & x_ { 1 2 } \ \
x_ { 2 1 } & x_ { 2 2 }
\ end { a r r a y } \ r i g h t | \ \
y \\
z
\ end { a r r a y } \ r i g h t )
\ end { d i s p l a y m a t h }

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 53 / 83


Advanced Elements Matrices

Using \array for Matrices: Example-4

\ 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 }

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 54 / 83


Advanced Elements Matrices

Using \array for Matrices- Example-4 ...


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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 55 / 83


± l1 m1 n1
Advancedl Elements m Matricesn
2 2 2
 2  2  2
   m   n 
 l1
Excercise using \array     1 
 m1 1 n1 l1
 +  + 
 l2 m2   m2 n2   n2 l2 

If the numerator is zero, the two lines meet somewhere.


Note: we do not recommend using {|cc|} in the formatting argument of
the three determinants in the denominator under the root sign. Here the
\left|. . . \right| pair should be applied. Try out both possibilities for yourself
and compare the results.
1

Exercise 5.15: Laurent expansion: using cn = 2π i
(ζ − a)−n−1 f (ζ) dζ, for every
function f (z) the following representation is valid (n = 0, ±1, ±2, . . . )

+∞
 ⎪
⎨ c0 + c1 (z − a) + c2 (z − a) + · · · + cn (z − a) + · · ·
2 n

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?

5.4.4 Lines above and below formulas


The commands

\overline{sub form} and \underline{sub form}

can be used to draw lines over or under a formula or sub-formula. They


may be nested to any level:
\[ \overline{\overline{a}ˆ2 + \underline{xy}
a2 + xy + z + \overline{\overline{z}}} \]
V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 56 / 83
Note: the above displayed formula consists of two sub-formulas, between which
Advanced
the word ‘and’ plus extra Elements
spacing Matrices\quad are inserted. Instead
of amount
of enclosing the array environment within size-adjusted vertical lines with

Excercise using \array


\left|. . . \right|, one may use a formatting argument {|. . . |} (Section 4.8.1)
to produce the vertical lines. Such a structure is called a determinant in mathe-
matics.

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

is given by the expression

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 

If the numerator is zero, the two lines meet somewhere.


Note: we do not recommend using {|cc|} in the formatting argument of
the three determinants in the denominator under the root sign. Here the
\left|. . . \right| pair should be applied. Try out both possibilities for yourself
and compare the results.
1

Exercise 5.15: Laurent expansion: using cn = 2π i
(ζ − a)−n−1 f (ζ) dζ, for every
function f (z) the following representation is valid (n = 0, ±1, ±2, . . . )

+∞
 ⎪
⎨ c0 + c1 (z − a) + c2 (z − a) + · · · + cn (z − a) + · · ·
2 n
−1
f (x)
V. Sahula = Jaipur)
(MNIT n
cn (z − a) = Mathematics+ −1 (z − a)
in cLatex (z − a)−2
+ c−230-Sep-20 + · · ·Academy
@EICT 57 / 83
Advanced Elements Lines- over & under Formulae

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 58 / 83


Advanced Elements Lines- over & under Formulae

\overline and \underline

a2 + xy + z

z }| {
\overline{sub form} and \underline{sub form} a+b + c
| {z } +d

\overbrace{sub form} and \underbrace{sub form}

\overline{\overline{a}^2 + \underline{xy}
+ \overline{\overline{z}}}

\overbrace{a + \underbrace{b+c} + d}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 59 / 83


Advanced Elements Stacked symbols

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 60 / 83


Advanced Elements Stacked symbols

Stacking using \Stackrel

~x def
= (x1 , ..., xn )

α0 β0
\stackrel{upper sym}{lower sym} A −→ B ←− C

\vec{x} \stackrel{\mathrm{def}}{=} (x_1,..., x_n)

A \stackrel{\alpha'}{\longrightarrow} B
\stackrel{\beta'}{\longleftarrow} C

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 61 / 83


Advanced Elements Stacked symbols

Stacking using \atop, \choose and \binom

{top \atop bottom}

{top \choose bottom}

\binom{top}{bottom}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 62 / 83


Advanced Elements Stacked symbols

Stacking using \choose and \binom- Example

     
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}

\binom{n+1}{k} = \binom{n}{k} + \binom{n}{k-1}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 63 / 83


Advanced Elements Stacked symbols

Stacking using \atop- Example

\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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 64 / 83


Advanced Elements Multiline equations

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 65 / 83


Advanced Elements Multiline equations

Multiline equations using \eqnarray and


\IEEEeqnarray

\begin{eqnarray} line 1\\ ... \\ line n \end{eqnarray}


\begin{eqnarray*} line 1\\ ... \\ line n end{eqnarray*}

\begin{IEEEeqnarray} line 1\\ ... \\ line n \end{IEEEeqnarray}


\begin{IEEEeqnarray*} line 1\\ ... \\ line n end{IEEEeqnarray*}

Use \usepackage{IEEEtrantools}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 66 / 83


Advanced Elements Multiline equations

Multiline equations with numbering using \eqnarray

\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)

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 67 / 83


Advanced Elements Multiline equations

Multiline equations with numbering using \eqnarray-


more examples

\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)

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 68 / 83


Advanced Elements Multiline equations

Multiline equations with numbering using \eqnarray-


more examples ...

\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π −∞

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 69 / 83


Advanced Elements Multiline equations

Multiline equations without numbering using


\eqnarray*

\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*}

xn u1 + · · · + xn+t−1 ut = xn u1 + (axn + c)u2 + · · ·


 
+ at−1 xn + c(at−2 + · · · + 1) ut
= (u1 + au2 + · · · + at−1 ut )xn + h(u1 , . . . , ut )

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 70 / 83


Advanced Elements Side-by-side formulae and Bold face letters

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 71 / 83


Advanced Elements Side-by-side formulae and Bold face letters

Multiline equations without numbering using


\eqnarray*

\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*}

xn u1 + · · · + xn+t−1 ut = xn u1 + (axn + c)u2 + · · ·


 
+ at−1 xn + c(at−2 + · · · + 1) ut
= (u1 + au2 + · · · + at−1 ut )xn + h(u1 , . . . , ut )

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 72 / 83


Advanced Elements Spacing

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 73 / 83


Advanced Elements Spacing

Spacing Elements

a\, b (a b) thin space


a\> b (a b) medium space
a\; b (a b) thick space
a\! b (ab) negative thin space

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 74 / 83


Advanced Elements Spacing

Mathematical Units based very small spacing

\thinmuskip=3mu
\medmuskip=4mu
\thickmuskip=5mu
Here, 1 mu is mathematical unit, equivalent to 1/18 of em

1
mu = em
18

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 75 / 83


Advanced Elements Font sizes in Formulae

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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 76 / 83


Advanced Elements Font sizes in Formulae

Font sizes in Maths

\displaystyle Size for equations in display mode


\textstyle Size for equations in text mode
\scriptstyle Size for first sub/superscripts
\scriptscriptstyle Size for subsequent sub/superscripts

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 77 / 83


Advanced Elements Font sizes in Formulae

Font sizes in Maths- Example-1

\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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 78 / 83


Advanced Elements Font sizes in Formulae

Font sizes in Maths- Example-2

x = a_0 + \frac{1}{\displaystyle a_1


+ \frac{1}{\displaystyle a_2
+ \frac{1}{\displaystyle a_3 + a_4}}}

1
x = a0 +
1
a1 +
1
a2 +
a3 + a4

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 79 / 83


Advanced Elements 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

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 80 / 83


Advanced Elements Manual sizing of brackets

Manual sizing of brackets

(for left delimiters) (for right delimiters) magnification


\bigl \bigr a bit bigger, but won’t overlap
\Bigl \Bigr 150% times big
\biggl \biggr 200% times big
\Biggl \Biggr 250% times big

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 81 / 83


Advanced Elements Manual sizing of brackets

Manual sizing of brackets

\Biggl\{2\Bigl(x(3+y)\Bigr)\Biggr\}

\left( \frac{(x+iy)}{\{\int x\}} \right)


( )
 
2 x(3 + y )

 
(x + iy )
R
{ x}

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 82 / 83


Advanced Elements Manual sizing of brackets

Thanks!

Thanks! Queries?

V. Sahula (MNIT Jaipur) Mathematics in Latex 30-Sep-20 @EICT Academy 83 / 83

You might also like