# wraptable generates table overlying text in XeLaTeX

I am using XeLaTex on OS/X. wrapfig appears to work perfectly. When I try the following:

{\bf This closing line of a paragraph emphasized}

\begin{wraptable}{r}{0.8\textwidth}
\begin{tabular}{|c|c|c|c|}\hline\hline
table contents, which is all text and numbers
\end{tabular}
\label{exposure}
\end{wraptable}

{\bf This opening line of the next paragraph emphasized}


The table is printed overlying the surrounding text. If I remove the {\bf text} at the beginning and end of the surrounding paragraphs, it works correctly.

-
welcome to tex.sx, however it would be much easier to answer your question if you edit your question to be a complete small document that shows the problem (you can use \rule{1cm}{1cm} instead of an image, so it is portable.) Note you can highlight code with the {} button (see my edit to your question) –  David Carlisle May 9 '13 at 19:44
thank you for editing my question- very helpful! –  William May 9 '13 at 20:24
It would be much easier to comment on a complete document but you are only leaving .2\textwidth for the text that is wrapping round your figure You haven't shown us what your full text width is but this is likely to be rather small, so perhaps tex can not break the text in which case it will complain about overfull box and it will stick into the table –  David Carlisle May 9 '13 at 20:34

It really isn't possible to say anything definite without an example document but I would guess that TeX is just failing to break the text into the very small space left. Using sloppypar is an option, although if the table takes up 80% of the text width, setting it as a standard full width table rather than a wraptable might be more appropriate.

Note the first line overprints in the original version but doesn't in the second at teh expense of stretched white space.

\documentclass{article}
\usepackage{wrapfig}
\begin{document}

\begin{wraptable}{r}{0.8\textwidth}
\begin{tabular}{|c|c|c|c|}
\hline\hline
1&2&3&4\\
1111&2222&3333&4444\\
\hline\hline
\end{tabular}
\label{exposure}
\end{wraptable}
one two three four one two three four
one two three four one two three four
one two three four one two three four
one two three four one two three four

\begin{sloppypar}
\begin{wraptable}{r}{0.8\textwidth}
\begin{tabular}{|c|c|c|c|}
\hline\hline
1&2&3&4\\
1111&2222&3333&4444\\
\hline\hline
\end{tabular}
\label{exposure}
\end{wraptable}
one two three four one two three four
one two three four one two three four
one two three four one two three four
one two three four one two three four
\end{sloppypar}

\end{document}

-