7 Dominando flotadores

Documents would be easier to read if all the material that belonged together was never split between pages. However, this is often technically impossible, and TEX, by default, splits textual material between two pages to avoid partially filled pages. Nevertheless, when this outcome is not desired (as with figures and tables), the material must be “floated” to a convenient place, such as the bottom or the top of the current or next page, to prevent half-empty pages.

This chapter shows how “large chunks” of material can be kept conveniently on the same or a nearby page by using a float object. We begin by introducing the general concepts through which LaTEX handles float objects and the parameters that define how LaTEX typesets its basic figure and table float environments and describe some of the packages that make it easy to control float placement (Section 7.2).

We then continue by explaining how you can define and use your own floating environments (Section 7.3.1) or, conversely, how captioning commands can be used to enter information into the list of figures and tables for nonfloating material (Section 7.3.2). Then methods for rotating the content of a float are described (Section 7.3.3). It is often visually pleasing to include a “picture” inside a paragraph, with the text wrapping around it. Some package authors have tried their hand on this difficult topic, and in Section 7.3.4 we look at one of them in some detail.

The fourth section addresses the problem of customizing captions. There is a recognized need to be able to typeset the description of the contents of figures and tables in many different ways. This includes specifying subfigures and subtables, each with its own caption and label, inside a larger float.

In the final section of this chapter we then look at two recent packages that offer a modern key/value approach to the float topic and attempt to bridge the gaps between the different packages introduced in the earlier sections. While both attempt to be fairly comprehensive, they have a different focus, which is why we describe both to enable you to make an educated decision based on the requirements of the job.

Many float-related packages have been developed over the years, unfortunately often with incompatible concepts and syntax, so there is no point discussing them all here. In fact, the packages that we describe often feature quite a few more commands than we are able to illustrate. Our aim is to enable you to make an educated choice and to show how a certain function can be obtained in a given framework. In each case consulting the original documentation will introduce you to the full possibilities of a given package.