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.)

4
  • I see, and then the idea is that on each page, the figure occurs, say, 2.5" down from the top? Oct 18, 2010 at 17:43
  • @Antal - That is correct.
    – Andrew
    Oct 18, 2010 at 17:44
  • I think you may be forced to adjust each figure individually.
    – dank
    Oct 19, 2010 at 10:47
  • Even with setting each box's position individually, is doing so still possible while keeping the wrapping? (Although I bet I can set them all at once by creating a custom command for them.)
    – Andrew
    Oct 19, 2010 at 13:33

2 Answers 2

8
+50

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.

3
  • multiple-span.txt (putting this here for my own purposes)
    – Andrew
    Nov 16, 2010 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. Nov 16, 2010 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. Nov 17, 2010 at 3: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 ;-)

1
  • 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 8, 2010 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.