Tell me more ×
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.

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.

share|improve this question

2 Answers

up vote 14 down vote accepted

Have you tried putting each of them in a minipage environment? They won't float at all, but you can make sure they appear side-by-side.

Edit: This isn't as straightforward as I thought. You can't put a figure environment inside a minipage environment. You get a "not in outer par mode" error.

But as Stefan notes, you can put minipages inside a figure environment and get separate captions!

\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}
}
\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}
\end{minipage}
\begin{minipage}{0.45\textwidth}
\centering\exedout
\caption{second figure}
\end{minipage}
\end{figure}

\lipsum

\end{document}

I was surprised to discover two \captions in the same figure environment actually work as desired.

HT: LaTeX Matters via Google

share|improve this answer
1  
This is what I ended up with. It appears that the actual semantics of figure is: "Everything with a caption in this environment is a figure, and it all floats together". – Little Bobby Tables Nov 23 '10 at 9:09
I normally put a \hfill between the minipages to spread them evenly over the text width. – Martin Scharrer Apr 28 '11 at 17:49

Since your figures shall be side by side, they are not expected to float independently. So you need just one figure environment for both objects.

Within this figure environment, you may use minipages (like Matthew already suggested). Some additions:

  • minipages understand optional alignment parameters to align at top, bottom or center.
  • For adding a caption to the minipages, I recommend to use the subcaption package. It is part of the feature-rich caption package.

Nevertheless you could check out the subfig package. That task could be handled like subfigures even if you customize the captions such that they look like two independent figures.

share|improve this answer

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.