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.

20 Chapter 2. Text, Symbols, <strong>and</strong> Comm<strong>and</strong>s<br />

Note that if the names of the environment in the \begin{..} \end{..}<br />

pair do not match, an error message will be issued on processing.<br />

Most declaration comm<strong>and</strong> names (see next section) may also be used<br />

as environment names. In this case the comm<strong>and</strong> name is used without<br />

the preceding \ character. For example, the comm<strong>and</strong> \em switches <strong>to</strong><br />

an emphatic typeface, usually italic, <strong>and</strong> the corresponding environment<br />

\begin{em} will set all the text in italic until \end{em} is reached.<br />

A nameless environment can be simulated by a {...} pair. The effect<br />

of any comm<strong>and</strong> within it ends with the closing curly brace.<br />

The user can even create his or her own environments, as described in<br />

Section 8.4.<br />

2.3 Declarations<br />

A declaration is a comm<strong>and</strong> that changes the values or meanings of<br />

certain parameters or comm<strong>and</strong>s without printing any text. The effect of<br />

the declaration begins immediately <strong>and</strong> ends when another declaration<br />

of the same type is encountered. However, if the declaration occurs<br />

within an environment or a {...} pair, its scope extends only <strong>to</strong> the<br />

corresponding \end comm<strong>and</strong>, or <strong>to</strong> the closing brace }. The comm<strong>and</strong>s<br />

\bfseries <strong>and</strong> \small mentioned in the previous section are examples<br />

of such non-printing declarations that alter the current typeface.<br />

Some declarations have associated arguments, such as the comm<strong>and</strong><br />

\setlength which assigns a value <strong>to</strong> a length parameter (see Sections 2.4<br />

<strong>and</strong> 8.2).<br />

Examples:<br />

{\bfseries This text appears in bold face} The \bfseries declaration<br />

changes the typeface: This text appears in bold face. The<br />

effect of this declaration ends with the closing brace }.<br />

\setlength{\parindent}{0.5cm} The paragraph indentation is set <strong>to</strong><br />

0.5 cm. The effect of this declaration ends with the next encounter<br />

of the comm<strong>and</strong> \setlength{\parindent}, or at the latest with<br />

the \end comm<strong>and</strong> that terminates the current environment.<br />

\pagenumbering{roman} The page numbering is <strong>to</strong> be printed in Roman<br />

numerals.<br />

Some declarations, such as the last example, are global, that is, their<br />

effects are not limited <strong>to</strong> the current environment. The following declarations<br />

are of this nature, the meanings of which are given later:<br />

\newcounter \pagenumbering \newlength<br />

\setcounter \thispagestyle \newsavebox<br />

\add<strong>to</strong>counter

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

Saved successfully!

Ooh no, something went wrong!