28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

184 Chapter 8. User Cus<strong>to</strong>mizations<br />

8.2 Lengths<br />

It has been constantly pointed out in all the descriptions of the length<br />

parameters such as \parskip or \textwidth that new values may be<br />

assigned with the \setlength comm<strong>and</strong>. Some of these parameters<br />

expect rubber length values that may stretch or shrink. These are mainly<br />

parameters that produce vertical spacing. The types of length units,<br />

both fixed <strong>and</strong> rubber, are described in detail in Section 2.4. This will<br />

not be repeated here, but rather additional comm<strong>and</strong>s for assigning <strong>and</strong><br />

h<strong>and</strong>ling lengths are discussed in this section.<br />

The st<strong>and</strong>ard L AT E X method for assigning a value <strong>to</strong> a length parameter<br />

is with the comm<strong>and</strong><br />

\setlength{\length cmd}{length spec}<br />

where length spec may be a length specification (with units) or another<br />

length parameter. In the latter case, \length cmd takes on the current<br />

value of that other parameter. Thus with \setlength{\rightmargin}<br />

{\leftmargin} the right-h<strong>and</strong> margin in a list environment is set <strong>to</strong><br />

the same value as that of the left-h<strong>and</strong> margin.<br />

Lengths may be increased with<br />

\add<strong>to</strong>length{\length cmd}{length spec}<br />

which adds length spec <strong>to</strong> the value of the length parameter \length cmd.<br />

A negative value for length spec decreases \length cmd by that amount.<br />

Once again, another length parameter may be used for length spec, with or<br />

without a preceding minus sign, <strong>and</strong> its value will be added or subtracted.<br />

A decimal number just before a length parameter multiplies its value by<br />

that quantity: 0.5\textwidth means half the width of the text column<br />

<strong>and</strong> 2\parskip twice the inter-paragraph spacing.<br />

With the comm<strong>and</strong><br />

\set<strong>to</strong>width{\length cmd}{text}<br />

the length parameter \length cmd is set equal <strong>to</strong> the natural length of a<br />

piece of text.<br />

Similarly the comm<strong>and</strong>s<br />

\set<strong>to</strong>height{\length cmd}{text}<br />

\set<strong>to</strong>depth{\length cmd}{text}<br />

set the \length cmd equal <strong>to</strong> the height <strong>and</strong> depth of the text above <strong>and</strong><br />

below the baseline, respectively.<br />

Finally, the comm<strong>and</strong><br />

\stretch{decimal num}<br />

yields a rubber length that is decimal num times as stretchable as \fill<br />

(Section 2.4.2).<br />

A user-defined length parameter is created with

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

Saved successfully!

Ooh no, something went wrong!