\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[width=3cm]{Vlieger}
\caption{Vlieger}
\label{fig1:}
\includegraphics[width=3cm]{Pijl}
\caption{Pijl}
\label{fig2:}
\end{minipage}
This is my code to put my two images next to each other. But it doesn't work… Can someone pleas help me?
Best Answer
As Mico suggest, probably you want to make a
figure
environment, where you can have two figures with two captions usingminipages
orsubfigures
environments with two subcaptions ans a main caption. Note that figure environments are floats, so by default they can be moved to the top or bottom of the page, or to another page, although you can influence the position of float environments.In any case, in these environments and the images usually is better set relative lengths as
\linewidth
instead of absolute lengths as3cm
.On the other hand, at least for big images, instead of
\centering
(and some spacer between theminipages
or thesubfigures
) you may want these aligned with the margins, no matter its exact size. For this, use\hfill
as in this minimal working example: