How to Use LaTeX on Overleaf: A Beginner’s Guide
Português: Leia este tutorial em português.
Overleaf is one of the easiest ways to start using LaTeX. It runs in your browser, compiles documents in the cloud, and requires no local installation. In this guide, you will create a project, understand the basic structure of a .tex file, and learn how to solve common errors.
What is Overleaf?
Overleaf is a collaborative LaTeX editor. Your source code appears on the left and the generated PDF on the right. Projects can be organized into folders, shared with collaborators, and compiled with different LaTeX engines.
Create your first project
- Go to overleaf.com and sign in.
- Click New Project and choose Blank Project.
- Give the project a clear name, such as my-first-document.
- Open
main.tex, replace its content with the example below, and click Recompile.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\title{My First LaTeX Document}
\author{Your Name}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
Hello, world! This is my first document.
\section{An Equation}
The Pythagorean relation is
\[
a^2+b^2=c^2.
\]
\end{document}
Understand the file structure
\documentclassdefines the type of document.\usepackagecommands add features, fonts, and languages.- Visible content belongs between
\begin{document}and\end{document}. \sectionand\subsectioncreate a consistent hierarchy.
Choose a compiler
Overleaf supports pdfLaTeX, XeLaTeX, and LuaLaTeX. pdfLaTeX is a reliable choice for traditional documents. XeLaTeX and LuaLaTeX are usually better for system fonts and extensive Unicode support.
Common beginner errors
Undefined control sequence
Check the command spelling and make sure the required package has been loaded.
Missing braces or an unclosed environment
Every opening brace needs a closing brace, and every \begin{...} needs the matching \end{...}. Start with the first error in the log.
File not found
Check the filename, extension, and folder. Avoid spaces and special characters in filenames.
Good Overleaf practices
- Separate chapters, images, and references into organized files or folders.
- Use short, lowercase filenames without spaces.
- Compile after small changes so errors are easier to locate.
- Review version history before major changes.
- Grant editing access only to the collaborators who need it.
Next step: practice with a small project, then explore the TexDrop LaTeX templates to start from a professional structure.