I want figures on the left pages, text on the right ones and numbering on the right pages only, so I followed this: Figures on left pages, text on right ones with class book, numbering only on right pages

However some of my figures must be sideways, so that I'd like to use a sidewaysfigure environment, and some other need subfigures: how can I use floats for my figures?

1 Answer 1


This is a modification of this solution to "Figures on left pages, text on right ones with class book, numbering only on right pages"; see below for the complete code.

Replace the definition of \addfig by the two lines


Now you don't need to load the package caption anymore. For sideways figures, load the package rotating, for sub-figures the package subfigure. In the sample code referenced above this means to replace \usepackage{booktabs,caption} by


To add figures or tables, use

  {...code of figure...
   \caption{...caption of figure...}%
   \label{...label of figure ...}%


  {...code of table...
   \caption{...caption of table...}%
   \label{...label of table ...}%

For sub-figures, use

  {\subfigure[...caption of subfigure 1]{...code of subfigure 1...}%
   \subfigure[...caption of subfigure 2]{...code of subfigure 2...}%
   \caption{...main caption...}%

(and likewise \addtab for tables).

For sideways figures without sideways caption use

   ...code of sideways figure...
   \caption{...caption of figure...}%

For sideways figures with sideways caption use

     \begin{minipage}{...width of sideways box...}
     ...code of sideways figure...
     \caption{...sideways caption of sideways figure...}%

enter image description here

For the sake of self-containedness, here is the complete modified code.

      \setbox\z@\vbox to\vsize{\sos@figures}%
        {\vbox to\sos@top{}\moveright\sos@right\box\z@}%

% Test example

\title{Hello world}
\author{Bruno Le Floch}




    Abc def & ghijk lmno pq \\
    \lipsum[1] & \lipsum[2] \\
  \caption{\label{tab:atable}A table}}

  \caption{A figure}}


\addfig{\begin{sideways}\includegraphics[width=5cm]{example-image}\end{sideways}\caption{A sideways figure}}
\addfig{\begin{sideways}\begin{minipage}{5cm}\includegraphics[width=\textwidth]{example-image}\caption{A sideways figure with sideways caption.}\end{minipage}\end{sideways}}
\subfigure[Image A]{\includegraphics[width=3cm]{example-image-a}}
\subfigure[Image B]{\includegraphics[width=3cm]{example-image-b}}
\caption{Two sub-figures side by side.}}


\renewcommand{\lips@par}{ } % now \lipsum[1-10] makes one big par

\addfig{\rule{8cm}{3cm}\caption{That should be figure 5.}}
\addfig{\rule{1cm}{3cm}\caption{Perhaps the sixth}}


\addfig{\rule{8cm}{3cm}\caption{Yet another one}}


\chapter{Back to normal}

\addfig{\rule{8cm}{3cm}\caption{That figure won't be lost.}}


\addfig{\rule{4cm}{5cm}\caption{Nor will that one.}}



See Table~\ref{tab:atable}.


\chapter{Figures, again}

\addtab{\rule{5cm}{2cm}\caption{Let's pretend it's a table}}


\addtab{\rule{5cm}{2cm}\caption{Let's pretend it's a table}}


\addtab{\rule{4cm}{1cm}\caption{Last table}}

  • subfigure is obsolete and ought not be used. Use subfig or subcaption instead.
    – cfr
    May 6, 2017 at 2:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .