next up previous
Next: Spacing Up: The Basics of LATEX Previous: Special Characters

Commands and Environments

As I've already mentioned, LATEX commands begin with the special character \. Some commands can be followed by parameters that provide information used by the command. An example is \footnote, which is used to insert a footnote into a paper. The text of the footnote is the parameter to the command. The parameter follows the command and is enclosed between { and }.2 In fact, you can leave out the { and }, but in that case the parameter will be the single character that follows the command. This is what is done with the accenting commands above, so that \'e is equivalent to \'{e}.

Some commands can include extra, optional information that is enclosed between [ and ] and placed between the command and the parameter. For example: \documentclass[11pt]{article}. And it's possible for a command to have several parameters, each enclosed in its own pair of braces. For example: \setlength{\parindent}{2cm}.

There is one annoying thing about commands that consist of a sequence of letters: LATEX will ignore any spaces that follow the command. This means that if you type ``\LaTeX is fun!'', it will come out on the page as ``LATEXis fun!''. To fix this, you can add an explicit space command. The command ``\ '' (that's a backslash followed by a space) represents a space that LATEX won't ignore. So, to get ``LATEX is fun!'' to come out right, you should type ``\LaTeX\ is fun!''.

LATEX gets a lot of milage out of two general commands, \begin{name} and \end{name}, where name is the name of an ``environment'' such as itemize or quotation. These commands always occur in a begin/end pair, using the same name in both places. Anything between begin and end is treated in a special way that depends on which particular environment you are using. For example, \begin{center} ...\end{center} is used to center things horizontally on the page. Many environments have special commands that only apply inside that environment. We will see some examples of environments later.


next up previous
Next: Spacing Up: The Basics of LATEX Previous: Special Characters
David Eck 2003-10-21