LaTeX Media & Figures Importing Images with graphicx

Importing Images with graphicx

AS
Aman Saurav
| Jan 22, 2025 |
6 min read
#images #figures

To include external images (PNG, JPG, PDF) in your document, the graphicx package is essential.

Setup

\usepackage{graphicx}
\graphicspath{ {./images/} }

The Figure Environment

To make an image “float” to the best position (usually top or bottom of a page), wrap it in a figure environment.

  1. Begin the figure.
  2. Center it.
  3. Include the graphics.
  4. Add a caption.
  5. Add a label.
\begin{figure}[h]
    \centering
    \includegraphics[width=0.5\textwidth]{cat}
    \caption{A cute cat}
    \label{fig:cat}
\end{figure}

Example Result

Below is an example of how a figure appears in a final PDF:

LaTeX Figure Example
LaTeX Figure Example

Tutorial

How to Insert Images in LaTeX