5

What i'm trying to achieve:

Have two images in one page, one image on the top half of the page and the other the bottom half. Ive managed to do this by:

\vbox{
  \begin{minipage}[t][0.45\textheight][t]{\textwidth}
    \centering
    \includegraphics[height=0.5\textheight]{image1}
  \end{minipage}

  \nointerlineskip
  \begin{minipage}[b][0.45\textheight][t]{\textwidth}
    \vspace{0.4in}
    \centering
    \includegraphics[height=0.45\textheight]{image2}
  \end{minipage}
}

But i would like to have a caption beside the image so that it doesn't use up too much space. Ive tried a few ways but i always get the 'not in outer par mode' error.

Any way of doing this?

  • Welcome to the site! have you tried captionof from the caption package? – cmhughes Mar 21 '14 at 23:32
  • You could use the floatrow package, which is used to group figures or tables, and has an option capposition=beside. – Bernard Mar 21 '14 at 23:37
  • So what else is on the page? Or do you just want to take up a full page with just two images - one at the top and one at the bottom? Also you make the images take up roughly half the text block width. Does that mean the caption should fill the rest on the opposing side? – Werner Mar 21 '14 at 23:50
  • Not sure on how to use <code>captionof</code> to place the caption on the side. <code>Floatrow</code> was one of the ones that caused the 'not in outer par mode' error. just two images at the moment. I really only want them referenced (e.g. Fig. 1). – Waddas Mar 22 '14 at 0:29
3

One option using \captionof from the caption package (the capt-of package also offers this feature) to provide the captions:

\documentclass{article}
\usepackage{caption}
\usepackage{graphicx}

\begin{document}

\clearpage
\noindent\begin{minipage}[t][0.45\textheight][t]{.45\textwidth}
  \centering
  \includegraphics[height=0.5\textheight,width=\linewidth]{example-image-a}
\end{minipage}\hfill
\begin{minipage}[b]{.45\textwidth}
\captionof{figure}{here's the caption for the first figure and some more text for the example}
\label{fig:testa}
\end{minipage}
\vfill

\noindent\begin{minipage}[t][0.45\textheight][t]{.45\textwidth}
  \centering
  \includegraphics[height=0.45\textheight,width=\linewidth]{example-image-b}
\end{minipage}\hfill
\begin{minipage}[b]{.45\textwidth}
\captionof{figure}{here's the caption for the second figure and some more text for the example}
\label{fig:testb}
\end{minipage}
\clearpage

\end{document}

enter image description here

Adjust the lengths and alignments used according to your needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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