If you wish to change the typeface in a short passage of text, there are
two ways to do it in LaTeX. For example, to emphasize a few words, you can
type {\em some text}. In this example, \em is a
declaration. You could instead use the command \emph, which
takes an argument, as follows: \emph{some text}. These
are not the best way to do change of typeface in longer passages, however,
as we shall see. A common error is to forget the right hand curly
brace, which results in TeX complaining about a runaway argument.
Corresponding to the pair \emph and \em, there
are pairs consisting of a command and a declaration for roman type, sans
serif, typewriter type, bold type, and several others. These are listed
conveniently on p. 9 of the document Essential LaTeX.
If you want to emphasize a longer passage, and you wish to have it appear
as a separate paragraph, you should use one of the standard environments
of LaTeX. These are used as follows:
\begin{environment-name}
some text goes here
\end{environment-name}
For example, to set a whole paragraph in emphasized text, use:
\begin{em}
some text goes here
\end{em}
Notice that the backslash is not used in front of the command em
when the command is used as the argument in the \begin command.
To see how LaTeX handles emphasizing text, make a copy of the file you
used for the first homework: if you called it
feynman.tex you might make the copy
feynman2.tex.
You can do this by getting a UNIX shell prompt and using the UNIX command:
cp feynman.tex feynman2.texIn the first paragraph, choose two short passages, and emphasize one with
\em and the other with \emph. Then put the second
paragraph inside a \begin{em} ... \end{em} environment.What we just did is a simple use of LaTeX environments. These are the essential constructions for using LaTeX. In Chap. 3 of his book Math into LaTeX,George Grätzer groups the text environments into three types:
The example of emphasized text is of the third type, of course. We now consider displayed text environments.
Here is one environment that you may need for
making certain displays, such as headers:
\begin{center}
Text on line 1 \\
Text on line 2 \\
.
.
.
\end{center}
The center environment allows you to create a paragraph
consisting of
lines that are centred within the left and right margins on the current
page. Each line must be terminated with the string \\,
which is the short form of the command \newline, and
gives a line which is not justified to the right.
There are three environments for listing text.
\begin{enumerate}
\item First item
\item Second item
.
.
.
\end{enumerate}
The enumerate environment produces a numbered list. Enumerations
can be nested within one another, up to four levels deep. They can also
be nested within other paragraph-making environments.
Each item of an enumerated list begins with an \item command.
There must be at least one \item command within the environment.
\begin{description}
\item [label] First item
\item [label] Second item
.
.
.
\end{description}
The description environment is used to make labelled lists. The
label is bold face and flushed right.
\begin{itemize}
\item First item
\item Second item
.
.
.
\end{itemize}
The itemize environment produces a "bulleted" list. Itemizations
can be nested within one another, up to four levels deep. They can also
be nested within other paragraph-making environments.
Src/fractals01, Src/fractals02, etc,
in succession to see a document's format being applied
in stages.
Some useful URLs:
Create a LaTeX document (article class with the 12pt option) to demonstrate the
use of the three list types just given as well as the center environment. For
example, you might make a short bulleted shopping list, a numbered list of
LaTeX environments, and a short captioned list of terms taken from the index
of a book, with a definition given for each term. See if you can use the spell
checker ispell with emacs. Process the file with
latex and view it with xdvi before printing it out
and emailing me a copy of the tex file (not the .dvi or .ps file).