# Two figures side-by-side with inequal height and aligned captions

I have an addition to this question: Two figures side by side.

Suppose we have two pictures, making them of uneven height. I am looking for a way to not use subfig and align two figures side-by-side, while keeping the captions vertically aligned.

I've created the following example:

\documentclass{article}
\title{Two Figures Side by Side}
\author{Little Bobby Tables}
\usepackage{lipsum}
\usepackage{tikz}

\newcommand{\exedout}{
\begin{tikzpicture}
\path node (LL) {}
++ (0.8\textwidth, 0.8\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}
}

\newcommand{\exedouttwo}{
\begin{tikzpicture}
\path node (LL) {}
++ (0.8\textwidth, 0.4\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}
}
\begin{document}
\maketitle
How can I put two figures side-by-side? Not two sub-figures, but two actual figures
with separate "Fig.: bla bla" captions. A figure is supposed to spread over the
entire text width, but I have two figures which are narrow and long, and I need to
save the space in order to withstand the pages limit.

\lipsum

\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
\centering\exedout
\caption{first figure but with more comments than the second picture to see what the different is.}
\end{minipage}
\begin{minipage}{0.45\textwidth}
\centering\exedouttwo
\caption{second figure}
\end{minipage}
\end{figure}

\lipsum

\end{document}


It gives the following result:

But I need this:

-
minipage environments have placement parameters [c], [t] and [b], do they help? –  uli Dec 6 '11 at 12:43

Use the [t] optional argument of minipage to align both to the top baseline (i.e. the image baseline / lower line). I also added %s to your macros to avoid extra spaces being inserted by the source code line breaks.

\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}

\newcommand{\exedout}{%
\begin{tikzpicture}
\path node (LL) {}
++ (0.8\textwidth, 0.8\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}%
}

\newcommand{\exedouttwo}{%
\begin{tikzpicture}
\path node (LL) {}
++ (0.8\textwidth, 0.4\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}%
}
\begin{document}
How can I put two figures side-by-side? Not two sub-figures, but two actual figures
with separate "Fig.: bla bla" captions. A figure is supposed to spread over the
entire text width, but I have two figures which are narrow and long, and I need to
save the space in order to withstand the pages limit.

\lipsum

\begin{figure}
\centering
\begin{minipage}[t]{0.45\textwidth}
\centering\exedout
\caption{first figure but with more comments than the second picture to see what the different is.}
\end{minipage}
\begin{minipage}[t]{0.45\textwidth}
\centering\exedouttwo
\caption{second figure}
\end{minipage}
\end{figure}

\lipsum

\end{document}

-
Yes, this is what I was looking for. I already tried it with only a single [t], but didn't come up with doing it at both minipages. –  Marnix Dec 6 '11 at 13:28

Is using floatrow an option?

Note that in the following example I made the two figures narrower by changing \exedout and \exedouttwo, as ffigbox doesn't seem to change \textwidth as minipage does, hence the two figures would be too wide.

\documentclass{article}
\title{Two Figures Side by Side}
\author{Little Bobby Tables}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{floatrow}
\newcommand{\exedout}{
\begin{tikzpicture}
\path node (LL) {}
++ (0.4\textwidth, 0.8\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}
}

\newcommand{\exedouttwo}{
\begin{tikzpicture}
\path node (LL) {}
++ (0.4\textwidth, 0.4\textheight) node (UR) {}
(LL -| UR) node (LR) {}
(LL |- UR) node (UL) {};
\draw (LL) rectangle (UR) (LL) -- (UR) (UL) -- (LR);
\end{tikzpicture}
}
\begin{document}
\maketitle
How can I put two figures side-by-side? Not two sub-figures, but two actual figures
with separate "Fig.: bla bla" captions. A figure is supposed to spread over the
entire text width, but I have two figures which are narrow and long, and I need to
save the space in order to withstand the pages limit.

\lipsum

\begin{figure}
\begin{floatrow}
\ffigbox{\caption{first figure but with more comments than the second picture to see what the different is.}}{\exedout}
\ffigbox{\caption{second figure}}{\exedouttwo}
\end{floatrow}
\end{figure}

\lipsum

\end{document}


-
Seems like a good alternative if I need any other configurations like aligning them both at the top. –  Marnix Dec 6 '11 at 13:29