## Tex2RTF for non-LaTeX users

You don't need to have LaTeX installed to use Tex2RTF. You can still output RTF files to be imported into your favourite word processor, and hypertext files for on-line help.

This chapter gives a very brief introduction to LaTeX. For further information, Kopka and Daly's A Guide to LaTeX [3] is recommended.

What is LaTeX?
Document structure
Command syntax
Space

### What is LaTeX?

LaTeX is a macro package built on top of the typesetting package, TeX. TeX was written by Donald Knuth in the 1970s, and Leslie Lamport wrote LaTeX as a higher-level, easier way to write TeX.

TeX was quite advanced for its day, and is still used (particularly by academics) because of its free availability and its flexibility in typesetting maths and other symbols. It's more like a programming language than a word processor, with embedded commands prefixed by a backslash and block structure. Like programs, TeX documents are processed by a 'compiler', outputting a .dvi file, which is a device independent file which can be read by many converters for output onto physical devices, such as screens and printers.

A reason for its longevity is the ability to add facilities to TeX, using macro packages that define new commands.

LaTeX is the most popular way to write TeX. Although WYSIWYG word processors and DTP packages are outstripping LaTeX, the increasing interest in hypertext and mark-up languages makes LaTeX relevant as a similar language to SGML documents (such as World Wide Web HTML files).

Also, languages such as LaTeX (and Rich Text Format, which it resembles in many ways) are complementary to WYSIWYG packages. These languages allow automatic production and translation of documents, where manual mark-up is impractical or undesirable.

Since the source code of TeX and LaTeX is in the public domain, there are many free and commercial implementations of LaTeX for almost every computer in existance. Of PC implementations, EmTeX is arguably the best and most complete. You can download it from various FTP sites.

If you don't want to use LaTeX itself, you may wish to use a program called lacheck to check your documents before using Tex2RTF, since it catches some mistakes that Tex2RTF doesn't.

### Document structure

Here is a sample of a typical LaTeX document:

        \documentstyle[a4,texhelp]{report}
        \title{A title}
        \author{Julian Smart}
        \date{October 1993}
        \begin{document}
        \maketitle

        \chapter{Introduction}

        ...

        \section{A section}

        ...

        \end{document}

The first line is always a `\documentstyle` command. The square brackets enclose optional style files (suffix `.sty`) that alter the appearance of the document or provide new commands, and the curly brackets enclose the mandatory style, in this case 'report'.

Before the document begins properly with `\begin{document}`, you can write various commands that have an effect on the appearance of the document or define title page information. The `\maketitle` command writes the title page using information defined previously (title, author, date).

A report has chapters, which are divided into sections, and can be further divided into subsections and subsubsections. To start a new section, you write the appropriate section command with the section heading; there is no specific end section command, since a new section heading or the end of the document will indicate the end of the previous section.

An article is divided into sections, subsections and subsubsections, but has no chapters. This is so an article can be included in a report as a chapter.

Tex2RTF is written to deal with reports best, so stick with the report style if you can.

### Command syntax

There are several kinds of commands in LaTeX. Most involve a keyword prefixed with a backslash. Here are some examples:

        \titlepage

        \centerline{This is a centred line}

        \begin{center}
        This is a centred
        paragraph
        \end{center}

        {\bf This is bold font}

The first example has no arguments. The second has one argument. The third example is an environment which uses the begin and end keywords instead of a pair of braces to enclose an argument (usually one). The fourth is an example of using a command within a pair of braces: the command applies to the scope within the braces. Tex2RTF treats this form as if it were a command with one argument, with the right brace delimiting the argument. In this case, the command must immediately follow a left brace as shown.

Commands may be nested, but not overlapped.

### Space

In LaTeX, white space is mostly ignored, line breaks make no difference. However, LaTeX interprets two successive newlines (a blank line) as denoting a paragraph break. You may also use the `\par` command to end a paragraph.