1

I have a wide picture that I'd like to turn at 90 degrees, but when I use the sidewaysfigure environment of the rotating package, I get an offset and the figure is shifted on the side of the page. Here is my MWE:

\documentclass[referee]{svjour3}
\usepackage{showframe}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{rotating}
\usepackage{graphicx} 
\usepackage{siunitx}
        \sisetup{detect-all, %
        separate-uncertainty = true}
\usepackage{lipsum}

\renewcommand{\textfraction}{0.15}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.65}
\renewcommand{\floatpagefraction}{0.60}

\begin{document}
\lipsum[1-2]

\noindent
\begin{sidewaysfigure}[p]
\includegraphics[width=1.0\textwidth]{myfigure} 
\caption{Caption of the large rotated figure}
\label{fig:largefig}
\end{sidewaysfigure}

\lipsum[3-4]
\end{document}

I tried many things, including \raisebox, but didn't find a satisfactory solution. The class svjour3 is a class provided by Springer for the journal I want to submit my paper to.

The figure myfigure used in the MWE could be something produced by:

\documentclass[border = 0.5cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[fill=orange] (0,0) rectangle (20,10)
\end{tikzpicture}
\end{document}

or anything more complicated

DRi
  • 847

1 Answers1

1

You can try to use the package adjustbox instead as suggested here.

Result

Result

MWE

\documentclass[referee]{svjour3}
\usepackage{showframe}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx} 
\usepackage{lipsum}
\usepackage{adjustbox}

\renewcommand{\textfraction}{0.15}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.65}
\renewcommand{\floatpagefraction}{0.60}

\begin{document}
    \lipsum[1-2]

    \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=1]{example-image}%
        \end{adjustbox}
    \end{figure}

    \lipsum[3-4]
\end{document}
Roald
  • 1,245