Intro to LaTeX : Learn to write beautiful math equations

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you're a stem student or anybody that writes down math formulas then I got a great product for you particularly a project well we're all stuck at home and the idea is this how do mathematicians write beautiful mathematics I don't mean the content of the mathematics how do they actually display it for example this is a portion of my PhD thesis as you see it's a combination of formulas and math diagrams as well as just normal paragraphs so how do you do that well in this video I'm gonna give you an introduction to latex latex is a markup language and what that means is that if you write your math formulas with a little bit of code it's not so bad I'll show you how to do it then the system is going to display the code for your math formulas in a very nice way now there's many ways to write in latex what we're going to use in this video is overleaf but down in the description i'll put in installers for pc versions and for Mac versions of latex as well but overleaf is a free cloud-based one all right so let's begin I'm going to go to overleaf comm and I already have an account but you can come up here and either register for account I am going to simply log in now we get this list of projects we previously worked on but I'm going to go to the top left click new project and there's many different templates down here but I'm gonna click on blank project and I'm gonna come here and call it hello YouTube that will be the name of my project and object.create and so this is what it looks like on the left side I have this code here this is the code you type in the latex and then on the right hand side we get what it produces so we have to understand how this code works and it's not so bad so let's take a look the first thing I'm going to observe is that there is something called begin document and end document and in between begin document and document is where you do all your typing so for example if I came down here and type hello world then what is going to happen is that that hello world is going to appear on the right hand side now to make that appear up on the top here you see a button called recompile which basically just goes and runs the code and gives the document and you can click the arrow and turn auto compile on which means that every few seconds it will come and do this and that hello world that we typed over here now appears on the right-hand side the other things I have between begin document and document right now is something called make title make title just goes and output this initial code that I have on the top and then something called section introduction and it basically gives a nice bolded when you put it back slash section introduction it creates this number one of the frontier in this large introduction so that's what's happening between the begin document and document the initial portion here is called a preamble and in this preamble some of the is self-explanatory some is not the first few things there's part of the process of making the title down below I say what is the title I say what my name is I say what the date is and you can change those appropriately and then when you click make title what it's doing is just telling like that to display these things that you typed up in the preamp at the very top the very first line called document class article you probably do this every time but there's different document classes for books and for presentations and you can explore those in the future then the second line is alt something that just over leaf is just doing as a default when you use a package it adds new functionality new libraries of commands and ways to interpret symbols and this is just a default one that were using in fact we're going to see how to add different packages later on nevertheless we just use these defaults and it's time to go down here and make some changes into our section so let's begin with a formula and what should we do how about Euler's formula to make a formula you use two different dollar signs and you wrap the thing there's a formula in between the dollar signs and so let's do how about e to the power and so I write my little caret symbol and because I want to do e to the I pi I want two things to be up in the exponent what I do is I put curly brackets and curly brackets are a way of just lumping together code in in latex so everything that is inside of this curly bracket will be put up in the exponent look what I want to put under put an eye a little pie symbol and the way to make a pie symbol is do backslash pie and as you'll notice slowly goes into this recompiling now I get e to the I pi appearing in and perhaps I want to add plus one and equal to zero so that we can get our famous formula Euler's formula this backslash business you could do backslash alpha to make an Elfa symbol backslash beta and make a beta whatever you like generally backslash is telling latex you're about to give some command in this case the command to make a PI symbol this type of formula is called an inline formula and basically means that the formula is a line tear with the text but we can also do formulas that have no much a single dollar sign wrapping it but a double dollar sign wrapping it and what happens here is it creates its own new equation environment so for example I need a new fraction the way to do a fraction is backslash which tells me I do a code and then I'm going to type frac for fraction what you'll notice down at the bottom when it pops up it sort of tells you how to format it is that it takes two inputs and curly braces the top one is your numerator I'll put a 1 there and the bottom one let's do an NSA is your denominator know what's happening here is after recompiles it's gonna appear is this nice fraction on the right hand side often formulas that are long complicated and messy and might take more than the amount of space that you'd want them to be nicely aligned in line should have these double dollar signs to create a sort of own math environment okay I'm gonna add some more things to this I'm gonna put a 1 plus I'm gonna put a bracket around the left-hand side a bracket to the right-hand side and raise it to the power of n some of you may know where I'm going with this but what I want to notice is all the radiance I don't think it looks very good the brackets are sort of too small I want to raise the entire thing to the power of n but the practice don't look that great so what I'm gonna do here is a command to make auto-scaling brackets where I have the first bracket I'm going to write backslash left to tell the system that this is a left bracket and then I'm gonna do a backslash right to tell the command at the final closing bracket is also similarly an auto scale 1 and what you get now is these brackets that scale to be exactly the size they need to be 1 plus 1 over n all to the power of n so this probably can make much prettier different formats ok what else should I do here let's put a limit the front of this thing the command for limit is backslash limit and now for my limit I want to put something underneath of it and so I'm gonna do underscore and I'll put in some braces here and this tells me that whatever I put in between these braces currently nothing is going to be underneath the limit symbol much like how the caret told you to do things that were is the exponent of the exponential in this case I'm going to do n on your new backslash 2 which is a symbol for an arrow backslash 2 is an arrow and then to infinity is backslash T so as you see this a bunch of these different sort of symbols you have to start memorizing effectively but you can look into them up pretty quickly and what we have here is finally a definition for e is this particular limit or this is one way to write it we want to have a bit more fun with this we can do another ones let's do an end to infinity in the same kind of way we're gonna do a new fraction it's gonna have an N on the top this is coming from Sterling's formula and then on the bottom well I want to do the nth root of n factorial how do I do an ant burger well I'm gonna do backslash s QR t for square root and then square roots kind of funny square root accepts a parameter and by that I'm going to use two different square brackets and I'm going to put in in here and so basically what this code does is it tells me I'm not making a square root symbol I'm making an nth root symbol so square root with you put the brackets around the end tells it to make an nth roots implement every symbol of what well n factorial and you put that all in and put it recompiles it's going to come here it's for set and create an nth root for that in factorial another limit formula for e alright we can do another let's do I someone this time so e is gonna be backslash sum this is gonna make a big Sigma I'm gonna do the underscore here to put something beneath the sum and I'm gonna write it starts at n equal to zero and then I'm going to put my caret and write an empty and this is all going to come out together and make a nice sum from n equal to zero up to infinity looks like I have one too many braces for now okay and then what I want to have it be a sum of it's 1 divided by n factorial is how you work let's compile it to force it to happen and we get this other formula for each all right let's do one more we can also use continued fractions you may not have seen this particular definition before it's a kind of a fun one so what I'm gonna do start with the two and then it's a fraction where there's a 1 on the top and then there's something I have to put down the bottom but if I then go inside there and what am I put on the bottom I'm going to put a 1 plus another fraction it's a fraction with the one on the top and then something along the bottom and then what is the thing on the bottom well it's gonna be a 2 plus a fraction with a 2 on the top and something along the bottom you see what's starting to happen here is it's gonna come along as it compiles and it keeps on having this sort of pattern refraction after fraction let's do another one it's a 3 plus a fraction with a 3 on the top and something on the bottom what is that something on the bottom it is a 4 plus a fraction with a 4 on the top and a something on the bottom let's see how that one compiles oh I have a big error message that means I formatted something improperly and it looks like I had one too few braces so let's run it this time up there it is and what do we want to put let's try to do it dot dot dot if you do backslash d dots that's gonna give me some very nice diagonal dots and so we have this sort of look down here oh I don't actually like that there it is now it's compiled for plus five but them in the dot dot dot just to indicate that it goes on in that way so this is called a continued fraction all right so that's a bunch of the different types of commands that you can use we're gonna do more but you might want to say this is starting to look messy you might want to clean it up and so one of the things I want to talk about is how you make lists and so I'm gonna do something called begin and numerate a new Marie I can't spell enumerate there we go and we're going to close it and we're gonna come down to the end of the document it will fix all my error message in a moment and end enumerate all right let's recompile that now I haven't done anything except I've created all of this text between begin enumerate and enumerate is picked in this enumerate thing well what does that do basically you can write backslash item to create items on a list let's come down here and do another item there and one more item down here and as you can see you have this nice sort of one two and three appearing and so it just organized a little better especially for doing for example multiple homework problems if you don't like it being number you can come and double-click on the numerate which selects the numerator on the top and on the bottom and you can write itemized here and come along on the bottom and itemize there as well we recompile this an itemized gives dots opposed to numbers alright so that's a bit of an introduction here now I want to go and goes to a new section with some new commands remember how at the beginning I had this section which was called introduction that was our first one by the way if you don't like that one appearing at the front you can come here and press star in front of it and that's gonna turn it's gonna get rid of this one here start it sort of takes away the numbering nevertheless let's come down here and do a new section about more formulas something like this and here we want to talk about just a few formulas that you may well need I will put a star there as well so we don't get a 1 in front of that one I knew if you want formulas you might need in calculus or linear algebra courses if you have any other courses or any other symbols it's totally fine for you to look up and figure out this gonna be for instance one of the most 1.0 forms of samples so the integral with a on the bottom and B on the top and then f of X DX is going to give us well in interval formula I my brackets and we're hot so lets me rewrite by FX a little bit nicer and it's go about this no the next formula is absolutely something that we can't do with the package we have right now remember at the top we said that we could add these news packages to the preamble but the next symbol is not in this one that we established I want to do a new package and this is what I would always suggest using AMS math this is the American Mathematical Society and it's a whole bunch of new formulas new symbols that do not exist in sort of the native tech environment so now that I have added that package I can do something which is a new symbol that didn't work previously backslash and I'm gonna do an interval but I'm gonna put more than one eye there's a single interval there's a double integral and there's a triple integral so three eyes in your interval sign and then maybe I want to come along and write f of X and Y and Zed DX dy DZ and this is gonna give me a nice triple integral so as you go in Google and find new symbols you may sometimes need to add new packages to allow you to use those symbols you just do those up in the preamble okay what about for linear algebra one of the most important ones is being able to do vector so you do backslash that can put your V there I can define this for example is V sub 1 V sub 2 V sub 3 something like this and this is gonna be a nice little vector with an arrow Havilland you might want to take a dot product between two vectors so I could take how about a V vector and I do make the dot you do backslash c dot for a central dot and then a vector W and this gives me a nice dot product between these two different things let's let me compile so it decides there and there we go we have that ok very nice final new sort of formula that I want to talk about is for matrices obvious we have to do this all the time in the new relative brick this is another command that requires a am s Mac it's called a b matrix and so here's the approach i'm going to begin with a double sign on the top and i can give myself a little bit of space here so all of this region here is my formula now I'm gonna do a begin is called a b matrix and then i'll go for a little while and then i will end my B matrix I didn't type it fast enough and so what I tried to compile it it shot me a little bit of an error message but okay nevertheless right now it looks pretty terrible just got these two different brackets here's how it works - typing row in the B matrix you put any number and then you put an ampersand to denote that you're going along your row and then maybe save too and then I'll put an M three and then when you're done with your row you put backslash backslash and so what I get here when it compiles is this matrix and breakfast that is a just a row vector one two three if you want to add a new row come how and do four and five and six and you don't actually have to do the backslash on the very left one but let's put in there anyways and it makes this really nice matrix all right two final things that I want to talk about which is images and commenting suppose I had done this and then I decided I don't actually want this triple interval I need to come along here and put a percent sign in front of it I'll hit recompile and notice what happens to the triple enroll it goes away so if you're not sure whether you want to display something but you've been working on it you'll want to don't leave it you can just go and hide it behind the percent signs and that gives a card the final thing I want to talk about is images how do you add an image because maybe you've made some graphs somewhere else either in some other software or you've read over by hand you want to include it in your homework how do you do that so the first thing we do to get an image is I go up to the top where I've got my packages and I'm going to use a new package and this one is called graphics with an X at the end of it now to add the images i'm gonna click my little arrow over here so i see this main dot txt by the way it's just the name of this tech document that i'm right in and that's where I put my code I'm going to come here and click the upload button I'm going to select from my computer and I have an image they're called definition of length and so if I come along and click that now in the sort of this folder I have this image or something I just wrote up by hand it's kind of a long name I'm gonna rename it I'm just gonna call it length by itself and now I don't have it yet in my document anywhere but I have added the package that allows me to make a command to include it okay so down here I'm gonna do include graphics and I love what this little portion of it you see how it pops up down here it sort of shows how it formats it shows that there's a section in square brackets a section ends in a squiggly brackets the section in square brackets is basically you telling it sign there's many ways to do this but one way is to write scale as some fraction of the original size so if you sort of know how big your original document is you can scale it other options are to make the width equal to say half the text width there's different versions like this but nevertheless I'll stick with that one and then in the squiggly bracket I put the name of the image so remember how we would call that length so it was lengths up there and so I will call it length down here and it's going to recompile and I'll scroll down and there I have it and I have my document just organized very nicely all right so well that's all I've got for you right now I hope you enjoy I definitely encourage you to check out the description where I've got more information and links to install it or a links to go to overleaf and it's just a great product to work on over summer so that all of your different homework assignments can be presented really nicely if you do anything else use math formulas Lake dick it's just so powerful because if you know these elementary codes you don't have to worry about making everything spaced and look nice it just does all of that for you which is why Lake heck is so powerful and it's basically used throughout mathematics and many other STEM fields as well so if you have any questions about this video then please leave them down in the comments give it a like Rome Athens we like algorithm for new YouTube lick algorithm so give the video a like for the YouTube algorithm and we're going to do some more math no I'm citing a math more actual math in the next video
Info
Channel: Dr. Trefor Bazett
Views: 370,840
Rating: undefined out of 5
Keywords: Math, Solution, Example, Latex, Install, overleaf, installation, overview, FAQ, math, equations, formula, An Introduction to Overleaf, tutorial, LaTeX Tutorial, Creating a LaTeX Document, Math Notation, How to Format a Math Paper, Common Math Notation, Learn Latex, Calculus Notation, latex introduction
Id: Jp0lPj2-DQA
Channel Id: undefined
Length: 19min 8sec (1148 seconds)
Published: Tue May 05 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.