Difference between revisions of "LaTeX-Old-Version/C2/Equations/English-timed"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 4: Line 4:
 
|-
 
|-
 
|00:00
 
|00:00
|Welcome to this tutorial on creating '''equations''' through '''latex'''.  
+
|Welcome to this tutorial on creating '''equations''' through '''Latex'''.  
 
|-
 
|-
 
|00:06
 
|00:06
Line 10: Line 10:
 
|-
 
|-
 
|00:10
 
|00:10
|I have created a '''12pt''' size, '''article class''' document. And using '''AMSmath '''package''' and also using the 'ccliscences' package for creative commons copyright statement as here.  
+
|I have created a '''12pt''' size, '''article class''' document. And using '''AMSmath package''' and also using the 'ccliscences' package for creative commons copyright statement as here.  
 
|-
 
|-
 
|00:30
 
|00:30
|'''make title''', creates the title page. '''new page''' command, takes the rest of the document to a new page.  
+
|'''make title''' creates the title page. '''new page''' command takes the rest of the document to a new page.  
 
|-
 
|-
 
|00:43
 
|00:43
Line 22: Line 22:
 
|-
 
|-
 
|01:03
 
|01:03
|Align star, Frac d by dt of begin b-matrix, x_1, next line, x_2, end b-matrix.
+
|Align star, Frac d by dt of begin b-matrix, x_1, next line x_2, end b-matrix.
 
|-
 
|-
 
|01:27
 
|01:27
Line 31: Line 31:
 
|-
 
|-
 
|01:42
 
|01:42
|Let us now augment the vector with two more components.  
+
|Let us now '''augment''' the '''vector''' with two more components.  
 
|-
 
|-
 
|01:48
 
|01:48
|You do it as follows. Next line x3, next line x4. Save it. Compile it. So I have four components.  
+
|You do it as follows. Next line x3, next line x4. '''Save''' it. Compile it. So I have four components.  
 
|-
 
|-
 
|02:03
 
|02:03
|Let me now say that this is equal to the right hand side matrix of begin b-matrix.
+
|Let me now say that this is equal to the right hand side matrix begin b-matrix.
 
|-
 
|-
 
|02:20
 
|02:20
Line 46: Line 46:
 
|-
 
|-
 
|02:37
 
|02:37
|And then, lets close this matrix. Save.  
+
|And then, lets close this matrix. '''Save'''.  
 
|-
 
|-
 
|02:47
 
|02:47
Line 52: Line 52:
 
|-
 
|-
 
|02:53
 
|02:53
| It is always a good idea to compile after very few small additions so that we have not made a mistake.  
+
| It is always a good idea to compile after every few small additions so that we have not made a mistake.  
 
|-
 
|-
 
|03:00
 
|03:00
Line 67: Line 67:
 
|-
 
|-
 
|03:50
 
|03:50
|What we will do is, lets come here, get rid of these dollar signs. Save it.  
+
|What we will do is, let's come here, get rid of these dollar signs. '''Save''' it.  
 
|-
 
|-
 
|03;59
 
|03;59
|Exit compilation by this x. recompile it and note that minus gamma has come. So we need one more line here, we put that. Zero, alpha without dollar sign, zero, zero. Alright, now this is the way to do that.
+
|Exit compilation by this x. recompile it and note that '''minus gamma''' has come. So we need one more line here, we put that. Zero, alpha without dollar sign, zero, zero. Alright, now this is the way to do that.
 
|-
 
|-
 
|04:28
 
|04:28
| Lets complete this equation. I have a few more terms here.  
+
| Let's complete this equation. I have a few more terms here.  
 
|-
 
|-
 
|04:34
 
|04:34
|Let me just see if it is here, yes it is here.  
+
|Let me just see if it is here, yes, it is here.  
 
|-
 
|-
 
|04:39
 
|04:39
Line 91: Line 91:
 
|-
 
|-
 
|05:04
 
|05:04
| Let us add one more aligned statement. And I have written this equation here.  
+
| Let us add one more '''align''' statement. And I have written this equation here.  
 
|-
 
|-
 
|05:13
 
|05:13
Line 97: Line 97:
 
|-
 
|-
 
|05:17
 
|05:17
|Here is the equation, so let me say begin align star.  
+
|Here is the equation, so let me say '''begin align star'''.  
 
|-
 
|-
 
|05:26
 
|05:26
|Let’s cut this. Copy this. Close this align. We compile it.  
+
|Let’s cut this. Copy this. Close this '''align'''. We compile it.  
 
|-
 
|-
 
|05:39
 
|05:39
Line 106: Line 106:
 
|-
 
|-
 
|05:44
 
|05:44
|There are two problems with this. There is a large gap between the two equations and also we may want to align the equations.  
+
|There are two problems with this. There is a large gap between the two equations, also we may want to align the equations.  
 
|-
 
|-
 
|05:52
 
|05:52
|In view of these observations, we put both of these equations into a single align star environment.  
+
|In view of these observations, we put both of these equations into a single '''align star''' environment.  
 
|-
 
|-
 
|06:01
 
|06:01
Line 121: Line 121:
 
|-
 
|-
 
|06:20
 
|06:20
|We will take care of that by telling latex to split this by the reverse slash. Two of them.  
+
|We will take care of that by telling latex to split this by the '''reverse slash'''. Two of them.  
 
|-
 
|-
 
|06:33
 
|06:33
Line 127: Line 127:
 
|-
 
|-
 
|06:40
 
|06:40
|But the equations are not aligned. Suppose we want to align the equal to sign. Suppose we want to align these two signs, we put an ampersand symbol in front of the equal to signs here. Lets put it.  
+
|But the equations are not aligned. Suppose that we want to align the 'equal to' sign, suppose we want to align these two signs, we put an ampersand symbol in front of the 'equal to' signs here. Let's put it.  
 
|-
 
|-
 
|07:00
 
|07:00
Line 133: Line 133:
 
|-
 
|-
 
|07:18
 
|07:18
|Suppose we want to introduce some text in between the equations without upsetting the alignment.
+
|Suppose that we want to introduce some text in between the equations without upsetting the alignment.
 
|-
 
|-
 
|07:24
 
|07:24
| This can be achieved using the inter-text command.
+
| This can be achieved using the '''inter-text''' command.
 
|-
 
|-
 
|07:29
 
|07:29
| So we remove, we made a mistake here, the delta mu has come here. So what we should do is, let us first, put this properly, compile this.  
+
| So we remove... we made a mistake here, the 'delta mu' has come here. So, what we should do is, let us first put this properly, compile this.  
 
|-
 
|-
 
|07:48
 
|07:48
|Now delta mu has come there. U of t is here.  
+
|Now 'delta mu' has come there. 'U of t' is here.  
 
|-
 
|-
 
|07::51
 
|07::51
|Now we want introduce some text between these two. So the line separator slash, slash slash  is removed and in that place we introduce this text that we want to include.  
+
|Now we want to introduce some text between these two. So the line separator slash slash  is removed and in that place we introduce this text that we want to include.  
 
|-
 
|-
 
|08:07
 
|08:07
|Let’s take this text and put it there. Whatever text we want to put appears in braces with an inter-text command.  
+
|Let’s take this text and put it there. Whatever text we want to put, appears in braces with an '''inter-text''' command.  
 
|-
 
|-
 
|08:24
 
|08:24
Line 154: Line 154:
 
|-
 
|-
 
|08:37
 
|08:37
|Lets compile this. So here is the text and you also have the equations aligned.  
+
|Let's compile this. So here is the text and you also have the equations aligned.  
 
|-
 
|-
 
|08:50
 
|08:50
|Note also the use of the dollar sign within the inter-text command.  
+
|Note also the use of the dollar sign within the '''inter-text''' command.  
 
|-
 
|-
 
|08:54
 
|08:54
|Inter-text is like running text, so this is not part of the align environment. You need to include dollars here.  
+
|'''Inter-text''' is like running text, so this is not really a part of the '''align''' environment. You need to include dollars here.  
 
|-
 
|-
 
|09:03
 
|09:03
|These equations don’t have numbers. In fact, the star in the aligned star command has told latex not to put the equation numbers.  
+
|These equations don’t have numbers. In fact, the star in the '''align star''' command has told latex not to put the equation numbers.  
 
|-
 
|-
 
|9:14
 
|9:14
|Let us remove the star and see what the aligned environment does. Let’s remove the star here. Also remove the star here. Let’s see what happens.  
+
|Let us remove the star and see what the '''align environment''' does. Let’s remove the star here. Also remove the star here. Let’s see what happens.  
 
|-
 
|-
 
|09:30
 
|09:30
Line 175: Line 175:
 
|-
 
|-
 
|09:49
 
|09:49
|Suppose this is the second equation I want to discretize, So I write this statement.  
+
|Suppose, this is the second equation I want to discretize, so I write this statement.  
 
|-
 
|-
 
|09:55
 
|09:55
Line 181: Line 181:
 
|-
 
|-
 
|10:04
 
|10:04
|Let me compile it. So it says we will now discretize the PID controller given in equation 2.  
+
|Let me compile it. So it says "we will now discretize the PID controller given in equation 2".  
 
|-
 
|-
 
|10:13
 
|10:13
Line 190: Line 190:
 
|-
 
|-
 
|10:32
 
|10:32
|Slash, slash, A equals B.  
+
|Slash, slash, a equals b.  
 
|-
 
|-
 
|10:40
 
|10:40
Line 196: Line 196:
 
|-
 
|-
 
|10:47
 
|10:47
|Now I have A equals B as the second equation. Now this has become the third equation.
+
|Now I have 'a equals b' as the second equation. Now this has become the third equation.
 
|-
 
|-
 
|10:53
 
|10:53
| Here we have hardcoded that equation 2 has to be discretized but this is no longer the second equation.
+
| Here we have hard-coded that equation 2 has to be discretized but this is no longer the second equation.
 
|-
 
|-
 
|11:04
 
|11:04
| Hardcoding of equation numbers in referencing always has this problem. This is solved by the label command.
+
| Hard-coding of equation numbers in referencing always has this problem. This is solved by the '''label''' command.
 
|-
 
|-
 
|11:12
 
|11:12
| So let us come here and here at the end of the equation we introduce ‘label equation PID’ and then here I write in equation ‘ref’, ref is the command, and whatever than comes here label, should appear here also, again within the braces,equation PID’.  
+
| So, let us come here and here at the end of the equation we introduce ‘label equation PID’ and then here I write in equation ‘ref’, '''ref''' is the command and whatever that comes here label, should appear here also, again within the braces, 'equation PID’.  
 
|-
 
|-
 
|11:39
 
|11:39
|Lets see what happens when I compile it.  
+
|Let's see what happens when I compile it.  
 
|-
 
|-
 
|11:47
 
|11:47
Line 214: Line 214:
 
|-
 
|-
 
|11:52
 
|11:52
|On second compilation see what happens here – now it has become three. On second compilation the numbers become correct.  
+
|On second compilation, see what has happened here – now it has become three. On second compilation the numbers become correct.  
 
|-
 
|-
 
|12:03
 
|12:03
Line 220: Line 220:
 
|-
 
|-
 
|12:08
 
|12:08
|Let us now delete the A equals B equation.
+
|Let us now delete the 'a equals b' equation.
 
|-
 
|-
 
|12:15
 
|12:15
Line 226: Line 226:
 
|-
 
|-
 
|12:22
 
|12:22
|Let’s compile it. This equation 2 is gone, but you still have this three.  
+
|Let’s compile it. This equation 2 is gone but you still have this three.  
 
|-
 
|-
 
|12:30
 
|12:30
|ON first compilation the reference gives the previous number, on second compilation the numbers become correct.  
+
|On first compilation the reference gives the previous number, on second compilation the numbers become correct.  
 
|-
 
|-
 
|12:40
 
|12:40
|The labels are case sensitive. For example, here I have called it equation PID, PID is in capitals. Let’s change this to small PID.  
+
|The '''labels''' are '''case sensitive'''. For example, here I have called it equation PID, PID is in capitals. Let’s change this to small pid.  
 
|-
 
|-
 
|12:54
 
|12:54
Line 238: Line 238:
 
|-
 
|-
 
|13:02
 
|13:02
|Its only that these have to be identical, these need not be characters. For example, suppose I want to give numbers here, let me just put hundred, let me put 100. Save it. Compile it.  
+
|It's only that these have to be identical, these need not be characters. For example, suppose I want to give numbers here, let me just put hundred, let me put 100. '''Save''' it. Compile it.  
 
|-
 
|-
 
|13:21
 
|13:21
|Okay, it doesn’t know it yet in the first compilation, but if I compile it a second time it will know. Numbers are the same.  
+
|Okay, it doesn’t know it yet in the first compilation but if I compile it second time it will know. Numbers are the same.  
 
|-
 
|-
 
|13:30
 
|13:30
Line 256: Line 256:
 
|-
 
|-
 
|14:00
 
|14:00
|And says section ref sec-100, shows how to write equations. Save it.  
+
|And say: section ref sec-100, shows how to write equations. '''Save''' it here.  
 
|-
 
|-
 
|14:23
 
|14:23
Line 262: Line 262:
 
|-
 
|-
 
|14:26
 
|14:26
|On next compilation this is taken care of.  
+
|On next compilation, this is taken care of.  
 
|-
 
|-
 
|14:30
 
|14:30
|So section 1, this number is the same as this one.  
+
|So section 1, this number is the same as this number.  
 
|-
 
|-
 
|14:34
 
|14:34
|So this works for sections, sub-sections and so on. In fact with any environment that has a number associated with it.  
+
|So this works for sections, sub-sections and so on. In fact, with any environment that has a number associated with it.  
 
|-
 
|-
 
|14:42
 
|14:42
Line 274: Line 274:
 
|-
 
|-
 
|14:56
 
|14:56
|Lets compile these. Once again. Alright.  
+
|Let's compile these once again. Alright.  
 
|-
 
|-
 
|15:04
 
|15:04

Revision as of 18:31, 12 June 2015

Time Narration
00:00 Welcome to this tutorial on creating equations through Latex.
00:06 You see three windows as usual.
00:10 I have created a 12pt size, article class document. And using AMSmath package and also using the 'ccliscences' package for creative commons copyright statement as here.
00:30 make title creates the title page. new page command takes the rest of the document to a new page.
00:43 There are many ways to create equations, I will use the command align star to create equations.
00:51 Let us begin with a matrix differential equation consisting of four components.
01:03 Align star, Frac d by dt of begin b-matrix, x_1, next line x_2, end b-matrix.
01:27 Let me close this. Let us compile it.
01:37 So we have created ‘d by dt of x1 x2’.
01:42 Let us now augment the vector with two more components.
01:48 You do it as follows. Next line x3, next line x4. Save it. Compile it. So I have four components.
02:03 Let me now say that this is equal to the right hand side matrix begin b-matrix.
02:20 Zero, zero, one, zero.
02:29 Next line: zero, zero, zero, one.
02:37 And then, lets close this matrix. Save.
02:47 So I have this. So I have written the first two rows.
02:53 It is always a good idea to compile after every few small additions so that we have not made a mistake.
03:00 Note that the align star environment takes the role of the dollar signs.
03:06 For example, we did not enter the dollar sign at all. As a matter of fact, we should not enter the dollar sign within the aligned star environment.
03:14 Let us add a third line to the matrix on the right hand side and illustrate this idea.
03:25 Zero, dollar minus gamma, zero, zero. So there are four entries. Compile it. It comes and says, missing dollar inserted.
03:50 What we will do is, let's come here, get rid of these dollar signs. Save it.
03;59 Exit compilation by this x. recompile it and note that minus gamma has come. So we need one more line here, we put that. Zero, alpha without dollar sign, zero, zero. Alright, now this is the way to do that.
04:28 Let's complete this equation. I have a few more terms here.
04:34 Let me just see if it is here, yes, it is here.
04:39 Let’s cut this. Put this here.
04:46 Let’s see what happens when I compile this.
04:52 This is a model of an inverted pendulum.
04:59 What do you do when you have more than one equation?
05:04 Let us add one more align statement. And I have written this equation here.
05:13 Let me bring it from there.
05:17 Here is the equation, so let me say begin align star.
05:26 Let’s cut this. Copy this. Close this align. We compile it.
05:39 When I compile it, I get the second equation appearing.
05:44 There are two problems with this. There is a large gap between the two equations, also we may want to align the equations.
05:52 In view of these observations, we put both of these equations into a single align star environment.
06:01 So we will do this as follows. Delete this.
06:08 Save this. Compile it.
06:14 Now what has happened is that both the equations have come on the same line.
06:20 We will take care of that by telling latex to split this by the reverse slash. Two of them.
06:33 When I compile it, now these have gone to second equation.
06:40 But the equations are not aligned. Suppose that we want to align the 'equal to' sign, suppose we want to align these two signs, we put an ampersand symbol in front of the 'equal to' signs here. Let's put it.
07:00 And then we will put it here also. Ampersand. Let’s compile this. Now notice that both of them are aligned.
07:18 Suppose that we want to introduce some text in between the equations without upsetting the alignment.
07:24 This can be achieved using the inter-text command.
07:29 So we remove... we made a mistake here, the 'delta mu' has come here. So, what we should do is, let us first put this properly, compile this.
07:48 Now 'delta mu' has come there. 'U of t' is here.
07::51 Now we want to introduce some text between these two. So the line separator slash slash is removed and in that place we introduce this text that we want to include.
08:07 Let’s take this text and put it there. Whatever text we want to put, appears in braces with an inter-text command.
08:24 Note that the opening brace has to be closed, not closing the brace is a common mistake made by the beginners.
08:37 Let's compile this. So here is the text and you also have the equations aligned.
08:50 Note also the use of the dollar sign within the inter-text command.
08:54 Inter-text is like running text, so this is not really a part of the align environment. You need to include dollars here.
09:03 These equations don’t have numbers. In fact, the star in the align star command has told latex not to put the equation numbers.
9:14 Let us remove the star and see what the align environment does. Let’s remove the star here. Also remove the star here. Let’s see what happens.
09:30 So equation numbers have appeared automatically.
09:36 We want to refer to them, so for example, let’s say we want to refer to them, so I have this here.
09:49 Suppose, this is the second equation I want to discretize, so I write this statement.
09:55 Let me take this here, below this, put it.
10:04 Let me compile it. So it says "we will now discretize the PID controller given in equation 2".
10:13 The equation numbers unfortunately may change while insertion or deletion of equations.
10:20 To demonstrate this, let us suppose, we include an equation here.
10:32 Slash, slash, a equals b.
10:40 And then we will delete these lines. Let’s compile this.
10:47 Now I have 'a equals b' as the second equation. Now this has become the third equation.
10:53 Here we have hard-coded that equation 2 has to be discretized but this is no longer the second equation.
11:04 Hard-coding of equation numbers in referencing always has this problem. This is solved by the label command.
11:12 So, let us come here and here at the end of the equation we introduce ‘label equation PID’ and then here I write in equation ‘ref’, ref is the command and whatever that comes here label, should appear here also, again within the braces, 'equation PID’.
11:39 Let's see what happens when I compile it.
11:47 On compiling it, we see question marks here.
11:52 On second compilation, see what has happened here – now it has become three. On second compilation the numbers become correct.
12:03 This is similar to what we saw in table of contents.
12:08 Let us now delete the 'a equals b' equation.
12:15 Let us get rid of this also.
12:22 Let’s compile it. This equation 2 is gone but you still have this three.
12:30 On first compilation the reference gives the previous number, on second compilation the numbers become correct.
12:40 The labels are case sensitive. For example, here I have called it equation PID, PID is in capitals. Let’s change this to small pid.
12:54 What happens now, here it says that it doesn’t know that.
13:02 It's only that these have to be identical, these need not be characters. For example, suppose I want to give numbers here, let me just put hundred, let me put 100. Save it. Compile it.
13:21 Okay, it doesn’t know it yet in the first compilation but if I compile it second time it will know. Numbers are the same.
13:30 In a similar way we can create labels for sections, sub-sections and so on.
13:35 So let us do that, let us demonstrate this with section. Let us do it here.
13:45 Section, this is first section. Label, sec 100.
13:56 Then we go to the end of the document here.
14:00 And say: section ref sec-100, shows how to write equations. Save it here.
14:23 ‘Section, question marks shows how to write equations’.
14:26 On next compilation, this is taken care of.
14:30 So section 1, this number is the same as this number.
14:34 So this works for sections, sub-sections and so on. In fact, with any environment that has a number associated with it.
14:42 Alright, let’s delete these.
14:56 Let's compile these once again. Alright.
15:04 We will now see how to accommodate long equations.
15:09 So I have already written it here. Let me just go there at the end of the document, okay here it is.
15:23 Let me add this.
15:29 Put it here. Lets see what happens when I compile it.
15:40 So I have a third equation that I have added here, it’s a long equation. It’s a long equation so it doesn’t fit into one line.
15:49 So let us break it into two. The way to do that is, let us break it here, slash, slash, and come here and I’m putting an aligned with this ampersand.
16:11 Let me save it, Compile it. See that this equation has been broken into two parts and I am aligning it with the plus sign.
16:26 All these equal signs and plus signs are aligned now.
16:30 Unfortunately we have equation numbers in both parts.
16:35 Supposing we don’t want the number in the first line, suppose we don’t want this number. Include the command ‘no number’ before this slash, slash symbol. Do this as follows.
16:51 Save this. Compile this. See that this equation number is gone and this has become three.
17:02 We see that the braces we wanted in some terms are missing. For example here I have said E N, E N minus 1. Here it appears without these braces. This is because, braces are delimiters in latex.
17;16 We now want to tell latex to not interpret these braces. This is done by putting a reverse slash before the braces.
17:24 Let me put a reverse slash here. Let me also put a reverse slash here.
17:36 See that we have the braces here similarly lets put it here also.
17:46 Here and here. Save this, now we have got that.
17:58 We will now show to create large graphics in equations. For example here, these brackets are very small.
18:08 The way to do that is using – what are known as left and right commands.
18:15 So lets come here – so the equation is here.
18:21 The way to do this is – K slash left and on this side I have this, so here I put slash right.
18:38 Let’s compile this. See this, it has become bigger.
18:45 We can do this also with square brackets.
18:58 I got square brackets. I can also put braces, only thing is that I have to tell latex not to interpret. So I put a slash brace.
19:12 Let’s compile this.
19:17 See this braces.
19:22 When we have one equation split into multiple lines, we will have to put only the left on the first. For example, we have a bracket here and a bracket here, I want to make this slightly bigger. So let me do that here.
19:35 Suppose for example, I want to put a left bracket here and here I want to put a right bracket. Compile it.
19:57 It comes and complains ‘forgotten right’, because I opened it here but I didn’t close it in the same equation.
20:04 The way to do that is to use what is known as slash right dot, that means don’t worry about the right hand side.
20:15 Similarly , here we have to say slash left dot, don’t worry about the left here. Let me exit here. Let me re-compile it. So this is taken care of.
20:30 Now suppose I want to push this a little inside. I can always say slash h-space 1cm.
20:45 let me just do that shift.
20:51 So this has been shifted, this has been aligned.
20:54 If you don’t want this, you want the plus sign to come inside.
20:59 Let’s do this here, put the plus sign here.
21:08 Okay, this plus is now inside. Now this is nicely done.
21:17 All commands that work in between the dollar sign also work between the aligned environment but for the ampersand symbol that is used for the aligning of multiple symbols.
21:27 All commands that work in the aligned environment also work within the dollar symbols.
21:32 Nevertheless, there is a small difference in the way some outputs appear in the aligned environment and in the running mode obtained with the dollar.
21:41 This can be illustrated with the integral mode.
21:46 So lets come here.
21:50 Let’s delete this.
21:53 So I have this statement here. Let me take this,
22:10 let me put it here.
22:15 The integral mode includes the term this integral.
22:21 Let me close this otherwise alignment will complain.
22:28 So what I have done is the integral mode includes the term this integral.
22:33 Note the size of this integral size and this integral. This is a lot bigger and this is smaller.
22:47 Such changes also occur in the case of fractions, sum and product to cite a few.
22:52 There is one other thing that I want to tell before completing this tutorial.
22:58 Aligned environment does not like blank lines in between. Suppose for example, I create a blank line here.
23:11 It comes and says that paragraph ended before alignment was complete. If you really want a space, leave a percentage which tells latex that it is a comment.
23:24 Re-compiling. It goes through and you get all the text as before.
23:32 This brings us to the end of this tutorial. Thanks for listening.
23:37 This is Kannan Moudgalya signing off. Good-bye.

Contributors and Content Editors

Minal, Nancyvarkey, PoojaMoolya, Pratik kamble, Sandhya.np14