[Tex/LaTex] wraptable generates table overlying text in XeLaTeX

tableswrapfigure

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.

Best Answer

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.

enter image description here

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