<<

TUGb oat, Volume 18 1997, No. 1 39

the prop er way coming to a compromise between

readability and abstract typ esetting rules.

Tutorials / Surveys

I will discuss here those few tricks that physi-

cists and engineers, not mathematicians,must know

Typ esetting mathematics for science and

in order to satisfy the international regulations and

technology according to ISO 31/XI

to distinguish similar symb ols with di erent mean-

ings and, ultimately, in order to cop e with the ISO

Claudio Beccari

regulations [1] and the recommendations issued by

Abstract

the International Union of Pure and Applied Physics

IPU [6].

Mathematicians set mathematics into typ e di er-

ently from physicists and engineers; the latter re-

2 Upright and sloping letters

quire some particular tricks in order to satisfy

The main and p ossibly the only di erence b etween

ISO 31/XI and to distinguish similar symb ols that

\mathematical" vs. \physical" mathematics lies in

A

have di erent meanings. The L T X2 commands

"

E

the use of upright and sloping letters. Scientists and

to implement such tricks are shown and explained.

technologists should use upright letters much more

1 Intro duction

often than mathematicians.

A

In math mo de L T X2 cho oses normal letters

"

E

As D.E.Knuth p oints out very well in The T Xbook

E

from the \math italics" alphab et, which includes

[7], the strength of T X and its derived dialects

E

also the Greek lowercase ones. Both Latin and

A

among which L T X2 outclasses all others lies

"

E

Greek letters have a sloping shap e, the former b eing

in the abilitytotyp eset b eautiful mathematics; the

in italics, the latter just sloping to the right with a

variety of symb ols, the shap e of the op erators, the

slop e angle that matches the one of the italics char-

spacing, b oth vertical and horizontal, the sizes of

acters. Just the upp ercase Greek letters by default

rst and second order sub and sup erscripts make

are upright, but it would b e very easy, although un-

A

L T X the b est software available to day for typ e-

E

usual, to set them with a sloping shap e b ecause they

A

setting mathematics. Of course L T X doesawon-

E

app ear in the \math italic" , and in all the \text

derful job also with plain text, tables, cross refer-

italic" and other \slanted" .

encing, indexing, and so forth, but other programs

In the following I will call \roman" the upright

may p erform well with the latter tasks; what other

shap e and \italic" the one that T Xies are used to

E

programs really cannot do is the excellentwork with

asso ciate with math italics. The choice of the word

mathematics; all this is not surprising since T Xwas

E

\roman" is not chance, since sans- characters

created by a mathematician for typ esetting mathe-

are not suited for physical mathematics b ecause sev-

matics, rst of all in his own b o oks.

eral signs are not easy to distinguish in the absence

In this pap er I do not discuss how to typ eset

of serifs: compare I and l for example; you cannot

A

mathematics, since L T X takes care of most of it;

E

tell which one is \upp er case I" and which one \lower

very seldom the author needs minor corrections of a

case l".

formula, and when this happ ens it is usually to cor-

Sans-serif upright characters may be used in

rect some spacing when slanted op erators are to o

technical and/or physical texts in order to mark

close or to o far away from the symb ols they precede

ob jects that cannot b e confused with mathematical

or follow, so that the slanting shap e of the op erator

symb ols, for example for the names of p oints in the

requires some degree of manual intervention in or-

description of geometrical gures, technical ob jects,

der to x the spacing. Several such cases are dealt

exp erimental setups, and the like. Therefore sans-

A

with b oth in The T Xbook and in Lamp ort's L T X

E E

serif upright letters never app ear in a mathematical

Handb o ok [8].

formula of a physicist or an engineer, while math-

Nor do I discuss the aesthetics of a typ eset for-

ematicians use sans-serif fonts to represent certain

mula, where several factors should follow one an-

1

structures in category theory. As a partial excep-

other in such a way that the formula pro le is

tion, sans-serif sloping upp ercase letters are allowed

as smo oth as p ossible, without valleys and p eaks.

to indicate tensors of the second rank, but this is the

Typ esetting a complicated formula requires b oth

mathematical knowledge and a sense of aesthetics,

but requires also, esp ecially in didactic b o oks, that

the relevant parts of the formula are highlighted in

1

Thanks to the reviewer for this information; although

he/she do es not sp ecify it, nevertheless I supp ose that they

are sans-serif sloping fonts.

40 TUGb oat, Volume 18 1997, No. 1

only exception mentioned in the IPU recommenda- index; but R where `E' distinguishes an ob ject such

E

tions [6] and stated in the ISO regulations [1, clause as the \emitter".

11-10.14] for using sans-serif fonts.

2.2 Roman symb ols

2.1 Italic symb ols

Any other symbol that was not dealt with in the

According to the ISO regulations and the IPU rec- preceding subsection must b e set in roman font; the

ommendations, italic symb ols should be used only list of such \roman" entities is surprisingly long and,

to denote those mathematical and physical entities unfortunately, little known although ISO regulations

that may assume di erent values, typically those and IPU recommendations are quite clear on this

symb ols that play the role of physical variables, but sub ject.

also those physical \constants" that are not really

A

1. Numb ers must b e set in roman typ e L T X2

"

E

constant, b ecause b etter measuring techniques may

do es this by default.

pro duce up dated values.

2. Numerical constants must b e set in roman typ e;

Among such constants there is for example the

this is p erhaps the most neglected rule, but it

elementary electric charge the charge of the proton

applies to e = 2:718 281 8 :::, the base of nat-

19

e =1:602  10 C, that is considered constantuntil

ural logarithms, to the \imaginary unit" that

b etter measures will add other signi cant digits; the

mathematicians and physicists call `i', while

same holds true for such constants as the velo cityof

most engineers call `j ', and so on. The ISO

c, the Planck constants h andh  , the Boltzmann

regulations [1, clause 11-8.1] allow b oth sym-

constant k , and so on.

b ols for the imaginary unit, but b oth must b e

Every physical variable is represented by one

set in roman typ e. The reason b ehind this is to

italic letter with as many mo di ers as needed such

avoid confusion b etween the base of natural log-

as subscripts, sup erscripts, primes, etc. [6, clause

arithms and the elementary electric charge, b e-

1.2.1]. There are a few exceptions to this rule, rep-

tween the imaginary unit and the instantaneous

resented by the dimensionless parameters such as

current i or the instantaneous current density

the Mach numb er, the Euler numb er, and so on

j whose symb ols are recommended by the IPU

that are sp eci ed with a two-letter symbol by the

[6, sections 7.5 and 8.5].

ISO regulations [2]; for example the Machnumber

Anyb o dy can notice that `e' and `i' or `j' are

is represented by Ma , the Euler number by Eu ; when

universally typ eset in italic font in b oth mathe-

suchtwo-letter symb ols are used, equations must b e

matical and physical or technological texts; this

written with sp ecial care so as to make sure that

observation gives a measure of how much the

Ma do es not represent the pro duct of the physical

rule I am sp eaking ab out is ignored, at least by

variables M and a. For the names of the nuclides,

physicists and engineers.

that may consist of two letters, see the next section.

The same rule should apply to numerical con-

In pure mathematics two- or three-letter names

stants represented by Greek letters, such as

are used in applications such as, for example, the

2

 =3:141 592 6 :::, but it is necessary to get by

name of the Galois eld with n elements that is

with it b ecause it is dicult to have b oth the

represented with GF n. But such applications are

upright and the sloping Greek fonts; fortunately

not substantially di erent from what the ISO regu-

enough the frequency of such symb ols except

lations say ab out the names of sp ecial functions [1,

  is not high. If b oth upright and sloping

clauses from 11.11.1 to 11.11.21].

Greek fonts were available, an upright  should

In the domain of Computer Science as well as

indicate the numerical constant \3:1415 :::",

in Electronics authors and typ esetters make frequent

3

while a sloping  should indicate the physical

use of multiletter symb ols, but this tradition is ev-

constant\3:1415 ::: rad" corresp onding to the

idently in contrast with the ISO and IPU statements



angle of 180 .

and should b e abandoned.

Sub and sup erscripts must b e set in italics when

3. Physical units must b e set in roman typ e with

they representphysical quantities or mathematical

the additional requirement that a line break

variables [6, clause 1.2.2] otherwise they should b e

cannot take place b etween the measure and the

set in roman typ e; for example: C , where T rep-

T

unit of measure. In order to emphasize the uni-

resents \temp erature"; M , where i is a summation

i

tary nature of a physical constant, the measure

and the unit of measure should be separated

2

Thanks again to the reviewer for p ointing out this topic.

3

byanunbreakable thin , rather than bya

Please notice the di erence between the symbol of a

regular interword unbreakable space. Besides and the name of an op erator or a function.

TUGb oat, Volume 18 1997, No. 1 41

dards, this particular one is almost completely b eing quite reasonable, this p oint cop es with

neglected. the high p enalty that T Xintro duces in a for-

E

mula within a pro duct of terms; if T X has to

The ISO prescription and the IPU recommen-

E

break a formula across lines, it do es so close to

dation concerning the di erential op erator are

a binary or a relation op erator although very

not illogical, since in physical and technological

reluctantly, not within the pro duct of terms,

mathematics it is essential to distinguish di er-

and a physical quantity is the pro duct of the

ent mathematical ob jects within a formula, tak-

measure the unit of measure.

ing into account the nomenclature recommen-

dations for physical quantities; it is really neces-

4. Mathematical op erators indicated with letters

A

sary to distinguish `d' from `d' when the latter

must be set in roman typ e; L T X2 already

"

E

indicates one of the many physical quantities

do es this for a numb er of prede ned op erators,

whose symb ol is recommended to b e d: thick-

such as `lim' or `sin'. The package amsmath

ness, diameter, relative density, lattice plane

adds some more prede ned op erators, but, most

spacing, degeneracy of vibrational mo de, etc.

imp ortant of all, it adds a couple of commands

for using other op erators. We will discuss this

7. Sub and sup erscripts that do not represent

topic in a following section.

physical quantities or mathematical variables

should b e set in roman typ e; the amsmath pack- It is worthwhile to mention that op erators

age makes available the command \text for set- do not require that their argument b e enclosed

ting in roman typ e anyword or sentence within within parentheses if the op erand is made up of

mathematics, also in sub and sup erscripts. In no more then two ob jects 2 b eing counted as

general, though, the problem is to distinguish one ob ject, but prop er spacing is required on

the typ e of sub and sup erscripts in order to de- b oth sides; so you simply write sin !t and do

cide how they should b e typ eset. In the b o oks not need to write sin!t, but you should write

I wrote I estimated that more than two thirds sin2f t; in any case parentheses are required

of the subscripts I used had to be set in ro- when a formula contains several op erators with

man typ e, while the absolute ma jority of su- their arguments.

p erscripts were mathematical expressions; al-

5. The names of sp ecial functions such as `erf '

though just a few b o oks have no statistical

error function, or `Ei' exp onential integral,

value, the exp erience I gained allows me to say

or `E' incomplete elliptic integral of the sec-

that this p ercentage of roman subscripts should

ond kind, ... , are treated by ISO 31/XI the

b e considered typical, so that roman subscripts

same as the names of op erators [1, clauses from

are almost the default case in physics and tech-

11.11.1 to 11.11.21] and should be typ eset in

nology.

roman typ e, although their arguments must

8. Chemical symb ols coincide with the names of always b e indicated within parentheses. See the

the nuclides if they carry prop er sub and su- following sections for what concerns the de ni-

p erscripts; with resp ect to typ ography, particles tion of new op erators.

and quanta are treated as the nuclides. They

6. A particular op erator, the op erator of di eren-

are made up of one or two letters and must b e

tiation, should b e set in roman typ e, but under

A

set in roman typ e [6, section 4]; chemical equa-

the L T X2 p oint of view, it should b ehave dif-

"

E

tions are in general quite complicated so that

ferently from other op erators as concerns spac-

for setting into typeabookonchemistry it is

ing. The use of roman typ e for the di eren-

b etter to use sp ecialized packages; the last one

tial op erator is another example of a highly ne-

that was describ ed in TUGb oat [10] is an ex-

glected rule, alb eit the ISO regulations [1, clause

A

cellent example; the L T X Companion [9] de-

11-5.15] are explicit on this p oint.

E

scrib es another package ChemT X [11] for the

The \house style" of the ma jority of publish-

E

same purp ose.

ing companies, where the di erential op erator is

For simpler chemical formulas that do not re-

a common italic `d', was evidently set up under

A

quire the graphic facilities of L T X2 , the au-

the in uence of the tradition of pure mathemat-

"

E

thor can typ eset chemical equations with the

ical typ esetting b efore the ISO regulations were

usual math commands provided he/she remem-

published; now manyyears have elapsed since

b ers to switch to roman typ e for the symb ols of

their publication so that the ISO regulations

the chemical elements.

should be widely applied, and it is surprising

9. Roman numb ers are seldom used in physics it surprises me, at least that, while the mo d-

and technology, although they nd their wayin ern world is so attentivetointernational stan-

42 TUGb oat, Volume 18 1997, No. 1

4. The International System of Units SI [3] is chemistry where they may represent the sp ec-

the only legal system of units to be used in trum of a z -fold ionized atom or, in sup erscript

those countries that undersigned the sp eci c p osition, the oxidation numb er; in b oth cases

bill. In practice the SI is the only system of they are set in roman typ e [6, clause 4.5].

units accepted by the scienti c community, al-

Roman numb ers used for enumerated lists or

though engineers do it more readily than physi-

for numb ering front matter pages do not p ertain

cists; the latter sometimes indulge in using one

to mathematics; they are generally set accord-

of the old cgs systems, more for the p ossibil-

ing to the publishing house style. As a matter

ity of skipping some constants in the formulas

of p ersonal taste, in these situations I prefer

dealing with electromagnetic phenomena, than

small-caps roman numerals to italic ones.

for a real need of using centimetres/centimeters

3 Other typ esetting recommendations

and grams.

The SI establishes the symb ols for the fun-

While typ esetting \physical" mathematics it is con-

damental and derived units and the legal deci-

venient to rememb er that scienti c and technical pa-

mal pre xes; some non-SI units keep their value,

p ers haveaworldwide readership and the observance

while some others are \outlaw". In any case

of the ISO regulations and IPU recommendations is

every legal or accepted unit has its own symbol

essential for making one's text easily understo o d by

and only that symbol must b e used; you write

readers of di erent language and culture. Here are

3h 12min 45s, not 3hrs 12mins 45secs; you write

some hints:

\a conductance of 25 mS", not \a conductance

1. The is the \decimal comma"

of 25 m0".

in the rest of the world [6, clause 3.2] and the

5. The symb ols of the physical units are symbols,

\decimal p oint" in the English sp eaking coun-

not abbreviations, therefore they must never

tries; it is necessary to b e consistent with this

carry the abbreviation p oint after them and do

rule and to avoid mixed separators see the fol-

not change in the plural [6, clause 2.1.2] so that

lowing p oint.

it is correct to write 7.25 cm while it is wrong to

2. Before and after the decimal separator digits

write either 7.25 cm: or 7.25 cms with the abbre-

may b e group ed in triplets separated only bya

viation p oint or with the plural of the symb ol.

thin space, not by commas USA or lowered or

Unit symb ols must always b e used when they

raised p oints Europ e [6, clause 3.5]; in general

accompany the measure and they must b e set

Europ eans are more used to the North Amer-

after the measure; the full sp elled name with

ican habit of dividing triplets with commas,

lower case even if the unit has an upp er-

than North Americans with Europ ean habits.

case symb ol should b e used in the text when

In b oth cases a professional typ esetter of a sci-

preceded by general sp eci cations such as \sev-

enti c or technical text uses only thin spaces

eral", \few" or when the unit of measure is

so as to avoid the trouble of interpretation to

called by name; you write \electric bulbs are

readers of di erent cultures. Triplets may be

lab eled with the op erating voltage in volts and

avoided when b efore or after the decimal sep-

the p ower rating in watts", not \electric bulbs

arator there are just four digits: that is, you

are lab eled with the op erating voltage in V and

should write USD 1900 or $1900 preferably to

the p ower rating in W".

USD 1 900, while writing USD 1,900 should be

As for the plurals of the unit names not

absolutely avoided: in Europ e it means \one

of the unit symb ols that are invariant as men-

US dollar and 90 cents"!

tioned ab ove, every language has its own rules

In this pap er the North American decimal

and every country its own regulations; b eware

separator is b eing used all over; for Europ eans

4

not to use a plural form of another language.

I recall that the p oint in the role of the deci-

mal separator is allowed only in numerical con-

6. Prop er scienti c prose do es not use the physical

stants written within a section of a program-

quantity symb ols in text mo de, it rather uses

ming language.

the full sp elled name p ossibly followed by the

symb ol; you write \space s and t are the

3. When anumb er is less than unityin absolute

only physical quantities necessary to deal with

value, this should b e explicitly indicated with a

`zero' preceding the decimal separator [6, clause

4

This is not a common problem in English sp eaking coun-

3.2]; therefore it is necessary to write 0:123 and

tries, but it is a problem in other countries where English

0:456 in place of :123 and :456 resp ectively. plurals are often used.

TUGb oat, Volume 18 1997, No. 1 43

kinematics", not \s and t are the only physical 11. Physicists seem to like the powers of 10; -

quantities necessary to deal with kinematics". gineers prefer the decimal pre xes established

by the SI. Such pre xes, representing p osi-

7. Connected to the previous item, the scientist

tive and negative powers of 1000 in addition

and the engineer should cho ose the correct

to several that represent the rst few p ositive

names for physical quantities; the IPU recom-

and negativepowers of 10, cover an extremely

mendations [6] o er a very wide nomenclature

18 18

wide range, from 10 to 10 , so that pow-

list in English and French for virtually every

ers of 10 can be easily avoided. When cho os-

quantityofinterest in pure and applied physics;

ing the right pre x it is necessary to remember

for every quantity a preferred literal symbol

that integer values of the measures are preferred

is indicated and the names of the quantities

and that zero es just after the decimal separator

should b e used in a consistentway, rather than

should b e avoided; you write 32 pF rather than

inventing new names and new symb ols for old

0.032 nF. This rule holds true everywhere, ex-

ob jects simply b ecause of sp ecialized technical

cept in tabular formats where the unit of mea-

jargons.

sure is sp eci ed in every -head and is

8. The physicist's and the engineer's equations are

valid for all the table entries of that column [3,

relationships between physical quantities; the

section 4].

latter are groups made up of a rst term that

12. Connected with the previous item there is

represents the measure, and a second term that

the question of the number of signi cant dig-

represents the unit of measure; although they

its; while zero es b etween the decimal

are not commutative, they b ehave as factors of

separator and the rst nonzero digit are al-

amultiplication. The mathematical op erations

lowed only in tables, trailing zero es should b e

p erformed on physical quantities op erate in the

avoided unless they are signi cant b ecause they

usual way on the numerical parts and in an al-

carry information on the measure precision: in

gebraic way on the units of measure, giving rise

physics 7.25 m is di erent from 7.250 m b ecause

in some instances to derived units. If a physical

the former quantity is precise to 0:5 cm while

equation contains a physical constant not repre-

the latter, to 0:5mm. Therefore physicists

sented by a symb ol, this constantmust contain

and engineers should b e careful to use just the

b oth elements: measure and unit of measure.

p p

number of signi cant digits inclusive of the

You write Z = 377 = , not Z = 377= .

0 0

trailing zero es that are compatible with the

For the same reason it is not necessary, or

exp erimental or technological data they are re-

b etter, it is de nitely wrong to write the units

ferring to.

of measure after a coherentphysical equation;

13. I need not emphasize that pre xes as well as

see also the next item.

units of measure should be sp elled correctly,

9. Measure equations should b e absolutely avoided

paying particular attention to upp ercase and

in professional scienti c texts; measure equa-

lowercase letters and to the op erators b etween

tions were somewhat p opular b efore the SI was

units; nevertheless the following errors are quite

universally adopted; now they should not be

common: `K' kelvin in place of `k' kilo; `M'

used any more. They survived in those coun-

mega in place of `m' milli or vice versa;

tries where the \English system of units" is b e-

`m' milli-micro in place of `n' nano [6,

ing used, but, since scienti cally sp eaking this

clause 2.2.2]; `u' in place of `'; `hz' and `db'

5



traditional system of units is \illegal", mea-

in place of `Hz' and `dB'; ` K' in place of `K';

sure equations have no reason to be used any

`kwh', `KWH', `KWh', `kw/h' awful! in place

more.

of `kWh' or even b etter `kW h' | notice the

thin space; `kc' kilo cycles in place of `kHz' or,

10. Since every physical quantity is a group formed

at least, even if it is not fully SI,`kc/s' kilo cy-

by the measure and the unit of measure, it is

cles p er second.

wrong to sp ecify the unit of measure after the

symbol of a physical quantity; you write \a p e-

Decimal pre xes should be attached to the

rio dic function of p erio d T ", not \a p erio dic

following unit without interp osing any space;

function of p erio d T seconds".

comp ound units mayhave a thin space b etween

them or exceptionally a raised dot [6, clause

5

The United States was one of the last countries to adopt

2.3.1]; either separator is mandatory when units

the SI in the late fties, but even after four decades have

may b e confused with pre xes; p ositive or neg-

elapsed, in that country the SI seems to have diculties in

replacing the traditional units. ative powers refer to the unit inclusive of its

44 TUGb oat, Volume 18 1997, No. 1

decimal pre x ; negative powers, although al- mands are de ned just once and you do not have

lowed, are preferably avoided: `kW h' is b etter to be concerned ab out anything else; on the con-

2

than `kW  h' and b etter than `kWh'; `m=s 'is trary if you use \newcommand*, you receive error

2

A

b etter than `m s ' and b oth mean something messages when L T X2 executes them if the com-

"

E

2

di erent from `ms ' meters per square sec- mand b eing de ned already exists, and if you use

ond versus the inverse of square milliseconds \renewcommand* the error messages show up the

A

[6, clause 2.2.3]. rst time L T X2 executes it. I prefer the aster-

"

E

isk form b ecause I get b etter diagnostic messages in

14. As mentioned ab ove, the math italic typ eface

case I forget some closing brace.

is used for normal variables and roman typ e-

face is used for letters and \adjectives" that do

1. Some commands for sp ecial units and a pre-

not representvariables. Other typ efaces are sel-

x are very handy; the following de nitions are

dom used; the IPU recommendations [6] state

valid b oth in text and in math mo de:

that sloping sans-serif characters maybe used

\DeclareMathAccent{\ring}

for second rank tensors and b oldface italic char-

{\mathalpha}{operators}{"17}

acters for vectors lowercase and matrices up-

\providecommand*{\angs}

p ercase.

{\ensuremath{\smash{\mathrm{\ring A}}}}

15. Currency units are not part of the SI, and are

\providecommand*{\ohm}

standardized by other regulations [5]; they are

{\ensuremath{\mathrm{\Omega}}}

generally made up of three upp ercase letters,

\providecommand*{\degree}

the rst two of which are the two-letter co de

{\ensuremath{^\circ}}

for the nation while the third one is the ini-

\providecommand*{\celsius}

tial of the currency name; therefore you write

{\ensuremath{\mathrm{^\circ C}}}

USD, not US$, for a text that should b e read

\providecommand*{\micro}

abroad, and keep the symbol $ just for the

{\ensuremath{\mu}}

national readership | after all, many countries

The rst declaration adds the ring accent

use the dollar as the national currency b esides

A

in math mo de; L T X2 has the \r command

"

E

the United States, there are Canada, Australia,

for the ring accent in text mo de, but in math

Hong Kong, and many others, but in general

mo de the ring accent is missing so that it is

they are not equivalent to one another; the same

necessary to de ne it. At the present state

holds true for the UK p ound $ and the Italian

A

6

of the L T X2 art, mathematical signs, let-

"

E

lira, whose international symb ols are GBP and

ters, accents, . . . , are taken from the traditional

ITL resp ectively.

knuthian cm fonts, and accents are set over the

In contrast to other units, currency units pre-

accented letter, esp ecially a capital one, a little

cede the monetary value but the rule of the un-

to o high; with the dc fonts accented letters are

breakable thin space keeps its validity. Trailing

made up of just one and the p ositioning

zero es such as `USD 1900.00' may be required

of the accent has b een carefully adapted to each

in order to sp ecify also the unit submultiples

letter by the font designer. Mayb e in the future,

for legal and/or commercial purp oses.

when new 256-glyph math fonts are available,

A

4 L T X2 new commands

the p osition of the accents will b e more precise.

"

E

This is whyIintro duced the \smash command

A

Here I will describ e some very simple L T X2 new

"

E

7

in the de nition of the angstrom unit, other-

commands intended to help in the typ esetting of

wise in text mo de a line containing such a unit

\physical" mathematics. In general I will use the

would force some interline leading, resulting in

command \providecommand*. This instruction b e-

a nonuniform line spacing. The chance of inter-

haves just as \newcommand* except that it de nes

fering with the previous line is small

the new command only if it is unde ned; if the com-

but not zero. See the following .

mand already existed the new de nition is silently

The \ring command is useful not only for

ignored. In this way if you make yourself several



setting the unit symbol `A', but also for setting

packages that include such de nitions, the new com-

6 7

The UK p ound and the Italian lira have similar symb ols: The angstrom unit is tolerated by the SI in the sp ecial-

£ and \; attentive p eople notice that the UK p ound symbol ized eld of light and optics; the name of the unit, in contrast

has one stroke across, while the Italian lira has two strokes, to other SI units derived from p ersonal names containing di-

but if you ask Italians, the great ma jority don't notice the acritics, maintains its [3, annex A, clause 6.3.1] [4,

di erence. section IV.2].

TUGb oat, Volume 18 1997, No. 1 45

avariety of `physical' variables in telecommuni- where the typ esetter should correct the almost

cations when they refer to the analytical signal. p erfect setting p erformed byT X.

E

The remaining de nitions intro duce handy

A

4. L T X2 provides an internal command for set-

"

E

commands for common units that may b e used

ting text sup erscripts, but we need commands

in b oth mo des thanks to the \ensuremath com-

that let you set sub and sup erscripts with the

mand. There is a drawback with these de ni-

prop er math sizes; the package amsmath pro-

tions, that is the newly de ned units are set in

vides the command \text for setting text in

roman medium uprighttyp e everywhere and do

math mo de, and this command cho oses the

not change family or series in text mo de.

right size according to the sub or sup erscript

8

The \ohm de nition is a little redundant, be-

commands. Here I intro duce a couple of com-

cause \Omega by default is de ned as a symb ol,

mands that are good for single word sub and

A

not as a letter, so that with L T X2 it is not

sup erscripts:

"

E

sub ject to the change in the math version ei-

\providecommand*{\ped}[1]{

ther normal or b old; but if you rede ne it or

\ensuremath{_\mathrm{1}}}

use a package where it is rede ned as a letter

\providecommand*{\ap}[1]{

from the \mathnormal alphab et, the ab ove de -

\ensuremath{^\mathrm{1}}}

nition guarantees that the unit is set in roman

typ e anyway. These de nitions, that work in b oth mo des, can

b e handy also for setting text sup erscripts such

2. The following macro lets you set the units,

nd rd

as 2 ,3 . The names are abbreviations of the

whichever they are, in roman typ e, b oth in text

Latin words pedex and apex that refer to the

and math mo des, with the prop er unbreakable

fo ot or the head p osition resp ectively.

thin spacing:

A

5. The L T X2 package amsmath provides a cou-

"

E

\providecommand*{\unit}[1]{

ple of commands for using a sequence of letters

\ensuremath{\mathrm{\,1}}}

as an op erator; they are \operatorname and

When you use \unit in text mo de, of course,

\operatornamewithlimits; here I intro duce a

you must not leaveany space b etween the mea-

couple of new commands that de ne new op er-

sure and the \unit command.

ators.

3. Numerical constants represented by Latin let-

But b efore going on, it is b etter to recall a

ters may b e treated by the following macros:

A

couple of details ab out op erators. L T X deals

E

 The number `e'

with two kinds of op erators: the \log-like" and

\providecommand*{\eu}

the \lim-like" ones; the former treat subscripts

A

{\ensuremath{\mathrm{e}}}

and sup erscripts as regular ones, that is L T X

E

 The imaginary unit

sets them in smaller size at the right and low-

\providecommand*{\iu}

ered or raised resp ectively, while the latter ac-

{\ensuremath{\mathrm{j}}}

cept sub and sup erscripts as limits, so that in

math display mo de subscripts are set under-

In the imaginary unit de nition a physicist

neath the op erator and sup erscripts ab ove it.

would probably substitute `j' with `i', but this

A

Moreover L T X sets spaces at the left and

is not the p oint, b ecause the ab ove de nition

E

at the right of the op erator in di erent ways

is just an example of how the imaginary unit

according to what kind of mathematical ob ject

should b e de ned. A more sophisticated de ni-

falls close to the op erator; such di erent spac-

tion might refer to math op erators see b elow

ings are describ ed in detail in chapter 18 of The

so that prop er spacing is left around such let-

T Xbook. Therefore to set p erfect physical

ters esp ecially around the imaginary unit. In

E

mathematics it is advisable to de ne op erators

several sciences, though, a common expression

in the prop er way, but owing to the two kinds

is the combination of `e' raised to some imagi-

of op erators it is necessary to sp ecify in the def-

nary p ower; if you use `j' for the imaginary unit,

inition whether sub and sup erscripts should b e

its butts against the `e' irresp ective

used as limits or not:

of what de nition you use and in practice this

o ccurs even if you to the tradition of us-

\providecommand{\newoperator}[3]{

ing italic fonts; this is one of the rare o ccasions

\newcommand*{1}{\mathop{2}3}}

8

\providecommand{\renewoperator}[3]{

In any case, even if \ohm was simply \let to \Omega,it

would b e shorter to sp ell and clearer to understand. \renewcommand*{1}{\mathop{2}3}}

46 TUGb oat, Volume 18 1997, No. 1

Here the rst argument is the op erator name, With resp ect to total and partial deriva-

the second is its full description and the third is tives it might be useful to de ne some com-

the T X declaration \limits or \nolimits. A mands with the order as an optional argument

E

couple of examples are necessary: according to by means of the usual \providecommand* con-

the ISO regulations the integer part of a decimal struct:

number is called \ent" [1, clause 11-4.15], so

\providecommand*{\deriv}[3][]{

that the following de nition is required

\frac{\diff^{1}2}{\diff 3^{1}}}

\newoperator{\ent}

\providecommand*{\pderiv}[3][]{

{\mathrm{ent}}{\nolimits}

\frac{\partial^{1}2}

{\partial 3^{1}}}

According to the ISO regulations [1, clauses

11-8.2 and 11-8.3] the real part and the imag-

The rst optional argument is the derivative

inary part of a complex numb er are \Re" and

order, the second is the function b eing derived,

\Im", not < and =; therefore we need the fol-

and the third the derivation variable. Partial

lowing rede nitions:

high order mixed derivatives require a more so-

\renewoperator{\Re}

phisticated de nition, or direct setting with the

{\mathrm{Re}}{\nolimits}

\frac command.

\renewoperator{\Im}

With the help of these new commands it b e-

{\mathrm{Im}}{\nolimits}

comes very easy to typ eset the following equa-

tions with the assurance that spacings are right

6. The di erential op erator must b e treated in a

and the di erential op erator is correctly set in

slightly di erentway, b ecause it is a sp ecial op-

roman typ e; a sample of source co de follows

erator that requires di erent spacings on the

each equation.

left and on the right; moreover b eing made up

2

of just one letter, it is necessary to use a little

d y d y

a + c = f x + b

T X trick in order to guarantee that its mathe-

2

E

d x d x

matical axis lines up prop erly. The di erential

a\deriv[2]{y}{x}+.. . 

op erator should be spaced as an op erator on

1 d y d log y 

the left, while on its right it should receive dif-

=

d x y d x

ferent spacings, and in particular it should not

be spaced from its argument. A p ossible way

\deriv{\log y}{x}=...

of achieving this result is to de ne it as an op-

@z @z

d z x; y = d x + d y

erator that contains a negative spacing on the

@x @y

right; in order to cop e with p ossible exp onents

. . . =\pderiv{z}{x}\diff x+...

some tests must b e p erformed along the line and

Z

1

this requires some low level T X programming.

st

E

L[f t] = e f tdt

0

\makeatletter

. . . \eu^{st}ft\diff t

\providecommand*{\diff}

15

{\@ifnextchar^{\DIfF}{\DIfF^{}}}

7. The pre x \femto" that stands for 10 

\def\DIfF^1{

turns out to be rather frequent in micro elec-

\mathop{\mathrm{\mathstrut d}}

tronics where it is generally used as a pre x for

\nolimits^{1}\gobblespace}

the unit `farad'; the couple `fF' requires some

\def\gobblespace{

so that the lowercase `f ' do es not butt

9

\futurelet\diffarg\opspace}

against the upp ercase `F'; up to now the avail-

\def\opspace{

able math fonts do not consider this couple

\let\DiffSpace\!

for implicit kerning information, therefore the

\ifx\diffarg

typ esetter should remember to insert an italic

\let\DiffSpace\relax

9

At the time of writing, the latest version of dc fonts is

\else

1.3 and has a date of June 1996; this release of the dc fonts

\ifx\diffarg[

cop es with many new kernings that take place with SI decimal

\let\DiffSpace\relax

pre xes, but this do esn't help much in math mo de b ecause

here cm fonts are used; their latest version was re ned in

\else

1992, but the latest available source METAFONT les on the

\ifx\diffarg\{

CTAN archives carry the date of June 1995; let's hop e that

\let\DiffSpace\relax

the new math fonts with 256-glyph enco ding will b e available

\fi\fi\fi\DiffSpace} so on.

TUGb oat, Volume 18 1997, No. 1 47

correction between the lowercase `f ' and any 6. Some text with physical quantities: \The heat



upp ercase non-slanting-left-side letter that fol- sink with a thermal resistance of 3.3 C=W

sa

lows; examples: `f F' f\/F, `f W' f\/W, `f H' is supp osed to maintain the temp erature be-

f\/H, but `fA' fA. low the transistor maximum junction op erat-

ing temp erature when it op erates in an envi-

At present a \femto macro would solve the



ronmentat60 C."

kerning problem, but in the future such kern-

$\theta\ped{sa}$ 3.3\unit{\celsius/W}

ings should nd their wayinto the very de ni-

60\unit{\celsius}

tions of the various fonts that are used in math

mo de.



7. Use of angstroms: awave length of 5500 A

5500\unit{\angs}.

5 Examples

In addition to the examples shown in the previous

6 Conclusion

section, I rep ort here some more examples where

I have b een using the ab ove commands for several

the various features describ ed ab ove show the dif-

A

years; b efore the advent of L T X2 I had put to-

"

E

ference b etween `mathematical' and `physical' equa-

A

gether similar commands for L T X 2.09, but the dif-

E

tions. Between parentheses you nd the source co de

ference lies simply in the easier way of de ning them

for some relevant part of the example.

A

with the new version of L T X. With the help of such

E

1. The Euler equation involves the ve most im-

commands I have found it very simple to cop e with

p ortant mathematical constants:

the ISO regulations and IPU recommendations at the

j

e +1 = 0

p oint that now I feel somewhat handicapp ed if I have

to write anything scienti c on a computer where the

\eu^{\iu\pi}

A

L T X implementation is lacking such commands.

E

Actually in this case, as p ointed out in the

At the same time they are so few and simple

previous section, the typ esetter should intro-

that I did not consider the p ossibility of making up a

duce a small correction to the spacing:

short package le where the do cumentation and the

j

e +1 = 0

insertion driver would b e much larger than the useful

\eu^{\,\iu\pi}

lines to b e submitted to the CTAN archives. Any-

2. A comp onent list:

body can copy such commands from pap er and/or

use them as guidelines for making one's own set of

R =2:2k R = 180 k

B F

useful commands, p ossibly p erforming b etter than

h =1:5k h = 100

ie fe

the simple ones that I suggested.

C =3:3nF R =4:7k

E C

But, most imp ortant of all, I warmly suggest to

R\ped{C}=4.7\unit{k\ohm}

pay attention to the international regulations and

3. The equations of a common emitter stage with

recomendations; the results are worth the little extra

a feedback resistor on the emitter:

e ort.

I = 1=h V V 

b ie b R

E

References

V = 1 + h R I

R fe E b

E

[1] \Mathematical sign and symb ols for use in phys-

V = h R I

c fe C b

ical sciences and technology | ISO 31/11" ISO

A

Notice in particular the term V whose L T X

R

E

E

Standards Handbook N.2, International Organi-

source co de is V_{R\ped{E}}.

nd

zation for Standardization, Geneva 1982, 2 ed.

4. A table

[2] \Dimensionless parameters | ISO 31/12" ISO

Stub length Decay time

Standards Handbook N.2, International Organi-

in mm in ns

nd

zation for Standardization, Geneva 1982, 2 ed.

0.04 798.72

1.20 19 836.07

[3] \SI units and recommendations for the use of

2.28 17 356.74

their multiples and of certain other units |

3.36 15 468.04

ISO 1000" in ISO Standards Handbook N.2,

3.96 14 747.75

International Organization for Standardization,

nd

14\,747.75

Geneva 1982, 2 ed.

5. An equation with complex variables:

[4] Le Syst eme International d'Unit es, Bureau In-

Re[F  +j! ] > 0 8 >0 and 8 !

ternational des Pois et Mesures, Pavillon de Bre-

th

\renewoperator\Re{\mathrm{Re}}{\nolimits} teuil, S evres, France, 1991, 6 ed.

48 TUGb oat, Volume 18 1997, No. 1

[5] \Co des for the representation of currencies and

funds | ISO 4217" International Organization

for Standardization, Geneva 1990.

[6] \Symb ols, units and nomenclature in physics"

in CRC Handbook of chemistry and physics,

R. C. Weast, M. J. Astle and W. H. Beyer, edi-

th

tors, CRC Press Inc., Bo ca Raton, Florida, 65

edition, 1985, pp. F259{F293.

[7] Knuth D.E., The T Xbook, Addison-Wesley

E

Publishing Company, Reading, Mass., 1984.

[8] Lamp ort L., A document preparation system,

A

L T X, User guide & reference manual, Addison-

E

Wesley Publishing Company, Reading, Mass.,

1986 second edition.

[9] Go ossens M., Mittelbach F. and Samarin A., The

A

L T X Companion, Addison -Wesley Publishing

E

Company, Reading, Mass., 1994.



[10] Fujita S., \X MT X for drawing chemical

E

structural formulas" in TUGb oat,vol. 16, n. 1,

pp. 81{89, March 1996.

[11] Haas R.T. and O'Kane K.C., \Typ esetting

Chemical Structure Formulas with the Text For-

A

matter T X/L T X" in Computers and Chem-

E E

istry,vol. 11 n. 4 pp. 251{271, 1987.

 Claudio Beccari

Dipartimento di Elettronica

Politecnico di Torino

Turin, Italy [email protected]