# Layout text and enumerate around figure

I'd like to place a figure next to an enumerate, and have it inset into the preceding paragraph enough to align with the bottom of the enumerate environment. I managed to pull this off manually, using cutwin and minipage. However, this ended up not being as exact as I'd like - with a little fudge room at the bottom - and I'm wondering if there's a way to accomplish this without explicitly cutting lines and tweaking hspace/vspace.

I did try wrapfigure, but wasn't able to get it to stay on the same page as the enumerate, even when I put the enumerate in a minipage.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{lipsum}
\usepackage{cutwin}
\usepackage{amstext}
\usepackage{graphicx}
\usepackage{capt-of}
\usepackage{indentfirst}

\title{layout-test}
\author{Author}
\date{April 2018}

\begin{document}

\maketitle

\section{Introduction}

\vspace{8pt}

\renewcommand*{\windowpagestuff}{%
%HACKS
\vspace{18em}\hfill
\begin{minipage}[t]{0.9\textwidth}
\centering
\includegraphics[width=\textwidth]{blank.jpg}
\captionof{figure}[Something spooky]{A marvelous sample figure.}
\label{fig:sample_figure}
\end{minipage}
}
% HACKS
\opencutright
\begin{cutout}{8}{0.5\linewidth}{0pt}{8}
\lipsum[1]
\end{cutout}

% HACKS
\vspace{-1em}
\hspace{-1.75em}
\begin{minipage}{0.5\textwidth}
\begin{enumerate}
\item One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin.
\item He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections.
\item The bedding was hardly able to cover it and seemed ready to slide off any moment.
\end{enumerate}
\end{minipage}

\end{document}


I think the simplest consists in using the plain TeX macro package insbox – more specifically its \InsertBoxR{no of unshortend lines}{box inserted} macro, combined with the enumitem package, using its (undocumented) key rightmargin=.

Here is a short code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{indentfirst}
\usepackage{fbb}
\usepackage{lipsum}
\usepackage{amstext}
\usepackage{graphicx}
\usepackage{caption}
\captionsetup{format = hang, justification = raggedright, textfont = it, labelsep = newline}
\usepackage{enumitem}
\input{insbox}
\makeatletter
\@InsertBoxMargin =3mm
\makeatother
\title{layout-test}
\author{Author}
\date{April 2018}

\begin{document}

\maketitle

\section{Introduction}{8}