Catalog / LaTeX Cheat Sheet

LaTeX Cheat Sheet

A concise reference for LaTeX markup and formatting, covering essential commands and environments for document creation.

Basic Document Structure

Document Setup

\documentclass{article} - Specifies the document class (e.g., article, report, book).

Options:

  • 10pt, 11pt, 12pt - Font size.
  • letterpaper, a4paper - Paper size.
  • twocolumn - Two-column layout.

\usepackage{package_name} - Includes a package for extended functionality (e.g., amsmath, graphicx).

\title{Document Title} - Sets the document title.

\author{Your Name} - Sets the document author.

\date{Date} - Sets the document date. Use \date{} for no date.

\begin{document} - Begins the document environment.

\maketitle - Generates the title.

\end{document} - Ends the document environment.

Sectioning

\section{Section Title} - Creates a section.

\subsection{Subsection Title} - Creates a subsection.

\subsubsection{Subsubsection Title} - Creates a subsubsection.

\paragraph{Paragraph Title} - Creates a paragraph.

\subparagraph{Subparagraph Title} - Creates a subparagraph.

Text Formatting

Font Styles

\textbf{text}

Bold text.

\textit{text}

Italic text.

\underline{text}

Underlined text.

\texttt{text}

Typewriter text (monospace).

\textsc{text}

Small caps.

\emph{text}

Emphasis (usually italic).

\textnormal{text}

Normal font style.

Lists

\begin{itemize}
  \item Item 1
  \item Item 2
\end{itemize}

Unordered list.

\begin{enumerate}
  \item Item 1
  \item Item 2
\end{enumerate}

Ordered list.

\begin{description}
  \item[Term 1] Definition 1
  \item[Term 2] Definition 2
\end{description}

Description list.

Math Mode

Inline Math

$ ... $ - Inline math mode.

Example:
The equation y = mx + b represents a line.

\( ... \) - Another way to denote inline math mode.

Example:
The formula (E = mc^2) is famous.

Display Math

\[ ... \] - Display math mode (equation on a separate line).

Example:
[ \int_{-\infty}{\infty} e{-x^2} dx = \sqrt{\pi} ]

\begin{equation} ... \end{equation} - Numbered equation.

Example:

\begin{equation}
  x^2 + y^2 = r^2
\end{equation}

\begin{align} ... \end{align} - Align multiple equations (requires amsmath package).

Example:

\begin{align}
  a &= b + c \\
  d &= e + f
\end{align}

\begin{gather} ... \end{gather} - Use gather environment to group equations without alignment.

Example:

\begin{gather}
  a = b + c \\
  d = e + f
\end{gather}

Math Symbols

\alpha, \beta, \gamma, \delta

Greek letters.

\pm, \times, \div

Math operators.

\leq, \geq, \neq

Inequality symbols.

\infty, \nabla, \partial

Other symbols.

\sum, \int, \lim

Summation, integral, limit.

\frac{num}{den}

Fraction.

\sqrt{x}

Square root.

x^{y}

Superscript.

x_{y}

Subscript.

Figures and Tables

Figures

\begin{figure}[h!]
  \centering
  \includegraphics[width=0.8\textwidth]{image.jpg}
  \caption{Figure caption}
  \label{fig:my_label}
\end{figure}

Includes an image. Requires the graphicx package.

Options for figure environment:

  • h - Place here.
  • t - Place at the top of the page.
  • b - Place at the bottom of the page.
  • p - Place on a separate page.

Tables

\begin{table}[h!]
  \centering
  \begin{tabular}{|c|c|c|}
    \hline
    Header 1 & Header 2 & Header 3 \\
    \hline
    Cell 1 & Cell 2 & Cell 3 \\
    Cell 4 & Cell 5 & Cell 6 \\
    \hline
  \end{tabular}
  \caption{Table caption}
  \label{tab:my_label}
\end{table}

Creates a table.

Column specifiers in tabular environment:

  • c - Centered.
  • l - Left-aligned.
  • r - Right-aligned.
  • | - Vertical line.

\hline - Horizontal line.
\multicolumn{cols}{align}{text} - Cell spanning multiple columns.