3

enter image description here

I want to format my documents in such a way that the image is to the right of the text and the text should wrap to it. Can you help me to do this? By the way I am using enumitem package.

Schweinebacke
  • 26,336

2 Answers2

3

With enumtiem's series and resume and convenient minipages you can solve the problem.

\documentclass{article}
\usepackage{enumitem}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\begin{enumerate}[series=myproblems]
\item \lipsum[2]
\item \lipsum[3]
\end{enumerate}
\begin{minipage}{.6\textwidth}
\begin{enumerate}[resume=myproblems]
\item This is a nice problem that you can solve with \texttt{resume} option of \texttt{enumitem} package. Include your text into a \texttt{minipage} 
\item And the figure into another \texttt{minipage}
\item \dots
\item \dots
\end{enumerate}
\end{minipage}\hfill
\begin{minipage}{.3\textwidth}\centering
\includegraphics[width=\textwidth]{example-image}
\end{minipage}
\begin{enumerate}[resume=myproblems]
\item Some more problems
\item \lipsum[2]
\end{enumerate}
\end{document}

enter image description here

Ignasi
  • 136,588
2
\documentclass{article}
\usepackage{graphicx}
\usepackage{enumitem}

\begin{document}


\begin{enumerate}
\item text text text text text text text text text text text text text text text text text text text text text 

\parbox[b]{.7\textwidth}{%
    \item text text text text text text text text text text text text text text text text text text text text text 

    \item text text text text text text text text text text text text text text text text text text text text text 
}\hfill\includegraphics[width=.2\textwidth]{example-image}

\item text text text text text text text text text text text text text text text text text text text text text 
\end{enumerate}

\end{document}

enter image description here