Difference between revisions of "LaTeX/C2/Mathematical-Typesetting/English"
Nancyvarkey (Talk | contribs) (Created page with "'''Script - Format ''' {| style="border-spacing:0;" | style="border:0.05pt solid #000000;padding-top:0.049cm;padding-bottom:0.049cm;padding-left:0.185cm;padding-right:0.185c...") |
(No difference)
|
Latest revision as of 15:52, 5 August 2016
Script - Format
FOSS | LaTeX |
Tutorial Title: | Mathematical Symbols in LaTeX |
Author: | Kannan Moudgalya |
Reviewer: | Ambika Vanchinathan |
Date: | Original: 18 July 2007. Revised: 6 July 2016 |
Keywords: | Video tutorial, LaTeX tutorial, Dollar sign, Greek symbols, spaces in maths, minus sign, fractions, braces, subscripts, superscripts, amsmath package, matrix, pmatrix, bmatrix |
|
|
Show Slide 1 | Welcome to this spoken tutorial on Mathematical Typesetting in LaTeX.
My name is Kannan Moudgalya. |
Slide 2: LaTeX pronunciation | A reminder: we should call it LaTeX and not latex. |
Show Slide 3
Learning Objectives |
In this tutorial, we will learn how to create mathematical symbols in LaTeX.
In particular,
|
Show Slide 4
System Requirements |
I am creating this tutorial on our less than 10,000 Rupee laptop.
I am using Ubuntu, TeXworks, and LaTeX. |
Show Slide 5
Prerequisites |
The prerequisites are the following:
|
Show Slide 6
Learning material used in this tutorial |
|
Go to TeXworks window | Let me go to the ‘TeXworks’ window. |
Go to TeXworks, opened in 600x400, with maths.tex read in | I have already opened the file maths.tex.
Please download this file and practise along with me. |
\setlength\parindent{0pt} | We have already seen the commands that are at the top of this file.
This command removes the paragraph indent. We will study the effect of this statement through an assignment. |
Let us start with Greek symbols that are used in mathematics. | |
$\alpha$ |
We use dollar sign to get into mathematical mode in LaTeX.
Let us begin with alpha.
|
Compile | Let us compile and see that we get the Greek letter alpha in the pdf.
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. |
$\alphaa$ | We will next take up the concept of spaces in mathematical expressions.
How do we generate alpha a? 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. |
Let me close this. | |
Space between alpha and a | LaTeX handles this through a space after every command.
Let us leave a space after alpha. |
Compile | Let us abort the compilation.
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. | |
\\
Append $\alpha \ a$ |
Let us ask LaTeX to start a new line. Let us write alpha backslash space a. |
Compile | Compile it.
This has created a space. |
Append $\alpha \quad a$
Compile |
If you want more space, use quad, as we do now. Compile it.
|
We will now move to another topic. | |
Delete 2nd and 3rd lines
Compile. |
Let us delete the last two lines.
Let’s compile. |
Prepend “Product of $\alpha$ and a is” to $\alpha a$
Compile. |
What happens to the font when we go from the text to the mathematical mode?
To understand this, let us write “Product of $\alpha and a is”. Compile. |
You can see that the fonts of these two a's are different. | |
Change “ a “ to “ $a$ “
Compile. |
This is solved by writing this 'a' also inside dollar signs.
Compile. |
Now the fonts of these of two a’s are identical.
Not keeping the font of variables identical is a common mistake. | |
Delete everything | Let’s get rid of these.
Let’s compile. |
-$\alpha$
Compile
|
Let us now discuss a rule for creating minus signs.
Suppose that we want to create minus alpha. Let’s compile. Notice that the minus sign appears as a small dash here. |
Append \\ $-\alpha$ in next line
Compile |
Let us also copy, with the minus sign inside dollar.
Let us compile again. |
See the difference in the minus sign now.
This dash is not to be used.
| |
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. |
Point or highlight as per narration | It generates 'a by b'.
The command 'frac' is terminated by a space. It looks for two arguments.
It becomes the numerator. The second character 'b' is taken as the second argument. It becomes the denominator.
|
\frac ab cd, don’t compile | What if we want to create ab by cd.
I want you to try this. |
\frac{ab}{cd}
Compile |
In LaTeX, the arguments longer than one character are enclosed by braces.
When we compile THIS, we get the desired output.
|
Delete all | Let us delete all of these. |
Now we will look at subscripts and superscripts. | |
X_a
|
'x' underscore 'a' creates 'x sub 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. | |
x^3 | Superscripts are created by the caret or the up arrow symbol.
For example, if you want to create 'x' to the power 3, you will write: x up arrow 3. |
x_a^b | We can also put subscripts and superscripts simultaneously.
|
Compile | Let’s compile.
|
Delete | Let me delete this. |
\usepackage{amsmath} |
Alright, next we will move onto Matrices.
Let us include it through the usepackage command. |
$\begin{matrix}
a & b \end{matrix}$ |
The ampersand, that is the 'and' symbol, is used to separate the columns.
We write begin matrix. a and b, end matrix
|
Compile | Compile and see the matrix, as expected. |
After b, put \\, CR
c & d & e
|
Now suppose, we want to add a second row to this.
We put two back slashes, meaning, go to the next line.
|
Compile | Compile it and see the second row also included now. |
Change matrix to pmatrix in both places, compile | Supposing we change matrix to pmatrix, at begin and end.
|
Let us go to the slides now. | |
Show Slide 5
Summary |
Let us summarise what we learnt in this tutorial.
Entering and leaving the mathematical mode Using spaces and creating them Fractions, subscripts and superscripts Defining an argument with braces amsmath package to create matrices |
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. |
4. Matrices | Through this assignment, we shall learn a few more methods to create matrices. |
5. More maths symbols
Highlight chap11-prn.pdf Show this file (cont. mode)
|
This assignment is on creating more mathematical symbols.
This is based on the TUG India LaTeX guide. Let us see that document now. I already asked you to download this document from our web page. 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. |
8. Paragraph indent | You will experiment with the paragraph indent in this assignment. |
This brings us to the end of this tutorial. | |
About project slide | This video summarises the Spoken Tutorial project.
If you do not have good bandwidth, you may download and watch it. |
Workshop slide | We conduct workshops using Spoken Tutorials.
Give certificates. Please contact us. |
Spoken Tutorial Forum slide | * Do you have questions in THIS Spoken Tutorial?
|
Slide for no cluttering | * The Spoken Tutorial forum is for specific questions on this tutorial.
|
General questions | * For topics not covered in spoken tutorials, visit stack exchange at this address.
|
Spoken Tutorial project is funded by NMEICT, MHRD, Government of India. | |
Thanks for joining.
Goodbye. |