Document 112

How to add float.sty to a document style

Version: 2.5 - Scientific WorkPlace & Scientific Word

Note If you are using SW/SWP 3.0 or later, see Using the float package with SW/SWP.

The float.sty package provides for precise placement of floating tables and figures in documents created with non-Style Editor styles. You must use floating figures and tables to add captions that appear in the List of Figures and List of Tables. The steps below explain how to add the package to your document style. Note that the procedure differs for LaTeX2e and LaTeX2.09 styles. Note too that the procedure differs for placing figures and tables with float.sty.

To add float.sty to your LaTeX2e document style

  1. Open your SW document.

  2. From the File menu, choose Style.

  3. Choose Add Packages.

  4. Click the arrow next to the Base Package box.

  5. Select float.sty.

    If the package isn't visible:

    1. Choose Cancel.

    2. Click Go Native.

    3. When the Go Native dialog box opens, position the insertion point at the end of the last entry in the packages box.

    4. Type the name of the package you want, enclosed in curly braces, like this: {float}.

    5. Choose OK to leave the dialog box.

  6. Choose OK twice to return to your document.

  7. Change the Preamble of your document to include the float.sty option:

    1. From the File menu, choose Document Info.

    2. Choose the Preamble tab.

    3. After the line that reads \input tcilatex, add these lines:

      \floatstyle{plain}

      \restylefloat{table}

      \restylefloat{figure}

      \floatplacement{table}{H}

      \floatplacement{figure}{H}

      The \floatstyle command can be followed by one of three options:

      • plain places the caption on the bottom.

      • ruled places the caption on top and adds rule lines.

      • boxed places the caption on the bottom and puts a box around the floating object.

    4. Choose OK.

To add float.sty to your LaTeX 2.09 document style

  1. Open your SW document.

  2. From the File menu, choose Style.

  3. Choose Go Native.

  4. In the Options area of the Native LaTeX Style dialog box, type the command ,float.

  5. Choose OK to close the dialog box.

  6. Choose OK to return to your document.

  7. Change the Preamble of your document to include the float.sty option:

    1. From the File menu, choose Document Info.

    2. Choose the Preamble tab.

    3. After the line that reads \input tcilatex, add these lines:

      \floatstyle{plain}

      \restylefloat{table}

      \restylefloat{figure}

      \floatplacement{table}{H}

      \floatplacement{figure}{H}

      If you don't want the caption under the floating object, change the \floatstyle option as described above.

    4. Choose OK.

To use float.sty to position a floating table

  1. Insert the table:

    1. From the File menu, choose Import Fragment.

    2. From the Import Fragment dialog box, choose table4_3 and then choose OK.

    3. The program inserts a fragment containing a table with four rows and three columns, like this:
      Table 4_3 fragment

  2. Edit the properties of the TeX field containing [B]:

    1. Select the field.

    2. From the Edit menu, choose Properties.

      SW opens a TeX Field dialog box that contains this string: \begin{table}[tbp]\centering.

    3. Change [tbp] to [H].

    4. Choose OK.

To use float.sty to position a floating figure

  1. Modify the tcilatex.tex file:

    1. Use an ASCII editor to open the tcilatex.tex file, which is in the sw25\tex\macros\tci directory.

    2. Find the second line, which reads \begin{figure}[#1]%

    3. Change [#1] to [H].

    4. Save the changes, close the file and exit the ASCII editor.

  2. Insert the figure.

  3. Select the figure.

  4. From the Edit menu, choose Properties.

  5. In the Floating Placement area, check here.

  6. Make sure none of the other placement options are selected.

  7. Choose OK.

Last revised 02/21/06

This document was created with Scientific WorkPlace.