LaTeX for Beginners

A short guide on how to begin using LaTeX on your computer.

For a no-effort introduction to LaTeX, you might want to try the online LaTeX editor Overleaf. The guide on this page is for those wanting to try LaTeX on their own computer.

What Do I Need?

If you have decided you would like to learn LaTeX, or at least try it out, there are three things that you will need (two of which you likely already have).

1. LaTeX/TeX Distribution

LaTeX (and the TeX backend) is obtained as part of what's called a distribution. Distributions include the compiler which interprets your code to produce a PDF document and a multitude of packages which add to the functionality of LaTeX. You will need to download a distribution for your operating system, below are recommended distributions for the three major operating systems:

macOS: MacTeX , Windows: MiKTeX and Linux/UNIX: TeX Live

Depending on the distribution you choose, the installer file sizes can often times be in the hundreds of megabytes or greater. This is not because LaTeX takes a lot of resources to run, but rather because these large distributions include all the packages that you are likely to ever need, and each of these contains documentation, which all adds up. It is recommended to download the full versions of these distributions as some of the templates on this website use packages not included with the basic distributions which will slow down initial compilation as they are downloaded on demand.

2. Text Editor

Since LaTeX documents are written in plain text, a text editor is the only graphical user interface you will be using. Most LaTeX distributions include a text editor with syntax highlighting, which is useful to differentiate your document text from the LaTeX commands you will be using. For example, most text editors will color comments a separate color from everything else in the document. If you leave yourself comments throughout your document, this is handy since you will now be able to clearly see them or ignore them.

3. PDF Viewer

LaTeX produces documents in PDF format which means you will need a PDF viewer to view them. macOS will open PDFs in Preview by default but both Windows and Linux will require additional software to be installed. For a free open-source PDF viewer try Evince (for Windows and Linux).

Your First LaTeX Document

Once you're installed the required components, we can create a simple LaTeX document to make sure everything is working as intended.

As discussed previously, LaTeX uses a markup language to define the document structure and formatting, similar to HTML. A markup language uses a standard syntax to specify formatting and is written within plain text as commands. The standard syntax for commands in LaTeX is a backslash (\) followed by the command name and often a curly bracket ({}) for a value to the command. For example, to output italic text in a sentence, the \textit{} command is used as follows:

This sentence contains normal and \textit{italic text}.

Every LaTeX document needs to have three lines which specify the LaTeX class of the document and where the document content starts and ends. LaTeX classes define the general type of document that will be created (book, report, article, letter, etc) and allow the use of different sectioning commands. They also slightly tweak page layouts to match the document type they are intended for. The following LaTeX code contains these three lines along with a line of text:

\documentclass{article}

\begin{document}
My first \LaTeX~document!
\end{document}

You can copy this code into the text editor that came with your LaTeX distribution and typeset it using the 'Typeset' button or menu option, or alternatively on the command line with the pdflatex filename.tex command from the directory where you saved the code in a .tex file. Both approaches should produce a pdf file in the same directory as the .tex file which should look like the following:

Click here for the PDF output you should have created. If this has been successful, congratulations, you have a working LaTeX installation and can use any of the templates on this website!

More Resources

LaTeX Templates does not aim to teach you how to use LaTeX. There are a large number of free resources for learning LaTeX available online. To get started, here's a list of high quality resources:

  1. The LaTeX WikiBooks book is a very comprehensive resource full of examples and descriptions for almost everything you could possibly need to know about LaTeX.
  2. LaTeX Community is an excellent resource for answering any questions you have about LaTeX. Very supportive of new users.
  3. The Not So Short Introduction to LaTeX 2e by Tobias Oetiker, Hubert Partl, Irene Hyna and Elisabeth Schlegl. This is another very well known resource that aims to teach LaTeX to a beginner, perhaps in a more analytical fashion than the WikiBooks book.
  4. The TeX Users Group website. This website was founded in 1980 as a resource for users of TeX and LaTeX. Specifically, this page lists many resources available for LaTeX both online and in print.