Document 57

Placement of floating elements with float.sty

Version: 2.5 - Scientific WorkPlace & Scientific Word

Q. I'm using the Standard LaTeX Book style to create a document with SW version 2.5. I know that to add captions to the tables in my SW document, I must create floating tables, but I need to control the placement of the tables precisely. Is there any way I can put a caption on a table that doesn't float?

A. No, you must use a floating environment in order to have captions appear in the list of tables, be cross-referenced, and otherwise behave correctly. However, in SW v. 2.5 you can control the placement of a floating table by adding the package called float.sty to your non-Style Editor style. You can find the package in \swp25\tex\macros\float\float.sty.

The float.sty package provides the H placement specifier, which tells LaTeX to place your table or figure at the current position rather than allowing it to float. In other words, when you use the H specifier, you insist upon the placement of the table or figure. The H specifier means "Here!"

In contrast, the h specifier, which we support directly through the Frame dialog box for figures, tells LaTeX to try to put your figure at the current position, but permits LaTeX to float the figure if necessary. When you use the h specifier, you suggest but don't insist upon the placement. The h specifier means "here."

Thus, using the H specifier prevents the table from floating, but provides all of the normal captioning capabilities. Remember, the package doesn't work with Style Editor styles.

To use the float.sty package, add it to your document style.

Added 07/02/96

This document was created with Scientific WorkPlace.