I am new to latex and still in the stage where I am modifying example code, so maybe there is a better way to do this or I'm just missing something. I have 3 subfigures and I want them to stack in a nice little column with the text wrapped around them. I'd also like to put a box around the whole thing. I'm using floatrow for all my other graphics (so far).
wrapfigure and floatrow work fine in my single-line images, but when I tried using subfloatrow to stack the images, I get strange behavior. It depends on whether I have text before and/or after the wrapfigure, but here is an example:
I don't need it exactly after that paragraph, I'd just like it somewhere nearby. So ideally in this case I would have wanted wrapfigure to scooch it up, in addition to properly shifting it leftward into that hole it made.
Separately, I've been using fbox to put a box around my groups of figures, but if I try that here it puts them back in a horizontal row.
How do I do these two things? Wrap text around stacked subfigures, and put a box around it.
\documentclass[11pt]{amsart}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{floatrow}
\DeclareFloatVCode{largevskip}
{\vskip 20pt}
\floatsetup[figure]{style=plain,capbesideposition={inside,center},floatrowsep=qquad,capbesidesep=quad,subfloatrowsep=qquad,rowpostcode =largevskip}
\captionsetup[figure]{font=small}
\usepackage{subfig}
\usepackage{wrapfig}
\usepackage{lipsum}
\begin{document}
\lipsum[1-2]
\begin{wrapfigure}{r}{0.4\textwidth}
%\begin{figure}
\ffigbox[\FBwidth]
% {\setlength\fboxsep{4pt} \fbox
{\begin{subfloatrow}
\ffigbox[\FBwidth]
{\includegraphics[width=\textwidth]{example-image-a}}
{\caption{Subcaption 1}\label{sfig:ex1}}
\end{subfloatrow}
\begin{subfloatrow}
\ffigbox[\FBwidth]
{\includegraphics[width=\textwidth]{example-image-a}}
{\caption{Subcaption 2}\label{sfig:ex2}}
\end{subfloatrow}
\begin{subfloatrow}
\ffigbox[\FBwidth]
{\includegraphics[width=\textwidth]{example-image-a}}
{\caption{Subcaption 3}\label{sfig:ex3}}
\end{subfloatrow}}
% }
{\caption{asdf!} \label{fig:ex}}
\end{wrapfigure}
%\end{figure}
\lipsum[3-4]
\end{document}

