I am using knitr to create inline sparkline-esque graphics. However, when knitr inserts images that it generates with R, it add a blank line, which forces LaTeX to make a new paragraph.
That is, if I have text like this (not actual knitr code...):
Lorem ipsum dolor sit amet KNITR_FIGURE_HERE Ut enim ad minim veniam, quis nostrud exercitation.
It will generate TeX output like this
Lorem ipsum dolor sit amet
\begin{knitrout}
\includegraphics{path_to_figure}
\end{knitrout}
Ut enim ad minim veniam, quis nostrud exercitation.
Which then forces the remaining text in the paragraph into a new paragraph. If I manually remove the blank line in the knitrout environment, it works inline as expected.
Hacking the knitr output to remove the blank line is non-trivial, so I'm wondering if there's a TeX command that can force a paragraph to be part of the previous one, regardless of new lines. For example, assuming \keepwithprevious is this hypothetical command...
Lorem ipsum dolor sit amet.
\keepwithprevious Ut enim ad minim veniam, quis nostrud exercitation.
...would result in this when typeset:
Lorem ipsum dolor sit amet. Ut enim ad minim veniam, quis nostrud exercitation.
Is there a way to do this in TeX?


\gobbleparslooks promising, as does\eatparat tex.stackexchange.com/a/24790/11851. I just can't get either to work right now... – Andrew Feb 12 at 17:34