return

Celebratio Mathematica

Richard Sheldon Palais

Communication of Mathematics with \( \mathsf{\TeX} \)

by Barbara Beeton and Richard Palais

1. Introduction

Un­til about the early 1960s, most pub­lished math­em­at­ics was type­set pro­fes­sion­ally by skilled com­pos­it­ors work­ing on Mono­type ma­chines. As this form of “hot-met­al” com­pos­i­tion be­came less read­ily avail­able, on ac­count of both cost and the fact that skilled com­pos­it­ors were re­tir­ing and not be­ing re­placed, “en­hanced” type­writers began to be used to pre­pare less pres­ti­gi­ous pub­lic­a­tions. Pho­to­type­set­ting (“cold type”) began to ap­pear gradu­ally, al­though it was more ex­pens­ive than type­writer-based com­pos­i­tion, and gen­er­ally not as at­tract­ive in ap­pear­ance as pro­fes­sion­ally pre­pared Mono­type copy.

By the mid-1970s, Mono­type com­pos­i­tion was es­sen­tially dead. Don­ald Knuth, a pro­fess­or of com­puter sci­ence at Stan­ford Uni­versity, was writ­ing a pro­jec­ted sev­en-volume sur­vey en­titled The Art of Com­puter Pro­gram­ming (TAOCP); volume 3 was pub­lished in 1973, com­posed with Mono­type. By then, com­puter sci­ence had ad­vanced to the point where a re­vised edi­tion of volume 2 was in or­der but Mono­type com­pos­i­tion was no longer pos­sible; the gal­leys re­turned to Knuth by his pub­lish­er were pho­to­com­posed. Knuth was dis­tressed: the res­ults looked so aw­ful that it dis­cour­aged him from want­ing to write any more. But an op­por­tun­ity presen­ted it­self in the form of the emer­ging di­git­al out­put devices — im­ages of let­ters could be con­struc­ted of zer­os and ones.1 This was something that he, as a com­puter sci­ent­ist, un­der­stood. Thus began the de­vel­op­ment of \( \mathrm{\TeX} \).

2. The problem

Math­em­at­ics as a dis­cip­line de­pends on its own ar­cane lan­guage for com­mu­nic­a­tion. Pri­or to the ubi­quit­ous avail­ab­il­ity of per­son­al com­puters, the op­tions for com­mu­nic­at­ing math­em­at­ic­al know­ledge were lim­ited to face-to-face con­tact, prefer­ably with a writ­ing sur­face handy, al­though con­ven­tions de­veloped to en­able in­tel­li­gible tele­phone dis­cus­sion, per­son­al let­ters (at least bits of which re­quired hand­writ­ten nota­tion), or form­al pub­lic­a­tion. The last mode re­quired a highly skilled com­pos­it­or, work­ing either with tra­di­tion­al hand-set type or with a hot-met­al typecaster, or a com­bin­a­tion of the two.

The gold stand­ard for type­set math­em­at­ics in the midtwen­ti­eth cen­tury was the Mono­type typecaster [e1], [e3]. The audi­ence was re­l­at­ively small, and the work ex­act­ing. Since math­em­at­ic­al nota­tion is es­sen­tially multi-level (see Fig­ure 1), the Lino­type, the lin­ear-type work­horse for news­pa­pers and most book pub­lish­ing, was not up to the task. Only a few sup­pli­ers would take on such work, and math­em­at­ic­al com­pos­i­tion was al­ways con­sidered “pen­alty copy”.2

Quad­rat­ic for­mula


\[
  x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\]
\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]

Max­well's equa­tions


\begin{align*}
  \vec{\nabla} \cdot \vec{B} &= 0 \\
  \vec{\nabla} \times \vec{E} + \frac{\partial B}{\partial t} &= 0 \\
  \vec{\nabla} \cdot \vec{E} &= \frac{\rho}{\epsilon_0} \\
  \vec{\nabla} \times \vec{B}
     - \frac{1}{c^2} \, \frac{\partial E}{\partial t} &= \mu_0 \vec{J}
\end{align*}
\begin{align*} \vec{\nabla} \cdot \vec{B} &= 0 \\ \vec{\nabla} \times \vec{E} + \frac{\partial B}{\partial t} &= 0 \\ \vec{\nabla} \cdot \vec{E} &= \frac{\rho}{\epsilon_0} \\ \vec{\nabla} \times \vec{B} - \frac{1}{c^2} \, \frac{\partial E}{\partial t} &= \mu_0 \vec{J} \end{align*}

An­oth­er sys­tem of equa­tions


\new­com­mand{\gam­maurad}[1]{%
  \frac{\gamma u_{\text{rad}}^{} \bar{\lambda} a_{\text{eff}}^2}{2I_1 {#1}}\,}
\begin{align*}
  \frac{d\phi}{dt} &= \gammaurad{\omega \sin \xi} G(\xi, \phi)
                      - \Omega_{\mathrm{B}} \, , \\
  \frac{d\xi}{dt} &= \gammaurad{\omega} F(\xi, \phi)
                     - \frac{\sin \xi \cos \xi}{\tau_{\text{DG}}^{}} , \\
  \frac{d\omega}{dt} &= \gammaurad{}
    \bigl[ \gamma H(\xi, \phi)
           + (1 - \gamma) \langle Q_\Gamma^{\text{iso}} \rangle \bigr] \\
  &\phantom{{}={}} - \frac{\omega \sin^2 \xi}{\tau_{\text{DG}}^{}}
   + \frac{\omega \sin^2 \xi}{\tau_{\text{drag}}^{}}
   - \frac{\omega}{\tau_{\text{drag}}^{}}
\end{align*}
\begin{align*} \frac{d\phi}{dt} &= \frac{\gamma u_{\text{rad}}^{} \bar{\lambda} a_{\text{eff}}^2}{2I_1 {\omega \sin \xi}}\, G(\xi, \phi) - \Omega_{\mathrm{B}} \, , \\ \frac{d\xi}{dt} &= \frac{\gamma u_{\text{rad}}^{} \bar{\lambda} a_{\text{eff}}^2}{2I_1 {\omega}}\, F(\xi, \phi) - \frac{\sin \xi \cos \xi}{\tau_{\text{DG}}^{}} , \\ \frac{d\omega}{dt} &= \frac{\gamma u_{\text{rad}}^{} \bar{\lambda} a_{\text{eff}}^2}{2I_1 {}}\, \bigl[ \gamma H(\xi, \phi) + (1 - \gamma) \langle Q_\Gamma^{\text{iso}} \rangle \bigr] \\ &\phantom{{}={}} - \frac{\omega \sin^2 \xi}{\tau_{\text{DG}}^{}} + \frac{\omega \sin^2 \xi}{\tau_{\text{drag}}^{}} - \frac{\omega}{\tau_{\text{drag}}^{}} \end{align*}

Fig­ure 1. Samples of dis­play math us­ing \( \TeX \) in­put and out­put.

3. Analysis of the problem

What Knuth did next is de­scribed nicely in his lec­ture on the oc­ca­sion of his re­ceiv­ing the Kyoto Prize in 1996 [e6]. Pub­lic­a­tion of the pho­toset volume 2 was hal­ted, and Knuth sought out the best ex­amples he could find of the math­em­at­ic­al type­set­ter’s art. He chose three: Ad­dis­on-Wes­ley books, in par­tic­u­lar the ori­gin­al TAOCP; the Swedish journ­al Acta Math­em­at­ica, from about 1910; and the Dutch journ­al In­d­ag­a­tiones Math­em­at­icae, from about 1950.

To de­vel­op rules for prop­er spa­cing in math­em­at­ics, he writes ([e7], pp. 364–365)

I looked at all of the math­em­at­ics for­mu­las closely. I meas­ured them, us­ing the TV cam­er­as at Stan­ford, to find out how far they dropped the sub­scripts and raised the su­per­scripts, what styles of type they used, how they bal­anced frac­tions, and everything. I made de­tailed meas­ure­ments, and I asked my­self, “What is the smal­lest num­ber of rules that I need to do what they were do­ing?” I learned that I could boil it down in­to a re­curs­ive con­struc­tion that uses only sev­en types of ob­jects in the for­mu­las.

4. Growing pains

The ini­tial im­ple­ment­a­tion of \( \mathrm{\TeX} \) began in Oc­to­ber 1977 and was com­plete in May 1978. This tool was at first in­ten­ded just for use by Knuth and his sec­ret­ary to pro­duce fu­ture volumes of TAOCP of which he could be proud. As a trained math­em­atician, he de­signed the in­put so that it would be mean­ing­ful in its raw form to an­oth­er math­em­atician, but would also be easy for a sec­ret­ary to type. Sym­bols would be in­put by name, e.g., \gamma, as would the struc­tur­al com­pon­ents of a doc­u­ment, e.g., \chapter or \sec­tion, as op­posed to the pre­vail­ing com­pos­it­or’s ap­proach of mark­ing changes by font and type size. (The lat­ter ap­proach is still evid­ent in the design of many word pro­cessing pro­grams, al­though it’s usu­ally hid­den from the per­son en­ter­ing the text.) \( \mathrm{\TeX} \) was de­signed to be used as a batch pro­cess, al­though in­ter­act­ive entry is pos­sible, so the out­put isn’t seen un­til the file has been pro­cessed; it is de­cidedly not “WYSI­WYG”. It was not con­tem­plated that \( \mathrm{\TeX} \) would be­come a com­mer­cial product; in­stead, it would be made freely avail­able.3

In Janu­ary 1978, Knuth de­livered the Jo­si­ah Wil­lard Gibbs lec­ture to the an­nu­al meet­ing of the Amer­ic­an Math­em­at­ic­al So­ci­ety (AMS). The lec­ture, en­titled “Math­em­at­ic­al Ty­po­graphy” [e2], began “Math­em­at­ic­al books and journ­als do not look as beau­ti­ful as they used to.” Armed with co­pi­ous ex­amples, both good and bad, and a firm sense of how best to present math­em­at­ic­al nota­tion so that it is in­tel­li­gible (at least to those who are fa­mil­i­ar with its use), Knuth presen­ted a view of how com­puters can serve to re­place the van­ish­ing ex­pert­ise of tra­di­tion­al com­pos­it­ors and re­store the ap­pear­ance of tech­nic­al pub­lic­a­tions to their former glory. In ad­di­tion to the dis­cus­sion of prop­er present­a­tion of math­em­at­ic­al nota­tion, the lec­ture in­tro­duced a com­pan­ion tool, Meta­font, for pro­duc­tion of the needed fonts.

The chair of the AMS Board of Trust­ees, Richard Pal­ais, was in the audi­ence. Since the AMS was one of the pub­lish­ers suf­fer­ing from the tech­no­lo­gic­al trans­ition, \( \mathrm{\TeX} \) soun­ded like the solu­tion to many prob­lems. An ar­range­ment was set up for a group of AMS rep­res­ent­at­ives to spend a month at Stan­ford and learn \( \mathrm{\TeX} \), “bring it back and make it work”. This group con­sisted of one staff mem­ber from each of the AMS of­fices (Bar­bara Bee­ton from headquar­ters and Rilla Thed­ford from Math­em­at­ic­al Re­views) and three math­em­aticians: the afore­men­tioned Richard Pal­ais; Robert Mor­ris from the Uni­versity of Mas­sachu­setts, Bo­ston, who had ex­tens­ive com­puter ex­per­i­ence; and Mi­chael Spivak, who had a proven abil­ity to write co­gent text­books. The charge was to de­vel­op meth­ods for deal­ing with the typ­ic­al pub­lic­a­tion cycle and to write an in­ter­face and in­struc­tion manu­al for end users as well as pro­duc­tion staff.

As one of the AMS rep­res­ent­at­ives, Bee­ton gathered a num­ber of “good bad ex­amples” that she knew would be en­countered in pro­duc­tion be­cause they already had. This turned out to be good pre­par­a­tion: sev­er­al of these ex­amples turned up later in The \( \TeX \)book ([e5], see vol. A) and as new fea­tures ad­ded to the pro­gram it­self.4

The \( \mathrm{\TeX} \) pro­gram was duly brought back to the Provid­ence of­fice of the AMS, in­stalled, and ini­tial im­ple­ment­a­tion of use­ful pro­ced­ures was un­der­taken.5 The first ap­plic­a­tions were light on math­em­at­ic­al con­tent; pol­ish­ing of the ex­ten­ded in­struc­tion set for use by math­em­aticians (AMS-\( \mathrm{\TeX} \)) and writ­ing of its user manu­al [e4] were still un­der­way. Also, in the in­ter­im, ex­tens­ive changes were made in the pro­gram to provide fea­tures not in the first it­er­a­tion (known now as \( \mathrm{\TeX} \)78). These changes in­cluded (i) en­hanced ma­nip­u­la­tion of “boxes” (the con­tain­ers for prin­ted char­ac­ters) and sur­round­ing spaces and (ii) an in­crease in the num­ber of fonts that could be used as well as im­proved meth­ods for ma­nip­u­lat­ing them. The res­ult­ing ver­sion, known as \( \mathrm{\TeX} \)82, is the basis for today’s pro­gram. At the same time, the lan­guage in which \( \mathrm{\TeX} \) was writ­ten was changed, from one that was in lim­ited use to one with a sol­id his­tory of use in teach­ing pro­gram­ming.6 As it had been from day one, the soft­ware re­mained free to use and ad­apt. Hav­ing achieved his goal of a sys­tem that met his needs, Knuth re­turned to his work on TAOCP.

Con­trib­ut­ing to \( \mathrm{\TeX} \)’s grow­ing pop­ular­ity was the emer­gence, start­ing in the mid-1980s, of per­son­al com­puter sys­tems and their rap­id ad­op­tion by tech­nic­ally minded in­di­vidu­als. This was \( \mathrm{\TeX} \)’s nat­ur­al audi­ence, and im­ple­ment­a­tions of \( \mathrm{\TeX} \) on these per­son­al ma­chines pro­lif­er­ated.

By the end of the 1980s, a grow­ing user pop­u­la­tion in Europe was be­com­ing in­creas­ingly frus­trated with the dif­fi­culties in hand­ling non-Eng­lish texts. \( \mathrm{\TeX} \) re­quired ar­cane com­bin­a­tions of char­ac­ters to rep­res­ent ac­cen­ted let­ters rather than the single pre-ac­cen­ted forms provided by European key­boards. Also, the com­pound in­put forms could not be prop­erly hy­phen­ated. A per­suas­ive group of Ger­man users sat down with Knuth at the 1989 \( \mathrm{\TeX} \) Users Group meet­ing to dis­cuss this lack. This meet­ing res­ul­ted in the ex­ten­sion of \( \mathrm{\TeX} \) to ac­com­mod­ate nat­ively ac­cen­ted let­ters on in­put and prop­er hy­phen­a­tion in pro­cessing.7

5. Communicating mathematics

The ba­sic \( \mathrm{\TeX} \) sys­tem comes with a func­tion­al toolkit of ty­po­graph­ic func­tions and one (quite ex­tens­ive) fam­ily of fonts. This is ne­ces­sary for the type­set­ting of math­em­at­ics and oth­er tech­nic­al ma­ter­i­al, but many users did not find it suf­fi­cient. De­vel­op­ment has oc­curred in sev­er­al areas, not all in­volving \( \mathrm{\TeX} \).

Document structuring

While AMS-\( \mathrm{\TeX} \) format­ted com­plic­ated math dis­plays ad­mir­ably us­ing de­script­ive com­mands, it lacked the abil­ity to auto­mat­ic­ally num­ber equa­tions and sec­tions of a doc­u­ment and the means for cross-ref­er­en­cing. An­oth­er user in­struc­tion set, \( \mathrm{\LaTeX} \) (de­vised by Leslie Lam­port,8 a former stu­dent of Pal­ais), did provide those fea­tures, al­though it lacked the math­em­at­ic­al re­fine­ments of AMS-\( \mathrm{\TeX} \). The AMS, re­spond­ing to pres­sure from au­thors, ar­ranged to have the math-format­ting fa­cil­it­ies of AMS-\( \mathrm{\TeX} \) re­writ­ten to op­er­ate with­in the \( \mathrm{\LaTeX} \) paradigm; the res­ult was called AMS-\( \mathrm{\LaTeX} \), com­pris­ing two parts, ams­math and the AMS doc­u­ment classes.9

Fonts

Font de­vel­op­ment has been driv­en by the avail­ab­il­ity of per­son­al com­puters and laser print­ers and the growth of the World Wide Web, as well as by the de­sire for vari­ation in type styles avail­able for \( \mathrm{\TeX} \).

One font fam­ily that ori­gin­ated in the need for ro­bust out­put from low-res­ol­u­tion laser print­ers is Lu­cida by Kris Holmes and Charles Bi­gelow. Bi­gelow was on the Stan­ford fac­ulty dur­ing part of the \( \mathrm{\TeX} \) pro­ject de­vel­op­ment, and Lu­cida has, from the very be­gin­ning, in­cluded a large com­ple­ment of math sym­bols as needed by \( \mathrm{\TeX} \) users.

De­sire to give math­em­aticians the abil­ity to com­mu­nic­ate on the Web was the driv­ing force be­hind the STIX pro­ject.10 In the first phase of this pro­ject, a com­pre­hens­ive list of math sym­bols was com­piled from lists sub­mit­ted by the STIpub mem­ber or­gan­iz­a­tions and sub­mit­ted for ad­di­tion to Uni­code. The bulk of ad­di­tions be­came avail­able with Uni­code 4.0 in 2003, com­pris­ing sev­er­al thou­sand sym­bols, in­clud­ing sev­er­al vari­ant al­pha­bets (e.g., Frak­tur and script) needed to dis­crim­in­ate between dif­fer­ent vari­ables as defined in math­em­at­ic­al con­texts.

Ver­sion 1 of the STIX fonts (based on Times) was re­leased in 2012, and fi­nal pol­ish­ing of ver­sion 2 is un­der­way.

Pos­sibly in­flu­enced by the STIX work with Uni­code,11 Mi­crosoft ad­ded math­em­at­ics sup­port to Word 200712 along with the newly de­signed Cam­bria font [e10]. Cam­bria is the first Open­Type font (OTF) to make use of the OTF Math table. In­deed, the OTF Math table was cre­ated spe­cific­ally for Cam­bria, and many of its para­met­ers are re­cog­niz­able as par­al­lel to the \( \mathrm{\TeX} \) font paradigm.

The Web

XML was de­veloped as a Web-aware ap­plic­a­tion of SGML. Even for SGML, there had been an ef­fort to stand­ard­ize the names of math sym­bols as a “pub­lic en­tity set”, and this drew heav­ily on the names as­signed for \( \mathrm{\TeX} \) and AMS-\( \mathrm{\TeX} \). This vocab­u­lary was taken in­to XML and its tech­nic­al daugh­ter Math­ML. Work has con­tin­ued in this area to main­tain par­al­lel nam­ing, in­so­far as pos­sible, between the two “lan­guages”.

Since Math­ML is not as eas­ily com­pre­hen­ded by hu­mans as \( \mathrm{\TeX} \), trans­la­tion con­ven­tions and soft­ware have sprung up to al­low in­put us­ing \( \mathrm{\TeX} \) nota­tion, which is fa­mil­i­ar to math­em­aticians. An­oth­er Web present­a­tion tool, Math­Jax, has emerged to al­low in-line math to be de­livered nat­ively on-screen (that is, without the use of bit­map in­clu­sions, which are not scal­able, or PDF); again, the in­put nota­tion is es­sen­tially \( \mathrm{\TeX} \) al­though it is rarely entered dir­ectly by a hu­man au­thor.

Non-technical applications

Since \( \mathrm{\TeX} \) was de­signed as a hard­ware-in­de­pend­ent batch pro­cess, it is cap­able of be­ing used in re­pet­it­ive con­texts to pre­pare per­son­al­ized form let­ters, in­voices, bank state­ments, train sched­ules, cata­logs, …; the list goes on and on. The ori­gin­al out­put format is com­pact, since it con­tains only the iden­ti­fic­a­tion of glyphs and their loc­a­tion on the page; thus it can be archived com­pactly (along with one copy of each needed font and oth­er re­pet­it­ive con­tent such as lo­gos), an im­port­ant fea­ture to com­ply with leg­al re­quire­ments for some doc­u­ments. Most such uses are “in­vis­ible” to those not fa­mil­i­ar with the rel­ev­ant work­flow, but they are ex­tens­ive, es­pe­cially in Europe.

Remaining limitations

One area that has not yet seen a sat­is­fact­ory meth­od of present­a­tion is ac­cess­ib­il­ity — the abil­ity to trans­late \( \mathrm{\TeX} \) in­put to an au­dio out­put that is read­ily un­der­stand­able by a trained math­em­atician with visu­al lim­it­a­tions. Part of the prob­lem is that, for best res­ults, an au­thor must think ahead about such use and re­strict the way that nota­tion is used; most au­thors can’t be bothered, even if they are aware of the prob­lem. Someone may find a cred­ible and eas­ily ap­plied solu­tion, but to date, it’s still a quite hard prob­lem.

6. Conclusion

The most last­ing ef­fect of \( \mathrm{\TeX} \) is sep­ar­ate from the soft­ware it­self: \( \mathrm{\TeX} \)’s vocab­u­lary has be­come the lin­gua franca of math­em­at­ics. Knuth’s design of a lin­early coded stream for rep­res­ent­ing math has with­stood the test of time and has been ad­op­ted in­to oth­er soft­ware without any sub­stan­tial re­design. And \( \mathrm{\TeX} \) it­self is one of the few pieces of soft­ware from that peri­od still in wide use.

Since the in­put is plain text, it is not af­fected by (most) up­grades to the pro­cessing sys­tem, and it is hard­ware in­de­pend­ent; the same in­put will yield the same out­put, mod­ulo the avail­ab­il­ity of identic­al fonts. Knuth’s ori­gin­al goal of cre­at­ing a sys­tem that would en­able him to type­set his life’s work, TAOCP, with the same high qual­ity shown by the first edi­tion of volume 1 and re­main con­sist­ent re­gard­less of how many years have elapsed has been achieved ad­mir­ably.

Un­less something totally un­fore­seen ma­ter­i­al­izes that is sim­pler to use and pro­duces res­ults of equally high qual­ity without the need to un­learn the ba­sics of math­em­at­ic­al dis­course it­self, the situ­ation is likely to re­main very much the same in the com­ing dec­ades.

Authors

Bar­bara Bee­ton is a long-time em­ploy­ee of the Amer­ic­an Math­em­at­ic­al So­ci­ety, where she has been in­volved in tech­nic­al sup­port of type­set­ting ever since in­stall­a­tion of the first com­puter. She is a found­ing mem­ber of the \( \mathrm{\TeX} \) Users Group (TUG) and ed­it­or of their journ­al, TUG­boat. She has been a rep­res­ent­at­ive to U.S. and in­ter­na­tion­al stand­ards work­ing groups with a fo­cus on doc­u­ment pro­cessing, and she rep­res­en­ted STIpub to the Uni­code Tech­nic­al Com­mit­tee in the ef­fort to ex­pand Uni­code to ac­com­mod­ate math­em­at­ic­al nota­tion.

Richard Pal­ais was the Found­ing Chair of the \( \mathrm{\TeX} \) Users Group. He was a mem­ber of the AMS Board of Trust­ees from 1972 to 1981 and its chair from 1977 to 1979. He is pro­fess­or of math­em­at­ics emer­it­us at Bran­de­is Uni­versity, and since 2004 he has been on the fac­ulty at the Uni­versity of Cali­for­nia, Irvine.