14

Is it possible to achieve the following layout with the subfigure package (and any other package/command I don't know about):

############# ##############
#           # #            #
#  pic1     # #            #
#           # #      pic2  #
#           # #            #
############# #            #
              #            #
############# #            #
#           # #            #
#   pic3    # #            #
#           # #            #
#           # #            #
############# ############## 

Each picture should have a subcaption.

3
  • 1
    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. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you.
    – Mensch
    Jul 18, 2013 at 11:04
  • 1
    All right, thank you for the clarification.
    – JHK
    Jul 18, 2013 at 11:14
  • 2
    Instead of using the subfigure package I recommend switching to caption and subcaption. I am looking for an example, where i used this and will post it in a bit. Jul 18, 2013 at 11:16

3 Answers 3

14

subfigure is an obsolete package. One option cold be to use floatrow and subfig; depending on the actual size of your figures, you might need to adjust some lengths:

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

\begin{document}

As can be seen in Figure~\ref{fig:test}, we have the three subfigures~\ref{sfig:testa}, \ref{sfig:testb}, and \ref{sfig:testc}.
\begin{figure}
\ffigbox[7.8cm]{%
\begin{subfloatrow}
  \hsize0.7\hsize
  \vbox to 6.35cm{
  \ffigbox[\FBwidth]
    {\caption{small subfigure A}\label{sfig:testa}}
    {\includegraphics[width=3cm,height=3cm]{example-image-a}}\vss
  \ffigbox[\FBwidth]
    {\caption{small subfigure B}\label{sfig:testb}}
    {\includegraphics[width=3cm,height=2cm]{example-image-b}}
  }
\end{subfloatrow}\hspace*{\columnsep}
\begin{subfloatrow}
  \ffigbox[\FBwidth][]
    {\caption{A large subfigure}\label{sfig:testc}}
    {\includegraphics[width=3cm,height=6cm]{example-image-c}}
\end{subfloatrow}
}{\caption{three subfigures}\label{fig:test}}
\end{figure}

\end{document}

enter image description here

8

EDITED so that this approach supports hyperlinking of subfigures.

Just replace the \rules with \includegraphics and put in your own captions. The gap between subfigure and subcaption can be changed with an optional argument (e.g., [5pt]) to \stackunder in the definitions of \capfiga, b, and c.

\documentclass{article}
\usepackage{hyperref}
\usepackage{stackengine}
\usepackage{subcaption}
\begin{document}
\begin{figure}
  \centering
  \def\figa{\rule{1in}{1.1in}}
  \def\figb{\rule{2in}{3.4in}}
  \def\figc{\rule{1in}{0.9in}}
  \def\capa{subfig a caption}
  \def\capb{subfig b caption}
  \def\capc{subfig c caption which may be longer}
  \savestack{\capfiga}{\subcaptionbox{\capa\label{fg:a}}{\figa}}
  \savestack{\capfigb}{\subcaptionbox{\capb\label{fg:b}}{\figb}}
  \savestack{\capfigc}{\subcaptionbox{\capc\label{fg:c}}{\figc}}
  \def\hgap{3ex}
  \stackon%
    [\heightof{\figb}-\heightof{\figc}-\heightof{\capfiga}-\depthof{\capfiga}]%
    {\capfigc}{\capfiga}\hspace{\hgap}\capfigb%
  \caption{This is my figure\label{fg:}}
\end{figure}
\clearpage
In figure \ref{fg:}, \ref{fg:a}, \ref{fg:b} and \ref{fg:c}...
\end{document}

enter image description here

2
  • Sadly, for the current project, I need the hyperlinking to subfigures.
    – JHK
    Jul 18, 2013 at 11:29
  • @user2586950 See revised version that hyperlinks. Jul 18, 2013 at 13:43
6

You can use it with the caption and subcaption packages:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption,subcaption}
\usepackage{calc}
\usepackage{lipsum}
\usepackage{hyperref}

\newlength\heightfiga\newlength\heightcapa
\newlength\heightfigb\newlength\heightcapb
\newlength\heightfigc\newlength\heightcapc
\newlength\heightfig

\begin{document}
\lipsum[1]

Look at that figure~\ref{fig}!

\lipsum[2]

And now look at figure~\ref{subfig2} in particular.

\lipsum[3]

\begin{figure}[b]
%Definition of lengths
\setlength\heightfiga{1.5cm}
\setlength\heightfigb{2.0cm}
\setlength\heightcapa{1\baselineskip}
\setlength\heightcapb{2\baselineskip}
%Do not change
\setlength\heightcapc{\heightcapa}
\setlength\heightfigc{\heightfiga+\heightfigb+\heightcapa}
\setlength\heightfig{\heightfigc+\heightcapc}

\begin{minipage}[b][\heightfig][t]{0.49\linewidth}\centering
\includegraphics[height=\heightfiga]{./graphics/dummy.eps}
\parbox[b][\heightcapa][t]{1\linewidth}{\subcaption{A caption}\label{subfig1}}
\includegraphics[height=\heightfigb]{./graphics/dummy.eps}
\parbox[b][\heightcapb][t]{1\linewidth}{\subcaption{Yet another caption}\label{subfig2}}

\end{minipage}\hfill
\begin{minipage}[b][\heightfig][t]{0.49\linewidth}
\centering
\includegraphics[height=\heightfigc]{./graphics/dummy.eps}
\parbox[b][\heightcapc][t]{1.\linewidth}{\subcaption{Still a caption}\label{subfig3}}
\end{minipage}%
\caption{This is a figure}
\label{fig}
\end{figure}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .