[Tex/LaTex] soul’s \ul{} breaks wrapfigure and textflow

soululemwrapfigure

Please, I have a nice picture without that \ul{...}, but i need that.

\documentclass{article}

\usepackage{wrapfig}
\usepackage{soul}

\begin{document}

\begin{wrapfigure}[3]{l}{30mm}
\Huge 1
\end{wrapfigure}

\ul{Lorem ipsum dolor sit amet}, consectetur adipiscing elit.
Suspendisse nec dolor eget tortor iaculis molestie et ac diam.
Aliquam feugiat tempus orci et suscipit.
Morbi varius dignissim arcu, vitae facilisis metus imperdiet id.
Morbi non mi at neque mollis elementum.
Etiam mauris velit, accumsan in fringilla nec, auctor in eros.
Etiam porta fermentum pretium. 

\end{document}

With that \ul{…} paragraph is being stretched to full width and figure goes away to the left. What is wrong?

Thanks!

ps. Actually there are graphics in wrapfigures and i really need some words to be underlined. Yes, ulem's \emph does the same as \ul. Well, yes, \underline does right thing here, but i am unhappy with \underline.

Update:
With this addition:

\usepackage{color}
...
% instead of just \Huge 1:
\fcolorbox[gray]{0.59}{1}{\parbox{30mm}{\Huge 1}}

and after making "just too long word" pdflatex produces this picture:
hyphenation does work!

So, paragraph is nicely stretched to \textwidth;

Best Answer

For wrapfig to work properly it needs to see a paragraph. You can force a paragraph by using \leavevmode.

\documentclass{article}
\usepackage{wrapfig}
\usepackage{soul}

\begin{document}
\begin{wrapfigure}[3]{l}{30mm}
\Huge 1
\end{wrapfigure}
\leavevmode\ul{Lorem ipsum dolor sit amet}, consectetur adipiscing elit.
Suspendisse nec dolor eget tortor iaculis molestie et ac diam.
Aliquam feugiat tempus orci et suscipit.
Morbi varius dignissim arcu, vitae facilisis metus imperdiet id.
Morbi non mi at neque mollis elementum.
Etiam mauris velit, accumsan in fringilla nec, auctor in eros.
Etiam porta fermentum pretium. 

\end{document}

You could also use a noindent or quitvmode or use a rule as per Seamus post.

Related Question