LaTeX-Old-Version/C2/Mathematical-Typesetting/English
Welcome to this tutorial on basic mathematics typesetting using Latex. Notice 3 windows – Maths.tec is a source file. The second window is used to compile this file. The output file Maths.pdf is in the pdf browser. This browser shows the latest version of the pdf file.
Let us start with Greek symbols that are used in mathematics. We have to tell latex that we are writing mathematical expressions with a dollar sign. For example, we create alpha using dollar alpha. On compiling, we get alpha. Similarly we write beta, gamma, delta and so on. Let’s see what happens when we compile this. One can get the complete list of such symbols from standard textbooks on latex or from the internet.
We will next take up the concept of spaces in mathematical expressions. Before we do this, let’s delete these. Compile the system. How do we generate alpha-a? Let us try alpha-a, that is we want to generate, product of alpha and a. Let us try alpha-a. Latex complains that alpha-a is an undefined control sequence. It says that it does not understand this command. This is solved by allowing the space in the source file and ignoring it in the output. Let’s first exit this. Compile it again. Says product of alpha and a is alpha-a. Thus we see that spaces separate commands in the source file. These spaces do not appear in the output.
What do we do if we want to introduce spaces in the output? We have to explicitly tell Latex. For example, alpha reverse slash space A, compile it, See that leaves a space here. We can introduce different lengths of spaces. For example, let’s go to the next line. Quad-A, here's the space. alpha-q-qad-A leaves a larger space. We can combine these commands. See it’s bigger. We can also use the command, hspace, would be even larger space.
By the way, why do we have the first line indented here? It is because of the beginning of the paragraph. Let us now shift this over here. Okay. Now I want to show how to create a smaller space. So, it is done by, slash comma-A. See this here. The last one has smaller space created by slash comma command.
Now we will look at the change in font while going from text mode to mathematical mode. In fact it is clear from here, Note that, we have ‘A’ here as well as here on output though we have this A here but if you look at this, this A, the font of A is different. This is solved by writing this A also inside dollar symbol. See this now, now this font and this font are identical. Not keeping the font of variables identical is a common mistake made by beginners of latex. We need to use dollar symbol for minus sign also. For this, let’s get rid of these, let’s compile this.Alright! Supposing we write, negative of alpha-a is minus-alpha-a. Let's see what happens when you type this. Compile this. Notice that the minus sign appears as a small dash here, as a small dash here. It is solved by taking the minus sign inside the dollar. In this case, we write the minus sign here inside the dollar sign. In fact, for comparison purposes, let us keep this here and make a copy of this here with minus sign here. See what happens, see the difference between this minus sign and this minus sign. This minus sign is within the dollar sign, this is another common mistake made by beginners of Latex. This is what is required in mathematical symbols. This dash is not to be used.
Next we would like to explain the frac command, that is used to make fractions. Let's compile this. Frac a b, it generates this. A by B. Note that A and B appear in small size here, for example, A by B is created by. Look at the size of A and B here and the A by B. The command frac is terminated by a space. It looks for two arguments. The first argument of A is taken as the numerator and the second argument B is taken as the denominator. It follows that frac A B here, without the space here, will also given the same answer. It has give the same answer. The space between A and B does not matter.
What if we want to create A B by C D. In Latex, the arguments are enclosed by braces. For example, let’s put dollar frac A B by C D. Here it is. AB by CD is here. All the entries within the braces are taken as a single argument. As a result one can enter any complicated expression within the braces. For example, frac AB then here 1+ frac CD by EF. Close this. Look at this here. We have created this more complicated expression AB divded by 1+ CD by EF. What this command says is that the first argument of AB should come in the numerator. The second argument which will go in the denominator is 1+ CD by EF. Using this feature it is possible to effortlessly typeset even complicated expressions.
Now we will look at subscripts and superscripts. Let’s delete this. X underscore A creates X of A. The size of A gets automatically reduced to an appropriate level. What about X underscore AB? So let’s do this. X, AB, put a dollar sign. If we expect X sub AB we are disappointed, we only obtained X sub A B. The reason is that the subscript command expects only one argument. A is taken as this argument. So if we want the product AB to come as the subscript we need to enclose it in braces. For example, we have to put this entire thing in braces. Just happened here.
Superscripts are created by the carrot or by the up arrow symbol. For example if you want to create X to the power 3, you will write, X up arrow 3. In normal editors it will appear like this, X up arrow 3. We enclose it with a dollar, compile it to get X to the power 3. Once again using braces we can produce complicated expressions involving subscripts and superscripts. For example, X to the power 3, to the power A, to the power 2.5. Produces, X to the power 3 times this whole thing. Alright, now, if we didn’t want this three to come we have to delete this. Okay, now we see that, X to the power, A to the power 2.5. And we can also add a subscript to this. Subscript, beta, co-subscript is ‘ce’, closes this subscript. Next level, dollar sign. So it has come here. X to the power, A to the power 2.5, subscript beta, co-subscript is ce.
Let us now look at some common symbols. Let's compile this. Start with a clean slate. A equals B, A not equal to B, See this. Not equal to B. Go to the next line. A greater than B, A greater or equal to B, A greater greater than B. See what happens. A greater than B, greater than or equal to B, Much greater than B. Similarly for less than. Less than B. A less than or equal to B, A less than less than B. See this, less than or equal to, much less than B.
A right arrow B, A left arrow B, A right arrow B. Right arrow, left arrow, left right arrow. Let’s add some more. A times B. let’s see what happens. A times B is here. A plus C-dots plus B. A comma L-dots comma B. Okay, C-dots means the dots come in the center, L-dots result in the dots coming in the bottom. Similarly it is possible to create V-dots as well as D-dots. One can create infinity using the command, -i-n-f-t-y , infinity. See the symbol.
It is possible to create ‘sum’ command. See the ‘sum’ command. Summation symbol. We can add subscript and superscript to this. I equals 1, up arrow 100,which is the superscript. There it is, look at this! I equals 1 through 100. We can also create ‘product’. See this pie symbol. We can create integral. And with subscript, beta to the power 2. Integral, unintegral subscript A, superscript beta square.
Alright, next we will move onto Matrices. First we will remove all this. Compile this and start with a clean slate. For this purpose, we will need the command, ‘use package a-m-s-math. This package defines extra commands, some of which, we will use now.
The ampersand, that is the and symbol, is used to separate the columns. How do we create a matrix. We begin, matrix, A, B, end matrix. You put the dollar sign. See this AB.
Now suppose we want to add a second row to this. It is created by a reverse slash, two reverse slash. The rows are separated by two reverse slashes. So we will say c, d, e. There will be three entries in the second row. Okay, you’ve got this c, d, e. It is also possible to re-write it in this fashion. First row, second row, third row. The effect is the same.
Supposing we put p-matrix here. What we get is this. Let’s put b-matrix. See this here. More complicated matrices can be created as follows. So lets get rid of this, I have predefined a command here. Copy this, paste this. This didn’t appear in the previous compilation because it was below this end document. Whatever is below this end document gets ignored.
So I have created a more complicated one. There are four rows. The first row says a, b up to z. Second row says a-square, b-square up to z-square. Third row shows only v-dots. The last row has this.
In general, latex commands are case sensitive. For example if I change this to capital B, See what happens here. This produces a different result. In general, most built-in commands of latex are in lower case only without upper case equivalents. Those who use latex in Windows operating system should remember this.
This brings us to the end of this tutorial. Beginners of latex should compile after each and every change and ensure that the changes they have made are acceptable. Thanks of listening to this tutorial, This is Kannan Moudgalya signing off. Good bye.