Payload LogoOctree

Learn LaTeX

LaTeX is the gold standard for academic and scientific document preparation. This guide will take you from complete beginner to confident LaTeX user.

What is LaTeX?

LaTeX (pronounced "LAY-tek" or "LAH-tek") is a document preparation system widely used in academia, especially for scientific and technical documents. Unlike word processors like Microsoft Word, LaTeX separates content from formatting, allowing you to focus on what you're writing while the system handles how it looks.

Why Use LaTeX?

  • Beautiful Typography – LaTeX produces professionally typeset documents with superior handling of mathematical equations, tables, and figures.
  • Consistency – Document styling is consistent throughout, managed by templates and style files.
  • Cross-references – Automatic numbering of sections, figures, tables, and equations with easy cross-referencing.
  • Bibliography Management – Seamless integration with BibTeX for managing citations and references.
  • Version Control Friendly – Plain text files work perfectly with Git and other version control systems.

Your First LaTeX Document

Every LaTeX document follows a basic structure:

\documentclass{article}

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

\begin{document}

\maketitle

\section{Introduction}
Hello, LaTeX! This is my first document.

\section{Mathematics}
Here's an equation: $E = mc^2$

And a displayed equation:
\[
  \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
\]

\end{document}

Document Classes

LaTeX provides several document classes for different purposes:

  • article – For short documents, journal articles, and reports
  • report – For longer documents with chapters
  • book – For books with front matter, chapters, and back matter
  • beamer – For presentations and slides
  • letter – For formal letters

Essential Packages

Packages extend LaTeX's functionality. Here are some must-haves:

\usepackage{amsmath}    % Advanced math formatting
\usepackage{graphicx}   % Include images
\usepackage{hyperref}   % Clickable links
\usepackage{geometry}   % Page margins
\usepackage{listings}   % Code listings
\usepackage{booktabs}   % Professional tables

Text Formatting

CommandResult
\textbf{bold}bold
\textit{italic}italic
\underline{underline}underline
\texttt{monospace}monospace

Lists

Create bulleted and numbered lists:

% Bulleted list
\begin{itemize}
  \item First item
  \item Second item
  \item Third item
\end{itemize}

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

Mathematical Expressions

LaTeX excels at typesetting mathematics:

% Inline math
The equation $a^2 + b^2 = c^2$ is Pythagoras' theorem.

% Display math
\[
  \sum_{i=1}^{n} i = \frac{n(n+1)}{2}
\]

% Aligned equations
\begin{align}
  f(x) &= x^2 + 2x + 1 \\
       &= (x + 1)^2
\end{align}

Figures and Images

\begin{figure}[htbp]
  \centering
  \includegraphics[width=0.8\textwidth]{image.png}
  \caption{A descriptive caption}
  \label{fig:example}
\end{figure}

% Reference: See Figure~\ref{fig:example}

Tables

\begin{table}[htbp]
  \centering
  \begin{tabular}{lcc}
    \toprule
    Name & Score & Grade \\
    \midrule
    Alice & 95 & A \\
    Bob & 87 & B \\
    Charlie & 92 & A \\
    \bottomrule
  \end{tabular}
  \caption{Student grades}
  \label{tab:grades}
\end{table}

Citations and Bibliography

% In your .bib file:
@article{einstein1905,
  author = {Einstein, Albert},
  title = {On the Electrodynamics of Moving Bodies},
  journal = {Annalen der Physik},
  year = {1905},
  volume = {17},
  pages = {891--921}
}

% In your document:
As shown by Einstein~\cite{einstein1905}...

\bibliographystyle{plain}
\bibliography{references}

Next Steps

Now that you understand the basics, explore more advanced topics:

Ready to start writing?

Try Octree – the AI-powered LaTeX editor that makes writing faster and easier.

Try Octree Free →