Articles LaTeX tutorial

LaTeX for Beginners: Your Complete Guide to Getting Started

A practical LaTeX beginner guide: install LaTeX, write your first document, and learn the commands, math, citations, and packages you actually use in academic writing.

inscrive.io · Jan 30, 2025 · 14 min read
LaTeX for Beginners: Your Complete Guide to Getting Started

LaTeX for Beginners: Your Complete Guide to Getting Started

LaTeX (pronounced “Lay-tech” or “Lah-tech”) is a document preparation system that has become the default for academic and scientific writing. It looks intimidating on day one. Give it a weekend and it starts to feel less like fighting a tool and more like working with one. This LaTeX beginner guide walks you from installation through your first real document, covering the commands you’ll actually use for research papers, theses, and anything heavy on math.

What is LaTeX and Why Should You Learn It?

LaTeX is a markup language that separates content from formatting. You write the words and structure; the system handles layout, spacing, and typography. That split is the whole point. In a word processor you nudge margins and fonts by hand. In LaTeX you describe what something is (a section, an equation, a citation) and let the engine render it consistently.

Here is what you get in return for the learning curve:

  • Publication-quality output with consistent formatting across a whole document
  • Math typesetting that no word processor comes close to
  • Automatic numbering for sections, figures, tables, and references
  • Plain-text source that works with Git and other version control
  • Citations and bibliographies managed from a structured file, not copied by hand

The trade-off is real. You compile to see results, errors can be cryptic, and the first hour is humbling. Most people find it pays off by the second or third document.

Getting Started: Your First LaTeX Document

Step 1: Install LaTeX

You need two things: a TeX distribution (the engine and packages) and an editor.

For Windows:

  1. Install MiKTeX
  2. Install an editor like TeXstudio

For macOS:

  1. Install MacTeX
  2. Use TeXstudio, or an online editor

For Linux:

sudo apt install texlive-full
sudo apt install texstudio

A full TeX install is several gigabytes. If disk space is tight, or you just want to skip setup entirely, a browser-based editor compiles in the cloud and needs nothing local. More on that at the end.

Step 2: Create Your First Document

Create a file named first-document.tex:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{geometry}

% Page setup
\geometry{
  left=2.5cm,
  right=2.5cm,
  top=2.5cm,
  bottom=2.5cm
}

\begin{document}

\title{My First LaTeX Document}
\author{Your Name}
\date{\today}
\maketitle

\section{Introduction}
This is my first LaTeX document. I'm learning how to create professional documents.

\section{What I've Learned}
LaTeX is a powerful tool for creating:
\begin{itemize}
  \item Research papers
  \item Theses and dissertations
  \item Technical reports
  \item Mathematical documents
\end{itemize}

\section{Conclusion}
I'm excited to learn more about LaTeX and create better documents.

\end{document}

Step 3: Compile Your Document

  1. Save the file with a .tex extension
  2. Compile from your editor, or run:
    pdflatex first-document.tex
  3. Open the generated PDF

If it errors, read the first error message, not the last. The first one usually points at the real problem.

Essential LaTeX Commands and Structure

Document Structure

Every LaTeX document has the same skeleton:

\documentclass{article}  % Document class declaration
\usepackage{package}     % Package imports (the preamble)
\begin{document}         % Content begins
% Your content here
\end{document}           % Content ends

Everything between \documentclass and \begin{document} is the preamble. That is where packages and settings go.

Common Document Classes

  • article: research papers and short documents
  • report: longer documents with chapters
  • book: books and many theses
  • beamer: presentations

Basic Formatting Commands

% Text formatting
\textbf{bold text}           % Bold
\textit{italic text}         % Italic
\underline{underlined text}  % Underlined
\texttt{monospace text}      % Monospace font

% Section commands
\section{Section Title}       % Numbered section
\subsection{Subsection}       % Numbered subsection
\subsubsection{Subsubsection} % Numbered subsubsection

% Lists
\begin{itemize}              % Bullet list
  \item First item
  \item Second item
\end{itemize}

\begin{enumerate}            % Numbered list
  \item First item
  \item Second item
\end{enumerate}

% Spacing
\newpage                     % Start new page
\\                           % Line break
\vspace{1cm}                 % Vertical space
\hspace{1cm}                 % Horizontal space

Mathematical Expressions

LaTeX’s math typesetting is the reason many people switch in the first place. For deeper coverage, see LaTeX Math Mode Mastery.

Inline Math

Single dollar signs put math inside a line of text:

The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.

Display Math

For an equation on its own line, the amsmath packages prefer \[ ... \]:

The quadratic formula is:
\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]

Equation Environment

When you need a numbered equation you can reference later:

\begin{equation}
E = mc^2
\end{equation}

Common Mathematical Symbols

% Greek letters
\alpha, \beta, \gamma, \delta, \epsilon

% Mathematical operators
\pm, \mp, \times, \div, \cdot
\leq, \geq, \neq, \approx, \equiv

% Subscripts and superscripts
x^2, x_1, x_{i,j}, x^{n+1}

% Fractions and roots
\frac{a}{b}, \sqrt{x}, \sqrt[n]{x}

% Sums and integrals
\sum_{i=1}^{n} x_i
\int_{a}^{b} f(x) \, dx

A note on Greek letters: there is no \Alpha or \Beta command, because uppercase alpha and beta look identical to Latin A and B. Just type A and B. Uppercase Greek that differs from Latin (\Gamma, \Delta, \Sigma) does have commands.

A Few Worked Examples

% Matrix (needs amsmath)
\begin{bmatrix}
a & b & c \\
d & e & f \\
g & h & i
\end{bmatrix}

% Aligned equations
\begin{align}
y &= mx + b \\
  &= 2x + 3
\end{align}

% Piecewise function
f(x) = \begin{cases}
x^2 & \text{if } x > 0 \\
0 & \text{if } x = 0 \\
-x^2 & \text{if } x < 0
\end{cases}

These environments need \usepackage{amsmath} in your preamble.

Citations and Bibliography

LaTeX manages citations from a structured .bib file, so you number and format references once and never renumber by hand. For the full picture, see LaTeX Bibliography Management.

Basic Citations

% In your document
According to Einstein \cite{einstein1905}, energy equals mass times the speed of light squared.

% Bibliography
\bibliographystyle{plain}
\bibliography{references}

BibTeX File (references.bib)

@article{einstein1905,
  title={On the electrodynamics of moving bodies},
  author={Einstein, Albert},
  journal={Annalen der Physik},
  volume={322},
  number={10},
  pages={891--921},
  year={1905},
  publisher={Wiley Online Library}
}

@book{lamport1994,
  title={LaTeX: A document preparation system},
  author={Lamport, Leslie},
  year={1994},
  publisher={Addison-Wesley}
}

Citation Styles

\bibliographystyle{plain}    % Standard
\bibliographystyle{ieeetran} % IEEE
\bibliographystyle{apalike}  % APA-like

Figures and Tables

Including Images

\usepackage{graphicx}  % Add this to the preamble

% In your document
\begin{figure}[h]
\centering
\includegraphics[width=0.8\textwidth]{image.png}
\caption{A sample image}
\label{fig:sample}
\end{figure}

% Reference the figure
Figure~\ref{fig:sample} shows a sample image.

The tilde in Figure~\ref{...} is a non-breaking space. It keeps “Figure” and the number from splitting across a line break. Small habit, cleaner output.

Creating Tables

\begin{table}[h]
\centering
\begin{tabular}{|l|c|r|}
\hline
\textbf{Left} & \textbf{Center} & \textbf{Right} \\
\hline
Data 1 & Data 2 & Data 3 \\
\hline
\end{tabular}
\caption{A sample table}
\label{tab:sample}
\end{table}

For tables in real papers, drop the vertical lines and use booktabs:

\usepackage{booktabs}  % In the preamble

\begin{table}[h]
\centering
\begin{tabular}{lcc}
\toprule
\textbf{Variable} & \textbf{Mean} & \textbf{Std Dev} \\
\midrule
Age & 25.3 & 4.2 \\
Height & 170.5 & 8.1 \\
Weight & 65.2 & 12.3 \\
\bottomrule
\end{tabular}
\caption{Descriptive statistics}
\label{tab:stats}
\end{table}

Cross-References and Labels

Label things once, reference them anywhere, and let LaTeX keep the numbers correct:

\section{Methodology}\label{sec:methodology}

As discussed in Section~\ref{sec:methodology}, our approach...

\begin{figure}[h]
\centering
\includegraphics[width=0.6\textwidth]{results.png}
\caption{Experimental Results}\label{fig:results}
\end{figure}

Figure~\ref{fig:results} shows our experimental results.

Insert a figure halfway through and every later number updates itself. That alone saves hours over a thesis.

Essential Packages

Packages extend what LaTeX can do. A starter set for most documents:

\usepackage[utf8]{inputenc}    % Character encoding
\usepackage[T1]{fontenc}       % Font encoding
\usepackage{geometry}          % Page layout
\usepackage{graphicx}          % Images
\usepackage{amsmath}           % Advanced math
\usepackage{amssymb}           % Math symbols
\usepackage{natbib}            % Bibliography
\usepackage{hyperref}          % Hyperlinks
\usepackage{booktabs}          % Better tables
\usepackage{xcolor}            % Colors

A couple of common configurations:

\usepackage[margin=1in]{geometry}
\usepackage[colorlinks=true,linkcolor=blue,citecolor=green]{hyperref}

Load hyperref last, or near last. It patches a lot of internals and tends to conflict when loaded early. For a guided tour of what to add and when, see Essential LaTeX Packages.

Custom Commands

Once you type the same thing repeatedly, define a shortcut:

\newcommand{\todo}[1]{\textcolor{red}{[TODO: #1]}}
\newcommand{\R}{\mathbb{R}}

% Usage
This needs work \todo{Add more detail}.
The function $f: \R \to \R$ is continuous.

Custom commands also future-proof your notation. Change one definition and every use updates.

Troubleshooting Common Issues

A few errors you will meet early:

! LaTeX Error: File 'package.sty' not found. The package isn’t installed. Install it through your distribution’s package manager, or switch to a cloud editor where packages are already there.

! Undefined control sequence. A misspelled command, or a command from a package you forgot to load. Check the spelling first.

! Missing $ inserted. You used math like x_1 or \alpha outside math mode. Wrap it in dollar signs: $x_1$.

When stuck, comment out half the document to find which half breaks. Binary search beats squinting at line numbers.

Learning Resources

Where to Write Without the Setup Hassle

If installing a multi-gigabyte distribution feels like a lot just to try LaTeX, you can write and compile in the browser instead. inscrive.io is a collaborative online LaTeX editor with a free tier (€0, no credit card) that covers up to 10 active projects, unlimited collaborators, PDF export, templates, and a 60-second compile window. Nothing to install, and packages are already available, so the “file not found” errors above mostly disappear.

It is built and hosted in the EU, with data on Hetzner servers in Germany and Finland under ISO 27001 certification, which matters if your institution has GDPR or data-residency requirements. If you outgrow the free tier, Pro is €7/month and bumps compile time to 480 seconds plus AI-suggested fixes for compile errors. Either way, real-time collaboration means you and a co-author edit the same document at once, no merge conflicts.

Starting out, the basics here carry you a long way. Write a short document, add a few equations, include a figure, then keep going. For a side-by-side of the browser-based options, see Online LaTeX Editors Compared.

Want to skip installation entirely? Try inscrive.io and start writing for free.

Sign up for our newsletter

Roadmap progress, announcements and exclusive discounts — straight to your inbox.

We care about the protection of your data. Read our privacy policy.