[Tex/LaTex] Caption on the side of a figure

captionspositioning

Can anyone tell me how to get my caption on side of my figure, and at the same time aligned with the top of my figure?

Best Answer

You can use the \floatbox and \capbeside commands provided by the floatrow package:

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

\begin{document}

\begin{figure}
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={left,top},capbesidewidth=4cm}}]{figure}[\FBwidth]
{\caption{A test figure with its caption side by side}\label{fig:test}}
{\includegraphics[width=5cm]{name}}
\end{figure}

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

\end{document}

enter image description here

You could also be interested in the tufte document classes:

\documentclass{tufte-book}
\usepackage[demo]{graphicx}
\usepackage{lipsum}

\begin{document}

\lipsum[1]
\begin{figure}
  \centering
  \includegraphics[width=5cm]{name}
  \caption{\protect\lipsum[1]}
\end{figure}

\end{document}

enter image description here