Skip to main content
Master the art of including and formatting images in LaTeX documents. This comprehensive guide covers everything from basic image inclusion to advanced layouts, optimization, and professional formatting techniques.
Prerequisites: Basic LaTeX knowledge and the graphicx package
Time to complete: 25-30 minutes
Difficulty: Intermediate
What you’ll learn: Image formats, positioning, sizing, captions, subfigures, wrapping text, and advanced techniques

Understanding Image Basics

Supported Image Formats

LaTeX supports different image formats depending on the compiler:
Supported formats:
  • PDF - Vector graphics, best quality
  • PNG - Lossless compression, good for diagrams
  • JPG/JPEG - Lossy compression, good for photos
  • EPS - With epstopdf package

Basic Image Inclusion

Figure Environments

Basic Figures with Captions

Advanced Caption Formatting

Multiple Images

Side-by-Side Images

Grid Layouts

Text Wrapping

Wrapping Text Around Images

Image Transformations

Scaling and Rotating

Special Effects

Advanced Techniques

Dynamic Image Paths

External Graphics Tools

Optimizing Images

File Size Management

Best practices for image optimization:
  1. Choose the right format:
    • PDF: Vector graphics, diagrams, plots
    • PNG: Screenshots, diagrams with text
    • JPG: Photographs, complex images
  2. Optimize before including:
  3. Use appropriate resolution:
    • Print: 300 DPI
    • Screen: 72-96 DPI
    • Web: 72 DPI

Performance Tips

Troubleshooting

Common Issues and Solutions

Common image problems:
  1. “File not found” errors:
  2. Wrong image size:
  3. Figure placement issues:
  4. Overflow into margins:

Debug Mode

Best Practices Checklist

Image workflow checklist:
  • Choose appropriate file format
  • Optimize file size before inclusion
  • Use relative widths (\textwidth)
  • Always include captions
  • Add meaningful labels
  • Test different positions
  • Check output at final resolution
  • Verify all images are included in repository
  • Use consistent naming convention
  • Document image sources

Complete Example

Next Steps

Now that you’ve mastered image handling:

Creating Tables

Learn to create professional tables

TikZ Graphics

Create diagrams with TikZ

Managing Large Documents

Handle images in multi-file projects

Troubleshooting

Fix common image-related errors

Pro tip: Always keep high-resolution originals of your images. You can create lower-resolution versions for drafts and switch to high-resolution for final output using conditional inclusion.