The Beginner’s Guide to LaTeX Part 1: LaTeX Document Setup

LaTeX gives you professional-looking documents while providing consistent formatting and automatic organization but is less intuitive to use than MS Word. You will need to install a TeX/LaTeX system on your PC and install an editor to prepare your documents. You can prepare your document using the \documentclass{} and break it up with \section{}, \subsection{}, \subsubsection{} commands.

Written by: Laura Grassie

last updated: May 8, 2025

If you’re interested in giving LaTeX a try but don’t know where to start—this article will 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.

In this article, I’ll explain LaTeX document setup. In particular, I’ll cover how to install LaTeX, set up a document and start writing it, and how to spot and deal with syntax errors as they occur.

Advantages and Drawbacks of LaTeX vs. Microsoft Word

Before getting stuck into setting up your LaTeX document, it’s worth stopping to consider whether it’s the correct program for the type of document you want to create.

Below are some of LaTeX’s pros and cons, and the types of documents it’s good at creating.

Advantages

Using LaTeX over Microsoft Word can make life a lot easier in the long run, especially for large and complex documents like a thesis. Here are a few reasons why:

  • Consistent formatting
  • Automatic organization
  • Professional-looking documents

We’ve covered the reasons to use LaTeX in more depth here, but in brief, LaTeX handles formatting through predefined commands. So, you spend less time adjusting the appearance using cumbersome visual editors.

It also automatically manages numbering and cross-references for figures, tables, and sections, making it less error-prone than using Word.

Plus, the typesetting quality of LaTeX documents is considered superior, particularly for scientific papers and documents that include formulas.

Drawbacks

There are a few drawbacks to LaTeX that you’ll want to consider before making the switch:

  • Using it involves a (potentially steep) learning curve
  • It’s arguably less intuitive to use than MS Word
  • It’s harder to share documents between collaborators

Unlike Word, what you see is not what you get. You write in plain text commands, which then get compiled into the finished document. Learning those commands takes some time!

And think about whether or not your collaborators use LaTeX? If they don’t, it’s going to be hard to share files and work together on documents. That’s not to say it’s not worth learning for your sake, though!

Types of Documents You Might Want to Use LaTeX For

Because of the command-based approach, LaTeX is particularly well-suited for several types of documents, including:

  • Academic articles and theses
  • Literature reviews
  • Books
  • CVs and resumes

Basically, any long document that requires neat typesetting and includes different types of media will be easier to prepare neatly and consistently if you use LaTeX to make it.

Types of Documents Better Suited for MS Word

There are some instances where LaTeX will definitely be overkill for what you want to achieve. Also, Word and other Office 365 programs have powerful and integrated commenting features and the ability to track changes. These are not available in LaTeX.

Consider avoiding LaTeX for:

  • Proposals and contracts that involve input from multiple stakeholders
  • Slides and business documents that make use of Microsoft Office’s integrated charts and tables
  • Meeting agendas and minutes
  • Simple documents with few typeset features, such as letters

How to Install LaTeX

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 free.

Firstly, you need to 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 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!

LaTeX Document Setup and Document Types

LaTeX is not like Microsoft Word. You don’t see the finished document as you go along. Instead, you give commands explaining the layout of the document.

The Preamble

The first part of your file is called the preamble. 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
  • Report

To name a few. Each of these will come with its 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 things 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

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 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{}
  • \subsubsection{}

Put 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}.

How to Export Your Document as a 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).

The Beginner's Guide to LaTeX Part 1: LaTeX Document Setup

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:

The Beginner's Guide to LaTeX Part 1: LaTeX Document Setup

And this is what the PDF document looks like.

The Beginner's Guide to LaTeX Part 1: LaTeX Document Setup

Fixing Errors In Your Document

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 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.

The Beginner's Guide to LaTeX Part 1: LaTeX Document Setup

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.

Setting Up LaTeX Documents Summarized

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.

And my final bit of advice: I found that one of the best ways to find out how to do something was to simply Google it!

Read Part Two of our Beginner’s Guide to LaTeX series and learn how to format your text and create itemized lists.

Revised and updated in April 2025.

Useful Websites for LaTeX Users:

  1. https://en.wikibooks.org/wiki/LaTeX/Basics (a great guide to some of the basics of LaTeX)
  2. https://www.latex-project.org/guides/ (a good link to a variety of guides)
  3. https://www.bibtex.org/ (information about BibTeX – referencing software for LaTeX)
  4. https://jabref.sourceforge.net/ (software to manage your BibTeX references)

Laura holds a PhD in Molecular Biology from the University of Dundee. She has worked several different roles in scientific publishing and now works as a Managing editor at Bitesize Bio.

More 'Software and Online Tools' articles