# Tag Info

## Hot answers tagged wrapfigure

35

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.

32

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

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: ...

24

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....

24

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\...

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 \...

21

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} \...

20


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 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 ﬁgure, leaving a gap of \intextsep at the top and bottom, and \columsep at the side, by producing a series of ...

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

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

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, ...

12

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=...

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 ...

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 could simply include the wrapfig and the wrapped text in brackets as follows: { \begin{wrapfigure}{l}{0.5\textwidth} \rule{4cm}{12cm} \end{wrapfigure} \lipsum[1] } \section{Hello} This stops the wrapping at the line where the wrapped text stops. As pointed out by Andrew Swann, this doesn't work if the figure is longer than the text; in that case, the ...

10

I'm gonna answer my own question, in case someone stumbles over this. I used the cutwin package, as suggesten in this thread. (Thanks Schumacher for the link). The output came out pretty nice. Below is the actual code I used in my report. \documentclass[12pt]{scrreprt} \usepackage{graphicx,pstricks,cutwin} \usepackage[onehalfspacing]{setspace} \begin{...

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} \...

9

Instead of using 9cm, use 0pt, then the natural width of the wrapfigure will be used to align the surrounding text. It may also look weird to have an indent in the first line, so adding \noindent The primary... makes it look a little less weird. \documentclass{article} \usepackage{pgfplots,wrapfig} \begin{document} Whenever we deal with integration, we ...

9

You can use R rather than r and then wrapfig will allow the figure to float to a certain extent to avoid falling off the end of a page.

9

wrapfig doesn't work in lists, and questions is just another version of a list. The following is a quick and dirty reimplementation of https://tex.stackexchange.com/a/453624/117050 to work with enumerate like lists instead of with itemize. It uses insbox just like @Bernard's answer, but shouldn't require a manual paragraph. It does only implement the code to ...

8

Although there was indeed a bug in my patch to the parcolumns package in the thread about alternating columns, it turned out that the wrapfigure problem here is an incompatibility between the parcolumns and wrapfig packages. You can see that from the following example \documentclass{article} \usepackage{parcolumns} \usepackage{wrapfig} \usepackage{lipsum} ...

8

You can use the package lettrine: This is the MWE: \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{mdframed} \usepackage{lettrine} \usepackage{lipsum} % dummy text \begin{document} \begin{mdframed} \lettrine[image,lines=3]{Information}{} \lipsum[1] \end{mdframed} \end{document} This MWE need a real Information.pdf with the appropiate ...

8

It seems to work OK using r instead of R (lowercase specifiers don't allow the object to float); I also added some value for the hanging indentation: \documentclass{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{wrapfig} \begin{document} \blindtext[3] \begin{wrapfigure}{r}[-10pt]{0.5\textwidth} \vspace*{\topsep} ...

8

I've extended your example to a MWE: \documentclass{article} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{lipsum} \begin{document} \lipsum[1] \begin{wrapfigure}{r}{0.5\textwidth} \begin{center} \includegraphics[width=0.48\textwidth]{gull} \end{center} \caption{A gull} \end{wrapfigure} \lipsum[2-3] \end{document} Which is resulting ...

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