Home

subfig

Subfig is a LaTeX package that provides support for including multiple subfigures within a single figure environment. It allows each subfigure to have its own caption and label while sharing a common overall caption. The package is commonly loaded with \usepackage{subfig} and is used in conjunction with the standard figure environment. Subfig introduces the \subfloat command, which inserts a subfigure and its caption; additional subfigures can be appended in the same figure to create side-by-side or stacked layouts.

Typical usage involves composing a figure with multiple subfigures, each created by a separate \subfloat entry.

Subfig supports various layout options, enabling side-by-side, stacked, or mixed arrangements of subfigures through width settings

History and status: The subfig package is an older solution for combining subfigures and has been widely

For
example,
within
a
figure
you
might
place
\centering
followed
by
\subfloat[First
subcaption]{\includegraphics[width=0.45\textwidth]{image1}}
\subfloat[Second
subcaption]{\includegraphics[width=0.45\textwidth]{image2}}
and
then
add
a
main
caption
with
\caption{Overall
caption}
and
a
label
with
\label{fig:example}.
Each
subfigure
can
be
referenced
individually
using
its
own
label,
such
as
\label{fig:a},
and
referenced
with
\ref{fig:a}
in
the
text.
and
spacing
adjustments.
It
is
designed
to
work
with
the
caption
mechanism
for
subcaptions
and
labels,
facilitating
precise
cross-referencing
and
consistent
formatting
within
a
document.
used
in
many
documents.
It
is
often
contrasted
with
the
newer
subcaption
package,
which
provides
a
different
interface
and
improved
compatibility
with
modern
caption
handling.
In
some
setups,
loading
order
and
compatibility
with
other
caption-related
packages
may
require
attention.
Despite
these
considerations,
subfig
remains
a
stable
and
commonly
seen
option
for
producing
multi-part
figures.