Document 458

The LaTeX alltt package

Version: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific Word

The alltt package provides a verbatim-like environment in which the meaning of slashes and curly braces is unchanged by LaTeX. Thus, you can embed other TeX commands and environments inside the alltt environment to produce formatted mathematics and mathematics symbols.

Assume you want to include mathematics in a typeset verbatim paragraph. Ordinarily, the mathematics appears as LaTeX code when you typeset the document without the alltt package, as shown here:


Verbatim mathematics without alltt package

With the package, the mathematics appears as correctly formatted mathematics:


Verbatim mathematics with alltt package

You must place the entire alltt environment in an encapsulated TeX field.

How to use mathematics in a verbatim-like environment

  1. Add the alltt package to your document.
  2. Enter an encapsulated TeX field.
  3. Type \begin{alltt} to begin the alltt environment.
  4. Begin entering the content of the verbatim environment.
  5. For each mathematical element,
    1. Type \( to begin mathematics.
    2. Type the commands for the mathematical statement or symbol you want.
    3. Type \) to end mathematics.
  6. Complete the content.
  7. Type \end{alltt} to close the environment.
  8. Choose OK.

The package has no options. Alltt is provided automatically with LaTeX and is installed in the TCITeX/TeX/LaTeX/base directory of your program directory.

Last revised 01/20/06

This document was created with Scientific WorkPlace.