1

I read that itemize and wrapfigure don't go along but the figure doesn't even show where I entered it but at the end of the document. My intension is that my figure shows after the table and that the text wraps around it. I use the itemize so that I have a number before my questions but not really to itemize something.

    \documentclass[a4paper]{article}
    \usepackage{amsfonts}  
    \usepackage{amsmath}
    \usepackage{amssymb}
    \usepackage{graphicx}
    \usepackage{fancyhdr}
    \usepackage[none]{hyphenat}
    \usepackage{gensymb}
    \usepackage{wrapfig}
    \usepackage{float}

    \begin{document}
    \pagestyle{fancy}

    \item\textbf{question}\\

Here I inserted the table.

    \begin{wrapfigure}{L}{0.5\textwidth}
    \centering
    \includegraphics[width=0.4\textwidth]{vraagNMR1.PNG}
    \end{wrapfigure}

    Here is the answer to the question and the text that should be around the figure.

This is how it should look like

Yara
  • 13
  • 3
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Skillmon Mar 04 '18 at 15:16
  • 1
    Can you draw a sketch how the layout should look like? Maybe there is an easier solution without a wrapfigure. – samcarter_is_at_topanswers.xyz Mar 04 '18 at 15:17
  • 1
    From the wrapfig manual: "You must not specify a wrapfigure in any type of list environment or or immediately before or immediately after one. It is OK to follow a list if there is a blank line (\par) in between." – Skillmon Mar 04 '18 at 15:18
  • You could take a look here for something that works in lists like itemize. It doesn't use wrapfig, though. – Skillmon Mar 04 '18 at 15:21
  • It is a lot harder to put something to the left of a list that to the right, since lists set \leftskip themselves. See https://tex.stackexchange.com/questions/292780/a-list-and-a-figure-side-by-side – John Kormylo Mar 04 '18 at 15:35

1 Answers1

4

Instead of fighting with wrapfigure, I'd use simple minipages to place the image next to the itemize. If the itemize is too long to fit next to the image, one can manually resume it after the minipages.

\documentclass[a4paper]{article}
\usepackage{amsfonts}  
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage[none]{hyphenat}
\usepackage{gensymb}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{multicol}

\begin{document}

\begin{tabular}{cc}
a & b \\
c & d
\end{tabular}

\begin{minipage}{.45\textwidth}
    \includegraphics[width=\linewidth]{example-image}
\end{minipage}
\begin{minipage}{.5\textwidth}
    \begin{itemize}
        \item Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. 
        \item Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. 
    \end{itemize}
\end{minipage}

\begin{itemize}
 \item  Nam dui ligula, fringilla a, euismod sodales, sollicitudin vel, wisi. Morbi auctor lorem non justo. 
    \item Nam lacus libero, pretium at, lobortis vitae, ultricies et, tellus. Donec aliquet, tortor sed accumsan bibendum, erat ligula aliquet magna, vitae ornare odio metus a mi. 
\end{itemize}

\end{document}

enter image description here

  • Thank you this really helped, I had to modify it a little but it looks wonderfull now! – Yara Mar 04 '18 at 16:48