2.3 Million Researchers Can't Be Wrong
According to Overleaf, over 2.3 million researchers use LaTeX. There's a reason for that: it produces documents that look like they were typeset by professionals, because they were—by software designed specifically for scientific publishing.
But here's what nobody tells beginners: LaTeX isn't hard. It's just different.
You've probably heard horror stories about cryptic error messages and steep learning curves. Ignore them. By the end of this article, you'll have written your first LaTeX document. It'll take about 15 minutes, and you'll wonder why you waited so long.
What Makes LaTeX Different
In Word or Google Docs, you format as you write. You click a button to make text bold, you manually adjust spacing, you fight with figure placement.
In LaTeX, you describe what you want, and the system handles the formatting:
\textbf{This is bold}
\textit{This is italic}
\section{This creates a section heading}This separation of content and presentation means:
- Consistent formatting throughout your document
- Automatic numbering of sections, figures, equations, and tables
- Perfect typography without manual tweaking
- Easy restructuring without reformatting everything
- Beautiful mathematics that Word cannot match
Why Researchers Choose LaTeX
Before diving into how, let's understand why:
Professional Appearance
LaTeX documents look publication-ready because the same typesetting engine is used by major journals. The typography algorithms were designed by computer scientists and mathematicians who cared deeply about how documents look.
Mathematics
This is where LaTeX truly shines. Compare these two equations:
Word equation editor: basic, cramped, often inconsistent sizing
LaTeX: elegant spacing, proper sizing, beautiful symbols
The difference is immediately visible, which is why math-heavy fields universally use LaTeX.
Automation
- Number sections, figures, tables, and equations automatically
- Update numbering when you reorder content
- Generate table of contents, lists of figures/tables automatically
- Cross-reference elements that update if you move them
Collaboration
LaTeX files are plain text:
- Track changes with Git like source code
- Merge contributions from multiple authors
- Comment and review with any text tool
- No compatibility issues between software versions
Your First Document
Let's create a simple document. Every LaTeX document has the same basic structure:
\documentclass{article}
\begin{document}
Hello, LaTeX!
\end{document}That's it. Three lines for a complete document. Let's break it down:
\documentclass{article}tells LaTeX what type of document you're creating\begin{document}marks where your content starts\end{document}marks where it ends
Everything between \begin{document} and \end{document} is your content. Try typing this into Thetapad or any LaTeX editor and compiling—you'll see "Hello, LaTeX!" appear in the PDF output.
Adding Structure
Real documents need more structure. Let's add a title and some sections:
\documentclass{article}
\title{My First LaTeX Document}
\author{Your Name}
\date{\today}
\begin{document}
\maketitle
\section{Introduction}
This is my first section. LaTeX will automatically number it.
\section{Methods}
This section comes next. Notice how the numbering is automatic.
\subsection{Data Collection}
Subsections are numbered automatically too (2.1, 2.2, etc.).
\subsection{Analysis}
Another subsection, automatically numbered as 2.2.
\section{Results}
Results go here. This becomes Section 3.
\end{document}When you compile this, LaTeX creates a properly formatted document with:
- A centered title block with title, author, and date
- Numbered sections (1, 2, 3)
- Numbered subsections (2.1, 2.2)
- Consistent spacing and fonts throughout
Basic Text Formatting
Here are the text formatting commands you'll use most often:
\textbf{Bold text}
\textit{Italic text}
\underline{Underlined text}
\texttt{Monospace text} % good for code or filenames
% Combine them:
\textbf{\textit{Bold and italic}}
% Emphasis (italics in normal text, upright in italic context)
\emph{Emphasized text}Paragraphs and Line Breaks
LaTeX handles paragraph spacing automatically:
This is the first paragraph. You just keep typing,
and LaTeX will format it properly.
Leave a blank line to start a new paragraph. LaTeX
adds appropriate spacing between paragraphs.
To force a line break without a new paragraph,\\
use double backslash. But this is rarely needed.Lists
LaTeX makes lists easy:
% Bullet points (unordered list)
\begin{itemize}
\item First item
\item Second item
\item Third item
\end{itemize}
% Numbered list (ordered list)
\begin{enumerate}
\item First step
\item Second step
\item Third step
\end{enumerate}
% Nested lists
\begin{itemize}
\item Main point
\begin{itemize}
\item Sub-point one
\item Sub-point two
\end{itemize}
\item Another main point
\end{itemize}Your First Equation
This is where LaTeX really shines. Here's the famous mass-energy equivalence:
Einstein's equation: $E = mc^2$The dollar signs create inline math mode—the equation appears within your text.
For displayed equations (centered on their own line):
The relationship is given by:
\begin{equation}
E = mc^2
\end{equation}This centers the equation and numbers it automatically (Equation 1, Equation 2, etc.).
Common Math Symbols
| What you want | What you type | Result |
|---------------|---------------|--------|
| Fraction | \frac{a}{b} | a/b (properly stacked) |
| Square root | \sqrt{x} | √x |
| Superscript | x^2 | x² |
| Subscript | x_i | xᵢ |
| Greek letters | \alpha, \beta, \gamma | α, β, γ |
| Sum | \sum_{i=1}^{n} | Σ with limits |
| Integral | \int_{0}^{\infty} | ∫ with limits |
| Not equal | \neq | ≠ |
| Less/greater or equal | \leq, \geq | ≤, ≥ |
A More Complex Example
\begin{equation}
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
\end{equation}This produces a beautifully typeset Gaussian integral. Notice how LaTeX handles the spacing around the integral symbol, the sizing of the limits, and the fraction automatically.
Adding Packages
Packages extend LaTeX's capabilities. Add them in the preamble (before \begin{document}):
\documentclass{article}
\usepackage{amsmath} % Better math support
\usepackage{graphicx} % Include images
\usepackage{hyperref} % Clickable links
\begin{document}
% Your content here
\end{document}Essential packages for beginners:
| Package | Purpose |
|---------|---------|
| amsmath | Advanced math features (align, matrices, etc.) |
| graphicx | Including images and figures |
| hyperref | Clickable links and cross-references |
| geometry | Customize page margins |
| setspace | Control line spacing |
| booktabs | Better-looking tables |
Most LaTeX editors (including Thetapad) have common packages pre-loaded or auto-load them when needed.
Including Images
With the graphicx package loaded:
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{myimage.png}
\caption{Description of the figure}
\label{fig:myfigure}
\end{figure}Breaking this down:
\begin{figure}[h]starts a figure environment;[h]suggests placing it "here"\centeringcenters the figure horizontally\includegraphicsinserts the image;width=0.8\textwidthscales to 80% of text width\caption{}adds a numbered caption below the figure\label{}creates a reference name so you can refer to it later
Referencing the figure:
As shown in Figure \ref{fig:myfigure}, the results indicate...LaTeX automatically updates the figure number if you reorder figures.
Placement Options
The [h] in \begin{figure}[h] is a placement hint:
| Option | Meaning |
|--------|---------|
| h | Here (approximately) |
| t | Top of page |
| b | Bottom of page |
| p | On a separate page of floats |
| ! | Override internal limits, try harder |
| H | Exactly here (requires float package) |
Combine them: [htbp] means "try here, then top, then bottom, then separate page."
Tables
Tables use the tabular environment:
\begin{table}[h]
\centering
\begin{tabular}{lcc}
\hline
Name & Score & Grade \\
\hline
Alice & 95 & A \\
Bob & 87 & B \\
Carol & 92 & A \\
\hline
\end{tabular}
\caption{Student grades for the course}
\label{tab:grades}
\end{table}The column specifier {lcc} means:
l= left-aligned columnc= centered columnr= right-aligned column|= vertical line between columns (use sparingly)
For better-looking tables, use the booktabs package:
\usepackage{booktabs}
\begin{tabular}{lcc}
\toprule
Name & Score & Grade \\
\midrule
Alice & 95 & A \\
Bob & 87 & B \\
Carol & 92 & A \\
\bottomrule
\end{tabular}Comments
Comments help you organize your document and leave notes:
% This is a comment - LaTeX ignores it
Some visible text. % Comment at end of line
% You can comment out sections temporarily:
% \section{Deleted Section}
% This won't appear in the output.Use comments to:
- Leave notes for yourself or collaborators
- Temporarily remove content without deleting it
- Explain complex commands
- Mark sections that need revision
Cross-References
One of LaTeX's most powerful features is automatic cross-referencing:
\section{Introduction}
\label{sec:intro}
As discussed in Section \ref{sec:methods}...
\section{Methods}
\label{sec:methods}
Refer back to Section \ref{sec:intro}...This works for:
- Sections:
\ref{sec:label} - Equations:
\eqref{eq:label}(adds parentheses) - Figures:
\ref{fig:label} - Tables:
\ref{tab:label}
If you reorder sections or figures, all references update automatically.
Common Beginner Mistakes
1. Missing Braces
% Wrong - braces required
\textbf Bold text
% Right - text goes inside braces
\textbf{Bold text}2. Unescaped Special Characters
These characters have special meaning and need backslash escaping:
% These cause errors without backslash:
10% of users % Wrong
10\% of users % Right
$500 % Wrong (starts math mode)
\$500 % Right
Smith & Jones % Wrong (column separator)
Smith \& Jones % RightSpecial characters requiring escape: % $ & # _ { }
3. Forgetting to Compile Twice
For cross-references and citations to work, you often need to compile twice (or use a tool that does this automatically):
- First compile: LaTeX notes where labels are
- Second compile: LaTeX fills in the references
Most modern editors handle this automatically.
4. Spaces After Commands
LaTeX eats spaces after commands. Use braces or backslash-space:
\LaTeX is great % No space after "LaTeX"
\LaTeX{} is great % Space preserved
\LaTeX\ is great % Space preserved5. Wrong Quote Marks
"Wrong quotes" % These look bad in output
``Right quotes'' % Use backticks for open, apostrophes for closeModern editors often convert quotes automatically.
A Complete Example
Here's a complete document incorporating everything we've learned:
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\title{Introduction to Quantum Computing}
\author{Jane Researcher}
\date{December 2025}
\begin{document}
\maketitle
\begin{abstract}
This paper introduces the fundamental concepts of quantum computing,
including qubits, superposition, and entanglement.
\end{abstract}
\section{Introduction}
\label{sec:intro}
Quantum computing represents a fundamental shift in how we process
information. Unlike classical computers that use bits, quantum computers
use quantum bits, or \textit{qubits}.
\section{Basic Concepts}
\label{sec:concepts}
\subsection{Qubits}
Unlike classical bits, qubits can exist in \textit{superposition}:
\begin{equation}
|\psi\rangle = \alpha|0\rangle + \beta|1\rangle
\label{eq:superposition}
\end{equation}
where $|\alpha|^2 + |\beta|^2 = 1$. This property, expressed in
Equation \ref{eq:superposition}, enables quantum parallelism.
\subsection{Key Properties}
Quantum computers leverage several key properties:
\begin{itemize}
\item Superposition
\item Entanglement
\item Interference
\end{itemize}
\section{Applications}
Quantum computing has applications in:
\begin{enumerate}
\item Cryptography
\item Drug discovery
\item Optimization problems
\end{enumerate}
\section{Conclusion}
Quantum computing will transform computational science.
See Section \ref{sec:concepts} for the fundamental concepts.
\end{document}Next Steps
You've learned the fundamentals. Here's how to continue:
Immediate Next Steps
- Practice - Write a short document using what you've learned
- Experiment - Try different formatting options and see what happens
- Make mistakes - Error messages teach you how LaTeX works
Building Your Skills
- Learn citations - Add a bibliography with BibTeX or BibLaTeX
- Explore packages - Find packages specific to your field
- Try templates - Use journal or thesis templates
- Master math - If you write equations, learn advanced math mode
Recommended Resources
- This blog's other tutorials (continue the series)
- Overleaf's documentation (comprehensive reference)
- TeX Stack Exchange (questions and answers)
- Your field's template files (learn by example)
Getting Help
When you're stuck:
- Read the error message - It tells you the line number; start there
- Search the error - Copy the error message into a search engine
- Check for typos - Missing braces and misspelled commands are common
- Simplify - Remove content until it works, then add back piece by piece
- Ask for help - TeX Stack Exchange is friendly to beginners
Conclusion
LaTeX has a learning curve, but it's worth climbing. The time you invest now pays dividends across every paper, thesis, and report you'll write.
You've learned:
- Document structure with
\documentclass,\begin{document}, and\end{document} - Sections, subsections, and automatic numbering
- Text formatting with
\textbf,\textit, and friends - Lists with
itemizeandenumerate - Mathematical equations in inline and display modes
- Adding packages for extended functionality
- Including images and creating figures
- Building tables with
tabular - Cross-referencing sections, figures, and equations
- Common mistakes and how to avoid them
That's a lot for 15 minutes. Welcome to LaTeX!
Ready to write? Thetapad lets you start immediately with no installation. Just open your browser and begin.