84

The behaviour you describe is caused by using the wrapfig environment too close to a page break, as the following example demonstrates: \documentclass{article} \usepackage{wrapfig} \usepackage{lipsum} \begin{document} \lipsum[1-4] \begin{wrapfigure}{r}{5cm} \centering \rule{3cm}{7cm} \end{wrapfigure} \lipsum[1-6] \end{document} The wrapfig package ...


32

With the text and image as they are, wrapfig needs a bit of help. You could tell it to stop wrapping after 29 lines: \begin{wrapfigure}[29]{l}{0.5\textwidth} But the result is rather squeezed: A much better result in this case is to simply add \clearpage before the \section and move it to the next page.


31

The spacing around the wrapfigure is given by two lengths: \columnsep (for horizontal padding) and \intextsep (for vertical padding). Here's an example illustrating the difference between the default and setting them all to 0pt: \documentclass{article} \usepackage{graphicx,lipsum,wrapfig}% http://ctan.org/pkg/{graphicx,lipsum,wrapfig} \begin{document} % ...


29

As @prettygully says, the wrapfigure environment takes an optional 1st argument called number of narrow lines; from the documentation: Compare the following (default): \documentclass{article} \usepackage{lipsum} % sample text \usepackage{wrapfig} \begin{document} \begin{wrapfigure}{r}{3cm} \centering \rule{20pt}{10pt} \caption{My caption} \end{...


26

Here is my proposal for your code: \documentclass{article} \usepackage{float} \usepackage{graphicx} \begin{document} \begin{minipage}{0.5\textwidth} \begin{figure}[H] \includegraphics{figure1} \caption{\label{fig:blue_rectangle} Rectangle} \end{figure} \end{minipage} \hfill \begin{minipage}{0.45\textwidth} \begin{itemize} \item *Rectangle \item *Color: ...


25

The cutwin package (and some \parshape gymnastics) can be used here: \documentclass{article} \usepackage{cutwin} \usepackage{caption} \usepackage{graphicx} \usepackage{lipsum} \begin{document} \renewcommand\windowpagestuff{% \hspace*{25pt}\includegraphics[height=4cm]{ctanlion} \captionof{figure}{A test figure.} } \opencutleft \begin{cutout}{2}{10pt}{0....


22

FWIW, wrapfigure works out of the box in ConTeXt. So, it is clearly not a limitation of TeX. \setuppapersize[A5] \useexternalfigure[ctanlion][http://www.ctan.org/lion/ctan_lion_350x350.png][width=3cm] \starttext \placefigure[left,2*hang]{Test} {\externalfigure[ctanlion]} \startitemize[n] \item \input ward \item \input ward \item \input ward \...


22

Instead of using the scale option for \includegraphics, you could use width and select the same width that was declared for the wrapfigure environment: \documentclass[10pt,a4paper]{article} \usepackage[demo]{graphicx} \usepackage{wrapfig} \usepackage{lipsum} \begin{document} \begin{wrapfigure}{r}{0.5\textwidth} \centering \includegraphics[width=0.5\...


20

The accepted answer offers one method (make the figure float). If all you need is to remove the white box on the subsequent page, you can just add negative spacing. Adapting Gonzalo Medina's example: \documentclass{article} \usepackage{wrapfig} \usepackage{lipsum} \begin{document} \lipsum[1-4] \begin{wrapfigure}{r}{5cm} \centering \rule{3cm}{7cm} \...


19

\documentclass{article} \RequirePackage[demo]{graphicx} \usepackage{helvet}\renewcommand{\familydefault}{\sfdefault} \usepackage{lettrine} \usepackage{wrapfig} \newcounter{cnt}\setcounter{cnt}{0} \def\t{\stepcounter{cnt}\thecnt. cat sat on the mat. } \newdimen\tttaa \newdimen\tttbb \renewcommand\thepage{\the\numexpr(\value{page}+1)/2\relax} \makeatletter ...


18

I recommend you take a look at the cutwin package. Here's an MWE (Minimum Working Example) that demonstrates how it might be used in practice: \documentclass{article} \usepackage{cutwin,lipsum} \usepackage[demo]{graphicx} \opencutright \begin{document} % Define contents of "cutout window" before starting % the cutout environment. For this MWE, use a % "...


17

Using wrapfig in lists is explicitly unsupported, but if you want to do it anyway it works if you help it a bit: \documentclass[a4paper,12pt]{article} \usepackage[T1]{fontenc} \usepackage[demo]{graphicx} \usepackage{wrapfig} \usepackage{lipsum} \begin{document} This is an example: first paragraph is OK but the second have the problem! \begin{itemize} \...


15

Please always post complete small documents, and post code sections not images of code. However it appears from your fragment that you have omitted the arguments to wrapfigure the line \begin{wrapfigure} should be something like \begin{wrapfigure}{r}{0.5\linewidth}


14

The table environment is for normal floating tables. You do not need to put a tabular inside a table environment. You should use the wraptable environment instead. \begin{wraptable}{l}{40mm} \begin{tabular}{l | c} A & Cell 1 \\ \hline B & Cell 2 \\ \hline \end{tabular} Some random text \end{wraptable} This should be to the ...


14

When working in restricted width places you need to use \linewidth (or \columnwidth in other context) to get a relevant length for scaling. Also wrapfig argument which you have provided with 5 is the number of lines to be used in the wrapped paragraph. Hence the rest leaks into the paragraph below. Using something like 11 does the job. \documentclass[25pt, ...


13

You can put the algorithm inside of a minipage, put that inside of the wrapfigure, and it should work like a charm. \documentclass{article} \usepackage{algorithmic} \usepackage{algorithm} \usepackage{wrapfig} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{wrapfigure}{L}{0.5\textwidth} \begin{minipage}{0.5\textwidth} \begin{algorithm}[H]...


13

The \parshape primitive of TeX allows you to specify the paragraph shape on a line-by-line basis using an <indent> <width> pair. Why include this approach when Mico already did such a nice and clean approach via cutwin? Well, using \parshape allows you to typeset arbitrary (non-rectilinear) shapes as well, making it useful to understand how it ...


13

I know it's not really an answer to the question but I'd try to avoid wrapfigure altogether. There are two alternative packages called picinpar and picins. picins is often considered the successor of picinpar but I don't like it personally. In its documentation the amount of bad typography is only surpassed by the number of drop shadow effects. picinpar ...


13

The horizontal gap between the contents of the wrapfig environment and the surrounding paragraph text is \columnsep (from the wrapfig documentation, section 2 Sizing and optional overhang, p 3): LaTeX will wrap surrounding text around the figure, leaving a gap of \intextsep at the top and bottom, and \columsep at the side, by producing a series of ...


13

Another simple solution would consist in making LaTeX believe the figure height is smaller than it really is, thanks to the optional arguments of the \raiseboxcommand. Here is a code: \documentclass[11pt, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{...


12

When positioning the wrapped float, you can specify uppercase L or R for the position, instead of lowercase l, r. This allows the wrapfigure environment to float and LaTeX can move it to avoid page overflow.


12

It helps when you post questions to make complete documents including loading all the packages you need, I guessed \usepackage{booktabs,xfrac,amsmath} in this case. Also I fixed a few font issues (for multi-letter identifiers and angle brackets) Changing margins within a LaTeX list is a bit delicate, but this is I think the layout you want \documentclass{...


12

The document multiple-span.txt explains how to use wrapfig with two-column cutouts. Three little examples showing the layout od the image in the question and two other possible configurations: \documentclass[twocolumn]{article} \usepackage{lipsum} \usepackage{wrapfig} \usepackage{graphicx} \begin{document} \vspace*{18\baselineskip}Nam dui ligula, ...


11

In order to make a cutout shape the tex \parshape primitive has to be used to set the line length and indent for the initial lines of a paragraph (with all later lines using the last set length). This makes it rather difficult to make the parameter be a length, in fact if it could be a length you would almost never need to set it manually as that can be ...


11

Use two minipages and load the capt-of package to write the caption through the command \captionof \documentclass[demo]{report} \usepackage{blindtext} \usepackage{geometry} \usepackage{float} \usepackage[italian]{babel} \usepackage[most]{tcolorbox} \usepackage{tikz} \usepackage{varwidth} \usepackage{capt-of} \tcbset{enhanced,colback=cyan!5!white,colframe=...


10

\parshape can be used in the following setup: \documentclass{article} \usepackage{lipsum}% http://ctan.org/pkg/lipsum \usepackage{graphicx,wrapfig}% http://ctan.org/pkg/{graphicx,wrapfig} \begin{document} \begin{wrapfigure}{o}{0.5\textwidth} \centering \includegraphics[width=2in]{triangle.png} \end{wrapfigure} \noindent\lipsum[1] \null\hfill\smash{% ...


10

You are top-aligning your minipages. If a minipage (or some other box) starts with normal text then "top-aligning" means that its baseline is at the baseline of the first text line. But if it starts with some \vspace then this determines the baseline. Inside a minipage wrapfig adds at first a zero \vspace. The easiest way to "avoid" the gap is to add a ...


9

The wrapfigure and wraptable environments don't work inside lists; the wrapfig documentation clearly mentions this fact: The environment must not be placed in special places like lists. You can use the cutwin package instead: \documentclass{book} \usepackage{amsthm} \usepackage{cutwin} \usepackage{lipsum} \theoremstyle{plain} \newtheorem{thm}{Theorem} \...


Only top voted, non community-wiki answers of a minimum length are eligible