Home

includegraphicswidthlinewidthimage2

Includegraphics is a command provided by the LaTeX graphicx package used to insert images into a document. The command is written as \includegraphics[options]{filename}, where options is a comma-separated list of optional arguments and filename is the image file path. To use it, the graphicx package must be loaded in the preamble with \usepackage{graphicx}. If no extension is supplied, LaTeX will search for files with common image formats supported by the active engine.

Common options control size, rotation, and cropping. For example, \includegraphics[width=\textwidth]{image.png} scales the image to the text

Usage within a figure environment allows a caption and a label for cross-referencing, while inline use places

width,
and
\includegraphics[scale=0.5]{image}
reduces
its
size
by
half.
The
keepaspectratio
option
preserves
the
aspect
ratio
when
multiple
size
specifications
are
provided.
The
trim
and
clip
options
can
crop
the
displayed
region
by
specifying
left,
bottom,
right,
and
top
margins.
the
image
at
the
current
text
position.
The
command
works
with
engines
such
as
pdflatex,
xelatex,
and
lualatex
and
supports
formats
including
PDF,
PNG,
and
JPG.
Common
pitfalls
include
spaces
in
filenames,
incorrect
paths,
and
forgetting
to
load
the
graphicx
package.