Miscellaneous macro files

Version 1.4, last changed pdc 1995–03–30

P. Damian Cugley

1. PDCMIGR: Use math italic Greek capitals

Knuth notes that it is conventional to use unslanted Greek capitals in maths, even though other letters are slanted (I personally think that it looks nicer to use slanted Greek caps). Thus TEX takes the Greek capitals from fam 0 by default.

If you are using a body text font that does not have the Greek capitals—for example, almost any PostScript or Cork-style font—then this no longer works. Better then to switch to using the Greek capitals from the math italic font (fam 1). That’s what the file pdcmigr.tex does. The characters are still in maths class 7, meaning that they will respect changes to \fam made by font-switching commands.

 1 % pdcmigr.tex 1.4 1995/03/30-- see end of file for more info
 2 \message{1.4 <pdc 1995/03/30>}
 3 \mathchardef\Gamma   = "7100
 4 \mathchardef\Delta   = "7101
 5 \mathchardef\Theta   = "7102
 6 \mathchardef\Lambda  = "7103
 7 \mathchardef\Xi      = "7104
 8 \mathchardef\Pi      = "7105
 9 \mathchardef\Sigma   = "7106
10 \mathchardef\Upsilon = "7107
11 \mathchardef\Phi     = "7108
12 \mathchardef\Psi     = "7109
13 \mathchardef\Omega   = "710A

This file has more comments than code. Since the code is so short I think I’ll get away with putting the comments after an \endinput.

14 \endinput
15 %%%@TeX-definition-file {
16 %%% filename       = "$texmf/tex/plain/pdcmac/pdcmigr.tex",
17 %%% version        = "1.4",
18 %%% date           = "1995/03/30",
19 %%% package        = "pdcmac 1.0",
20 %%% author         = "P. Damian Cugley",
21 %%% email          = "damian.cugley@comlab.ox.ac.uk",
22 %%% address        = "Oxford University Computing Laboratory,
23 %%%                   Parks Road, Oxford  OX1 3QD, UK",
24 %%% codetable      = "USASCII",
25 %%% keywords       = "TeX, plain TeX, macros",
26 %%% supported      = "Maybe",
27 %%% abstract       = "A definition file for TeX, which redefines
28 %%%                   \Gamma, ..., \Omega to use letters from the
29 %%%                   maths italic font instead of the roman font.
30 %%%                   This file was generated by running
31 %%%                   plain TeX on pdcmisc.dtx",
32 %%% copyright      = "Copyright (c) 1991, 1995 P. Damian Cugley",
33 %%% copying        = "DO NOT DISTRIBUTE THIS FILE.
34 %%%                   Distribute pdcmisc.dtx only as part of the
35 %%%                   package it came in.",
36 %%% dependencies   = "",
37 %%% }

1–39 Miscellaneous macro files 1.4 1995–03–30

2. PDCIMTH: use text italic letters in maths mode

Very few existing font families have a separate math-italic font. When using these fonts as body fonts, with the Computer Modern fonts as maths fonts, it looks wrong to have the maths letters in a completely different style form the text italic. Therefore it makes sense to redefine maths mode so that the letters come from the text italic font.

This is also useful when multiple-letter identifiers are used in maths mode. We c an say $difference:=height+depth$ and get ‘difference := height + depth’ instead of ‘difference := height + depth’.

In the following, the counters \count0 to \count4 are used as follows:

\count0 mathcode for current upper case char
\count1 mathcode for current lower case char
\count2 ASCII code of current upper case char
\count3 ASCII code of current lower case char
\count4 number of characters left to redefine

The grouping prevents this temporary use conflicting with TEX’s use of these counters.

 1 % pdcimth.tex 1.4 1995/03/30 - maths letters in text italic
 2 \message{1.4 1995/03/30}

3

 4 \begingroup
 5  \count0="7400 \count1=\count0
 6  \advance\count0 by` A \advance\count1 by` a
 7  \count2=` A \count3=` a \count4=26
 8  \loop\ifnum\count4>0
 9  \advance\count4 by-1
10  \global\mathcode\count2=\count0
11  \global\mathcode\count3=\count1
12  \advance\count0 by1 \advance\count1 by1
13  \advance\count2 by1 \advance\count3 by1
14  \repeat
15 \endgroup

The value ˝ 7400 + c used above means mathcode 7, fam 4 (\itfam), character c.

Once again, the code is short enough that I think I can get away with putting the comments at the end:

16 \endinput
17 %%%@TeX-definition-file {
18 %%% filename       = "$texmf/tex/plain/pdcmac/pdcimth.tex",
19 %%% version        = "1.4",
20 %%% date           = "1995/03/30",
21 %%% package        = "pdcmac 1.0",
22 %%% author         = "P. Damian Cugley",
23 %%% email          = "damian.cugley@comlab.ox.ac.uk",
24 %%% address        = "Oxford University Computing Laboratory,
25 %%%                   Parks Road, Oxford  OX1 3QD, UK",
26 %%% codetable      = "USASCII",
27 %%% keywords       = "TeX, plain TeX, macros",
28 %%% supported      = "Maybe",
29 %%% abstract       = "A definition file for TeX, which redefines
30 %%%                   mathcodes to use letters from the
31 %%%                   text italic font instead of math italic.
32 %%%                   This file was generated by running
33 %%%                   plain TeX on pdcmisc.dtx",
34 %%% copyright      = "Copyright (c) 1991, 1995 P. Damian Cugley",
35 %%% copying        = "DO NOT DISTRIBUTE THIS FILE.
36 %%%                   Distribute pdcmisc.dtx only as part of the
37 %%%                   package it came in.",
38 %%% dependencies   = "",
39 %%% }

3. PDCHYEX: Hyphenation exceptions

These hyphenation exceptions are ones I use for must documents.

Note Of all the macro files in this package, this is the one you should be most chary of using. These are written for a TEX system which uses American English hyphenation patterns, but are intended to help it produce hyphenations suitable for British English, and this peverse approach will probably lead to all sorts of anomalies. Ideally separate hyphenation patterns will be used for British English documents.

3.1. File identification The list of exceptions is expected to grow, so it seems best to have the identification at the top of the file.

 1 % pdchyex.tex 1.4 1995/03/30 -- some British hyphenations
 2 %%%@TeX-definition-file {
 3 %%% filename       = "$texmf/tex/plain/pdcmac/pdchyex.tex",
 4 %%% version        = "1.4",
 5 %%% date           = "1995/03/30",
 6 %%% package        = "pdcmac 1.0",
 7 %%% author         = "P. Damian Cugley",
 8 %%% email          = "damian.cugley@comlab.ox.ac.uk",
 9 %%% address        = "Oxford University Computing Laboratory,
10 %%%                   Parks Road, Oxford  OX1 3QD, UK",
11 %%% codetable      = "USASCII",
12 %%% keywords       = "TeX, plain TeX, macros",
13 %%% supported      = "Maybe",
14 %%% abstract       = "A non-exhaustive set of hyphenation exceptions
15 %%%                   designed to make TeX with American hyphenation
16 %%%                   tables produce some British hyphenations.
17 %%%                   This file was generated by running
18 %%%                   plain TeX on pdcmisc.dtx",
19 %%% copyright      = "Copyright (c) 1991, 1995 P. Damian Cugley",
20 %%% copying        = "DO NOT DISTRIBUTE THIS FILE.
21 %%%                   Distribute pdcmisc.dtx only as part of the
22 %%%                   package it came in.",
23 %%% dependencies   = "",
24 %%%}

25

26 \message{1.4 <pdc 1995/03/30>}

27

3.2. Setting parameters These settings are from Hart’s Rules p. 141.

28 \lefthyphenmin=2 \righthyphenmin=3 \uchyph=0

3.3. And finally, the hyphenation exceptions

29 \hyphenation{

First, some words from Hart’s Rules pp. 14–15. I’ve taken the list on p. 14 and included here those which were given wrong hyphenation by TEX’s default tables.

30  le-gend le-gends re-adjust re-appear exact-ing
31  abs-cess abs-cess-es abs-cessed ana-lyse ana-lyses
32  ana-lysis ana-lyses appear-ance appear-ances bio-graphy
33  celeb-rate celeb-rates celeb-rations cor-respond-ence
34  depend-ent des-pise des-pises dis-pised dimin-ish
35  dimin-ish-es dimin-ish-ed dis-connect dis-connect-ed
36  dis-connects forget-ting gener-ally haemor-rhage
37  illus-trate immedi-ate immedi-ately immport-ance
38  inexplic-able inter-pret inter-est inter-ested
39  inter-est-ing minis-ter origin-ally philo-sophy
40  philo-sophic philo-sophic-ally prim-ary prob-ably
41  semb-lance

42  calm-est debt-ors fea-ther fea-thers post-humous lamb-like
43  poingn-ant tough-ish ach-ing archaeo-logy etymo-logy
44  philo-logist psycho-logist tauto-logy zoolo-gist

Now some random hyphenations I encountered in my own documents at some point. I haven’t checked these in a spelling dictionary, so don’t use them in documents where your life depends on correct hyphenation.

45  art-iest cig-ar-ette bio-logy bio-chem-is-try boy-friend
46  brit-ain brit-ish com-ic com-ics cug-ley dogs-body
47  dor-mouse gai-man graph-ic immedie-ate immedi-ate
48  immedi-ately issue mckean mis-hap mis-haps news-letter
49  news-paper night-crawler origin-ally origin-ator phys-ique
50  phys-iques porn-o-graphy porn-o-graphic rec-om-mend-ation
51  Ser-geant ser-geant Sien-kie-wicz spon-tan-e-ous
52  spon-tan-e-ously stop-ped strip-ped teen-ager teen-agers
53  tem-per-men-tal Thatch-er-ism Thatch-er-ite under-ground
54  under-grounds var-i-able venge-ance warp-smith warp-smiths
55  whirl-pool

56 }

4. PDCCNSUB: Substitutions using Computer Modern glyphs

The Malvern and PostScript repertoire includes some characters not included in the TEX Text fonts used by plain TEX. I have made macros for some of these that assemble symbols from existing characters. This way documents can be switched between the different font encoding schemes mroe easily. They won’t look very pretty though.

Note These work acceptably with ten-point Computer Modern but might need adjustment with other fonts.

4.1. File dientification

1 % pdcmisc.dtx 1.4 1995/03/30 -- CM subs for PS glyphs
 2 %%%@TeX-definition-file {
 3 %%% filename       = "$texmf/tex/plain/pdcmac/pdcmigr.tex",
 4 %%% version        = "1.4",
 5 %%% date           = "1995/03/30",
 6 %%% package        = "pdcmac 1.0",
 7 %%% author         = "P. Damian Cugley",
 8 %%% email          = "damian.cugley@comlab.ox.ac.uk",
 9 %%% address        = "Oxford University Computing Laboratory,
10 %%%                   Parks Road, Oxford  OX1 3QD, UK",
11 %%% codetable      = "USASCII",
12 %%% keywords       = "TeX, plain TeX, macros",
13 %%% supported      = "Maybe",
14 %%% abstract       = "Macros for simulating some PostScript characters
15 %%%                   using glyphs form the Computer Modern family.
16 %%%                   This file was generated by running
17 %%%                   plain TeX on pdcmisc.dtx",
18 %%% copyright      = "Copyright (c) 1991-1995 P. Damian Cugley",
19 %%% copying        = "DO NOT DISTRIBUTE THIS FILE.
20 %%%                   Distribute pdcmisc.dtx only as part of the
21 %%%                   package it came in.",
22 %%% dependencies   = "",
23 %%% }

24

25 \message{1.4 1995/03/30}

26

27 \dimendef\dimena=0

4.2. Currency signs The Yen sign looks like ‘50 000Y^{=}’, the cents sign like ‘37/ c’. The pounds-sterling sign is always italic.

28 \def\pounds{{\it\char36 }}

29 \def\yen{{%
30  \ooalign{%
31  \hfil\raise0.25ex\hbox{$\scriptscriptstyle=$}\hfil\crcr
32  \hfil Y\hfil
33  }%
34 }}
35 \def\cents{\leavevmode\hbox{\rm\rlap/c}}

The ISO 646 currency sign—originally created to replace the dollar sign in the international reference version character set—is supposed to be drawn as a circle with four ‘ears’; we’ll have to fake it rather crudely: ‘× ∘’, as in ‘× ∘100’ or possibly ‘100× ∘’.

36 \def\currency{{%
37  \ooalign{%
38  \hskip-0.1em
39  \raise0.2ex \hbox{\mathhexbox202}\hskip-0.1em\crcr
40  \hfil \raise0.2ex \hbox{\mathhexbox20E}\hfil
41  }%
42 }}

The florin sign ‘f’ seems to have started life as a way of getting an italic f on dotmatrix printers. In an italic context it still has to be in itaics—switching to a roman letter does not seem appropriate.

43 \def\florin{{\it f\/}}

4.3. Things in circles Here’s a general macro for making letters in circles—like the registered trade mark sign ‘◯^{R}’, or the signs ‘◯^{P}’ and ‘◯^{S}’ (I don’t use them so I haven’t given them names) or even ‘◯^{1}’. A matching copyright sing (using a small capital c instead of a lower case c) looks like ‘◯^{C}’. Parameter #1 to the macro is the amount to shift the small letter relative to the circle to get it optically centred.

44 \def\circledletter#1#2{{%
45  \ooalign{%
46  \hfil\kern#1\raise0.00ex \hbox{$\scriptstyle\rm #2$}\hfil\crcr
47  \mathhexbox20D%
48  }%
49 }}
50 \def\registered{\circledletter{0.02em}R}
51 \def\copyright{\circledletter{-0.045em}C}

4.4. Guillemets Ersatz guillemets look like ^{⟨⟨}this^{⟩⟩}.

52 \def\lguillemet{%
53  \leavevmode
54  \raise0.5ex \hbox{$\scriptscriptstyle\langle\!\langle$}%

55 }

56 \def\rguillemet{%
57  \leavevmode
58  \raise0.5ex \hbox{$\scriptscriptstyle\rangle\!\rangle$}%

59 }

4.5. Miscellaneous The per-mille sign ‘^{0}/_{00}’ can’t be made from ‘%’ sign because matching the rings is impossible, so we use ‘0/00’:

60 \def\permille{{%
61  \setbox0 \hbox{/}%
62  \flushtop{$\scriptstyle0\!$}/%
63  \lower\dp0 \hbox{$\!\scriptstyle00$}%
64 }}

The British decimal point is a raised dot: ‘3·141’ instead of ‘3.141’.

65 \def\gbdecimal{\mathhexbox201}

Unfortunately, this symbol has become a casualty of the ‘DTP revolution’, and the American use of a full stop as a decimal point has become common.

The glyphs ‘ā’ and ‘ō’ are used in to abbreviate Spanish ordinal numbers: the feminine primera becomes 1ā, and the masculine primero 1ō.

 66 \def\orda{\flushtop{\the\scriptfont\ifnum\fam>0 \fam\else 0\fi \b a}}
 67 \def\ordo{\flushtop{\the\scriptfont\ifnum\fam>0 \fam\else 0\fi \b o}}

4.6. Substitutions for Malvern’s alphabet-switching commands The macros used to select small capitals etc. in Malvern fonts cannot work with Computer Modern, but might appear in documents anyway. Instead they are all made equivalent to

\relax.
 68 \let\sc=\relax
 69 \let\csc=\relax
 70 \let\mc=\relax