LaTeX for beginners: learn LaTeX for your thesis from scratch
LaTeX is intimidating at first glance: you open a .tex file and instead of a document, you see code. But this approach has a powerful logic, and once you understand it, it will give you full control over your thesis, professional typographic quality, and a stability that Word cannot match over 200 pages.
This guide takes you from scratch: how LaTeX works, how to set it up, the essential commands, and how to structure a complete thesis.
If you are looking to work directly in the browser without any installation and to use ready-to-use templates on Overleaf, read our dedicated guide: Writing your LaTeX thesis on Overleaf.
Understanding LaTeX: separating content and form
The fundamental difference between LaTeX and Word: in Word, you see your document as it is being formatted (WYSIWYG, What You See Is What You Get). In LaTeX, you write a plain text file with commands, and LaTeX compiles this file into a PDF with precise and consistent formatting.
Concrete example:
In Word, to write a chapter title, you type the text, select it, then change the size and bold manually.
In LaTeX, you simply write:
\chapter{Introduction}
LaTeX automatically applies the style defined for chapters throughout your document: consistency guaranteed, even over 300 pages.
This separation of content and form is what makes LaTeX so powerful and so stable for long documents.
Option 1: LaTeX online with Overleaf (recommended to start)
The simplest way to get started with LaTeX without any installation: Overleaf (overleaf.com).
Overleaf is a LaTeX editor in your browser:
- No installation required
- Automatic compilation: you see the PDF update in near real time
- A library of thesis templates for many universities
- Collaboration possible with your supervisor
Create a free account on overleaf.com and choose New Project > Blank Project to start, or Templates > Thesis to start from a template.
When to switch to a local installation? If you often work offline, if your document becomes very long (large projects compile more slowly on Overleaf), or if you prefer a local editor like VS Code.
Option 2: Local installation of LaTeX
On Windows
- Download and install MiKTeX (miktex.org), a lightweight LaTeX distribution with on-demand package installation
- Install TeXstudio (texstudio.org) as an editor, an intuitive interface with autocompletion and built-in preview
On macOS
- Download and install MacTeX (tug.org/mactex), a complete distribution, about 4 GB
- The TeXShop editor is included with MacTeX, or use TeXstudio
On Linux
sudo apt-get install texlive-full # Ubuntu/Debian, complete installation
sudo apt-get install texstudio # TeXstudio editor
Alternative: VS Code + LaTeX Workshop
If you prefer a modern editor, Visual Studio Code with the LaTeX Workshop extension offers an excellent experience: syntax highlighting, automatic compilation, built-in PDF preview, command autocompletion.
Structure of a LaTeX thesis document
Here is the minimal structure of a LaTeX file for a thesis:
\documentclass[12pt, oneside, letterpaper]{memoir}
% Essential packages
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{geometry}
\usepackage{setspace}
\usepackage[style=apa, backend=biber]{biblatex}
% Margin configuration (UdeM example)
\geometry{top=2.5cm, bottom=2.5cm, left=3cm, right=2.5cm}
% Double spacing in the body text
\doublespacing
\addbibresource{references.bib}
\begin{document}
% Preliminary pages (Roman numbering)
\frontmatter
\input{pages/page-titre}
\input{pages/resume}
\tableofcontents
\listoffigures
\listoftables
% Body of the thesis (Arabic numbering)
\mainmatter
\input{chapitres/introduction}
\input{chapitres/revue-litterature}
\input{chapitres/cadre-theorique}
\input{chapitres/methodologie}
\input{chapitres/resultats}
\input{chapitres/discussion}
\input{chapitres/conclusion}
% Bibliography and appendices
\backmatter
\printbibliography
\appendix
\input{annexes/annexe-a}
\end{document}
This main file (main.tex) serves as a skeleton. Each chapter is in its own file, included with \input{}. This modular organization makes navigation easier and lets you compile a chapter on its own.
The essential LaTeX commands for a thesis
Titles and sections
\chapter{Introduction}
\section{Setting the context}
\subsection{Historical context}
\subsubsection{The 1990-2000 period}
Numbering is automatic. Reorganize your chapters without ever renumbering manually.
Text formatting
\textbf{bold text}
\textit{italic text}
\underline{underlined text}
\emph{emphasis: italics within normal text}
Lists
% Unnumbered list
\begin{itemize}
\item First item
\item Second item
\end{itemize}
% Numbered list
\begin{enumerate}
\item First step
\item Second step
\end{enumerate}
Figures
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{figures/figure1}
\caption{Distribution of results by group}
\label{fig:resultats}
\end{figure}
To reference the figure in the text: See Figure \ref{fig:resultats}: LaTeX handles the numbering automatically. Reorganize your chapters and all the references update.
Tables
\begin{table}[h]
\centering
\begin{tabular}{lcc}
\hline
Variable & Group A & Group B \\
\hline
Mean & 72.4 & 68.1 \\
Standard deviation & 8.3 & 9.7 \\
\hline
\end{tabular}
\caption{Descriptive statistics by group}
\label{tab:stats}
\end{table}
Equations (a major asset of LaTeX)
% Equation within the text
The equation $E = mc^2$ is fundamental.
% Numbered equation on a separate line
\begin{equation}
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
\label{eq:gauss}
\end{equation}
If your thesis contains equations, LaTeX has no equal.
Managing your bibliography with BibTeX/BibLaTeX
Creating your .bib file
Each reference in your references.bib file follows this format:
@article{dupont2020,
author = {Dupont, Marie},
title = {Blended learning in the Quebec context},
journal = {Canadian Journal of Education},
year = {2020},
volume = {43},
number = {2},
pages = {112-134},
doi = {10.xxxx/xxxxx}
}
@book{martin2019,
author = {Martin, Jean and Tremblay, Louise},
title = {Qualitative research methodology},
edition = {3},
publisher = {Presses de l'Université de Montréal},
year = {2019}
}
Inserting citations in the text
According to \textcite{dupont2020}, blended learning...
Several studies confirm this result \parencite{martin2019, jones2022}.
Tip: export from Zotero
Do not enter your references manually in the .bib file. Zotero can automatically export your library in BibTeX format. Import the .bib file into your project and link it with \addbibresource{references.bib}.
Customizing common settings
Margins:
\geometry{top=2.5cm, bottom=2.5cm, left=3.5cm, right=2.5cm}
Font:
\usepackage{times} % Times New Roman
% or
\usepackage{lmodern} % Latin Modern (LaTeX default, very clean)
Spacing:
\usepackage{setspace}
\doublespacing % Double spacing (standard for theses)
\onehalfspacing % 1.5 spacing (sometimes accepted)
Table of contents, display depth:
\setcounter{tocdepth}{3} % Display down to sub-subsections
\setcounter{secnumdepth}{3} % Number down to sub-subsections
Common beginner mistakes
Unclosed brace. If LaTeX does not compile, look at the first error in the log. A brace { opened without being closed is the most frequent cause.
Special characters. The characters %, $, &, #, _, {, } have special meanings in LaTeX. To display them, use \%, \$, \&, \#, \_.
Accents not displayed. Add to the preamble:
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
Images not found. Check that the image file is in the right folder and that the extension is correct (.pdf, .png, .jpg). LaTeX prefers PDF for vector images (graphics, diagrams).
Cross-references ??. LaTeX needs two compilation passes to resolve references (\ref, \cite). Compile twice in a row if you see ??.
Incomplete table of contents. If sections are missing from the table of contents, check the \tableofcontents command and compile twice.
Compliance with university standards
A good LaTeX file does not automatically guarantee compliance with your university’s specific standards. Each institution has its own requirements on margins, fonts, pagination and the format of the title page.
Uniformat provides LaTeX templates aligned with Quebec university standards and automatically checks your document’s compliance before the official submission, whether you are starting out with LaTeX or are an advanced user.
Download the Uniformat LaTeX template →
In summary: the steps to get started
| Step | Action |
|---|---|
| 1 | Choose between Overleaf (online) or a local installation |
| 2 | Create a project with a thesis template suited to your university |
| 3 | Organize your files: one .tex file per chapter |
| 4 | Learn the basic commands: \chapter, \section, \textbf, \cite |
| 5 | Connect Zotero to export your bibliography in BibTeX |
| 6 | Compile regularly to catch errors early |
| 7 | Check compliance with Uniformat before submission |
LaTeX requires an initial investment, but the gains on a 200-page thesis are considerable: automatic numbering, a table of contents that is always up to date, a flawless bibliography, professional typographic quality. Go for it.
For the compliance of your LaTeX thesis with university standards, visit uniformat.ca.