1

I am having some weird problem using fcapside in floatrow where I can't get the side caption to auto-calculate its width based on my figure. Instead, the side caption width seems to expand with the image. I set the capbesidewidth to something else in the preamble so I explicitly set it back to sidefil (or none) for the figure, but it does this even if I never set it anywhere. I can't figure out why this is different from the manual where the caption width is auotmatically calculated to occupy the rest of the space.

\documentclass[11pt,twoside]{report}

\usepackage{graphicx}
%\usepackage{caption}
\usepackage{floatrow}
\DeclareFloatVCode{largevskip} {\vskip 20pt}
%\floatsetup[figure]{a bunch of other settings here that I overwrite below}
\captionsetup[figure]{font=small}
\usepackage{subfig}

\begin{document}

\begin{figure}[htbp]
\floatsetup[subfigure]{style=plain,capbesideposition={inside,center},capbesidesep=quad,capbesidewidth=sidefil,rowpostcode=largevskip}
%\centering
\ffigbox[\textwidth]
    {\begin{subfloatrow}
        \fcapside[\FBwidth]
            {\setlength\fboxsep{4pt} \fbox
                {\includegraphics[width=0.5\textwidth]{example-image-a}}}
            {\caption{Hello I am a caption and my width seems to be approximately the same as that of the image next to me, which is 0.5 times the text width.}}
    \end{subfloatrow}
    \begin{subfloatrow}
        \fcapside[\FBwidth]
            {\setlength\fboxsep{4pt} \fbox
                {\includegraphics[width=0.65\textwidth]{example-image-a}}}
            {\caption{Hello I am a caption and my width also seems to be approximately the same as that of the image next to me, which is 0.65 times the text width.}}
    \end{subfloatrow}}
    {\caption{I am a centered caption for the full figure.}}
\end{figure}

\end{document}  

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.