Lesson 3: Text Environments in LaTeX

Environments that create a large character

One type of text environment creates what is sometimes called a "large symbol". For example, you can use the tabular environment to create a table, which is treated by LaTeX as a large symbol and placed somewhere on the page by LaTeX, or "floated". PostScript graphics can also be handled by LaTeX as large symbols.

Below is an example of LaTeX source code that creates a table showing the effects of the basic font-size change declarations (Note how they are used). The table has two columns, with & used as a separator, and the text in each column is left justified, which is done by the template argument { l l } after the \tabular command. Those are two letters "ell", not two numbers "one". The spaces in the argument are ignored.

If you wanted the text in the first column right justified, you could use the template { r l }. If you wanted vertical lines at the sides of the table, you could use the template { |r l |} indicating the position of vertical bars. If you also wanted the two columns separated by a vertical line, then you could use the template { |r | l|} as the argument for \begin{tabular}. You can also center the text in a column by substituting "c" for "r" or "l".

We summarize.

Here is how justification is specified:

Here are some layout features:

  1. Use the command \hline after \\ to draw a line between rows
  2. Type a | in the template wherever you want columns separated by a vertical line segment
  3. Type @{.} if you want a period instead of a space between two columns, or substitute any symbol you like in the curly brackets
  4. To get a caption, say MY TABLE, underneath your table, put a line with the command \caption{MY TABLE} just before the end{table} line.

LaTeX source code for the table

\begin{table}[ht]
\begin{tabular}{ l l }
\textbf{Declaration}    &  \textbf{Typeset by \LaTeX} \\ \hline
\verb=\tiny=            &  {\tiny sample text}        \\
\verb=scriptsize=       &  {\scriptsize sample text}  \\
\verb=\footnotesize=    &  {\footnotesize sample text}\\
\verb=\small=           &  {\small sample text}       \\
\verb=\normalsize=      &  {\normalsize sample text}  \\
\verb=\large=           &  {\large sample text}       \\
\verb=\Large=           &  {\Large sample text}       \\
\verb=\LARGE=        	&  {\LARGE sample text}       \\
\verb=\huge=        	&  {\huge sample text}        \\
\verb=\Huge=        	&  {\Huge sample text}        \\ \hline
\end{tabular}
     \caption{Font Size Declarations}
\end{table}

The image below is an enlarged version of the typeset table.



Notice:



Exercise on Tables

Make a LaTeX document (12pt article class) to display the following table.

Note: The names are left justified and the other entries are right justified.
Use the title line \title{\LaTeX{} Table Exercise.
Hand in a typeset copy.


Proclamations (theorem-like constructs)

To produce nicely formatted theorems, propositions and corollaries, you follow a two step procedure:

Step One:
In the preamble, use a \newtheorem command to define the proclamation. For example,
\newtheorem{theorem}{Theorem}
can be used to define a theorem environment that is used with the commands \begin{theorem} ...\end{theorem}. The second argument to the \newtheorem command, Theorem is used to label the statement.
Step Two:
In the body of the document, invoke the proclamation by typing
\begin{theorem}
The first theorem of this article states ...
\end{theorem}

The result will look something like this:
Theorem 1 The first theorem of this article states ...

Of course, you can do the same for Propositions, Lemmas, Corollaries, Definitions, and so on.
For example, \newtheorem{lemma}{Lemma}
could be used to create a "lemma" environment. The point is that you get a uniform style to all of your proclamations, you can create cross-references to them, and they are numbered automatically.


Homework

  1. Compose a document with at least 12 proclamations of at least 3 different types. Email me the source file and bring the typeset version to class. The content of each proclamation can be whatever you like -- it doesn't have to be a genuine mathematical statement. I just want you to learn how proclamations work. You could use proclamations to construct a set of instructions for a task, for making up a grocery list, etc.
  2. By now you should have sent me a list of your hobbies and interests by email. Find one interesting article from a newsgroup or from a web-site and forward the article to me (not just the URL or newsgroup reference). Print out a copy and hand it in during the next class


email: Martin Karel