You are on page 1of 8

5/14/2020 LaTeX/C2/Mathematical-Typesetting/English - Script | Spoken-Tutorial

LaTeX/C2/Mathematical-Typesetting/English
From Script | Spoken-Tutorial

Script - Format

FOSS LaTeX
Tutorial
Mathematical Symbols in LaTeX
Title:
Author: Kannan Moudgalya
Reviewer: Ambika Vanchinathan
Date: Original: 18 July 2007. Revised: 6 July 2016
Video tutorial, LaTeX tutorial, Dollar sign, Greek symbols, spaces in maths, minus sign,
Keywords:
fractions, braces, subscripts, superscripts, amsmath package, matrix, pmatrix, bmatrix
Visual Cue Narration
Welcome to this spoken tutorial on Mathematical
Typesettingin LaTeX.
Show Slide 1
My name is Kannan Moudgalya.

Slide 2: LaTeX pronunciation A reminder: we should call it LaTeX and not latex.
In this tutorial, we will learn how to create mathematical
symbols in LaTeX.

In particular,
Show Slide 3
How to get into and leave from the mathematical mode
Learning Objectives
The role of spaces and creating them
Mathematical symbols
Finally, A M S math package and its use in
creating matrices

Show Slide 4 I am creating this tutorial on our less than 10,000 Rupee laptop.

System Requirements I am using Ubuntu, TeXworks, and LaTeX.

The prerequisites are the following:


Show Slide 5
Basic spoken tutorials on LaTeX.
Prerequisites Exposure to the side-by-side tutorial.
All are available from our website.

Show Slide 6 I shall use the file maths.tex


It is available as a code file, in our web page, where you
Learning material used in this tutorial found this tutorial
In the same location, you will find this pdf file from
the TeX user group, India
We shall use it when we do assignments
https://script.spoken-tutorial.org/index.php/LaTeX/C2/Mathematical-Typesetting/English 1/8
5/14/2020 LaTeX/C2/Mathematical-Typesetting/English - Script | Spoken-Tutorial

Go to TeXworks window Let me go to the ‘TeXworks’ window.


I have already opened the file maths.tex.
Go to TeXworks, opened in 600x400, with
maths.tex read in Please download this file and practise along with me.

We have already seen the commands that are at the top of this
file.

This command removes the paragraph indent.


\setlength\parindent{0pt}
We will study the effect of this statement through an
assignment.

Let us start with Greek symbols that are used in mathematics.


We use dollar sign to get into mathematical mode in LaTeX.

Let us begin with alpha.

$\alpha$
We write $ back slash alpha $.

Let us compile and see that we get the Greek letter alpha in
the pdf.

Compile The first dollar says that we are getting into the mathematical
mode.

The second dollar says that we are leaving this mode.

From now on, I will not explicitly mention dollar or the back
slash.

But you have to do exactly what you see on the screen.

$\beta$, $\gamma$, $\delta$ Similarly we write beta, gamma, and delta.


Compile I did not save the tex file, as TeXworks does it automatically.
Delete everything except alpha Let us delete these.
We will next take up the concept of spaces in mathematical
expressions.

How do we generate alpha a?


$\alphaa$
That is, the product of alpha and a.

Let us try alpha a.

Compile Let me compile.


Highlight error LaTeX complains that alpha a is an undefined control
sequence.

It says that it does not understand this command.


https://script.spoken-tutorial.org/index.php/LaTeX/C2/Mathematical-Typesetting/English 2/8
5/14/2020 LaTeX/C2/Mathematical-Typesetting/English - Script | Spoken-Tutorial

Let me close this.


LaTeX handles this through a space after every command.
Space between alpha and a
Let us leave a space after alpha.

Let us abort the compilation.


Compile
Let us recompile.

This has solved the problem.

As it is used to terminate a command, the space does not


appear in pdf.

What do we do if we WANT to introduce spaces in the output?

We have to explicitly tell LaTeX, as we do now.

\\
Let us ask LaTeX to start a new line.
Append $\alpha \ a$
Let us write alpha backslash space a.

Compile it.
Compile
This has created a space.

If you want more space, use quad, as we do now.


Append $\alpha \quad a$
Compile it.
Compile

You can see that quad has left a large space.

We will now move to another topic.


Delete 2nd and 3rd lines Let us delete the last two lines.

Compile. Let’s compile.

What happens to the font when we go from the text to the


Prepend “Product of $\alpha$ and a is” to mathematical mode?
$\alpha a$
To understand this, let us write “Product of $\alpha and a is”.
Compile.
Compile.

You can see that the fonts of these two a's are different.
Change “ a “ to “ $a$ “ This is solved by writing this 'a' also inside dollar signs.

Compile. Compile.

Now the fonts of these of two a’s are identical.


https://script.spoken-tutorial.org/index.php/LaTeX/C2/Mathematical-Typesetting/English 3/8
5/14/2020 LaTeX/C2/Mathematical-Typesetting/English - Script | Spoken-Tutorial

Not keeping the font of variables identical is a common


mistake.

Let’s get rid of these.


Delete everything
Let’s compile.

Let us now discuss a rule for creating minus signs.


-$\alpha$
Suppose that we want to create minus alpha.
Compile
Let’s compile.

Notice that the minus sign appears as a small dash here.

Append \\ $-\alpha$ in next line Let us also copy, with the minus sign inside dollar.

Compile Let us compile again.

See the difference in the minus sign now.

The second one is what we need.

This dash is not to be used.

Not putting the minus sign within dollars is a common mistake


made by beginners.

Delete all Let us delete all of these.


Next we would like to explain the 'frac' command that is used
to create fractions.
\frac a b
'frac a b'.

Let’s compile.
Compile

Point or highlight as per narration It generates 'a by b'.

The command 'frac' is terminated by a space.

It looks for two arguments.

The first character 'a' is taken as the first argument.

It becomes the numerator.

The second character 'b' is taken as the second argument.

It becomes the denominator.

https://script.spoken-tutorial.org/index.php/LaTeX/C2/Mathematical-Typesetting/English 4/8
5/14/2020 LaTeX/C2/Mathematical-Typesetting/English - Script | Spoken-Tutorial

Notice that the size of a and b gets reduced automatically.

What do we do if we have longer characters?

What if we want to create ab by cd.


\frac ab cd, don’t compile
I want you to try this.

In LaTeX, the arguments longer than one character are


enclosed by braces.

For example, let us put braces here.


\frac{ab}{cd}
When we compile THIS, we get the desired output.

Compile All the entries within the braces are taken as a


single argument.

As a result, one can enter any complicated expression within


braces.

Delete all Let us delete all of these.


Now we will look at subscripts and superscripts.
'x' underscore 'a' creates 'x sub a'.
X_a
The size of 'a' gets automatically reduced to an appropriate
level.

What if we want to put ab as the subscript?

You have to use braces.

Try it yourself.

Superscripts are created by the caret or the up arrow symbol.

x^3 For example, if you want to create 'x' to the power 3, you will
write: x up arrow 3.

We can also put subscripts and superscripts simultaneously.

x_a^b
Let us put x sub a superscript b.

Compile Let’s compile.

Once again, using braces, we can produce complicated


subscripts and superscripts.
https://script.spoken-tutorial.org/index.php/LaTeX/C2/Mathematical-Typesetting/English 5/8
5/14/2020 LaTeX/C2/Mathematical-Typesetting/English - Script | Spoken-Tutorial

Delete Let me delete this.


Alright, next we will move onto Matrices.

The package a m s math has some matrix definitions that I


\usepackage{amsmath} like.

Let us include it through the usepackage command.

The ampersand, that is the 'and' symbol, is used to separate


the columns.

$\begin{matrix}
Let us create a matrix now.
a&b
We write begin matrix.
\end{matrix}$
a and b, end matrix

Don’t forget the dollar signs.

Compile Compile and see the matrix, as expected.


Now suppose, we want to add a second row to this.
After b, put \\, CR
We put two back slashes, meaning, go to the next line.
c&d&e

Suppose that we want three entries in the second row, say, c, d,


e.

Compile Compile it and see the second row also included now.
Supposing we change matrix to pmatrix, at begin and end.

Change matrix to pmatrix in both places, Compile and get this.


compile

It is now time for YOU to start exploring.

Let us go to the slides now.


Let us summarise what we learnt in this tutorial.

Entering and leaving the mathematical mode

Show Slide 5 Using spaces and creating them

Summary Fractions, subscripts and superscripts

Defining an argument with braces

amsmath package to create matrices

https://script.spoken-tutorial.org/index.php/LaTeX/C2/Mathematical-Typesetting/English 6/8
5/14/2020 LaTeX/C2/Mathematical-Typesetting/English - Script | Spoken-Tutorial

Show slide 6 Let me give some assignments.


# Spaces This assignment is on spaces - large and small.

Please pause the video, read the slide and do the assignment.

2. Fractions and braces This assignment is on fractions using braces.


3. Subscripts, superscripts This assignment is on subscripts and superscripts.
Through this assignment, we shall learn a few more methods to
4. Matrices
create matrices.
This assignment is on creating more mathematical symbols.
5. More maths symbols
This is based on the TUG India LaTeX guide.
Highlight chap11-prn.pdf
Let us see that document now.
Show this file (cont. mode)
I already asked you to download this document from our web
page.
Go back to the slides
You will reproduce some symbols given in this document.

6. Package amssymb You will try out more symbols through the next assignment.
7. More of TUG India Document This assignment is also based on the TUG India document.
You will experiment with the paragraph indent in this
8. Paragraph indent
assignment.
This brings us to the end of this tutorial.
This video summarises the Spoken Tutorial project.

About project slide If you do not have good bandwidth, you may download and
watch it.

We conduct workshops using Spoken Tutorials.

Workshop slide Give certificates.

Please contact us.

* Do you have questions in THIS Spoken Tutorial?

Please visit this site.


Choose the minute and second where you have the
Spoken Tutorial Forum slide
question.
Explain your question briefly.
Someone from our team will answer them.

* The Spoken Tutorial forum is for specific questions on this


tutorial.

Please do not post unrelated and general questions.


Slide for no cluttering
This will help reduce the clutter.
With less clutter, we can use these discussions as
instructional material.

General questions * For topics not covered in spoken tutorials, visit stack
https://script.spoken-tutorial.org/index.php/LaTeX/C2/Mathematical-Typesetting/English 7/8
5/14/2020 LaTeX/C2/Mathematical-Typesetting/English - Script | Spoken-Tutorial

exchangeat this address.

This is a great place to get answers on LaTeX.


You may also have questions on our workshops,
certificates, etc.
For this, get in touch with us at this email address.

Spoken Tutorial project is funded by NMEICT, MHRD,


Government of India.
Thanks for joining.

Goodbye.

https://script.spoken-tutorial.org/index.php/LaTeX/C2/Mathematical-Typesetting/English 8/8

You might also like