[Tex/LaTex] Using side captions with multiple subfloats (floatrow and memoir)

captionsfloatrowmarginsmemoirsubfloats

In a large document (memoir class), I'd like to have side captions in the outer margin to save space for figures consisting of multiple subfigures belonging together.

After trying sidecap with subfig (not really working together due to strange layout results), I read that the floatrow package is the recommended package for doing such things.

Now I fear that floatrow is not nicely working together with memoir – or I misunderstood the manual. I tried to mix the subfloatrow environment with the beside-caption example (page 36 in the manual) but was not successful.
I was not able to put the main caption into the outer margin, at all and on even page numbers, the figures stick into the outer margin.

Any help or hint is appreciated!

Here comes my minimal working example, I'm struggling with (result below):

\documentclass[11pt,a4paper,book,oldfontscommands,twoside,openright,final]{memoir}

\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{subcaption}
%\usepackage[wide]{sidecap}


\let\newfloat\undefined
\usepackage{floatrow}
\floatsetup[figure]{%
    margins=hangoutside, % makes the second figure stick into the outer margin
    capposition=beside,
    capbesideposition={bottom,outside},
    floatwidth=\textwidth
}
\floatsetup[subfigure]{style=plain}


\begin{document}

\blindtext


%\begin{SCfigure} % Using SCfigure environment results in strange subfigure numbering in the main caption
\begin{figure}[h]
\RawFloats % without \RawFloats, main caption disappears
\ffigbox[\textwidth]{%
    \begin{subfloatrow}
        \ffigbox{
            \includegraphics[width=.5\textwidth, height=3cm, draft]{foo1.png}
        }{\subcaption{Foo bar 1 \dots}}
        \ffigbox{
            \includegraphics[width=.5\textwidth, height=3cm, draft]{foo2.png}
        }{\subcaption{Foo bar 2 \dots}}
    \end{subfloatrow}

    \begin{subfloatrow}     
        \ffigbox{
            \includegraphics[width=.5\textwidth, height=3cm, draft]{foo3.png}
        }{\subcaption{Foo bar 3 \dots}}
        \ffigbox{
            \includegraphics[width=.5\textwidth, height=3cm, draft]{foo4.png}
        }{\subcaption{Foo bar 4 \dots}}
    \end{subfloatrow}
}

\caption{Main caption foo bar \dots}
\end{figure}
%\end{SCfigure}


\blindtext[2]


\begin{figure}[h]
    \RawFloats % without \RawFloats, main caption disappears
    \ffigbox[\textwidth]{%
        \begin{subfloatrow}
            \ffigbox{
                \includegraphics[width=.5\textwidth, height=3cm, draft]{foo1.png}
            }{\subcaption{Foo bar 1 \dots}}
            \ffigbox{
                \includegraphics[width=.5\textwidth, height=3cm, draft]{foo2.png}
            }{\subcaption{Foo bar 2 \dots}}
        \end{subfloatrow}

        \begin{subfloatrow}     
            \ffigbox{
                \includegraphics[width=.5\textwidth, height=3cm, draft]{foo3.png}
            }{\subcaption{Foo bar 3 \dots}}
            \ffigbox{
                \includegraphics[width=.5\textwidth, height=3cm, draft]{foo4.png}
            }{\subcaption{Foo bar 4 \dots}}
        \end{subfloatrow}
    }

    \caption{Main caption foo bar \dots}
\end{figure}

\blindtext

\end{document}

first page result of mwe
second page result of mwe

Best Answer

Do you looking something like this?

enter image description here

For above figure I use package subfig and from memoir sidecaption:

documentclass[11pt,a4paper,twoside]{memoir}

\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{subfig}

\sidecapmargin{outer}

    \begin{document}
\blindtext

\begin{figure}[h]
    \begin{sidecaption}{Main caption on outer side of figure}[fig:mayfig-1]\centering
\subfloat[sub figure A]{\includegraphics[width=0.48\hsize]{example-image-a}}
    \hfill
\subfloat[sub figure B]{\includegraphics[width=0.48\hsize]{example-image-b}}
    \end{sidecaption}
\end{figure}

\blindtext
    \end{document}

I shorten your code to MWE ...