2

I have a problem with my LaTeX code:

I want two things:

  1. Besides "normal" figures with the figure in the middle and the caption below, I want some pictures be rotated (because of their size) to fit the page in landscape view and the caption still below the picture, thus also rotated.
  2. I also need some pictures on the left or right of the page and the caption on the side of them.

First, I was able to do 1. via rotatebox. But to get my captions next to the figures, I added the package floatrow, which seems to cause that the captions for case 1. are not rotated anymore. Below you find the reduced code, including the floatrow package. Can someone help me and explain, why floatrow cancels the rotation of the caption and provide me with a work around?

\documentclass[12pt,a4paper]{scrbook}
 \usepackage[latin1]{inputenc}
 \usepackage{tgadventor}
 \renewcommand*\familydefault{\sfdefault} 
 \usepackage[T1]{fontenc}
 \usepackage[english]{babel}
 \usepackage{amsmath}
 \usepackage{subfigure}
 \usepackage[onehalfspacing]{setspace}
 \usepackage{placeins}
 \usepackage{caption}
 \usepackage{floatflt}
 \usepackage{wrapfig}
 \usepackage{fancyhdr}
 \usepackage{booktabs}
 \usepackage{color}
 \usepackage{multirow}
 \usepackage{geometry}
 \usepackage[nottoc]{tocbibind}
 \usepackage{appendix}
 \usepackage{color}
 \usepackage{paralist}
 %\usepackage{flafter}
 \usepackage{ifthen}
 \usepackage{mathptmx}
 \usepackage{upgreek}
\usepackage{enumitem} 
\usepackage{floatrow}

\begin{document}

\begin{figure}
\rotatebox{90}{%
\begin{minipage}{0.9\textheight}
\includegraphics[width=\linewidth]{picthatshouldberotated.pdf}
\caption[setupt]{text.}
\label{fig:setup}
\end{minipage}}
\end{figure}

\begin{figure}[h]
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=8cm}}]{figure}[\FBwidth]
{  \caption[thingy]{thingy}}
{\includegraphics[width=0.45\textwidth]{picwithcaptionnextoit.png}}
\label{fig:thingy}
\end{figure}


\end{document}
3

You could use the sidewaysfigure environment from the rotating package. This will place the rotated figure on a separate page.

\documentclass[12pt,a4paper]{scrbook}
\usepackage{rotating}
\usepackage{floatrow}

\begin{document}

\begin{sidewaysfigure}
\includegraphics[width=.9\linewidth]{example-image-16x10.pdf}
\caption[setupt]{text.}
\label{fig:setup}
\end{sidewaysfigure}

\begin{figure}[h]
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={right,top},capbesidewidth=8cm}}]{figure}[\FBwidth]
{  \caption[thingy]{thingy}}
{\includegraphics[width=0.45\textwidth]{example-image}}
\label{fig:thingy}
\end{figure}

\end{document}

enter image description here

  • ahhh very nice, also the auto alignment to the outer side of the document :) Thanks a lot – user49017 Apr 1 '14 at 11:17

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.