2

I'm trying to put a picture on the left of an enumerate to exploits the space on the left. However, as you can see the result is quite dirty because of the dot appearing just on top of my picture. Is it possible to move this dot to the right, next to "Lorem"? Ideally I'd love to be able to wrap the text around the image (let me know if you know how to do), but for now I'm just using a simple minipage.

enter image description here

MWE:

\usepackage{wrapfig}
\usepackage{adjustbox}
\usepackage{lipsum}
\usepackage{graphicx}

\begin{document}

\begin{enumerate} \item \begin{itemize} \item \lipsum[1] \item \begin{minipage}[t]{.3\linewidth} \lapbox[\textwidth]{0cm}{ \raisebox{-\height}{\includegraphics[width=4.5cm]{example-image-a}} } \end{minipage}\begin{minipage}[t]{.7\linewidth} \lipsum[1] \end{minipage} \end{itemize} \end{enumerate} \end{document}

EDIT

Breaking the enumerate in the middle allows me to do what I want. But still, the wrapping is not present. Do you know how to wrap the text around my picture? enter image description here

\documentclass[a4paper,11pt]{article}
\usepackage{wrapfig}
\usepackage{adjustbox}
\usepackage{lipsum}
\usepackage{graphicx}

\begin{document}

\begin{enumerate} \item \begin{itemize} \item \lipsum[1] \end{itemize} \begin{minipage}[t]{.3\linewidth} \lapbox[\textwidth]{0cm}{ \raisebox{-\height}{\includegraphics[width=4.5cm]{example-image-a}} } \end{minipage}% \begin{minipage}[t]{.7\linewidth} \begin{itemize} \item \lipsum[1] \end{itemize} \end{minipage} \end{enumerate} \end{document}

Bernard
  • 271,350
tobiasBora
  • 8,684
  • Which document class are you using? – Bernard Sep 29 '21 at 21:56
  • 1
    The other possibility is to manually break the paragraphs. You might find \splitpap and \coninuepar useful. See https://tex.stackexchange.com/questions/611977/floating-wrapfigure-leaves-whole-article-text-wrapped-if-unnumbered-sections-are/612011?r=SearchResults&s=1|0.0000#612011 – John Kormylo Sep 29 '21 at 22:54
  • @Bernard ideally would love a document-class agnostic solution, but I'm usually using "article" or "llncs". – tobiasBora Sep 30 '21 at 10:27
  • @JohnKormylo Thanks, I guess this can work but this requires a very manual tuning process since one needs to cut at the exact good word. – tobiasBora Sep 30 '21 at 11:16
  • I started playing with a minishape environment, but never really perfected it. Currently it fits the baseline to a shape, not the top and/or bottoms of lines. See https://tex.stackexchange.com/questions/560195/patch-wrapfig-to-work-with-lines-instead-of-paragraphs/560291?r=SearchResults&s=1|12.3636#560291 Of course, it also has the same problems with lists as wrapfig. – John Kormylo Sep 30 '21 at 12:41
  • Indeed, it seems that when I put an item inside, it just stops working. – tobiasBora Sep 30 '21 at 13:56

1 Answers1

2

You need to use the environment wrapfigure

a

Try this code.

\documentclass[12pt,a4paper]{article}

\usepackage{wrapfig} \usepackage{adjustbox} \usepackage{lipsum} \usepackage{graphicx}

\begin{document}

\begin{enumerate} \item \begin{itemize} \item Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pu- rus elit, vestibulum ut, placerat ac, adipiscing vitae, felis. Cur- abitur dictum gravida mauris. Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. \item \begin{minipage}[t]{\linewidth} \lipsum[1] \begin{wrapfigure}{o}{0.3\textwidth}% r, l, i, o <<<<< \includegraphics[width=0.3\textwidth]{example-image-a} \end{wrapfigure} \lipsum[2] \end{minipage} \end{itemize} \end{enumerate}

\end{document

Using \begin{wrapfigure}{l}{0.3\textwidth} %

b

Simon Dispa
  • 39,141
  • Thanks, but I wanted the dot to also move right to the figure like in the example I have, because the wrap should start on the very first line and an alone dot is quite ugly. – tobiasBora Sep 30 '21 at 06:40
  • Also, this solution won't allow page cut after the figure due to the minipage. – tobiasBora Sep 30 '21 at 06:41