## What is mtex?

Mtex is a system for producing man pages in both HTML and nroff formats from a single source format. The mtex file format is loosely based on LaTeX, but it contains far fewer commands and is somewhat fragile.

• Make a new directory called "mtex".

mtex.tar.Z

• cd into your new "mtex" directory. It should contain the single file "mtex.tar.Z". If it instead contains the file "mtex.tar", then your browser has automatically uncompressed the file, and you can skip the following step.

• Run "uncompress mtex.tar.Z" on the downloaded file.

• Run "tar xvf mtex.tar" on the resulting tar file to extract the mtex sources.

• Run "rm mtex.tar" to remove the tar file.

• Run "make". This will create a derived directory named by your machine's architecture. It's name is formed by running "machine". It will also build the mtex man pages (in both HTML and nroff format) in the "man/" subdirectory. That's about it!

• You may now want to copy the mtex scripts and man pages to centralized bin, man, and HTML directories. If your derived directory is denoted by arch, the files you may want to copy are:

To centralized bin:
• arch/mtex2html - produces man pages in HTML format
• arch/mtex2man - produces man pages in nroff format
• arch/mtex2tex - produces man pages in LaTeX format

To centralized man/man1:
• man/mtex2html.1 - mtex2html(1) man page (nroff format)
• man/mtex2man.1 - mtex2man(1) man page (nroff format)
• man/mtex2tex.1 - mtex2tex(1) man page (nroff format)

To centralized man/man7:
• man/mtex.7 - mtex(7) man page (nroff format)

To centralized man/html:
• man/mtex2html.1.html - mtex2html(1) man page (HTML format)
• man/mtex2man.1.html - mtex2man(1) man page (HTML format)
• man/mtex2tex.1.html - mtex2tex(1) man page (HTML format)
• man/mtex.7.html - mtex(7) man page (HTML format)

## Reporting Bugs

Mtex was written by Allan Heydon. If you have problems installing mtex or if you notice a bug, please send e-mail to heydon@pa.dec.com describing the problem. Please include the mtex source file that triggers the bug if possible.

## Man Pages

For more detailed information about mtex, see the following man pages.

mtex(7)
Describes the mtex file format.

mtex2html(1)
Converts mtex documents to HTML (HyperText Markup Language} format for viewing over the web.

mtex2man(1)
Converts mtex documents to man format for viewing with nroff(1)/troff(1) in conjunction with the man(7) macros.

mtex2tex(1)
Converts mtex documents to LaTeX format for processing by latex(1).

## Command Summary

Like LaTeX, mtex commands are introduced by the \ (backslash) character, and command arguments are delimited by curly braces { }. Some commands have multiple arguments, in which case each argument follows the command surrounded by curly braces. Mtex also uses \begin and \end commands to bracket environments. Unlike LaTeX, curly braces are used only to delimit command arguments, and not to delimit scopes. Also, there are no declarations, only commands; so you write \it{...} instead of {\it ...} to produce italics text.

Here is a summary of the mtex commands:

\manpage{<title>}{<name>}{<num>}
Declare the start of the manpage with the specified title for the command or routine named <name> in section <num> of the manual.

\section{<title>}
Introduce a new section of the man page.

\bf{<text>}, \it{<text>}, \tt{<text>}
Typeset <text> in a bold face, italics, or typewriter font, respectively.

\anchor{<name>}{<text>}
Make <text> an anchor named <name> in the current document.

Make <text> a hypertext link to the named HTML <URL>.

\begin{<env>} ... \end{<env>}
Delimit a new environment.

\newline
Start a new line in the flushleft environment.

\item, \item{<description>}
Start new items in the itemize, enumerate, and description environments.

## Environment Summary

Here is a summary of the mtex environments:

flushleft
An environment for displaying left-justified lines of text. New lines are started with the \newline command.

verbatim
Displays unfilled text in a fixed-width font without interpretting any of the usual mtex commands and escape sequences.

itemize, enumerate, description
The list environments. Items in the itemize environment are delimited by tick marks; those in the enumerate environment are delimited by increasing integers starting at one; and those in the description environment are delimited by pieces of text.

html, roff, tex
The output-specific environments for processing commands for a particular output format.

## Examples

As a starting point, the mtex2html.1.mtex source file provides a good example of a simple man page. The mtex.7.mtex source is a much more complicated man page; it is longer and it contains many examples of the language's character quotation facilities.

## Usage at SRC

At the Systems Research Center, mtex has been used in the man pages of the following projects, among others.

Last modified on Wed Oct  1 11:48:13 PDT 1997 by heydon