[Tex/LaTex] Wrapfigure without line break

line-breakingwrapfigure

Ok so here is a question for all of you latex experts. Every time I use the \wrapfigure{} environment I get the following:

Notice how there is line skip right after a period. and it separates the text.
(Notice how in this 1st image there is a line skip right after a period which separates the text.)

But what I really want is this:

enter image description here

Maybe is not possible to achieve this with a simple \wrapfigure{} but if someone knows how to do it I would really appreciate the help.
Thank you hand happy Latexing!

Best Answer

It's easy using the plain TeX macro package insbox. However, it does not accept floats, so you have to put the graphic in a \parbox of the relevant width,, and use \captionof{figure}{...}.

The syntax is the following for insertion on the right side \InsertBoxR{no of unshortened lines}{object to be inserted}[optional integer]. The optional argument is the number of supplementary short lines, in case TeX doesn't calculate the exact number of short lines.

\documentclass[12pt, latin]{article}
\usepackage{babel}
\usepackage{graphicx}
\usepackage{caption}
\input{insbox.tex}
\usepackage{lipsum}

\begin{document}

\InsertBoxR{3}{\parbox{0.35\linewidth}{\includegraphics[width=\linewidth]{traccia-table}%
\captionof{figure}{Traccia table}}}[6]

\lipsum[8-9]

\end{document} 

enter image description here

Related Question