0

Not sure exactly how to describe this. Here's what the pdf looks like:

enter image description here

Immediately after figure 4.6, the text correctly returns to full lines. But then with the next item in the description list, the text acts as though it still needs to wrap around the figure.

Providing an MWE for this is a bit complicated, as this behavior only shows up when things are "just so," but here's my code for the figure and the list:

\begin{wrapfigure}[16]{R}{0.4\textwidth}
    \captionsetup{skip=0.5\baselineskip,size=footnotesize}
    \centering
    \includegraphics[width=0.35\textwidth]{Figures/VIcurves}
    \rule{.4\textwidth}{.4pt}
    \caption[Example V-I curve for solar PV panel]{Example V-I curve for solar PV panel \cite{solarex_millenia_1999}.}
    \label{fig:VIcurves}
\end{wrapfigure}

Blah blah blah

\subsubsection{Inverters}

Blah blah blah

\begin{description}
    \item[UPS inverters] use mains power to charge a battery bank, and supply ac loads with power from the batteries when mains power is not avaialable. Three 700 \si{VA} UPS inverters are in use at CREST.
    \item[Solar UPS inverters] use solar PV input to charge the batteries and supply loads, when available. One 2400 \si{VA} solar UPS inverter is in use at CREST.
\end{description}
2
  • Reading the wrapfig manual on the first page: 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. ;-)
    – user31729
    Apr 26, 2017 at 18:26
  • @ChristianHupfer then it seems "immediately" is relative - I edited my code snippet to reflect the fact that there is a paragraph, a new section start, and a second paragraph, between the figure and the list.
    – LShaver
    Apr 26, 2017 at 18:32

1 Answer 1

1

You can interrupt and resume the description environment, emulating a vertical spacing of \itemsep between the two environments:

    \documentclass{report}
    \usepackage{caption}
    \usepackage{wrapfig, siunitx}
\usepackage{enumitem}
    \usepackage{graphicx}%[demo]
    \usepackage[showframe]{geometry}
\usepackage{lipsum, calc}
\setcounter{secnumdepth}{3}
    \begin{document}
\setcounter{chapter}{4}
\setcounter{section}{4}
\setcounter{subsection}{4}
\setcounter{subsubsection}{1}

\begin{wrapfigure}[17]{R}{0.4\textwidth}
    \captionsetup{skip=0.5\baselineskip,size=footnotesize}
    \centering
    \includegraphics[width=0.35\textwidth]{hare-blazon}
    \rule{.4\textwidth}{.4pt}
    \caption[Example V-I curve for solar PV panel]{Example V-I curve for solar PV panel \cite{solarex_millenia_1999}.}
    \label{fig:VIcurves}
\end{wrapfigure}

\lipsum[5]

\subsubsection{Inverters}

Blah blah blah

\begin{description}
    \item[UPS inverters] use mains power to charge a battery bank, and supply ac loads with power from the batteries when mains power is not available. Three 700 \si{VA} UPS inverters are in use at CREST.
\end{description}
\leavevmode\vspace*{-\dimexpr\topsep + 2\partopsep + \baselineskip -\itemsep}
\begin{description}
    \item[Solar UPS inverters] use solar PV input to charge the batteries and supply loads, when available. One 2400 \si{VA} solar UPS inverter is in use at CREST.
    \item[UPS inverters] use mains power to charge a battery bank, and supply ac loads with power from the batteries when mains power is not available. Three 700 \si{VA} UPS inverters are in use at CREST.
\end{description}

\end{document}

enter image description here

2
  • That works, but this seems like a bug to me.
    – LShaver
    Apr 27, 2017 at 21:45
  • What is a bug? What happens without this trick? It's known wrapfig and all similar packages are not really compatible with lists environments. You can try using the insbox plain TeX macro package, but won't float, and you'll have to use \captionof{figure}{…}.
    – Bernard
    Apr 27, 2017 at 21:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .