Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am a relatively new LaTeX user, so bear with me. I am using wrapfigure to present figures in a grant application (read: space is at a premium). All of a sudden, one of my figures is being presented under the text. I have done a lot of debugging including replacing the file from another figure file (still has the problem) but putting the original figure into other analogous code reproduces the problem with different code. Changing the file to a JPG from a PDF doesn't help.

Anyways, I've spent several hours on this and any help would be greatly appreciated! I've posted the relevant code.

image

\begin{wrapfigure}{r}{0.3\textwidth}

\begin{center}

\vspace{-38pt}

\includegraphics[width=0.3\textwidth]{infantpilotresults-cropped.pdf}

\vspace{-27pt}

\caption{\emph{Six month-olds' looking to unexpected visual omissions.}}

\vspace{-15pt}

\label{figure:prelim1results} 

\end{center}

\end{wrapfigure}
share|improve this question
    
Is there a page break near the problematic figure? –  Gonzalo Medina Sep 20 '12 at 3:25
    
Not an explicitly forced one. e.g. \newpage –  Lauren L Emberson Sep 20 '12 at 3:31
    
Please try to remove the \vspace. It might be that the total of the \vspace is more than the height of the figure. –  Guido Sep 20 '12 at 3:37
    
THanks for the suggestion but unfortunately that doesn't help. I took out all of the vspace and it shifted the figure but just behind the text. –  Lauren L Emberson Sep 20 '12 at 3:46
    
@LaurenLEmberson pagebreaks (even non explicit ones) can be problematic if they occur in the place where the wrapfigure is supposed to appear. Try changing the wrapfigure to another location and see if that solves the problem; also, remove the \vspace commands. –  Gonzalo Medina Sep 20 '12 at 3:46

1 Answer 1

After the comments to the original question it is clear that the problem was caused by a page break. Pagebreaks (even non explicit ones) can be problematic if they occur in the place where the wrapfigure is supposed to appear. The wrapfig package documenatation mentions this explicitly:

The environment should be placed so as to not run over a page break.

Moving the wrapfigure environment to another location fixes the problem.

As a side note, instead of using the center environment it could be better to use the \centering command; also, perhaps you might want to reconsider the use of the \vspace commands.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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