# Wrap text around table in itemize environment

I want to create a simple table using wraptable inside the itemize environment floating it to the right and wrapping the text by the left, but the table goes to the bottom of the page or even to another page. Tried to use wraptable outside the itemize environment and happens the same. Example:

\documentclass[letterpaper,12pt,oneside]{article}
\usepackage{geometry}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fontenc}
\usepackage{lipsum}
\usepackage{wrapfig}

\begin{document}
\lipsum[1-1]
\begin{itemize}
\item \lipsum[1-1]
\begin{wraptable}{r}{0.45\textwidth}
\begin{tabular}{l l}
\hline
Some random text & More random text\\
Some random text & More random text\\
\hline
\end{tabular}
\end{wraptable}
\lipsum[1-1]
\end{itemize}
\end{document}


And if this wasn't enough, writing this example results that the wraptable doesn't work! The table goes to the bottom of the page, it's not wrapped and it doesn't get floated to the right (watch the image).

• The table even goes through \section to the bottom – Matias Schiaffino Aug 20 '17 at 6:41
• Welcome to Tex.SE. You might consider changing the title. My suggestion would be "Wrap text around table in itemize environment". MiKTeX, TexWorks and Windows 10 are all irrelevant here. – Ross Aug 20 '17 at 8:43
• Thanks. That looks better. I am pleased you were able to implement this successfully. The wrapfig approach is robust in a wide range of list-type environments. Cutwin maybe more "fragile", but generally works. – Ross Aug 20 '17 at 11:05

Here are two approaches.

The first uses wrapfig inside an adjustbox. A feature of this approach is using a strut to create sufficient space for placing the figure. This places the figure in row 1, which can not be altered (as far as I am aware).

The second approach uses cutwin. This approach defines the content of the cutout using windowpagestuff. A cutout environment is then used to place the cutout within the paragraph. In this case, I started the cutout a the second row of the paragraph, and with the cutout extending 4 rows. See the example for further details.

This is the result:

This is the code:

\documentclass[letterpaper,12pt,oneside]{article}
\usepackage{geometry}
\usepackage[spanish]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fontenc}
\usepackage{wrapfig}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{enumitem}
\usepackage{lipsum}
\usepackage{cutwin}

\newlength{\strutheight}
\settoheight{\strutheight}{\strut}

\begin{document}

\begin{itemize}[leftmargin=*]

\item aaa
\begin{wrapfigure}{c}{0.55\linewidth}
\begin{tabular}{l l}
\hline
Some random text & More random text\\
Some random text & More random text\\
\hline
\end{tabular}
\end{wrapfigure}%
%
\lipsum[2]
\item aaa
\end{itemize}

\bigskip

\opencutright
\renewcommand\windowpagestuff{% setup the image to be placed in the cutout
\centering
\begin{tabular}{l l}
\hline
Some random text & More random text\\
Some random text & More random text\\
\hline
\end{tabular}
}

% {2} = Cutout starts in row 2
% {0pt} = Cutout is flush left (0pt from left edge)
% {0.50\linewidth} = text covers 0.50\linewidth relative to right margin
% {4} = cutout extends 8 rows

\begin{itemize}[leftmargin=*]
\item aaa