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.

Is it possible to get two figure environments side by side across the top of a page, where both (or at least 1) contains subfloats? IE: Mock Up

And if so, how? I am currently using the subfig package with a combination of figure/subfloat in my document.

share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  doncherry Sep 17 '12 at 5:51

2 Answers 2

up vote 3 down vote accepted

You can do it by using the packages floatrow and subfig together.

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{floatrow}

\begin{document}
\begin{figure}[htbp]
\centering
\begin{floatrow}
\ffigbox[\FBwidth]
{
\subfloat[Caption]{\includegraphics[height=4cm,width=3cm]{image1a}}
\quad
\subfloat[Caption]{\includegraphics[height=4cm,width=3cm]{image1b}}
}{\caption{Caption here}}
\ffigbox{
\subfloat[Caption]{\includegraphics[height=4cm,width=3cm]{image2}}
}{\caption{Caption here}}
\end{floatrow}
\end{figure}
\end{document}

preview of code

share|improve this answer
    
Verified this works as well. –  DavidE Sep 19 '12 at 2:08

The vertical and horizontal alignments will be a problem if the subfigures don't have the same dimensions. Here's a way under that assumption.

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{subfig,lipsum}

\begin{document}

\lipsum[2]

\begin{figure}[htp]
\centering
\begin{minipage}{.6667\textwidth}
\centering
\hspace*{\stretch{1}}%
\subfloat[Caption]{\includegraphics[width=3cm,height=2cm]{x}}%
\hspace{\stretch{2}}%
\subfloat[Caption]{\includegraphics[width=3cm,height=2cm]{x}}%
\hspace{\stretch{1}}
\caption{Caption here}
\end{minipage}%
\begin{minipage}{.3333\textwidth}
\centering
\hspace*{\stretch{1}}%
\subfloat[Caption]{\includegraphics[width=3cm,height=2cm]{x}}%
\hspace{\stretch{1}}
\caption{Caption here}
\end{minipage}
\end{figure}

\lipsum[3]

\end{document}

As usual the lipsum package and the demo option to graphicx are just to prepare the example. I've arranged things so that the space between the subfigures will be the same. The \centering commands have the purpose of avoiding the paragraph indentation. Notice also the % used to mask off the end-of-lines that would produce spaces and the \hspace* commands for getting the space at the beginning of the lines.

enter image description here

share|improve this answer
    
Worked great, but as mentioned has problems with aligning captions of differing height floats. –  DavidE Sep 19 '12 at 2: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.