0

This question already has an answer here:

I need to rotate of 90 degrees a table of image:

\begin{figure}
\begin{tabular}{cccc}
\subfloat[caption]{\includegraphics[width = 4.5in]{K2E250ellisse.png}} &
\subfloat[caption]{\includegraphics[width = 4.5in]{K2E600ellisse.png}} \\
\subfloat[caption]{\includegraphics[width = 4.5in]{K4E250ellisse.png}}&
\subfloat[caption]{\includegraphics[width = 4.5in]{K4E600ellisse.png}} 

\end{tabular}
\caption{4 x 4}
\end{figure}

I tried with adjustbox but it gives me the error :

\begin{adjustbox}{angle=90}
    \begin{figure}
    \begin{tabular}{cccc}
    \subfloat[caption]{\includegraphics[width = 4.5in]{K2E250ellisse.png}} &
    \subfloat[caption]{\includegraphics[width = 4.5in]{K2E600ellisse.png}} \\
    \subfloat[caption]{\includegraphics[width = 4.5in]{K4E250ellisse.png}}&
    \subfloat[caption]{\includegraphics[width = 4.5in]{K4E600ellisse.png}} 

    \end{tabular}
    \caption{4 x 4}
    \end{figure}
    \end{adjustbox}


    ! LaTeX Error: Not in outer par mode.

marked as duplicate by Stefan Pinnow, TeXnician, Bobyandbob, Kurt, CarLaTeX Mar 10 '18 at 21:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Put adjustbox INSIDE the flgure environment, – John Kormylo Mar 9 '18 at 15:42
  • ! You can't use `\hrule' here except with leaders. – gdlzzzz Mar 9 '18 at 15:45
  • (Both solutions presented there work. The simplest is probably loading the rotating package and replacing figure by sidewaysfigure in your original code.) – Circumscribe Mar 10 '18 at 17:08
1

When using adjustbox you need an additional internal box:

\documentclass{article}
\usepackage{adjustbox,subfig,graphicx}

\begin{document}

    \begin{figure}
    \begin{adjustbox}{angle=90}
    \begin{minipage}{0.9\textheight}  
    \begin{tabular}{cccc}
    \subfloat[caption]{\includegraphics[width = 2.5in]{example-image}} &
    \subfloat[caption]{\includegraphics[width = 2.5in]{example-image}} \\
    \subfloat[caption]{\includegraphics[width = 2.5in]{example-image}}&
    \subfloat[caption]{\includegraphics[width = 2.5in]{example-image}}
    \end{tabular}
    \caption{4 x 4} 
    \end{minipage}  
    \end{adjustbox}
    \end{figure}

\end{document}

Not the answer you're looking for? Browse other questions tagged or ask your own question.