12.07.2015 Views

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

The memoir class - The UK TeX Archive

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

TenFloats and captionsA float environment is a particular kind of box — one that La<strong>TeX</strong> decides where it shouldgo although you can provide hints as to where it should be placed; all other boxes are putat the point where they are defined. Within reason you can put what you like within a floatbut it is unreasonable, for example, to put a float inside another float. <strong>The</strong> standard <strong>class</strong>esprovide two kinds of float environments, namely figure and table. <strong>The</strong> only differencebetween these is the naming and numbering of any caption within the environments —a \caption in a figure environment uses \figurename while a \caption in a tableenvironment uses \tablename. Figures and tables are numbered sequentially but the twonumbering schemes are independent of each other.<strong>The</strong> <strong>class</strong> provides means of defining new kinds of floats. It also provides additionalforms of captions for use both within and outside float environments together with handlesfor changing the style of captions.10.1 NEW FLOAT ENVIRONMENTSIt is often forgotten that the La<strong>TeX</strong> float environments come in both starred and unstarredforms. <strong>The</strong> unstarred form typesets the float contents in one column, which is the mostusual form for a book. <strong>The</strong> starred form typesets the contents of the float across the top ofboth columns in a twocolumn document. In a onecolumn document there is no differencebetween the starred and unstarred forms.\newfloat[〈within〉]{〈fenv〉}{〈ext〉}{〈capname〉}<strong>The</strong> \newfloat command creates two new floating environments called 〈fenv〉 and 〈fenv*〉.If there is not already a counter defined for 〈fenv〉 a new one will be created to be restartedby the counter 〈within〉, if that is specified. A caption within the environment will bewritten out to a file with extension 〈ext〉. <strong>The</strong> caption, if present, will start with 〈capname〉.For example, the figure float for the <strong>class</strong> is defined as:\newfloat[chapter]{figure}{lof}{\figurename}\renewcommand{\thefigure}{%\ifnum\c@chapter>\z@ \thechapter.\fi \@arabic\c@figure}<strong>The</strong> last bit of the definition is internal code to make sure that if a figure is in the documentbefore chapter numbering starts, then the figure number will not be preceeded by a nonexistentchapter number.<strong>The</strong> captioning style for floats defined with \newfloat is the same as for the figuresand tables.169Chapter last updated 2013/05/10 (revision 458)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!