Skip to main content
To insert an image in LaTeX, load graphicx and use \includegraphics{...}. Add width or height to resize it, and use trim=left bottom right top,clip to crop unwanted margins.
Quick answer: add \usepackage{graphicx} to the preamble, then write \includegraphics[width=0.8\textwidth]{image-file}. To crop, use \includegraphics[trim=1cm 2cm 1cm 2cm,clip]{image-file}. The trim values are always ordered left, bottom, right, top.Related topics: Figure positioning | Tabular environment | Package management

Common image tasks

Quick Start

Trim and crop images with includegraphics

The trim option removes material from the four edges. Its order is left, bottom, right, top—not the clockwise order that many users expect. Add clip; without it, LaTeX changes the image’s bounding box but can still draw the trimmed material.

Expected output

The PDF shows the cropped image at 80% of the text width. The first example removes material from all four sides; the second removes only the top 12 mm.
LaTeX applies width to the cropped result. Use units such as cm, mm, pt, or bp; four bare numbers are interpreted differently depending on the graphics driver and are easier to misread.
If trim appears to do nothing, check for a missing clip option first. If the wrong edge disappears, verify that the values follow left bottom right top.

Basic Image Insertion

Simple Image Include

Supported Image Formats

*EPS requires additional configuration
Best practices for formats:
  • PDF: Vector graphics, diagrams, plots
  • PNG: Screenshots, images with transparency
  • JPG: Photographs, images without transparency

Scaling Images

Width and Height Control

Common Width References

Figure Environment

Basic Figure

Figure Placement Options

*Requires \usepackage{float}

Multiple Images

Side by Side Images

Grid of Images

Image Transformations

Rotation and Flipping

Advanced Techniques

Wrapping Text Around Images

Image Paths

Draft Mode

Image Formats and Conversion

Working with Different Formats

Best Practices

Image guidelines:
  1. Resolution: Use 300 DPI for print, 96-150 DPI for screen
  2. File size: Optimize images before including them
  3. Formats: Use vector (PDF) for diagrams, raster (PNG/JPG) for photos
  4. Naming: Avoid spaces and special characters in filenames
  5. Organization: Keep images in a dedicated folder
  6. Captions: Always include descriptive captions
  7. References: Label all figures for cross-referencing

Troubleshooting

For path-specific compiler messages, see image and path errors.

Quick Reference

Essential Commands

Figure Template


Next: Master Figure positioning to control exactly where your images appear, or learn about Creating tables for structured data presentation.