What are TeX, LaTeX, and friends?

TeX and associated programs such as LaTeX is a system for computer typesetting, for placing text on a page. (Pronounce the name "tech".) It is well known for its skill with mathematical and scientific text and other difficult typesetting jobs:  long or intricate documents, and multilingual works.

TeX systems produce output — on paper or on the computer screen — of the highest typographic quality. This quality is crucial with complex texts, where the ability of readers to understand the material depends on the clarity with which it is presented. TeX is Free software. It is availble on almost every computer that people are using today. TeX systems have many other advantages; see below.

As a result of these advantages, TeX systems are now the standard communication tool in the sciences. For instance, TeX has been adopted by the American Mathematical Society and many other professional societies as their preferred format. It is also widely used in other academic areas, in the humanities, and the social sciences.

History

The TeX project was started in 1978 by D Knuth, while revising the second volume of his Art of Computer Programming. When he got the galleys back, he saw that the publisher had switched to a new digital typesetting system and was shocked at the poor quality.

He reasoned that because digital typesetting meant arranging 1's and 0's (ink and no ink) in the proper pattern, as a computer scientist he should be able to do the job better. He originally estimated that this would take six months but ultimately it took nearly ten years. He had to handle not only the challenges of routine typesetting such as right-justification and page formatting flexible enough to allow for different output styles, but also the additional demands of academic publishing -- footnotes, floating figures and tables, etc. And, beyond that, he had to tell the computer how to typset formulas and other technical materials.

A year after he began, Knuth was invited to give one of the principal lectures at the AMS's annual meeting. He spoke on his TeX work, presenting not only the typographical aspects but also the mathematical ideas behind the programs. TeX's popularity took off from there.

An important boost to that popularity came in 1985 with the introduction of LaTeX. This is a set of commands that allows authors to interact with the system at a higher level than Knuth's original command set (called Plain TeX).

Today, TeX systems continue to be a well-known standard. They are used every day for research preprints, drafts of textbooks, and conference proceedings. And, active development of the software continues. Members of the community contribute a steady stream of new and updated enhancement packages, there have been great improvements in LaTeX's font-handling, and also improvements in TeX's ability with multilingual texts, there is now a version of TeX that outputs directly to PDF format, and an extension of that which seamlessly uses current font formats, and much more.

Why TeX?

This section describes some of the major advantages that TeX systems enjoy.

Compared to word processors

Most people have used a word processor, so a comparison may be helpful.

With a word processors your text is places while you type it, referred to as "what you see is what you get." In contrast, TeX is a formatter: it separates the steps of entering the material and placing it on the page.

To see the difference, consider how a typical user of each system might start a new section. In a word processor a typical user might start that section by hitting `<Enter>` twice to get two lines of vertical space, typing "`Section 1.2: New results`", clicking to highlight that text, clicking to select a larger type size, clicking to select a new type style, and finally entering two more lines of vertical space. A typical user TeX user will type into a file the line "`\section{New results}`". That is, a word processing user is formatting the text as they enter it, while the TeX user describes the meaning of the text and later TeX will format it.

Beginners like word processing but when they graduate to complex jobs the appeal fades. Word processing a twenty page technical article is hard; for instance, keeping the vertical space between sections uniform is error-prone, and so is making sure that all of the bibliographic entries follow the required format. In particular, very few people have both the knowledge and the eye to correctly lay out equations — people often say their equations "just don't look right." That is, as a user becomes more experienced and knowledgable the TeX approach of having the typesetting done by the program becomes the better choice. (Some word processors offer as advanced features TeX-like facilities for organizing input text, although few users take advantage of them.)

We'll give you ten good reasons ..

These are the reasons most often cited for using TeX, grouped into four areas: Output Quality, Superior Engineering, Freedom, and Popularity.

• Output Quality You write documents to be read. Your first concern should be: how good is the output?
• 1) TeX has the best output. What you end with, the symbols on the page, is as useable, and beautiful, as a non-professional can produce.

This is especially holds for complex documents such as ones with mathematics; see this sample from Rogers's Recursive Functions. It also holds for documents that are complex in other ways: with many tables, or many cross references or hyper-links, or just with many pages.

Even on simple documents TeX does a better job than a word processor. Compare these samples of plain text from Herigel's Zen in the Art of Archery done in the word processor Word, and TeX. These are short and the typographic differences are subtle but even a non-expert will have the sense that the TeX page looks better. For instance, the word processor's page has some lines with wide gaps between words and some lines with too many words stuffed in; contrast the second paragraph's second line with its third. TeX's output is better.

• 2) TeX knows typesetting. As those plain text samples show, TeX's has more sophisticated typographical algorithms such as those for making paragraphs and for hyphenating.

TeX's expertise comes into its own in setting technical material. TeX moves this task, as much as possible, into the software. For instance, it automatically classifies each mathematical symbol as a variable, or a relation, etc., and sets them with appropriate amounts of surrounding space. It also sizes superscripts and subscripts, radicals, brackets, and many other things. The result is that, because your document follows the conventions of professional typesetting, your readers will know exactly what you mean. You almost never have to fret with the formulas. They just come out looking right.

The quality of output is the best reason to use TeX.

• Superior Engineering Everyone has been frustrated with software that is slow, fat, buggy, or that undergoes frequent incompatible version changes. TeX will not give you those troubles; from a Computer Science standpoint, TeX is very impressive.
• 3) TeX is fast. On today's machines TeX is very fast. It is easy on memory and disk space, too.

• 4) TeX is stable. It is in wide use, with a long history. It has been tested by millions of users, on demanding input. It will never eat your document. Never.

But there is more here than just that the program is reliable. TeX's designer has frozen the central engine, the actual `tex` program. Documents that run today will still run in ten years, or fifty. So "stable" means more than that it actually works. It means that it will continue to work, forever.

• 5) TeX is stable, but not rigid. A system locked into 1978's technology would today have gaps. That's why TeX is extendable, so that innovations can be added on.

An example is the LaTeX macro package, which is the most popular way to use TeX today. It extends TeX by adding conveniences such as automatic cross references, sectioning, indexing, a table of contents, automatic numbering of chapters, sections, theorems, etc., in a variety of styles, and a straightforward but powerful way to make tables.

LaTeX also contains many features that encourage authors to structure documents by meaning rather than by appearance. For instance, a LaTeX author might indicate an acronym as "`the \ac{Tree Based Hashing} method`." This approach has two advantages. First, since `\ac` is run by a computer and not hand-entered by a person, we can rely on type style, size, etc., being the same throughout the document; in this case the first time the acronym is used in the paper it will appear as "Tree Based Hashing (TBH)" while in later times "TBH" will be all that is shown. Second, once information on the meaning is in the computer then we can do more with it, perhaps by producing an index of acronyms.

And, LaTeX itself can be extended. There are thousands of "style files" that do everything from adapting the basics to the needs of the American Math Society, to making cross-references into hyper-references, all the way to allowing you to add epigraphs, the short quotations that sometimes decorate the start or end of a chapter.

• 6) The input is plain text. TeX's source files are portable to any computing platform. They are compact; for instance, all of the files for my 450 page textbook and 125 page answer supplement fit easily on one floppy disk. And, they integrate with other tools such as search programs.

Use of this type of input file stems from TeX's roots in the world of science and engineering where there is a tradition of close cooperation among colleagues. A binary input format, especially a proprietary one, is bad for cooperation: probably you have had to go through the trouble of upgrading a word processor version because coworkers upgraded and you could no longer read their files. With TeX systems that rarely happens — the last time that a LaTeX release lost evan a small amount of compatibility was in 1995.

Another advantage of plain text is that the text may be automatically generated, for instance if it is drawn out of a database for a report. Getting a word processor into that work flow is a challenge. But TeX fits right in.

There are even ways to run TeX directly from XML input, which many people think is the standard input format of the future. So, with the TeX engine in the middle the input may be adjusted to meet your needs, and changing times.

• 7) The output can be anything. As with inputting, TeX's outputting step is separate from its typesetting. The TeX engine's results can be converted to a printer language such as PostScript or to PDF or HTML, or, probably, to whatever will appear in the future. And, the typesetting — line breaks, etc. — will be the same no matter where your output appears. (Did you know that word processing output depends on the printer's fonts, so that if you email your work to someone with a different printer then for them the line and page breaks are likely to come out differently?)

Many people find that TeX's input language fits with how they think about their material. For instance, a scientist might describe a formula to a colleague over a telephone using TeX constructs.

• Freedom Most computer users have heard about Free and Open-Sourced software and know that, as with the GNU programs, Linux, Apache, Perl, etc., this style of development can yield software that is first class. TeX systems fall into this category.
• 8) TeX is free. The source of the main `tex` engine is open; the Free Software Foundation uses it for their documents. All of the other main components are open, also.

• 9) TeX runs anywhere. Whatever platform meets your needs — Windows, Macintosh, a variety of Unix, or almost anything else — you can get TeX, either freely distributed or in a commercial version.

So although the core of TeX was written some time ago it fits well with today's trends.

• Popularity Using the same system as many other people has advantages. For instance, you can get answers to your questions. And, because of this large user base, your system is sure to be around for years.
• 10) TeX is the standard. Most scientists, especially academic scientists, know TeX. Research preprints, drafts of textbooks, and conference proceedings, all are regularly produced with TeX. As a result, many publishers of technical material are set up to work with it.

Because it is the standard, TeX's support by other technical software is the best. For example, there are editing modes to make input convenient, such as AUCTeX for Emacs. Another example is that all major computer algebra systems, such as SAGE, Maxima, etc., will give output in TeX. And no doubt technical software developed in the future will support TeX.

In addition, TeX is used by many people outside of the sciences, for all of the reasons given in this document. For instance, there is a way to produce beautiful critical edition texts.

Having to use a bad system simply because it is popular would be sad. But nonetheless, the existence of such a base is itself one argument in favor of a software package.

More

• What is TeX? by Doug Waud gives an expanded introduction.
• TeX advertising brochure by Peter Flynn
• part of a series on processing technical text printed in the Notices of the American Mathematical Society in 1986, persuaded many mathematicians that TeX was the way to go.
• The TeX showcase is pure showmanship.

In summary ..

TeX is a typesetting system that produces publication-quality output, even for difficult material such as mathematics. It is freely available. Its design makes it shine in areas where the system familiar to most beginning computer users, word processors, falls short. Briefly, that is, it was designed well.