Back to Index

A short introduction to LaTeX and Overleaf


Chapters

0:0 Introduction
0:30 Getting started
3:0 Source view
5:0 Citations
8:0 Site P vs Site T
9:0 Citation styles
10:0 Import citations into Bibtex
11:0 Recompile

Transcript

Hi, here I'm going to explain how to and why to use Overleaf and LaTeX for your scientific paper either to contribute to somebody else's paper or to create your own paper. So to get started we would go to Overleaf.com and create an account or log in and you'll find yourself with a screen that looks something like this or else if somebody sent you an email with a link to access their paper just click on it.

Once you click on a paper you'll see a screen which looks something like this. To create your own paper from scratch generally I would suggest going to Google and typing in Overleaf and template and the kind of thing you're creating such as a pre-print and generally that will give you access to their gallery where you can click on the kind of paper you want to create and say Open as template.

So in either case you're going to end up in a screen that looks like this. So this is a different way to creating papers to using something like Microsoft Word which we might be more familiar with and at first it honestly looks a bit terrifying. There's all this code that you see in front of you.

And the trick is basically to ignore all that code, this LaTeX code. Instead just find the bit where it says begin document and start typing. So here's a section where it says begin abstract and I can start typing in my abstract. And then you can create sections so these are just chapters and you can start typing in your sections.

And then at any point you can see what that's going to look like by clicking on this little arrow and saying recompile and what that does is it creates a PDF. And so as you can see it's created a nicely formatted paper for us. Now basically you don't have to do any formatting really yourself in terms of document formatting.

You just type in this is the abstract, these are the sections and so forth and it will automatically format it for you, create your references for you and so forth. So this is one of the big benefits of using LaTeX and Overleaf for doing this is that there's just a lot less time and hassle for you to think about.

You can just focus on typing your paper. There's two ways you can type your paper. One is by typing into this source view which is a bit more scary looking or you can type into the rich text view which is a bit less scary looking. Generally speaking pretty much everybody I know spends 99% of their time in the source view.

In the end they're both places you just type what you want to type. And yeah I would suggest like not looking really at what it looks like too often. Just focus on putting your information, your text to your paper in here and then yeah just from time to time you can always scooch over and look at the compiled PDF.

The only place I tend to sometimes use rich text is if I want to insert one of these things bold, italics, a numbered list or a bullet point list. For example as I've done here let's create our own one. So here is a bullet list and then you just hit this first, second, okay.

And so that's what it looks like in our rich text view. If you go to the source view you can see it's used some LaTeX code. So another way of creating things like bullet lists is just to copy and paste something that's already there. So if we go and have a look at the compiled LaTeX here you can see a bulleted list has been there.

So the main thing you need to know is yeah just type stuff and it will appear. The second thing then to know is how to do citations. So one of the really nice things about doing citations with LaTeX and Overleaf is that you don't have to worry about citation styles or anything like that or keeping your numbers up to date or all of that kind of stuff.

That is all done automatically for you. So there are two ways to create a citation. Basically everything in LaTeX which is a command starts with a backslash and to create a backslash you type backslash site and then there's two ways you can cite. You can either cite inside the text of a paragraph that will be site T or in parentheses at the end of a sentence that will be site P and in either case you then type open curly brace and you'll have a big long list of your citations here.

So for example if I click on this one and then if I have a look at my document, here the citation has appeared and you'll see it's appeared here and then if I scroll to the end you'll also see it has appeared here. So where did all those list of possible things to cite come from?

They come from a separate file. There's basically two files you care about. The .tech file here is the thing you type into and then the .bib file here is the thing that contains all your citations. And here they all are. So you can see there's one per line so here's one citation, here's one citation.

These are in a format called bibtech. If somebody's already created your bibliography for you, you won't have to worry about creating this or you need to know is that in general each citation has a name like this, L1-2020-doctors. Generally speaking if you use the approach I'll describe in a moment, the names of your citations will be the first author's surname, then the year of the reference, and then the first word of its title.

So this is quite handy, right? So for example we wanted to cite this thing here, post-acute COVID-19 syndrome from now Bandian 2021, then we would just start typing "site" and then we'd start typing now "Bandian" and here it is 2021 post. And so if we have a look at what that's put into our document, there it is, it's added to our reference list and you can see here it is in the document itself, now Bandian and it creates hyperlinks and all that kind of stuff for you in the PDF so if you click here it jumps straight to the reference and so forth so that's all pretty handy.

So why would you use site P versus site T? Well the reason why is that, here's an example of site T, site T is something that you would use in the body of your text. So for example, half of our et al. 2021 estimated the full impact etc. so that's site T because it's in the text and so it's the format it creates is to show the name and then the year and then so you can put this straight in the text like this as opposed to site P which puts it in parentheses, that would go at the end of a sentence like this, continue the vaccination rollout to 90% throughout the year, brackets and there's a citation and notice you can put more than one reference with a comma between, you can put as many as you like so that's why you see each one here and again I could click on it and it would jump straight to that reference.

Okay, so here's, actually if you look here I've got the two citation styles in a list so we can take a look at what they look like. So here are the two citation styles, that's the site T style and that's the site P style and things like exactly what kind of parentheses or brackets are used and stuff like that will depend on what template you've selected and that's very easy to change later so you can just up replace the template at any time and your whole document will be updated for that template.

So if you change which journal you're submitting to, you just stick it into a new template and away you go. Okay, so finally how do you add stuff to the bibliography that's not already there, just add stuff to the bibliography that's not already there, my strong suggestion is to use Google Scholar.

So Google Scholar is at scholar.google.com, the first thing you should do is click on these little lines and click settings and turn on the thing that says show links to import citations into bibtech. Okay, and so now that we've done that we can search for a paper so let's say I want a paper about clams.

So I would go like so, let's say yes giant clams that's the paper I want. So if I want to add this to my bibliography, I just click import into bibtech, I'm not a robot, and then select that copy and we go back to bibliography and paste it at the end, like so.

And as you can see, it's used that approach I described, surname, year, first word of the title. So if I now want to insert that into my text, I could say for example site in the text, what's his name, Yong, wrote about giant clams. There we go. And so if you want to see what that's going to look like, recompile.

And here it is, Yong wrote about giant clams and I can click it and I can see, yep, here it is in my reference section. Okay, so that's basically it. Then finally if you want to download the compiled version of your paper, you can go menu, download PDF, or to submit it as LaTeX, you can download source and then you could submit it from there.

Oh, and then I guess the other useful thing to show you is how to work collaboratively. So you can click the share button to share the paper with your collaborators and you can all edit it at the same time. You'll see each other's edits. And then to add comments or to track changes, just click review.

And I'll say track changes is on for everybody. And so now if I start typing, it focuses on the Great Barrier Reef. And you'll see here, it shows that I added, it focuses on the Great Barrier Reef. And so other people will see Jeremy Howard added this. And so then anybody can click accept or reject.

And then the other thing I could do is I could double click on a word, for example, and say add comment. What about oysters? And then other people could reply to that and so forth. Okay. So then I can go resolve, I could go reject, turn off change tracking.

And so this review button just shows the review appears and disappears. And if you click overview, it will show you all of the changes and you can go through and check all of them out. Great, I think that's about everything I wanted to show. So hopefully this helps you get started with using LaTeX and Overleaf.

And you find this a good way to write papers. Personally, I found it really saved me a lot of time. So hopefully it helps