<< . .

. 19
( : 23)

. . >>

Figure XI.1: This is an inserted EPS graphic

causes “Caption Text” to appear in the caption, but “List Text” to appear in the
list of ¬gures. This is useful when using long, descriptive captions.
• The ¬gure environment can only be used in outer paragraph mode, preventing it
from being used inside any box (such as parbox or minipage).
• Figure environments inside the paragraphs are not processed until the end of the
paragraph. For example:

. . . . . . . . . text text text text text text
. . . . . . . . . text text text text text text

Figure placement

The figure environment has an optional argument which allows users to specify possible
¬gure locations. The optional argument can contain any combination of the letters: h, t,
b, p.

h Place the ¬gure in the text where the ¬gure command is located. This option cannot
be executed if there is not enough room remaining on the page.
t Place the ¬gure at the top of the page.
b Place the ¬gure at the bottom of a page.
p Place the ¬gure on a page containing only ¬‚oats.

If no optional arguments are given, the placement options default to [tbp].
When we input a ¬‚oat, LTEX will read that ¬‚oat and hold it until it can be placed

at a better location. Unprocessed ¬‚oats are those which are read by LTEX but have not

yet been placed on the page. Though the ¬‚oat-placing is done by LTEX, sometimes the

user has to invoke commands to process unprocessed ¬‚oats. Following commands will
do that job:
figure ENVIRONMENT 127

This command places unprocessed ¬‚oats and starts a new page.
This command causes all unprocessed ¬‚oats to be processed. This is
provided by the placeins package. It does not start a new page, unlike

Since it is often desirable to keep ¬‚oats in the section in which they were issued, the
section option


rede¬nes the \section command, inserting a \FloatBarrier command before each sec-
tion. Note that this option is very strict. This option does not allow a ¬‚oat from the
previous section to appear at the bottom of the page, since that is after the start of a new
The below option

is a less-restrictive version of the section option. It allows ¬‚oats to be placed after the
beginning of a new section, provided that some of the previous section appears on the

The afterpage package provides the \afterpage command which
executes a command at the next naturally-ocurring page break.

Therefore, using \afterpage{\clearpage} causes all unprocessed ¬‚oats to be cleared
at the next page break. \afterpage{\clearpage} is especially useful when producing
small ¬‚oatpage ¬gures.

Customizing ¬‚oat placement

The following style parameters are used by LTEX to prevent awkward-looking pages

which contain too many ¬‚oats or badly-placed ¬‚oats.

Float placement counters
The maximum number of ¬‚oats allowed at the top of a text page (the
default is 2).
The maximum number of ¬‚oats allowed at the bottom of a text page
(the default is 1).
The maximum number of ¬‚oats allowed on any one text page (the de-
fault is 3).

These counters prevent LTEX from placing too many ¬‚oats on a text page. These

counters do not affect ¬‚oat pages. Specifying a ! in the ¬‚oat placement options causes
LTEX to ignore these parameters. The values of these counters are set with the \setcounter

command. For example,

prevents more than two ¬‚oats from being placed on any text page.

Figure fractions
The commands given below control what fraction of a page can be covered by ¬‚oats
(where “fraction” refers to the height of the ¬‚oats divided by \textheight). The ¬rst

three commands pertain only to text pages, while the last command pertains only to ¬‚oat
pages. Specifying a ! in the ¬‚oat placement options causes LTEX to ignore the ¬rst three

parameters, but \floatpagefraction is always used. The value of these fractions are set
by \renewcommand. For example,

The minimum fraction of a text page which must be occupied by
text. The default is 0.2, which prevents ¬‚oats from covering more
than 80% of a text page.
The maximum fraction of a text page which can be occupied by
¬‚oats at the top of the page. The default is 0.7, which prevents any
¬‚oat whose height is greater than 70% of \textheight from being
placed at the top of a page.
The maximum fraction of a text page which can be occupied by
¬‚oats at the bottom of the page. The default is 0.3, which prevents
any ¬‚oat whose height is greater than 40% of \textheight from
being placed at the bottom of a text page.
The minimum fraction of a ¬‚oat page that must be occupied by
¬‚oats. Thus the fraction of blank space on a ¬‚oat page cannot be
more than 1-\floatpagefraction. The default is 0.5.

Using graphics in LTEX

This section shows how graphics can be handled in LTEX documents. While LTEX can

import virtually any graphics format, Encapsulated PostScript (EPS) is the easiest graphics
format to import into LTEX. The ˜eps™ ¬les are inserted into the ¬le using command


The \includegraphics command


The following options are available in \includegraphics command:
The width of the graphics (in any of the accepted TEX units).
The height of the graphics (in any of the accepted TEX units).
The totalheight of the graphics (in any of the accepted TEX units).
Scale factor for the graphic. Specifying scale = 2 makes the graphic twice
as large as its natural size.
Speci¬es the angle of rotation, in degrees, with a counter-clockwise (anti-
clockwise) rotation being positive.

Graphics search path
By default, LTEX looks for graphics ¬les in any directory on the TEX search path. In addi-

tion to these directories, LTEX also looks in any directories speci¬ed in the \graphicspath

command. For example,
figure ENVIRONMENT 129





tells LTEX to look for graphics ¬les also in dir1/ and dir2/. For Macintosh, this becomes


Graphics extensions
The \DeclareGraphicsExtensions command tells LTEX which extensions to try if a ¬le

with no extension is speci¬ed in the \includegraphics command. For convenience, a
default set of extensions is pre-de¬ned depending on which graphics driver is selected.
For example if dvips is used, the following graphics extensions (de¬ned in dvips.def) are
used by default

With the above graphics extensions speci¬ed, \includegraphics¬le ¬rst looks for file.eps,
then file.ps, then ¬le file.eps.gz, etc. until a ¬le is found. This allows the graphics to
be speci¬ed with

instead of


Rotating and scaling objects

In addition to the \includegraphics command, the graphicx package includes four other
commands which rotate and scale any LTEX object: text, EPS graphic, etc.


produces the same three graphics as

For example, the following are produced with



However, the \includegraphics is preferred because it is faster and produces more
ef¬cient PostScript.


With the box elements already explained in the previous chapter, it would be possible to
produce all sorts of framed and unframed tables. However, LTEXoffers the user far more

convenient ways to build such complicated structures.

Constructing tables

The environments tabular and tabular* are the basic tools with which tables can be
constructed. The syntax for these environments is:
\begin{tabular}[pos]{cols} rows \end{tabular}
\begin{tabular*}{width}[pos]{cols} rows \end{tabular*}

Both the above environments actually create a minipage. The meaning of the above
arguments is as follows:
Vertical positioning arguments (see also the explanation of this argument for
parboxes). It can take on the values:

The top line of the table is aligned with the baseline of the current
external line of text.
The bottom line of the table is aligned with the external baseline.

With no positioning argument given, the table is centered on the external base-
This argument applies only to the tabular* environment and determines its
overall width. In this case, the cols argument must contain the @-expression
(see below) @{\extracolsep{\fill}} somewhere after the ¬rst entry. For the
other two environments, the total width is ¬xed by the textual content.
The column formatting argument. There must be an entry for every column,
as well as possible extra entries for the left and right borders of the table or for
the inter-column spacings. The possible column formatting symbols are:

The column contents are left justi¬ed.
The column contents are centered.
The column contents are right justi¬ed.
The text in this column is set into lines of width wd
and the top line is aligned with the other columns.
In fact, the text is set in a parbox with the command
\parbox[t]{wd}{column text}.
The column format contained in cols is reproduced
num times, so that *{3}{|c|}| is the same as |c|c|c|.

The available formatting symbols for right and left borders and for the inter-column
spacing are:

Draws a vertical line.
Draws two vertical lines next to each other.
This entry is referred to as an @-expression, and inserts
text in every line of the table between the two columns
where it appears.

removes the inter-column spacing that is automatically put between
each pair of columns. If white space is needed between the inserted text and the next col-
umn, this must be explicitly included with \hspace{ } within the text of the @-expression.
If the inter-column spacing between two particular columns is to be something other than
the standard, this may be easily achieved by placing @{\hspace{wd}} between the ap-
propriate columns in the formatting argument. This replaces the standard inter-column
spacing with the width wd.
An \extracolsep{wd} within an @-expression will put extra spacing of amount wd
between all the following columns, until countermanded by another \extracolsep com-
mand. In contrast to the standard spacing, this additional spacing is not removed by later
@-expression. In the \tabular* environment, there must be a command @{\extracolsep\fill}
somewhere in the column format so that all the subsequent inter-column spacings can
stretch out to ¬ll the prede¬ned table width.
If the left or right borders of the table do not consist of a vertical line, a spacing equal
to half the normal inter-column spacing is added there. If this spacing is not required, it
may be suppressed by including an empty @-expression @{} at the beginning or end of the
column format.

Contain the actual entries in the table, each horizontal row being terminated
with \\. These rows consist of a sequence of column entries separated from
each other by the & symbol. Thus each row in the table contains the same
number of column entries as in the column de¬nition cols. Some entries may be
empty. The individual column entries are treated by LTEXas though they were

enclosed in braces { }, so that any change in type style or size are restricted to
that one column.
This command may only appear before the ¬rst row or immediately after a row
termination \\. It draws a horizontal line the full width of the table below the
row that was just ended, or at the top of the table if it comes at the beginning.
Two \hline commands together draw two horizontal lines with a little space
between them.
\cline{n ’ m}
This command draws a horizontal line from the left side of column n to the
right side of column m. Like \hline, it may only be given just after a row
termination \\, and there may be more than one after another. The command
\cline{1-3} \cline{5-7} draws two horizontal lines from column 1 to 3 and
from column 5 to 7, below the row that was just ended. In each case, the full
column widths are underlined.
This command draws a vertical line with the height of the row at the location
where it appears. In this way, vertical lines that do not extend the whole height
of the table may be inserted with a column.
This command combines the following num columns into a single column with
their total width including inter-column spacing. The argument col contains

<< . .

. 19
( : 23)

. . >>