Quality
Though well-written, TeX is so large (and so full of cutting edge technique) that it is said to have unearthed at least one bug in every Pascal system it has been compiled with. TeX runs on almost all operating systems.
Knuth offers monetary awards to people who find and report a bug in it. The award per bug started at one cent and doubled every year until it was frozen at its current value of $327.68. This has not made Knuth poor, however, as there have been very few bugs and in any case a cheque proving that the owner found a bug in TeX is usually framed instead of cashed.
The name
The name TeX is intended to be pronounced "tekh", where "kh" represents the sound at the end of Scottish "loch" (but not English "loch"; in SAMPA: /tex/). The X is meant to be the Greek letter χ. TeX is the abbreviation of τεχνε, Greek for "art" and "craft," which is also the source word of "technical".
The name is properly typeset with the "E" below the baseline; systems that do not support subscript layout use the approximation "TeX".
Fans like to proliferate names from the word "TeX" - such as TeXnician (user of TeX software), TeXhacker (TeX programmer), TeXmaster (competent TeX programmer), TeXhax, and TeXnique.
Derived works
Several document processing systems are based on TeX, notably:
- LaTeX (Lamport TeX), which incorporates document styles for books, letters, slides, etc., and adds support for referencing and automatic numbering of sections and equations,
- AMS-TeX, produced by the American Mathematical Society, this has a lot of more user-friendly commands, which can be altered by journals to fit with the house style. Most of the features of AMS-Tex can be used in LaTeX by using the AMS "packages". This is then referred to as AMS-LaTeX. The main AMS-TeX manual is entitled The Joy of TeX.
- jadeTeX which uses TeX as a backend for printing from James' DSSSL Engine,
- Texinfo, the GNU documentation processing system.
Numerous extensions to TeX exist, among them BibTeX for bibliographies (distributed with LaTeX), PDFTeX, which bypasses dvi and produces output in Adobe Systems' Portable Document Format, and Omega, which allows TeX to use the Unicode character set. All TeX extensions are available for free from CTAN, the Comprehensive TeX Archive Network.
Compatible tools
The TeXmacs text editor is a WYSIWYG scientific text editor that is intended to be compatible with TeX. It uses Knuth's fonts, and can generate TeX output. LyX is a similar tool.
TeX and Wikipedia
As of 2003, Wikipedia implements TeX markup, using <math>...</math> tags enclosing blocks of TeX. This capability is implemented via Texvc which is basically a script that pipes the markup through TeX, then dvips to produce a PostScript file which Ghostscript renders into a PNG image. Due to the nature of the web environment, this is done in an efficient (cached) and security-conscious way -- allowing third parties to pass unsanitised text through the standard TeX engine is a bad idea if you value your files.
The example fragments of TeX below are rendered using Texvc, and simple ones such as can be used to generate ,
although it is recommended that one writes the HTML-rendered a/b instead.
TeX examples
A simple plain TeX example -
Create a text file myfile.tex with the following content:
hello
\\bye
Then open a command line interpreter and type
tex myfile.tex
TeX then creates a file myfile.dvi
Use a viewer to look at the file. MikTeX for example contains a viewer called yap:
yap myfile.dvi
The viewer shows hello on a page. \\bye is a TeX command which marks the end of the file and is not shown in the final output.
The dvi file can either be printed directly from the viewer or converted to a more common format such as PostScript using the dvips program.
To see TeX further in action, look at its formatting of mathematical formulas. For example, to write the well-known quadratic formula, try entering
The quadratic formula is ${-b\\pm\\sqrt{b^2-4ac} \\over {2a}}$
\\bye
Use TeX as above, and you should get something that looks like
- The quadratic formula is
Notice how the formula is printed in a way a person would write by hand, or typeset the equation. In a document, entering math mode is done by starting with a $, then entering a formula in TeX semantics and closing again with another $. Display math, or math presented centered on a new line is done by using $$. For example, the above with the quadratic formula in display math:
The quadratic formula is $${-b\\pm\\sqrt{b^2-4ac} \\over {2a}}$$
\\bye
renders as
- The quadratic formula is
See also:
References:
This article (or an earlier version of it) contains material from FOLDOC's article on TeX, used with permission.