Document 414

How to wrap text around a floating object

Version: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific Word

You can wrap text around inline objects at the side of the page if you use the wrapfig package and add several TeX commands in the body of your document. The package creates an artificial floating environment, so the graphics and tables can carry captions that appear in the text and the list of graphics.

The picins package provides precise control over the placement of inline graphics but doesn't support inline tables.

  1. Add the wrapfig package to your document.
  2. Place the insertion point where you want to insert the floating object.
  3. Begin the wrapfigure or wraptable environment:
    1. Enter an encapsulated TeX field.
    2. In the entry area, type \begin{wrapfigure}[w]{x}[y]{z} or \begin{wraptable}[w]{x}[y]{z}

      where w is the number of vertical lines to be narrowed to accommodate the graphic or table (optional).

      x is the placement of the graphic or table (required). Uppercase indicates float; lowercase indicates exactly here:

      Position Effect
      r or R Right side of text
      l or L Left side of text
      i or I Inside edge, near the binding (two-sided documents)
      o or O Outside edge, away from the binding (two-sided documents)

      y is the amount of overhang—the distance the graphic or table should extend into the margin (optional).

      z is the width of the graphic or table (required). If you specify a width of zero (0pt), the package uses the actual width of the graphic or table to determine the wrapping width.

    3. Choose OK.
  4. Insert the inline object.
  5. If you want the object to have a caption or title:
    1. Enter an encapsulated TeX field.
    2. In the entry area, type \caption{text} where text is the caption or title you want.
    3. Choose OK.
  6. End the wrapfigure or wraptable environment:
    1. Enter an encapsulated TeX field.
    2. In the entry area, type \end{wrapfigure} or \end{wraptable} and choose OK.

If your document combines both objects wrapped around text and objects that float, LaTeX may not sequence both kinds of objects correctly, although the graphic or table numbers will be correct. You may be able to correct the situation by adding the float package and revising each regular floating object—but not the wrapfigure or wraptable objects—to specify the Here placement option.

Last revised 03/06/06

This document was created with Scientific WorkPlace.