Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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:

share|improve this question
    
Do the images need their own subcaption? –  Gonzalo Medina Jul 22 '11 at 16:55
    
No, all 4 images should have only one common caption –  imagePlacer Jul 22 '11 at 17:18
    
As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. –  Martin Scharrer Jul 22 '11 at 18:02

1 Answer 1

up vote 12 down vote accepted

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

share|improve this answer
    
I used Your code and it seems that all images are now in one row. Should I use some line break to put last two images in second row ? –  imagePlacer Jul 22 '11 at 17:33
    
See the update code (or remove the % after the first \mbox{ .. }) –  Martin Scharrer Jul 22 '11 at 17:35
    
Thanks, that is exectly what I wanted to achieve –  imagePlacer Jul 22 '11 at 17:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.