Document 333

Using the float package with SWP/SW

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

When LaTeX typesets a document, it places text and graphic objects on the page as pleasingly as possible, taking into consideration line breaks, page breaks, and division headers. Floating objects, which are movable rather than being anchored to a specific location on the page, provide some flexibility during the page layout process. LaTeX can move floating objects around to determine their best placement and final position in the typeset document.

The two typical floating objects in LaTeX are tables and figures; several LaTeX packages define other floating objects. SWP and SW use the figure floating object for graphics that float. Tables that float are created in SWP and SW using the fragment Table - (4x3, floating) or, in Version 3.0, the table4_3 fragment.

The placement of floating objects is determined by placement options. The placement options for each object are simply suggestions to LaTeX, and LaTeX often seems to ignore them, especially the "here" placement option. The float package provides a way to force the placement of a floating object in a specific location.

The "Here" placement option provided in the float package forces LaTeX to place the floating object where it appears in the document file, even if the placement is typographically ill advised. If not enough room remains on the page to hold the floating object, LaTeX moves it to the next page, leaving blank space on the page before. Additional information is available in the documentation for the float package available in the online Help.

The instructions below explain how to use the float package with SWP and SW to force the placement of floating objects in a specific location. The method differs depending on whether you are creating a SW/SWP/SN document, a Portable LaTeX document, or (in Version 5.0) a PDF file. The method used to position floating tables is the same for all document types. Note that if you're using Version 3.0, you must update tcilatex.tex before using the float package.

Forcing the placement of floating graphics where they appear in the document file

For documents saved as SW/SWP/SN Document (*.tex) files

  1. If it is not already present, add the float package to your document.

  2. Insert a graphic.

  3. Edit the properties of the graphic to specify only the "here" placement:

    1. From the Edit menu, choose Properties to open the Graphic Properties dialog.

    2. Choose the Layout tab.

    3. In the Placement area, select Floating, check Here, and uncheck all other placement options.

    4. Choose OK.

For documents saved as Portable LaTeX (*.tex) files or PDF files

The program doesn't use the file tcilatex.tex when you create a Portable LaTeX file or a PDF file. Therefore, to use the "here" placement option of the float package, you must use a structure similar to the one used by the Table - (4x3, floating) fragment.

  1. If it is not already present, add the float package to your document.

  2. Place the insertion point where you want the graphic to appear and add the Table - (4x3, floating) fragment.

  3. Replace the sample table in the fragment with a graphic.

  4. Edit the properties of the graphic to specify In Line placement:

    1. From the Edit menu, choose Properties to open the Graphic Properties dialog.

    2. Choose the Layout tab.

    3. In the Placement area, select In Line.

    4. Choose OK.

  5. In the fragment, change the floating table to a floating graphic:

    1. Edit the properties of the bbox.wmf box, which contains the command \begin{table}[tbp]\centering.

    2. Change the \begin{table} entry to \begin{figure}.

    3. Choose OK.

    4. Edit the properties of the ebox.wmf box, which contains the command \end{table}.

    5. Change the \end{table} entry to \end{figure}.

    6. Choose OK.

  6. Edit the properties of the floating object to specify only the "here" placement:

    1. Edit the properties of the bbox.wmf box, which now contains the command \begin{figure}[tbp] \centering.

    2. Change the [tbp] entry to [H].

    3. Choose OK.

Forcing the placement of floating tables where they appear in the document file

  1. If it is not already present, add the float package to your document.

  2. Place the insertion point where you want the table to appear and add the Table - (4x3, floating) fragment.

  3. Edit the properties of the floating table to specify only the "here" placement:

    1. Edit the properties of the bbox.wmf box, which contains the command \begin{table}[tbp] \centering.

    2. Change the [tbp] entry to [H].

    3. Choose OK.

Updating tcilatex.tex with Version 3.0

If you are using Version 3.0, you must update tcilatex.tex before using the float package. Follow these download instructions only once.

  1. Download the updated version of tcilatex.tex.

  2. Save the file in the \TCITeX\TeX\LaTeX\tci subdirectory of your SWP or SW program directory (usually c:\swp30 or c:\sw30). This will replace an existing file of the same name.

The updated version of tcilatex.tex can be identified by the string TCILATEX Macros for Scientific Word 3.0 <05 August 1998> near the beginning of the file. This string will also appear in the .log file created when LaTeX compiles your document.

See also

Last revised 01/30/06

The information in this frame was created with Scientific WorkPlace.