[Tex/LaTex] Rotate picture with caption

captionsfloatsrotating

How can I rotate both a picture and its title in TeX?

Parameter in \includegraphics allows to rotate only a picture.

Best Answer

This can be done using the adjustbox package. The solution is similar to the one of Werner but saves you some manual work with saveboxes. Note that adjustbox v1.0 also includes a figure key which allows to add the figure environment automatically as well.

\documentclass{article}
\usepackage{adjustbox}
\usepackage{blindtext}
\begin{document}
\blindtext

\begin{figure}[ht]
  \begin{adjustbox}{addcode={\begin{minipage}{\width}}{\caption{%
      Here is a caption of the figure which is so long that 
      it has to be wrapped over multiple lines, but should 
      not exceed the width (height after the rotation) of the image.
      }\end{minipage}},rotate=90,center}
      \includegraphics[scale=.6]{example-image}%
  \end{adjustbox}
\end{figure}

\blindtext
\end{document}

Result