14

How can I display text to the right of figure, vertically centered? "Caption" is only displaying text below it, as it seems to me.

lockstep
  • 250,273
l7ll7
  • 2,267

1 Answers1

17

You can use the sidecap package and the c (centered) option for \sidecaptionvpos:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{sidecap}

\sidecaptionvpos{figure}{c}

\begin{document}

\begin{SCfigure}
  \centering
  \includegraphics[height=7cm]{name}  
  \caption{text text text text text text text text text text text text text text text text text text text text text text text text text text text text text}
\end{SCfigure}

\end{document}

enter image description here

If the captions should always appear to the right, you can use the rightcaption package option:

\usepackage[rightcaption]{sidecap}

Another option, using \capbeside, from the powerful floatrow package this time:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{floatrow}

\begin{document}

\begin{figure}
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,center},capbesidewidth=4cm}}]{figure}[\FBwidth]
{\caption{A test figure and its caption vertically centered side by side}\label{fig:test}}
{\includegraphics[width=5cm]{name}}
\end{figure}

\end{document}

enter image description here

The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.

Gonzalo Medina
  • 505,128