For those of you who read the previous post about LaTeX and are interested in giving it a go, but just don’t know where to start, this article should get you on your feet. I used LaTeX to write my thesis and was (mostly) self taught, so I know how scary it is to begin with. There are many different ways to use LaTeX, but I’ll show you the way that I did it.
Getting Started
To begin using LaTeX, you are going to need to install a few things on your computer (don’t worry, it’s all online and all free). Firstly you need download and install LaTeX. There are several different versions: I used a version known as MiKTeX. In addition to this, you will need an editor – the software that you will actually use to create your document. I used several different editors, although my favourite one is TeXmaker. Once you have these two things downloaded and installed, you are ready to go.
What is all this gibberish?
LaTeX is not like Microscoft Word. You don’t see the finished document as you go along: instead, you give commands explaining the layout of the document. The first part of your file is called the preamble, and this is where you determine what sort of document you are creating. There are many different types of documents you can choose from, including article, book, letter and report, to name a few. Each of these will come with their own particular settings, but all of these can be altered to suit your needs as you get more confident.
To say which document we want, we use the command \documentclass{report} (for a report). You can also alter thing like font size and style, page margins and pretty much anything you can think of in the preamble, but to start with all you need is the document class.
The document itself
Next you need to say you are ending the preamble and beginning the main part of the document. This is achieved with the command \begin{document}. Now you can get on with writing your document. To start a new chapter, you use the command \chapter{} with the title of the chapter within the brackets. Don’t worry about stating adding the word “chapter” to the title or the chapter number, LaTeX will do all that for you. To break your chapters up into smaller sections, you use the commands \section{}, \subsection{}, and \subsubsection{}, putting any titles within the brackets. Then you just need to write.
Ending the document
Once you are finished writing, you need to state that this is the end of your document, with the command \end{document}.
Creating the PDF
Once you have finished, you want to be able to create your final document. Make sure you save your file before continuing. To create a PDF of your document, you just need to select PDFLaTeX from the run menu and click run (the arrow).
Your PDF document will then be generated and will be found in the same folder as your saved LaTeX document.
Here is an example of a LaTeX document in TeXmaker:
And this is what the PDF document looks like.
One more important point. The nature of working in LaTeX means that there are going to be errors (mostly because you did something wrong – I spent the first six months of LaTeX use convinced it was riddled with bugs, until I finally realised that it was simply that I made a lot of errors). LaTeX will help you to figure out any errors in the document by informing you of them, telling you where in the document they are and what kind of error it is. For many errors, the error message is simple to understand and therefore easy to fix. For more ambiguous errors, a simple Google search will often shed light on the problem and how to correct it. In TeXmaker, errors are displayed below the document.
Here I have an error as I missed out a } after \subsection{This is the first subsection}, making LaTeX think that the title of the subsection never ended. The error message is very clear in this instance, as LaTeX states that it suspects I have forgotten a }, making it very easy to find and fix.
Those are the basics of LaTeX (simpler than you thought?).
Doing more complicated things (such as inserting figures, creating tables and adding references) is just a matter of finding the right commands. There are a ton of great websites explaining how to do pretty much anything in LaTeX, and I’ve included some of my favourites below. I found that one of the best ways to find out how to do something was to simply Google it!
Useful websites for LaTeX:
https://en.wikibooks.org/wiki/LaTeX/Basics ( a great guide to some of the basics of LaTeX).
https://www.latex-project.org/guides/ (a good link to a variety of guides).
https://www.bibtex.org/ (information about BibTeX – referencing software for LaTeX).
https://jabref.sourceforge.net/ (software to manage your BibTex references).