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}
Actually there are a number of ways of achieving what you are asking for.
Without Using Any Package
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}[!tbp]
\centering
\begin{minipage}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{flower1.jpg}
\caption{Flower one.}
\end{minipage}
\hfill
\begin{minipage}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{flower2.jpg}
\caption{Flower two.}
\end{minipage}
\end{figure}
\end{document}
Using Packages
You can use either subfig or subcaption.
Using subfig
\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\begin{document}
\begin{figure}[!tbp]
\centering
\subfloat[Flower one.]{\includegraphics[width=0.4\textwidth]{flower1.jpg}\label{fig:f1}}
\hfill
\subfloat[Flower two.]{\includegraphics[width=0.4\textwidth]{flower2.jpg}\label{fig:f2}}
\caption{My flowers.}
\end{figure}
\end{document}
Using subcaption
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}[!tbp]
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{flower1.jpg}
\caption{Flower one.}
\label{fig:f1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.4\textwidth}
\includegraphics[width=\textwidth]{flower2.jpg}
\caption{Flower two.}
\label{fig:f2}
\end{subfigure}
\caption{My flowers.}
\end{figure}
\end{document}
Pros and Cons of the Approaches
- It is actually difficult to call one method superior over the other. Which one you want to use will depend on the result you are expecting. So, see the results presented above and choose yourself.
- The first one which uses the
minipage
environment is actually very simple.
But as you can see the figures are number individually. If want to present a group of related figures, it may not be the one you are looking for.
- The results from
subfig
and subcaption
are very similar. Though each has its own way of usage. However, there are reports on subfig
not working properly with hyperref
. This question
provides an excellent discussion on the comparative analysis on subcaption
vs. subfig
.
Further Reading
In order to get a better understanding of the placement and width controlling issues, I strongly suggest the you go through the documentation of the above two packages (subfig and subcaption). These documentations contain some excellent hints and examples.
Also, for comprehending the solutions of related issues, these questions (A, B, C, D, E, F) are worth taking a look at.
Best Answer
An image inserted with
\includegraphics
is just like a big letter. You can achieve your aim by removing the interline glue that TeX inserts.Interacting with paragraphs might be complicated, so it's better to resort to lower level commands, in this case:
Full example:
The
trim=5 5 5 5,clip
part is just for removing the border in the example images provided by themwe
package and make clearer that no vertical space is inserted. You don't need it unless there is a border you want to remove (adjust the amount of trimming).Nothing prevents you from using
\twoobjects
in a `figure environment, for instance, asActually one can do it with LaTeX tools only, at the cost of efficiency.
You can check that the output is the same. One can consider the
tabular
approach advantageous, because the[b]
option can be changed into[c]
or[t]
:and the calls
would yield center, top and bottom alignment respectively. The approach with TeX primitives is equivalent to the
[b]
option.Decide if you want to trade efficiency with flexibility.