LaTeX Basics

LaTeX is a document preparation system widely used for academic and technical documents. Here's a quick introduction to get you started.

Document Structure

Every LaTeX document starts with a preamble and a document body:

\documentclass{article}

% Preamble - packages and settings go here
\usepackage{graphicx}

\begin{document}

% Your content goes here
Hello, World!

\end{document}

Common Commands

Text Formatting

\textbf{Bold text}
\textit{Italic text}
\underline{Underlined text}
\texttt{Monospace text}

Sections

\section{Introduction}
\subsection{Background}
\subsubsection{Details}

Lists

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

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

Math

% Inline math
The equation $E = mc^2$ is famous.

% Display math
\[
  \int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
\]

Images

\usepackage{graphicx}  % in preamble

\begin{figure}[h]
  \centering
  \includegraphics[width=0.8\textwidth]{image.png}
  \caption{My figure caption}
  \label{fig:myfigure}
\end{figure}

Tables

\begin{table}[h]
  \centering
  \begin{tabular}{|l|c|r|}
    \hline
    Left & Center & Right \\
    \hline
    A & B & C \\
    \hline
  \end{tabular}
  \caption{My table}
\end{table}

Common Packages

  • graphicx: For including images
  • amsmath: Enhanced math support
  • hyperref: Clickable links and references
  • geometry: Page layout control
  • biblatex: Bibliography management

Learn More

For comprehensive LaTeX documentation, visit Overleaf's Learn LaTeX or the LaTeX Wikibook.