Learn how to insert, scale, and format images in LaTeX documents. Covers supported formats, the graphicx package, and image customization.
\usepackage{graphicx}
in your preamble to work with images.Related topics: Figure positioning | Table creation | Package managementCompiler | Formats Supported |
---|---|
pdfLaTeX | PDF, PNG, JPG/JPEG |
XeLaTeX | PDF, PNG, JPG/JPEG, EPS* |
LuaLaTeX | PDF, PNG, JPG/JPEG, EPS* |
LaTeX (DVI) | EPS, PS |
Option | Meaning | Priority |
---|---|---|
h | Here (approximately) | Low |
t | Top of page | Medium |
b | Bottom of page | Medium |
p | Page of floats | Low |
H | HERE (exactly)* | Forced |
! | Override LaTeX’s rules | Modifier |
\usepackage{float}
\textwidth
[htbp]
for flexible positioning\usepackage{graphicx}
Command | Purpose | Example |
---|---|---|
\includegraphics{} | Insert image | \includegraphics{pic} |
width= | Set width | width=5cm |
height= | Set height | height=3cm |
scale= | Scale factor | scale=0.5 |
angle= | Rotate | angle=90 |
\caption{} | Add caption | \caption{Description} |
\label{} | Add reference | \label{fig:name} |