AZ logo

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".)

TeX is best known for its abilities with mathematical and scientific text and other difficult typesetting jobs; it allows ordinary users to produce output of the highest typographic quality. This is crucial for complex texts, where the ability of readers to understand the material depends on the clarity with which it is presented.

As a result, TeX is the standard in the mathematical 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.

TeX is Free software. You can freely download a version for almost every computer that people are using today. TeX systems have many other advantages; see below.

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 as a computer scientist he should be able to do better because digital typesetting meant arranging 1's and 0's (ink and no ink). He thought that this would take six months but ultimately it took nearly ten years because 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 is used every day for research papers, textbooks, and conference proceedings. And, 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 the major advantages that TeX systems enjoy.

Compared to word processors

You may have used a word processor, so a comparison may be helpful. In a word processor as you enter the text, the program places that text, with your help. In contrast, TeX is a formatter: it concentrates on placing the material onto the page (you enter the text with a separate program, an editor).

For instance, in a word processor an average user may start a new section by hitting <Enter> twice to get some 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 "\section{New results}". That is, a word processing user is formatting the text while entering it, while the TeX user describes the meaning of the text and leaves the formatting for the program to do later.

Beginners appreciate word processing because for a two page memo it is probably all that they need. But if that user graduates to complex jobs then the appeal or a word processor fades. Processing a twenty page technical article is hard; for example, keeping a uniform vertical space between sections is error-prone, as is keeping bibliographic citations consistent with the rules for the target journal. But with TeX many of those jobs are done by the program, not by the user.

In particular, few people have the knowledge and the eye to do mathematics — word processing users may say, "the equations just don't come out right", or even "you can tell what it means." That is, experience shows that often the TeX approach of having the typesetting knowledge built into the program is the better choice. (Some word processors offer as advanced features TeX-like facilities for organizing input text, although few users take advantage of them.)

I'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? is it as readable as possible?

  • 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 shines. Compare these samples of plain text from Herigel's Zen in the Art of Archery. These are short and the differences are subtle but even a non-expert will have the sense that the TeX page seems better. For instance, the word processor's page has some lines with too few words and some lines with too many; 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 with 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 the right spacing. It also sizes and spaces 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. The formulas, almost always, just come out right.

Superior Engineering You may have been frustrated with software that is slow, buggy, or that undergoes frequent incompatible version changes. TeX will not give you those troubles.

  • 3) TeX is 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 exercised by millions of users, on demanding input. It will never eat your document. Never.

    But there is more to stability 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 TeX doesn't just run reliably today. It will continue to do so, 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.

    An example is the LaTeX format, which is the most popular way to use TeX today. It is a set of commands that adds 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 encourages authors to structure documents by meaning rather than by appearance.

    And, LaTeX itself can be extended. There are thousands of packages 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.

    Suppose for instance that a LaTeX author's paper has many acronyms. This author might use the acronym package. With this package, if the author enters the information at the file start as "\acro{TBH}{Tree-Based Hashing}" then they can later call for the acronym with "\ac{TBH}". This approach has two advantages. The first is that it has the desired behavior: the first time that the computer sees "\ac{TBH}", it produces the full text "Tree-Based Hashing (TBH)", while subsequent appearances produce only "TBH". If this were hand-entered by a person then as the document is edited an acronym usage could by accident end up before its definition, but the computer will not lose track. The second advantage is that with the acronym information in the computer (that is, because the author specified its meaning instead of entering it directly into the text body), we can do more with that information, such as automatically producing a glossary of acronyms.

  • 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, plain text files fit with other tools, such as search programs or source text versioning systems.

    Another advantage of using the plain text input file format is that the text could have been automatically generated, for instance drawn from a database. Getting a word processor into a work flow like that is a challenge. But TeX fits perfectly.

    Input file formats that are binary or proprietary can be an issue; probably you have had to go through the trouble of upgrading a program because your 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).

  • 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 many output formats, such as PDF, or, probably, to whatever will appear in the future. And, the typesetting — line breaks, etc. — will be the same everywhere. (Did you know that word processing output depends on the printer's fonts, so that if you give your word processor document to someone with a different printer then for them the line and page breaks will come out differently?)

Freedom Most computer users have heard about Free and Open-Sourced software and know that, as with the GNU programs, Linux, Apache, Python, 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. On whatever platform you use, you can get TeX.

Popularity Using the same system as many other people has advantages. You can get your questions answered. And, your system is sure to be around for years.

  • 10) TeX is the standard. Most scientists know TeX. Every day research papers, textbooks, and conference proceedings, are 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.

Exhibits

These show you what the system can do.