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 rotate both a picture and its title in TeX?

Parameter in \includegraphics allows to rotate only a picture.

share|improve this question

migrated from stackoverflow.com Feb 13 '12 at 16:04

3 Answers

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

share|improve this answer

run texdoc hvfloat for the documentation of the different keywords

\documentclass{article}    
\usepackage{hvfloat,lipsum}
\begin{document}

\lipsum[2]
\hvFloat[
 floatPos=!htb,
 capWidth=h,
 capPos=r,
 capAngle=90,
 objectAngle=90,
 capVPos=c,
 objectPos=c]{figure}{\includegraphics[width=4cm]{tiger}}%
{Caption vertically centered right beside the float with a caption
width of figure width and 
\texttt{floatcapsep=5pt} (the default)}{fig:label}

\end{document}

enter image description here

share|improve this answer

Here is an elementary way of accomplishing a rotation. It requires boxing the figure contents (via a minipage) before rotating it.

enter image description here

\documentclass{article}
\usepackage{graphicx}% http://ctan.org/pkg/graphicx
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\newsavebox{\myimage}
\begin{document}
\lipsum[1]
\begin{figure}[ht]
  \centering
  \savebox{\myimage}{\rule{100pt}{150pt}}% Image to be included
  \rotatebox{90}{% Rotate 90 CCW
    \begin{minipage}{\wd\myimage}
      \usebox{\myimage}
      \caption{Here is a caption of the figure.}
    \end{minipage}}
\end{figure}
\end{document}

The image is saved in a box \myimage in order to obtain its width (\wd\myimage). This is then used to set the width of the minipage. I used a dummy 100pt x 150pt black rectangle.

lipsum was used to generate dummy text, Lorem Ipsum style.

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.