17

In Microsoft Word, it is common to create a floating text box, separate from the normal body text, that can be placed anywhere on the page. The body text will then wrap around this text box so everything is readable.

In (La)TeX, the wrapfigure package allows figures to be created that the body text will wrap around, but they may only be placed at the beginning of paragraphs and on the edges of the page. The package doesn't seem to allow absolute placement independent of the body text and margins. Using the absolute-placement package textpos in conjunction with wrapfig will simply break the wrapping.

So how can I have the best of both worlds—text wrapping and absolute placement (at the very least, vertical placement)?

Something like the diagram in this question, or this image from Word.

(Edited for generality and clarity.)

Andrew
  • 1,514

2 Answers2

8

Placing a picture somewhere on the page is easy. The problem is the wrapping. It is easy to say "indent line 5-10 of the next paragraph". But due to the asynchronic page builder there is in tex no way (unless your document is very simple) to say "indent line 5-10 of the next page". Perhaps it is possible with luatex. But with pdflatex you will have to do it manually. See also on CTAN wrapfig/multiple-span.txt.

Ulrike Fischer
  • 327,261
  • multiple-span.txt (putting this here for my own purposes) – Andrew Nov 16 '10 at 17:26
  • So maybe this is another instance where TeX being Turing complete is of no help? Having to follow the instructions in multiple-span.txt is a real nuisance. – Hendrik Vogt Nov 16 '10 at 18:40
  • 1
    @Hendrik — To do this in TeX would require you to hook into \everypar from the very beginning of the text, measure each paragraph before it's set, and keep track of where you are on the page at the end of every paragraph. (Perhaps using the output routine, but not necessarily; see vwcol for an example of all this.) Possible, and easier if you can assume paragraph text only, but this hasn't been implemented in any format or package that I'm aware of. Messy business indeed. – Will Robertson Nov 17 '10 at 03:37
3

I would suggest for you to dive into tikz manual. If you can use pdflatex and produce pdf directly, you can do absolute page placements with tikz, and later just do the usual includegraphics ;-)

Dima
  • 12,427
  • 8
  • 40
  • 53
  • Thanks for introducing me to Tikz, it's fantastic. I've gotten the text boxes styled exactly how I want with it. But I'm still unable to figure out how to get text to wrap around tikzpictures while using absolute positioning; I wind up with overlapping text. – Andrew Nov 08 '10 at 17:42