tags:

views:

3217

answers:

2

I have a LaTeX document with an image in it. There is a section, four subsections, the latter 3 having just some text, and the first having a description environment with some stuff.

I want to have an image on the top right and have everything text wrap nicely around it.

The wrapfig package takes an entire column away (so text below the images gets wrapped to a fixed width even without the image there) and pushes the description environment past the left margin, and the floatflt package puts the image exactly where I want it, but no text gets wrapped.

I have the floatflt/wrapfig environment above the initial section (I get the best image placement this way) but moving it to various other places doesn't work either.

Are their any other ways to wrap the text around the image?

Some examples of fail can be seen here: http://drop.io/a3dbxte

+3  A: 

wrapfig is the best i've found, however, you need to put the wrapfig code above the paragraph you want it to wrap into:

\begin{wrapfigure} \includegraphics... \end{wrapfigure}
This is the paragraph of text you want the figure to "wrap" into... etc etc.

If you put the wrapfig code under the paragraph you want to wrap into, it will obviously wrap into the next paragraph, producing an undesirable result.

you also mention a 'column' which makes me think you are using a multi-column layout, which probably isn't going to work that well with wrapfig.

When asking a specific question about latex, you should include a minimal working example, that is, enough of your preamble and body code/text so that people can recreate your problem.

EDIT: Ah. i see what you mean. wrapfig can take an optional line height argument:

\begin{wrapfigure}[line-height]{r}{width}

where line-height is a positive integer.

your solution would probably look like this:

\begin{wrapfigure}[10]{r}{2.5in}
\centering
\includegraphics[width=2in]{governator.jpg}
\end{wrapfigure}

EDIT #2: wrapfig/floatflt + enumerate, itemize = not working. the packages are incompatible with one another. For a "wrapfigure" effect with an environment, i.e., enumerate, itemize, etc etc., You should put the environment in a minipage and the graphic in in a minipage, then set the two minipages next to each other. something to the effect of (i put them in a tabular environment as well):

\begin{tabular}{l l}
\begin{minipage}[0.5\textwidth]
\begin{enumerate}
\item
\end{enumerate}
\end{minipage}
&
\begin{minipage}[0.5\textwidth]
\includegraphics...
\end{minipage}
\end{tabular}
Mica
When I say the wrapfig package takes an entire column, I mean it seems to allocate an entire column on the page, but I have no column layout at all.wrapfig, section, subsection, description, subsection, subsection, subsectionThat's it.
Daniel Huckstep
I uploaded some fail examples.
Daniel Huckstep
somehow i missed your list environment... wrapfig/floatflt + any environment = no working.
Mica
put two minipages side by side. or ditch the environment.
Mica
@Mica Write out an answer with a minipage example and I'll accept it. I already did it, but if you write it out I can accept it and give you the rep.
Daniel Huckstep
added some stuff. glad i could be of help.
Mica
A: 

I did some experimenting and your example is failing because wrapfig is unable to cope with the \section commands and the list environment. If you just put a bunch of text around the wrapfig, it all works fine. If you have either \section or \begin{description}, wrapfig becomes hopelessly confused.

I recommend you do a bunch of \parshape commands by hand.

Norman Ramsey