 Alright, so in this video we're going to go over how to use images and figures in LaTeX, like what kind of logic is behind them. So here I have a pretty empty LaTeX document. Now in order to call images, generally you have to invoke a particular package. So if you go to the top of your document before you begin document, type out the use package command. And the package we're going to call is GraphicX, so GraphicX. So this is the package that LaTeX uses to call images, and it enables you to do pretty much all the basic manipulation with them. So the important function you want to call is include graphics. Now let me show you what the folder I'm in looks like. I have a couple pictures here, one named ArchPng, EditorsPng, a couple things like this. So if I run the include graphics command, let's say I want to choose ArchPng. I just say ArchPng, should be in the same folder of course, and just run that. And if you look over at my preview here, you'll notice that there's nothing here because our image has actually been put on the second page. It is here, but it's in this massive size because by default, what LaTeX is going to do is just put everything in at the actual size it is. So how are we going to change that? Well, it's pretty easy. Before you actually call, before your curly brackets for actually calling the image name, you can feed it some parameters in square brackets. So let's say we want to have, what you can do is you can adjust the width. So we'll say width should be maybe five inches. Now that we've done that, our picture has shrunk to a width of five inches. The height is automatically adjusted as well. So this is much more manageable. I'll actually just shrink this down a little more, let's say three. Now of course, you also notice it's not centered by default, but you can center images just by using the center environment. So before that, before include graphics, we can say begin center, and after we say in center, and then it should be nice and centered. So that's nice. Now there are other parameters you can feed it here. For example, in addition to width, you can of course feed it a height. So let's say the height is five inches, something like that. And you'll notice that it will stretch out to that particular length or that height and width. So one thing that is nice that you might want to use is keep aspect ratio. Now this parameter, you'll notice it will shrink back up so that its height is sort of a normal length. Keep aspect ratio is nice because what you can basically do is call this command like in a macro, where you automatically give it a width and height. And functionally, the width and height act as maximum values if you have keep aspect ratio. So that's a nice thing that you can do to sort of keep things in order. But just so you know there are actually other things you can do besides just manually putting in width and height. You can also say something like let's say scale equals point five. So that means it'll be half the size that it usually is. But I recommend using width and height because they're a little easier to use. But there is, if you don't necessarily like doing that manually, there is one command that makes things super easy that is text width. So if you set the width equal to text width, this just means fit it so it fits in with a normal line. So that'll keep things nice and even. And if you don't want it to fill up the whole line, you can actually do something like this. You can say point seven, text width. And this will shrink it to 70% of the text width. So this is honestly probably the most robust way of doing it. Making a text with something else. Because if you take this code and put it in another document, it's automatically going to readjust. So that's really nice. You can do other things just in case you might need to. For example, you can change the angle of the picture. So let's say angle 90 and that will switch it 90 degrees. Of course you can, it doesn't just have to be 90, it can be like 43 or something like that. Lautex is pretty flexible in dealing with that. So that's basically how you insert images. Now let's talk about figures because figures you might want to put, you're pretty much going to want to put all of your images in figures in any professional document. But before I talk about figures, let me do something else. I'm going to add in another package. You don't have to do this. This is just for illustration. I'm going to add in the package blind text. And this package just lets me call a command blind text. Which just is going to add in a bunch of extra text because that's what I want here. So now we have a bunch of loremipsm here. Let's go down in our document, let's say in here. And we want to include another picture. Now this time we're going to include it in a figure. So let's say include graphics, we'll set the width equal to say 70% of the text width. And the file we're going to call is, we'll call emacs.jpg. So there's our picture. It's not centered because I haven't included it in a center environment. But here it is. Here's our image. So you might want to include images in what are called figures. And in order to do that, you just type begin figure and after figure around it. So figures do a couple things. One is that they automatically, you can't see it yet, but they automatically number your images. They also make them so they're more flexible. And you can also do things like adding captions. So for example, if I, in a side of a figure, if I say caption, and let's say, let's give this a caption, let's say the effects of emacs on your fingers. Now what this is going to do is, I spelled caption wrong, never notice these things. So now you're going to have a nice little caption here. Now I think I want to actually make this centered as well because it looks a little ugly as is. So we'll center that by putting the begin and enter center environment. Now you should also be able to, I think you can, let's get rid of these. You can also say something like centering. And that'll actually do the same thing. So that might be a little easier for you. But anyway, here's our picture. Now the thing about figures is that you can manipulate where they appear. By default, LaTeX is going to put them into place, which is sort of most efficient. So let me give you an example. I'm just going to add some text before this. So I'll say in the figure below, you can see the medical effects of emacs, something like that. But you'll notice if you look in our text here, if I actually zoom in on this PDF, you'll notice that this text is actually going right here. So it's not actually right in front of the, I mean, it's not right above the actual figure. So that's the thing with figures. LaTeX will automatically put figures in the place where it's most efficient, most space saving. But you can change that. For example, if you go to the begin figure tag, and if you put in square brackets, just an H, what this does is it's going to keep, it's going to make sure that the figure appears exactly where you put it in the text. Or you can put T. T will automatically put the figure at the top of a page. Or you can put B. B will put it at the bottom of a page. So here it's actually on a page all to itself, because that's the only place that LaTeX could fit it. Or you can just press P and this isn't going to change anything, but P just says always put this on a page of its own. So yeah, those are the sort of functionalities you get with figures. In most documents, in most scientific articles and stuff like this, you'll often notice that figures are going to be on totally different pages than where they're referred to in text because you have to save a whole lot of space. So that's figures generally. Another thing you might want to do, I'm going to add in some more blank text so we have more stuff here. Another thing you might want to do is wrapping text around figures. So notice these pictures, both of these pictures and this figure, they're in line. But you can include a figure sort of off to the side and have text wrap around it. So if you go back to the top, we're going to use another package. And the package we're going to use is WrapFig. So it's pretty simple, WrapFig. And then we'll scoot down here. And what you could do is call the BeginRapFigure and then we'll EndRapFigure. And basically in here, this takes two different arguments. One is what orientation do you want the figure to be? Let's say we want it on the right. And the other is how much space is this figure going to be taking up? Let's say three inches or something like that. Now everything we put in here, images or text included is going to appear in some kind of figure off to the side. Let me scoot down here. So you'll notice this is a figure already. Let's replace this with an image. So let's say LaTeX. So include graphics LaTeX.png. And of course now we have to change the width. So let's change it to something that's less than three inches. So we'll say width equals 2.5. And that should, is that not working? Sorry, I flipped the recording off because something was going long and I didn't realize I didn't put inches here. So yeah, that's what I missed. Be sure to always put whatever units you want. Can be centimeters, can be inches. There are a couple, I think you can even put pixels, but anyway here's our wrap figure here. So you'll notice that the figure itself takes up three inches and the picture here takes up two and a half. Let's actually call the centering command because I sort of want this in the middle. So yeah, that looks a little bit a little better. And so yeah, that's basically it. You can add like normal figures. You can also add captions. So I'll just put some text in there because I don't care that much about it. And now the last thing you'll realize is both of our figures have been automatically numbered. So this is figure one. This is figure two. And these numbers work like any other situation in LaTeX. You can use the label and ref commands to refer to them. So what I'm going to do is label this as LaTeX pic. So now whenever I'm in the text, I can say something like please refer to figure and then ref LaTeX pic. Now if we find that in text, oh yeah, here it is, please refer to figure two. I don't know if you can see that. Let me zoom in a little more. So of course the numbering is done automatically. So yeah, that's another nice thing about figures. And you're taking this text and you're taking the code and putting it in another document. All of this stuff will automatically readjust. Okay, so anyway, just as a reminder, you learned how to put in pictures in LaTeX. You can, by default, they're just going to put them in whatever size they are. But you can change the width to text width or something else. You can call individual heights, something like that. You can use the keep aspect ratio to make sure everything's in order. You can also put images in figures. Figures, of course, can float around. You can change where they appear by putting h or p for new page or t for top or b for bottom in the little brackets after the begin figure command. And lastly, we have the wrap figure, which is called by wrapfig. And you just use this, give it an orientation and give it a width. And yeah, that'll give you nice little figures to wrap your text around. So anyway, hope you learned something and you'll be seeing some more soon.