1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
% This is part of the book TeX for the Impatient.
% Copyright (C) 2003 Paul W. Abrahams, Kathryn A. Hargreaves, Karl Berry.
% See file fdl.tex for copying conditions.
% Fonts for TeX for the Impatient.
% This file is being distributed with the macros because the macro file
% refers to it. We used a combination of Bitstream and standard TeX
% fonts for the original printed book, but for the free edition, we
% stick to Computer Modern.
% -----------------------------------------------------------------------
%
% We used Computer Modern for the main text and math, and Zapf Humanist
% (i.e., Optima) for heads. (bs00015 is Optima Roman, 16 italic, 17
% bold, 18 bold italic.)
%
% First we define all of the fonts we use for any purpose, in terms of the
% font files. Later we define fonts functionally, using \let or \def.
% Computer Modern fonts.
%
\chardef\chinesefont = 2
\ifcase\chinesefont
\def\song{Adobe Song Std}
\def\hei{Adobe Heiti Std}
\def\kai{Adobe Kaiti Std}
\def\fang{Adobe Fangsong Std}
\or
\def\song{SimSun}
\def\hei{SimHei}
\def\kai{KaiTi}
\def\fang{FangSong}
\or
\def\song{FandolSong}
\def\hei{FandolHei}
\def\kai{FandolKai}
\def\fang{FandolFang}
\fi
%
\newif\ifxecjk \xecjktrue
\ifxecjk
\font\CJKfont="\song" at 10pt
\input xeCJK-base
\def\letfont{\let\CJKfont}
\normalspacedchars{-}
\else
\font\zhfont="\song" at 10pt
\def\zhpunctfont{\zhfont}
\input zhspacing.sty
\zhspacing
\def\letfont{\let\zhfont}
\fi
%
\font\enfiverm = cmr5
\font\zhfiverm = "\song" at 5pt
\def\fiverm{\enfiverm\letfont\zhfiverm}
\font\eneightrm = cmr8
\font\zheightrm = "\song" at 8pt
\def\eightrm{\eneightrm\letfont\zheightrm}
\font\enninerm = cmr9 % Glue pictures, small caps for ASCII.
\font\zhninerm = "\song" at 9pt
\def\ninerm{\enninerm\letfont\zhninerm}
%\font\tenrm = xcmr10 % with our kerning
\font\entenrm = cmr10 % don't have the xcmr10 source any more
\font\zhtenrm = "\song" at 10pt
\def\tenrm{\entenrm\letfont\zhtenrm}
\font\enoldtenrm = cmr10 % straight CM
\font\zholdtenrm = "\song" at 10pt
\def\oldtenrm{\enoldtenrm\letfont\zholdtenrm}
\font\entwelverm = cmr12
\font\zhtwelverm = "\song" at 12pt
\def\twelverm{\entwelverm\letfont\zhtwelverm}
\font\entwentysixrm = cmr10 at 26pt
\font\zhtwentysixrm = "\hei" at 26pt
\def\twentysixrm{\entwentysixrm\letfont\zhtwentysixrm}
%
\font\eneightit = cmti8
\font\zheightit = "\kai" at 8pt
\def\eightit{\eneightit\letfont\zheightit}
\font\ennineit = cmti9
\font\zheightit = "\kai" at 9pt
\def\nineit{\ennineit\letfont\zhnineit}
\font\entenit = cmti10
\font\zhtenit = "\kai" at 10pt
\def\tenit{\entenit\letfont\zhtenit}
%
\font\eneighttt = cmtt8
\font\zheighttt = "\fang" at 8pt
\def\eighttt{\eneighttt\letfont\zheighttt}
\font\ententt = cmtt10
\font\zhtentt = "\fang" at 10pt
\def\tentt{\ententt\letfont\zhtentt}
\font\eneleventt = cmtt10 at 11pt
\font\zheleventt = "\fang" at 11pt
\def\elventt{\enelventt\letfont\zhelventt}
\font\entwelvett = cmtt10 scaled \magstep2
\font\zhtwelvett = "\fang" at 12pt
\def\twelvett{\entwelvett\letfont\zhtwelvett}
%
\font\entenbt = cmtt10
\font\zhtenbt = "\fang" at 10pt
\def\tenbt{\entenbt\letfont\zhtenbt}
%
\font\enelevensf = cmss10 scaled\magstephalf
\font\zhelevensf = "\hei" at 11pt
\def\elevensf{\enelevensf\letfont\zhelevensf}
\font\enfourteensf = cmss10 scaled\magstep2
\font\zhfourteensf = "\hei" at 14pt
\def\fourteensf{\enfourteensf\letfont\zhfourteensf}
%
\font\eneightbf = cmbx8
\font\zheightbf = "\hei" at 8pt
\def\eightbf{\eneightbf\letfont\zheightbf}
\font\entenbf = cmbx10
\font\zhtenbf = "\hei" at 10pt
\def\tenbf{\entenbf\letfont\zhtenbf}
\font\enelevenbf = cmbx10 scaled \magstephalf
\font\zhelevenbf = "\hei" at 11pt
\def\elevenbf{\enelevenbf\letfont\zhelevenbf}
\font\entwelvebf = cmbx12
\font\zhtwelvebf = "\hei" at 12pt
\def\twelvebf{\entwelvebf\letfont\zhtwelvebf}
\font\enthirtysixbf = cmbx10 at 36pt
\font\zhthirtysixbf = "\hei" at 36pt
\def\thirtysixbf{\enthirtysixbf\letfont\zhthirtysixbf}
%
\font\entenbi = cmbxti10
\font\zhtenbi = "\hei" at 10pt
\def\tenbi{\entenbi\letfont\zhtenbi}
\font\enelevenbi= cmbxti10 scaled \magstephalf
\font\zhelevenbi = "\hei" at 11pt
\def\elevenbi{\enelevenbi\letfont\zhelevenbi}
\font\enfourteenbi= cmbxti10 scaled \magstep2
\font\zhfourteenbi = "\hei" at 14pt
\def\fourteenbi{\enfourteenbi\letfont\zhfourteenbi}
%
\font\entensc = cmcsc10
\font\zhtensc = "\fang" at 10pt
\def\tensc{\entensc\letfont\zhtensc}
\font\eneightsl = cmsl8
\font\zheightsl = "\fang" at 8pt
\def\eightsl{\eneightsl\letfont\zheightsl}
\font\eneighti = cmmi8
\font\zheighti = "\kai" at 8pt
\def\eighti{\eneighti\letfont\zheighti}
\font\eneightsy = cmsy8
\font\zheightsy = "\song" at 8pt
\def\eightsy{\eneightsy\letfont\zheightsy}
% % Optima fonts.
% %
% \font\eightopt = bs0015 at 8pt
% \font\nineopt = bs0015 at 9pt
% \font\twelveopt = bs0015 at 12pt
% \font\twentysixopt = bs0015 at 26pt
% \font\nineoptit = bs0016 at 9pt
% \font\tenoptit = bs0016 at 10pt
% \font\tenoptbf = bs0017 at 10pt
% \font\thirtysixoptbf = bs0017 at 36pt
% \font\tenbt = bs00175 at 10pt
% \font\tenoptbi = bs0018 at 10pt
% \font\elevenoptbi = bs0018 at 11pt
% \font\fourteenoptbi = bs0018 at 14pt
% Palatino fonts.
%
\font\tenpal = pplr
%\font\tenpal = bs0023
%\font\tenpalit = bs0024
%\font\tenpalbf = bs0025
%\font\tenpalbi = bs0026
% Logo and picture fonts.
%
\font\eightlogo = logo8
\font\logosl = logosl10
\font\handfont = pzdr
% The following changes are to avoid driver overflow
\ifmsdos
\font\cnum = cnum % 36-pt bold Optima, numbers only (just for MS-DOS)
\let\chapternumeralfont = \cnum
%\let\thirtysixoptbf = \twentysixopt
%\font\sevensy = cmsy8
%\font\seveni = cmmi8
\fi
\def\undefinedfont{\errmessage{Undefined font}}
% This should only be called when \rm et al. are going to be defined
% directly.
%
\def\clearfonts{\let\rm = \undefinedfont \let\bf = \undefinedfont
\let\it = \undefinedfont \let\bi = \undefinedfont
\let\tt = \undefinedfont \let\bt = \undefinedfont
\let\sc = \undefinedfont
\let\ss = \undefinedfont
}
% We only need to assign to \fam if the font is going to be used in math
% mode, which isn't the case with any of these. \rm, \it, \sl, \bf, and
% \tt are defined in plain.
%
\def\bi{\tenbi}
\def\mapquotes{\catcode`` = \active \catcode`' = \active}
{\mapquotes
\gdef\bt{% The font change also draws \ ` ' from a different font.
\tenbt
\def\\{{\tentt \char92}}%
\def`{{\tentt \char96}}\def'{{\tentt \char39}}%
}
}
\def\bti{\tenbi}
\def\sc{\tensc}
% Text fonts.
%
\def\textfonts{%
\def\rm{\fam0\tenrm}%
\textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
\textfont1=\teni \scriptfont1=\seveni \scriptscriptfont1=\fivei
\textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
\textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
\def\it{\fam\itfam\tenit}\textfont\itfam=\tenit
\def\sl{\fam\slfam\tensl}\textfont\slfam=\tensl
\def\bf{\fam\bffam\tenbf}\textfont\bffam=\tenbf
\scriptfont\bffam=\sevenbf \scriptscriptfont\bffam=\fivebf
\def\tt{\fam\ttfam\tentt}\textfont\ttfam=\tentt
\let\sc = \tensc
\setbox\strutbox=\hbox{\vrule height8.5pt depth3.5pt width\z@}%
\normalbaselineskip=12pt
\normalbaselines \rm
}
% Footnote fonts. We generally use eight point.
%
\def\footnotefonts{%
\def\rm{\fam0\eightrm}%
\textfont0=\eightrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm
\textfont1=\eighti \scriptfont1=\seveni \scriptscriptfont1=\fivei
\textfont2=\eightsy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy
\textfont3=\tenex \scriptfont3=\tenex \scriptscriptfont3=\tenex
\def\it{\fam\itfam\eightit}\textfont\itfam=\eightit
\def\sl{\fam\slfam\eightsl}\textfont\slfam=\eightsl
\def\bf{\fam\bffam\eightbf}\textfont\bffam=\eightbf
\scriptfont\bffam=\sevenbf \scriptscriptfont\bffam=\fivebf
\def\tt{\fam\ttfam\eighttt}\textfont\ttfam=\eighttt
\let\sc = \eightsc
\setbox\strutbox=\hbox{\vrule height7pt depth2pt width\z@}%
\normalbaselineskip=9pt
\normalbaselines \rm
}
% Fonts for the example titles. They are defined in the first example,
% also.
%
\def\exampletitlefonts{\clearfonts
\let\bf = \elevenbf
\let\bi = \elevenbi
\baselineskip = 13pt \bf
}
% Fonts for the subsection titles.
%
\def\subsectionfonts{\clearfonts \let\sf = \elevensf
\baselineskip = 12pt \sf
}
% Fonts for the section titles.
%
\def\sectionfonts{\clearfonts \let\sf = \fourteensf
\baselineskip = 16pt \sf
}
% Fonts for the chapter titles.
%
\let\chapternumeralfont = \thirtysixbf
\def\chapterfonts{\clearfonts \let\bf = \twentysixrm
\baselineskip = 32pt \bf
}
% Fonts for the table of contents.
%
\def\shorttocfonts{\clearfonts \let\rm = \twelverm
\baselineskip = 20pt \rm
}
\def\tocfonts{\clearfonts \let\rm = \ninerm
\let\it = \tenit \let\bf = \tenbf
\baselineskip = 12pt \rm
}
% Fonts for the index.
%
\def\indexfonts{\clearfonts
\let\rm = \eightrm
\let\it = \eightit
\let\tt = \eighttt
\let\sc = \tensc
\let\sl = \eightsl
\textfont2 = \eightsy % For \AMSTeX.
\let\mflogo = \eightlogo % For \Metafont.
\normalbaselineskip = 10pt \normallineskip = 1.5pt \normalbaselines
\setbox\strutbox=\hbox{\vrule height 7.5pt depth2.5pt width0pt}%
\rm
}
% Fonts for the inside back cover.
%
\def\conceptpagefonts{\clearfonts
\let\rm = \ninerm
\let\sc = \eightrm
\let\sl = \nineit
\baselineskip = 12pt
\rm
}
% We don't want any automatic hyphenation within the code font
\hyphenchar\zhtentt = -1
\hyphenchar\ententt = -1
\hyphenchar\zheighttt = -1
\hyphenchar\eneighttt = -1
\textfonts
|