 Hello, and welcome to the fourth video in a series on latex, the math typesetting language. In the third video, we learned about how to include basic mathematical notation in your latex document. In this video, we're going to take this a little farther by discussing more advanced math notation, such as roots and radical signs, fractions, Greek letters, the infinity symbol, trig, and logarithmic functions, and then resources for finding latex commands for more symbols on the web and elsewhere. Let's start here with a blank latex document. It's not really blank, of course, because I put in the preamble to the document and the begin and end document environment commands. Let's begin by looking at roots. To typeset, say, the square root of two, we'll need to be in math mode, first of all. So let's type in a single dollar sign to start inline math mode. If we wanted this to be in displayed math mode, remember we'd use a double dollar sign. Now type in the command slash sqrt, then open a curly brace, then the number two, then close the curly brace. Compiling the document will result in a square root of two. Latex automatically resizes the radical sign, so if we have a large argument under the root, like one, two, three, four, five, and compile it, the radical sign will automatically fit. Generally speaking, in latex, any required arguments for commands are enclosed in curly braces, like the two and square root of two. Any optional arguments are enclosed in square braces. For example, if I wanted a cube root, the latex command for this is I need to add one optional argument to the sqrt command between the sqrt and the curly braces. So I'll put in a pair of square brackets, and inside the square brackets I'm going to put a three. And when I compile this, it causes the root to become a cube root. Similarly, if I wanted, say, the 10th root, I'd put a 10 in the square brackets. For example, the 25th root of 11 will be typed like this. Another kind of common notation is fractions. Of course, you can type set a fraction horizontally just by entering math mode and using the slash character like this. But a lot of times we want to type set fractions vertically, and in that case we use a special command to type set two over three vertically. You enter math mode by typing a dollar sign. Then type slash F-R-A-C, which is a command to build fractions. Then we're going to create two sets of curly braces with no spaces in between. That means that the frac command has two required arguments, and that's going to be the numerator and the denominator. So I'm going to enter in two into the numerator, and then three into the denominator, and then compile it. And just as with the square root command, if I enter in a large numerator or denominator, the fraction bar will expand to fit. For example, let's type in F-R-A-C, two sets of curly braces. Then X plus Y plus Z on the top, and then A plus B on the bottom and compile it. Now with this fraction, the fraction bar is the right size, but the whole fraction itself is kind of small and hard to read. If this were in displayed math mode, then the fraction and the variables that are on the top and the bottom of it would look pretty much the same as the text that surrounds it. But suppose we don't want to go into displayed math mode, we really want this one to be in line. Well, there's a command we can add to fraction and any other thing that involves a delimiter like parentheses, as we'll see later, that will make things displayed size without putting them in displayed mode. And that is simply slash display style. And then a curly brace, and then close the curly brace elsewhere to close it off. What this is going to do is take the argument that's inside the brackets, the fraction command in this case, and just simply make it the same size as it would be if it were in displayed mode, so now it's a whole lot easier to read. Now let's look at a few special symbols that Lake Tech can handle. Greek letters are especially easy for Lake Tech. Generally speaking, these are entered in as commands whose names are the same as the letter you want. For example, if you want to enter a lower case Greek alpha, you would type set this by going into math mode, first of all, and then typing slash alpha with a lower case a. To get an uppercase Greek letter, you just capitalize the first letter of the Lake Tech command. For example, an uppercase Greek delta will be obtained by typing slash capital D, E-L-T-A. Make sure you're out of math mode, and then compile. You can also type set the infinity symbol, that's just slash i-n-f-t-y. Going back to functions, you can type set all six trigonometric functions just by invoking their names. For example, if I want to type set cosine of 2 theta, I enter in math mode by typing two dollar signs, and typing slash c-o-s-2. And then I'm going to enter in a Greek letter lower case theta, so that's slash lower case t-h-e-t-a. And then compile it, and we get what we wanted. I can type set a trig definition by putting together everything we know so far. Let's go into displayed mode, and let's type out the definition of the tangent of an angle phi. So we're in displayed math mode, so I want the tangent, that's slash t-a-n. Then I want the Greek letter phi, which is slash lower case p-h-i, equals. And then the tangent is just the sine divided by the cosine. So I'm going to type slash f-r-a-c to start a fraction. Then two sets of curly braces. I'm going to put the numerator, which is slash s-i-n, and then slash p-h-i in the numerator here in the first set of brackets. And then slash c-o-s-slash p-h-i for cosine of phi in the denominator. When I compile it, I see that I got what I wanted. Logarithmic functions work similarly. There's a command for the natural log l-n, just slash l-n, and a command for a general logarithm, which is slash l-o-g. If you need to specify a base, we just subscript the l-o-g like we learned in video three. For example, the log base 2 of x is in math mode, slash l-o-g underscore 2 space x, and then close the math mode symbols, and we get what we needed. So at this point, you get the idea that latex is very comprehensive in its treatment of mathematical symbols. Rather than showing a bunch more examples, let's just think about some places we can go to learn more. The document at this URL is a massive document of all the symbols that latex can handle. It's worth keeping a copy around for reference and searching. However, you should know that some of the symbols shown in this document require special packages, which we will discuss later in another screencast, and they may not work on your system without a special installation. The website Detecify allows you to draw the symbol you want inside a box, and the website will then attempt to decipher your handwriting and then find the symbol you wanted. Note that this only works for single symbols. If you need to find the latex code for something that has multiple parts, like art cosine or something like that, then this won't do that. There's also an iPhone app for Detecify if you need something on the go, as well as an app that just serves as a latex reference. Finally, this website called WebEquation works similarly to Detecify, except it handles entire latex expressions. So that should be enough to get you working on a more advanced document with prettier mathematics in it. The next video will be a couple of case studies of what we've learned so far to typeset some more complicated documents. See you there.