0% found this document useful (0 votes)
77 views6 pages

Latex/C2/Equations/English: Visual Cue Narration

This document provides instructions for writing equations in LaTeX using the align environment. It discusses opening the equations.tex and numbers.tex files, compiling the numbers.tex file, and viewing the output pdf. It demonstrates how to write single and multiple equations in align, including the use of \left, \right, and matrix commands. It emphasizes avoiding the dollar sign and blank lines within align, as these can cause errors. The tutorial recommends Leslie Lamport's book for learning more about LaTeX.

Uploaded by

vidhya ds
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)
77 views6 pages

Latex/C2/Equations/English: Visual Cue Narration

This document provides instructions for writing equations in LaTeX using the align environment. It discusses opening the equations.tex and numbers.tex files, compiling the numbers.tex file, and viewing the output pdf. It demonstrates how to write single and multiple equations in align, including the use of \left, \right, and matrix commands. It emphasizes avoiding the dollar sign and blank lines within align, as these can cause errors. The tutorial recommends Leslie Lamport's book for learning more about LaTeX.

Uploaded by

vidhya ds
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/ 6

5/16/2020 LaTeX/C2/Equations/English - Script | Spoken-Tutorial

LaTeX/C2/Equations/English
From Script | Spoken-Tutorial
1. Copy equations.tex into numbers.tex
2. Both equations.tex and numbers.tex should be sized
3. Both should be opened in TeXworks
4. Both should be at the first line
5. equations.tex should be at the top, and numbers.tex should be below
Initial conditions 6. Compile numbers.tex and get numbers.pdf
7. numbers.pdf should be sized
8. numbers.pdf should be scrolled all the way to the top
9. eqn-slides.pdf should be at the first slide
10. All should be arranged, as recorded in the tutorial
11. equations.tex should be directly below the slides file

TeXworks: Lucida Grande, 22pt, 20px. Preview: 75%, 200dpi

Visual Cue Narration


Welcome to this tutorial on writing equations using LaTeX.
Opening slide
My name is Kannan Moudgalya.

In this tutorial, we will learn


Learning objectives slide
How to create an equation in LaTeX.
Down arrow
How to write multiple equations
Down arrow
How to align multiple equations and
Down arrow Why we should avoid the dollar mode and blank lines while writing
equations

One may use any of Linux, Windows or the Mac operating system.

One needs LaTeX.


System requirements slide
I shall use TexWorks, although it is not required.

What are the prerequisites?


Prerequisites slide
One needs to be familiar with spoken tutorials that introduce LaTeX.
Press Down arrow
Exposure to the recommended method of side-by-side learning.
Down arrow
This information is available at the Spoken Tutorial webpage.

Additional material slide I shall use the file equations.tex


https://script.spoken-tutorial.org/index.php/LaTeX/C2/Equations/English 1/6
5/16/2020 LaTeX/C2/Equations/English - Script | Spoken-Tutorial

Open in TeXworks I have opened it in TeXworks.


Back to slides file, press down It is available as a code file along with this tutorial.
arrow
You need to have it to practise along with me.
Press down arrow
If you don't have it, please download it from the Spoken Tutorial
Press down arrow webpage.

I will next call your attention to this standard textbook by Leslie Lamport.
Slide on Leslie Lamport’s book
I learnt my LaTeX from this book.

It is available for about Rs. 500.

Web browser is opened Let me show on the web browser where one can buy it.
Let us begin this tutorial
Let us learn how to write equations using LaTeX.

Open equations.tex I have already opened the file equations.tex in TeXworks.

I have saved it as numbers.tex to use in this tutorial.

I will keep the file equations.tex intact, and not change it.

Open numbers.tex Let me open numbers.tex


Please pause the tutorial, make this copy and open it.

Whenever you want to start afresh, you can make a new copy
of equations.tex

I recommend this method whenever a code file is given with ANY spoken
tutorial.

Let us compile this file by pressing the Typeset arrow at the top left hand
Press the Typeset key
corner.
Pdf file You can see the pdf file on the right.
Switch to the tex file. Let us look at the tex file, which begins with its usual commands.
I have chosen the width of the pdf file to be 8cm.
Highlight 8cm
This is the only way I can show the entire file and also use a large font.

You may want to increase it to a more reasonable value, such as 15cm.


Change 8 to 15
But I will continue to use 8cm.
Put back 8

Click amsmath line I am using the package amsmath.


Click the first align I write the first equation within the align star environment, as shown here.
Switch to the pdf and highlight
You can see how it gets typeset in the pdf file.
the equation.
https://script.spoken-tutorial.org/index.php/LaTeX/C2/Equations/English 2/6
5/16/2020 LaTeX/C2/Equations/English - Script | Spoken-Tutorial

Click u(t) line in tex On the left hand side of this equation, we have u of t.
Click u(t) in the pdf file On the right hand side, I have produced big square brackets.
How did I do this?

With back slash left square and back slash right square brackets as
Hover on \left and click \right
shown here.

Scroll the tex file up

Similarly, I write a second equation using align star.


Click align* line

Click the x_1 line On the left hand side, we have the derivative of a vector.
Click on the eqn in the pdf file We can see the pdf output here.
Click on matrix tex On the right hand side, we have a 3 by 3 matrix.
Click on matrix pdf See the corresponding output.
Delete row 1 compile Suppose we delete the first row in this matrix and compile.
We get a 2 by 3 matrix pdf output.
Click the pdf
The first line is gone.

It is your responsibility to make the equations correct and consistent.

Undo the last command in tex Let me put the row back.
Compile Let me compile.
You can also add more rows, if necessary.

Similarly, you can change the columns, too.

Recall that we used the dollar mode to write formulae in another tutorial.
Here, align plays the role of the dollar mode.
Click on begin align in tex
In fact, one should not put the dollar sign within the align environment.

Put $ and compile


Suppose we put the alpha symbol within $ signs and compile.

Error message We get an error message about dollar.


Press the cross symbol on the top left red box and abort the
Press red cross symbol to abort
previous compilation.
Let us remove the dollar sign.
Remove $ signs
Compile again, it works!

Below the line with alpha, leave a Another common mistake is leaving blank lines in the align environment.
blank line
Let me leave an empty line and compile.

https://script.spoken-tutorial.org/index.php/LaTeX/C2/Equations/English 3/6
5/16/2020 LaTeX/C2/Equations/English - Script | Spoken-Tutorial

Error message It gives an error message.


Put % If you need this gap, put %, the comment character, in the first column.
Press red cross symbol to abort Abort compiling.
Compile again - it compiles ok.

Press Typeset symbol to compile So it is important to remember that you should not leave a blank line within
the align statement.

Remove the blank line Let me remove this line and compile.
Next, I want to align the two equations by the equal to sign.

For this, we need to put both equations inside one align star environment.

Remove \end{align*} Remove the end align* command of the first equation.

Remove \begin{align*} Remove the begin align* command of the second equation.

Compile Let us compile.


We see only one equation appearing.

In the pdf file The text in between the two equations appears as a large string.

The second equation does not even show up.

This is not what we wanted.

This problem is solved with the help of the intertext command.

Add braces before and after the


Let us put the text in between braces.
text.
Put the text into \intertext{}
Let us also put this command, back slash intertext as I type now.

Note that intertext is one word, without a space in between.

Point to the \ Do not forget the back slash before intertext.


Also, do not forget the closing brace.
Point to the closing brace
These are all common mistakes.

On compiling, we get this pdf file.


Compile
You see both equations now. But unfortunately, you see both the equations
right aligned.

Not aligned by the equal to sign.

So, I am not happy with it.

https://script.spoken-tutorial.org/index.php/LaTeX/C2/Equations/English 4/6
5/16/2020 LaTeX/C2/Equations/English - Script | Spoken-Tutorial

I want to align by the equal to sign.

To do this, let us put the ampersand sign in front of the equal to sign.
Put & sign before =
Let's do it for the first equation.

Repeat in the 2nd eqn. And then let's do it for the second equation.

If you have more equations to be aligned, do this for all of them.

Compile On compiling, we see the two equations aligned by the equal to sign.
The equations are aligned even though there is text in between.

Remember to use the intertext command whether you want the equations
aligned or not.

What do we do if we don’t have text between equations?


Delete text lines
To understand this, let us delete the entire text between the two equations.

Put \\ Note that we should not leave an empty line.


On compiling, we see both equations coming in the same line.
Compile
We didn’t tell LaTeX to start the second equation in the next line.

Add \\ We solve this by putting two back slashes at the end of the first equation.
Compile Let us compile, to get the correct pdf file.
Undo Let us now undo and put the text in between two equations.
Compile Let us compile once more.
This is where we will stop.

Let me go to the slides.

Summary slide This page summarises what we learnt in this tutorial.

Down arrow Please recall each of these commands.

Down arrow This is your first assignment.

I will give some more assignments.


More assignments slide
Can you pause the video and try to produce these equations?
Down arrow
The required code is given here.

Can you produce these equations?


Assignment 3
Notice that these equations are now aligned at the equal to sign.

Assignment 4 What happens if you forget a required ampersand sign?


https://script.spoken-tutorial.org/index.php/LaTeX/C2/Equations/English 5/6
5/16/2020 LaTeX/C2/Equations/English - Script | Spoken-Tutorial

Please pause the video and try this input.

You should get this output.

Forgetting ampersand signs is a common mistake made by everyone!

Can you pause this video and try to produce this output?
Assignment 5
Use the hint given here.

In this assignment, you have to align three equations.

Assignment 6 Please pause the video here, and try to produce them by yourself.

I have given the answer here.

I have the last assignment in this slide.


Assignment 7
Insert some text between equations.

I will now give some general information.


About the ST slide
This video summarises the Spoken Tutorial project.

Workshops slide We conduct workshops using Spoken Tutorials.


Answers slide
Do you have questions in THIS Spoken Tutorial?
Press down arrow
Please visit this site
Down arrow Choose the minute and second where you have the question
Explain your question briefly
Down arrow Someone from our team will answer them

Down arrow
You will have to register on this website to ask questions.
Down arrow twice

For topics not covered in spoken tutorials, visit stack exchange at this
Where to post slide
address.
Contact us slide For any other questions, please contact us.
Acknowledgement slide Spoken Tutorial project is funded by MHRD, Government of India.
Thanks for joining.

Goodbye.

https://script.spoken-tutorial.org/index.php/LaTeX/C2/Equations/English 6/6

You might also like