# Getting text to flow around images in either TeX or LaTex

For years I've been using HTML to produce web pages with text flowing nicely around images. Here's an example of the sort of thing:

As you can see, the images are floated left and right, and may overlap in vertical extent. There are also two images side-by-side with no text vertically overlapping.

Using HTML this is trivial, I'm using really old, outdated HTML with tables that are aligned left and right as appropriate, and the text simply flows around it.

The attempts I've made with LaTeX appear to be limited, not allowing images to overlap vertically, and insisting that any paragraph can only overlap with at most one image.

I feel like I must be missing something. I know LaTeX and Tex are page formatting systems - I used TeX for my PhD some decades ago - but extensive searching and several weeks of on-and-off hacking about have failed to produce anything cleaner than using \parshape and doing it all "by hand."

All assistance welcome. I'm using vanilla Ubuntu 14.04 (soon to be 18.04) so can use any commands available on that platform, including pdftex and pdflatex, to name just two.

• See what can be done with the plain TeX macro package `insbox`: it defines the `\InsertBoxL` and `InsertBoxR` commands. – Bernard Feb 6 '20 at 18:15
• float is a standard term in latex and a standard term in css, but has completely different meanings in the two systems. But basically the main question is do you want to say the image is 5cm down the page, on the right hand side, or do you want to say the image is on the right in the line with the word `foobar`. My previous answer shows how to do the first (at the tex primitive level) doing the second is a lot harder. – David Carlisle Feb 6 '20 at 19:52