[Tex/LaTex] Putting two images next to each other that are 0.5\textwidth wide

graphicspositioning

I need to put 4 images in one group and put it on the page. All images have the same length and width, however I have problem with placing them by two in a row. I used this code

\begin{figure}[h]
\centering
\includegraphics[width=0.5\textwidth]{CircleTemplate.eps}
\includegraphics[width=0.5\textwidth]{CircleOlimpicStarting.eps}
\includegraphics[width=0.5\textwidth] {CircleOlimpicFinishing.eps}
\includegraphics[width=0.5\textwidth] {CircleOlimpicFinishingWithNoise.eps}
\caption{Some long long caption  }
\label{fig:OlimpicCircleTT1}
\end{figure}

however it doesn't work – images were added one below the other. I also would like to put two (4 images) group in one page. Is it possible to adjust dimensions of these images somehow to fit all these images in one page

Please take a look at the pictures which show what I want to achieve

This is what I want to acomplish:

And this is what I get using the code presented at the beginning:

Best Answer

Box them together and look out for trailing spaces/line breaks:

\begin{figure}[h]
\centerline{%
\includegraphics[width=0.5\textwidth]{CircleTemplate.eps}%
\includegraphics[width=0.5\textwidth]{CircleOlimpicStarting.eps}%
}%
\centerline{%
\includegraphics[width=0.5\textwidth] {CircleOlimpicFinishing.eps}%
\includegraphics[width=0.5\textwidth] {CircleOlimpicFinishingWithNoise.eps}%
}%
\caption{Some long long caption}
\label{fig:OlimpicCircleTT1}
\end{figure}

Another alternative would be to use a tabular with {@{}c@{}c@{}} as column specification to avoid any inter-column spaces.

Note: The line endings in the source code will be taken as space if you don't use % to comment them out. So basically you ask for <image with 50% textwidth><space><image with 50% textwidth> which is slightly wider than the text width and therefore will be broken into two lines.


If you want some space between the images you can use the following:

\begin{figure}[h]
\makebox[\textwidth]{%
\includegraphics[width=0.49\textwidth]{image1}%
\hfill    
\includegraphics[width=0.49\textwidth]{image2}%
}\\[0.5cm]% If you want some vertical space
\makebox[\textwidth]{%
\includegraphics[width=0.49\textwidth]{image3}%
\hfill    
\includegraphics[width=0.49\textwidth]{image4}%
}%
\caption{Some long long caption}
\label{fig:OlimpicCircleTT1}
\end{figure}

Result