2

I am trying to add image to page, on the top right corner that contains couple of lists. I'm using wrapfigure package therefore i want text below image. However when image is inserted where i want, there is empty space under the image, same width as image,for the rest of the page. Its like it failed to wrap text around the image and pushed all text to the left. How do i make text to the lef of the image and under the image ?

Here is code i have used

\documentclass{article}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{float}

\begin{document}
bla bla bla bla bla bla bla bla

\begin{wrapfigure}{tr}{0.25\textwidth}
    \includegraphics[width=0.3\textwidth]{Name of the image}
    \caption{Image}
 \end{wrapfigure}

\section{Lists}

   \subsection{list 1}

       \begin{itemize}
          \item bla bla
       \end{itemize}

   \subsection{list 2}
        \begin{itemize}
          \item bla bla
        \end{itemize}

\end{document}
  • 1
    wrapfigure doesn't have that much documentation, but the one thing its documentation does say is don't use near a list. – David Carlisle Jan 5 '16 at 17:10
  • is there a way around it like using minipage or something? – Marius Kriauciunas Jan 5 '16 at 18:59
  • BTW, tr is not a valid entry. Just r, l, i and o (or R, L, I and O). – John Kormylo Jan 5 '16 at 21:46
1

You can always use a minipage. In this case, the list and the picture are about the same size, so nothing fancy is needed. The following aligns the top of the picture to the baseline of \section (the first baseline in the left minipage).

\documentclass{article}
\usepackage{graphicx}% for \includegraphics
\usepackage{caption}% for captionov

\begin{document}
bla bla bla bla bla bla bla bla

\noindent\begin{minipage}[t]{0.65\textwidth}
\section{Lists}

   \subsection{list 1}

       \begin{itemize}
          \item bla bla
       \end{itemize}

   \subsection{list 2}
        \begin{itemize}
          \item bla bla
        \end{itemize}
\end{minipage}\hfill
\begin{minipage}[t]{0.3\textwidth}
    \raisebox{-\height}{\includegraphics[width=\textwidth]{example-image}}
    \captionof{figure}{Image}
 \end{minipage}

\end{document}

no wrapfig


Here is a fancier case, using a \parbox inside an \item in order to use \hangindent. The picture is overlaid on top of the list first so that the list can flow past it. The fudge factor -5ex is used to get past the white space above\section.

\documentclass{article}
\usepackage{graphicx}% for \includegraphics
\usepackage{caption}% for captionov
\usepackage{enumitem}
\usepackage{mwe}

\newcommand{\nopar}{\bgroup\parfillskip=0pt\par\egroup}

\begin{document}
bla bla bla bla bla bla bla bla

\noindent\raisebox{\dimexpr -5ex-\height}[0pt][0pt]{\rlap{\hspace{0.7\textwidth}\begin{minipage}{0.3\textwidth}
    \includegraphics[width=\textwidth]{example-image}
    \captionof{figure}{Image}
 \end{minipage}}}%
\section{Lists}
   \subsection{list 1}

       \begin{itemize}
         \item \parbox[t]{\linewidth}{\hangindent=-0.35\textwidth\hangafter=-6
               \lipsum[1]}

         \item bla bla
       \end{itemize}

   \subsection{list 2}
        \begin{itemize}
          \item bla bla
        \end{itemize}


\end{document}

hangindent

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.