Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

About Tex and L TEX: 1.1 An Overview

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

chapter 1

                        

ABOUT TEX AND LATEX

1.1 An overview

It is surprising how diYcult it is to automate the process of typesetting. The


TEX (ideally pronounced to rhyme with blec-c-c-ch) typesetting system is
(arguably) the best way to do this by computer. TEX was designed to cope
with the intricacies of mathematical and technical typesetting and especially
to deliver beautifully typeset documents. The source of the “TEX” logo is the
Greek root  (tau epsilon chi), which forms part of words like “technol-
ogy.”
What is LTEX, and how does it diVer from TEX? In ways we will discuss,
A

TEX typesetting commands have been used to create many new commands
that are easier and more convenient to use; these new commands comprise
the LTEX system. But behind the scenes, all LTEX commands need to be re-
A A

solved in terms of primitive TEX commands, which is why it is proper to say


that LTEX is TEX. In the remainder of this chapter, “TEX” is usually a syn-
A

onym for “TEX and LTEX” because most of this material applies equally well
A

to LTEX or to plain TEX. Sometimes, for emphasis, we will say “LTEX and
A A

TEX” explicitly. An extended discussion of LTEX appears later (in chapter 4


A

and appendix 2).


For the best possible printed appearance of your document, TEX is the
tool of choice. Because of this, and because it's free (that is, the original pro-
gram code is free and many implementations of it are free), it's become a
preferred alternative (and often the standard) for electronically distributing
documentation, preprints and reprints, and technical reports. If an author
prepares a le containing the text of a message sprinkled with the format-
ting instructions that LTEX or TEX obeys, then anyone else anywhere in the
A

world can print this message precisely as intended using their local version
of TEX. The les we feed to the TEX program contain only printable ascii
characters, so these les are easy to transfer from one computer to another.
In addition to this portability, TEX documents are stable. Work on the
basic TEX “engine” has now been frozen (except for bug xes) so a decade-
old TEX document can be rerendered today.

1
2 CHAPTER 1. ABOUT TEX AND LTEX A

Type: - -- --- $ - $ `` '' ?` !` ff fi fl ffi ffl


To get: - – — “ ” ¿ ¡ V   Y Z
Figure 1: TEX's ligature mechanism helps typeset several di Verent characters.

1.1.1 Typographic niceties

LTEX and TEX are hardly the only systems purporting to paint digital char-
A

acters on a laser-printed page. But even at this late date, few other systems
do it as well as TEX does. Let's see what lies behind this extravagant claim.
Over the centuries, printers (doubtless attempting to mirror the owing
appearance of ne handwriting) became accustomed to replacing certain
pairs of adjacent letters by single characters termed ligatures. Early printers
used far more ligatures than do current typesetters, but some ligatures have
survived until now (or at least until the advent of computer typesetting!).
Today, knowledgeable typesetters would replace letter groups “fl” and “fi” by
the typographic equivalents  and  (look closely at the diVerences). Other
ligatures that should be used include V, Y, and Z, and TEX can actually
accommodate other exotic ligatures if the need arises. Human authors could,
of course, be taught to somehow select them as they key in their texts, but
this is a bad idea—computers that never err should do it instead. The task
of creating ligatures automatically is apparently beyond the capabilities of
most computer typesetting systems, and it's becoming increasingly common
to read books in which some (or all!) of the f-ligatures are missing.
TEX uses its ligature mechanism to improve the appearance of often
misused characters like dashes and quotes. Depending on how an author
enters a dash and on the context (math mode or not), LTEX or TEX typesets
A

four diVerent dash-like quantities. Quotes are handled in similar ways, so a


TEX document will contain proper left and right double “quotes.” Figure 1
summarizes these (and a few other) results.
TEX can also kern adjacent letters. A kern is a dollop of horizontal spac-
ing that is added or subtracted between character pairs to improve the ap-
pearance of the letters. Probably the best example of kerning appears in
the logo TOYOTA (compare with TOYOTA)—each letter is kerned to its
neighbor. Most of the time, kerning is negative—letters are moved together.
(But every so often, as with adjacent o's, TEX has to impose positive kerning
to further separate adjacent letters.) Figure 2 on the next page compares and
contrasts kerned text with its unkerned counterpart.
It's not always possible to end words on lines without splitting them in
two parts. The rules concerning this hyphenation are nontrivial and vary
from language to language. (Sometimes the rules vary from region to region
within a single language; British and American rules are completely diVer-
1.1. AN OVERVIEW 3

Kerned TOYOTA
Unkerned TOYOTA
Kerned IRRAWADDY
Unkerned IRRAWADDY
Kerned JAVA WAVE
Unkerned JAVA WAVE

Figure 2: Kerning

ent.) Although TEX works hard to set type without the necessity of hyphen-
ating, TEX does contain algorithms that ensure proper hyphenation about
95% of the time. (Corrections to a word's hyphenation are easy to specify.)
In general, TEX works hard to compute proper line breaks in a paragraph. In
extreme cases, the last word of a paragraph inuences the line break of the
rst line, so neither TEX nor LTEX will compute line breaks until the entire
A

paragraph is known to it.


The particular strengths of LTEX and TEX lie in the areas of setting
A

complex tables and mathematics and other technical material. (See gure 3
on the following page for mathematics, and gure 4 on page 7 and especially
the front endpaper for examples of tables.) For mathematical typesetting,
TEX is even able to distinguish between math in the context of display or
text—compare the displayed formula
m
X
2
k
x
i D0 i

to the same expression


P m2 k
i D0 xi set within text.

1.1.2 Scholarly detritus

Papers written for a scholarly or technical audience require many supporting


aids, such as indexes, footnotes, tables of contents, lists of gures, glossaries,
bibliographies, and so on. Most of these can be handled automatically by
TEX; some, like indexes, will always need some manual intervention.
TEX can write material to an external le and later retrieve information
from that le. That's how it is possible to prepare this material. Certain
commands will cause TEX to write phrases with page numbers to les, which
TEX can read back in on a subsequent run. This is why LTEX runs, for
A

example, sometimes conclude with an injunction to rerun the le through


LTEX, even though no additional changes have been made.
A
4 CHAPTER 1. ABOUT TEX AND LTEXA

01 1
BB 1
1 ::: 1 v
u s r
: : : 1n C
t1 C 1 C 1 C q1 C p1 C p1 C 
u
12 C
KBBB :2 22
::
: : : 2n C
:C
C
@ :: ::
: : :: A
m m2 : : : mn
Z 
2 e x2 ‚ k…„ ƒ ‚ l…„
's 's

ƒ
e dx
„ : : : ; ;ƒ‚ ; : : : ; …g
f ;
0
k Cl elements

Figure 3: TEX does mathematics.

In the case of footnotes and oating objects (like gures and tables),
TEX is adept at guring out how much space to leave to accommodate the
item and at moving a gure or table to the next page if the current page is
already too full (that's why they're called “oats”). Automatic numbering of
footnotes, tables, and so on, is also possible.
Sometimes, external programs work in concert with TEX. In the case of
index preparation, an author inserts various commands in the manuscript,
and LTEX or TEX obligingly spits the material to a separate index le. An-
A

other program, such as MakeIndex, is needed to sort the entries properly and
merge identical entries together. In the case of bibliography preparation, an
author may well like to prepare a collection of entries pertaining to her eld
of specialty, say, and have only a small number of entries selected for a par-
ticular report. The bibliographic information will need special formatting to
accommodate itself to the needs of the journal. This is done by a program,
usually BibTEX.
No matter what avor of TEX an author uses, these abilities are always
present. However, in plain TEX an author has to work harder, because rela-
tively few high level commands exist. The more complete a macro package
is, such as LTEX (see page 33), the easier these capabilities become.
A

Although the major advantage of using a program like TEX (plus per-
haps helpers like BibTEX or MakeIndex ) is convenience, the major payoV
occurring whenever the original manuscript undergoes revision. Changes to
pagination, page layout, and so on, which occur as a result of the document's
revision, automatically propagate to these ancillary materials.

1.1.3 Why is TEX hard?

Any reader with even a smattering of LTEX or TEX experience knows that
A

this versatility and perfectionism comes at a cost—TEX is widely perceived


to be a hard tool to use and master. Why should this be so?
1.1. AN OVERVIEW 5

For one reason, there is rarely immediate feedback with a TEX docu-
ment, and this may contribute to this perception. Like any computer sys-
—
Probe: actually.
VA
VA VA
elangyosj elangyosj elangyosj elangyosj elangyosj elangyosj

You might also like