1 % \begin{meta-comment} <general public licence>
2 %<*sty|mttpcr|fontinst>
4 %% mdwtools common declarations
5 %% Copyright (c) 1996 Mark Wooding
7 %% This program is free software; you can redistribute it and/or modify
8 %% it under the terms of the GNU General Public License as published by
9 %% the Free Software Foundation; either version 2 of the License, or
10 %% (at your option) any later version.
12 %% This program is distributed in the hope that it will be useful,
13 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
14 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 %% GNU General Public License for more details.
17 %% You should have received a copy of the GNU General Public License
18 %% along with this program; if not, write to the Free Software
19 %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 % \begin{meta-comment} <file preamble>
24 %<+sty>\NeedsTeXFormat{LaTeX2e}
25 %<+sty>\ProvidesPackage{mdwfonts}
26 %<+mttpcr>\ProvidesFile{mTTpcr.fd}
28 \ifx\ProvidesFile\mdwundefined
29 \def\ProvidesFile#1[#2]{\wlog{File: #1 #2}}
31 \ProvidesFile{mdwfonts.tex}
33 [2020/09/06 1.3 PostScript fonts for my documents]
38 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
39 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
40 %% Digits \0\1\2\3\4\5\6\7\8\9
41 %% Exclamation \! Double quote \" Hash (number) \#
42 %% Dollar \$ Percent \% Ampersand \&
43 %% Acute accent \' Left paren \( Right paren \)
44 %% Asterisk \* Plus \+ Comma \,
45 %% Minus \- Point \. Solidus \/
46 %% Colon \: Semicolon \; Less than \<
47 %% Equals \= Greater than \> Question mark \?
48 %% Commercial at \@ Left bracket \[ Backslash \\
49 %% Right bracket \] Circumflex \^ Underscore \_
50 %% Grave accent \` Left brace \{ Vertical bar \|
51 %% Right brace \} Tilde \~}
54 % \begin{meta-comment}
55 %</sty|mttpcr|fontinst>
60 \describespackage{mdwfonts}
67 %^^A-------------------------------------------------------------------------
70 % This suite of \LaTeX\ bits is intended to provide some configurability
71 % for the fonts used by documents. It lets users define their favourite
72 % collection of fonts, and any documents using this package will
73 % automatically honour those design decisions.
75 % It goes a little beyond this brief, however, by supplying some missing
76 % PostScript fonts which may be useful. (Well, the author uses them a lot.)
79 % \item The `squashed' Courier from David Carlisle's \package{pslatex}
80 % package is included, and extended to cover the other known variants of
81 % Courier (e.g., bold and oblique).
82 % \item A maths symbol font for Palatino has been added. It works in a
83 % similar way to the \package{mathptm} package's support for Times (i.e.,
84 % it grabs glyphs from the normal Palatino font, and from the Computer
89 % \section{Installing \package{mdwfonts}}
91 % The package comes with a large number of miscellaneous font files. They
92 % ought to be placed in appropriate directories where \TeX\ and/or other
93 % programs can find them. Exactly where this will be depends heavily on your
94 % installation: try looking for the other fonts and put these with them.
95 % The various extensions for the font files are:
97 % \item [.tfm] is a \TeX\ Font Metric file, needed by \TeX.
98 % \item [.vf] is a virtual font description file, needed by DVI-drivers.
99 % \item [.fd] is a font description file, required by \LaTeX.
102 % You'll also need to put |mdwfonts.sty| somewhere where \LaTeX\ will find
103 % it. What you do with the documentation file is up to you.
105 % The files |mTTpcr.fd| and |mdwfonts.sty| may not have been included in
106 % your distribution. If you don't have them, run \LaTeX\ on |mdwfonts.ins|
107 % to build them. I'm explicitly not giving instructions for building all
108 % the other font files, because I'd much prefer it if they were distributed
109 % as they are, please -- building them is a fiddly business, and I'd rather
110 % that only I had to do it.
112 % Once you've done all that, you must tell \textit{dvips} about your new
113 % fonts, so add the following lines to the |psfonts.map| file, unless they're
116 %pcrb8rn Courier-Bold ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
117 %pcrbo8rn Courier-BoldOblique ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
118 %pcrr8rn Courier ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
119 %pcrro8rn Courier-Oblique ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
121 % The |pcrr8rn| line will already be in the file if you've installed the
122 % \package{pslatex} package, so don't bother putting it in again.
125 % \section{Using \package{mdwfonts}}
127 % \subsection{Defining fonts to use}
129 % The font faces you can use, with their names as used by this package,
132 % \item Computer Modern Roman (|cmr|)
133 % \item Computer Modern Sans (|cmss|)
134 % \item Times Roman (|times|)
135 % \item Helvetica (|helvetica|)
136 % \item Palatino (|palatino|)
137 % \item Computer Modern Typewriter (|cmtt|)
138 % \item Courier (condensed version) (|courier|)
140 % Only Computer Modern Roman, Times Roman and Palatino may be used as a maths
143 % The \package{mdwfonts} package knows about five font families which
144 % documents probably want to use. The available families you can set, with
145 % their names as used by this package, are:
146 % \begin{description}
147 % \item [The body text family] (|body|) is the main font your document uses.
148 % The default body family is Computer Modern Roman.
149 % \item [The maths family] (|maths|) is the font used for mathematics.
150 % The default maths family is the same as the body family.
151 % \item [The sans serif family] (|sans|) is used for sans serif text.
152 % The default sans serif family is Computer Modern Sans.
153 % \item [The headings family] (|head|) is used for headings, if your
154 % document class supports this.\footnote{
155 % The \texttt{\char`\\headfam} command is configured to change to the
156 % chosen headings family. Co-operating document classes should use this
157 % hook when typesetting chapter and section headings, etc.}
158 % Most document classes don't support this, but \package{mdwfonts} patches
159 % the standard \LaTeX\ classes so that they work. The default headings
160 % family is Computer Modern Roman.
161 % \item [The typewriter family] (|tt|) is used for monospaced text. The
162 % default typewriter family is Computer Modern Typewriter.
164 % American users not used to spelling \lit{maths} correctly may use the
165 % alternative spelling \lit{math} instead. If only the rest of \LaTeX\ were
169 % \subsection{Assigning faces to families}
171 % \DescribeMacro\mdwfont
172 % This is fairly simple, really. The |\mdwfont| will attach a typeface to a
173 % given family. The syntax is as follows:
175 % "\\mdwfont" "{" \< <family-name> "=" <face-name> \\ "," \> "}"
177 % For example, saying
179 %\mdwfont{body=palatino, maths=palatino,
180 % sans=helvetica, head=helvetica
183 % uses Palatino for the main body text, and for maths, Helvetica for sans
184 % serif text, and for headings (again, only if your document class supports
187 % The \package{mdwfonts} package also supports a collection of options which
188 % may be passed to the package. The syntax of the package invocation is:
192 % \< \( <face-name> \\ <family-name> "=" <face-name> \) \\ "," \>
198 % A face name on its own configures families sensibly to use that face.
199 % The actual behaviour is as follows:
200 % \begin{description}
201 % \item [times] Set body and maths families to Times Roman.
202 % \item [palatino] Set body and maths families to Palatino.
203 % \item [cmr] Set body, headings and maths families to Computer Modern Roman.
204 % \item [helvetica] Set sans serif and headings families to Helvetica.
205 % \item [cmss] Set sans serif family to Computer Modern Sans.
206 % \item [courier] Set typewriter family to Courier.
207 % \item [cmtt] Set typewriter family to Computer Modern Typewriter.
209 % Astute readers will be able to deduce the author's personal preferences
210 % for assigning typefaces to families from the above rules. However, they
211 % should suffice for most simple configurations. Moreover, the direct
212 % assignment of faces to families is supported in case the above aren't
215 % When \package{mdwfonts} starts up, it reads a file called |mdwfonts.cfg|,
216 % if it exists. This file should set up defaults for the various families
217 % according to the user's preferences. The decisions made by the
218 % configuration file may be overridden by the document, however, since
219 % package options are processed after running |mdwfonts.cfg|.
224 % \section{The package}
231 % \subsection{Options handing}
233 % There are several font choices to be made. These can be made from the
234 % package options or the configuration file; the former takes precedence over
237 % I'll use David Carlisle's rather good \package{keyval} package to handle
238 % this lot because it saves a lot of hassle in the long run.
241 \RequirePackage{keyval}
244 % Now to define how all this actually works. Maintain a variable for each
245 % family that I understand, and a list of which fonts people have expressed
249 \def\mdwf@bodyfont{\mdwf@cmr}
250 \def\mdwf@mathsfont{\mdwf@bodyfont}
251 \def\mdwf@sansfont{\mdwf@cmss}
252 \def\mdwf@headfont{\mdwf@cmr}
253 \def\mdwf@ttfont{\mdwf@cmtt}
256 % Now to define the keys and values which I'll accept.
259 \def\mdwf@set#1#2{\edef#1{\expandafter\noexpand\csname mdwf@#2\endcsname}}
260 \define@key{mdwf}{body}{\mdwf@set\mdwf@bodyfont{#1}}
261 \define@key{mdwf}{maths}{\mdwf@set\mdwf@mathsfont{#1}}
262 \define@key{mdwf}{math}{\mdwf@set\mdwf@mathsfont{#1}}
263 \define@key{mdwf}{sans}{\mdwf@set\mdwf@sansfont{#1}}
264 \define@key{mdwf}{head}{\mdwf@set\mdwf@headfont{#1}}
265 \define@key{mdwf}{tt}{\mdwf@set\mdwf@ttfont{#1}}
268 % Now input the configuration file.
271 \def\mdwfont{\setkeys{mdwf}}
272 \@input{mdwfonts.cfg}
275 % Set up some package options which handle the common cases. Then add
276 % a catch-all option which just gets bundled to \package{keyval}.
279 \DeclareOption{times}{\mdwfont{body=times, maths=times}}
280 \DeclareOption{palatino}{\mdwfont{body=palatino, maths=palatino}}
281 \DeclareOption{cmr}{\mdwfont{body=cmr, maths=cmr, head=cmr}}
282 \DeclareOption{helvetica}{\mdwfont{sans=helvetica, head=helvetica}}
283 \DeclareOption{cmss}{\mdwfont{sans=cmss}}
284 \DeclareOption{courier}{\mdwfont{tt=courier}}
285 \DeclareOption{cmtt}{\mdwfont{tt=cmtt}}
286 \DeclareOption*{\expandafter\mdwfont\expandafter{\CurrentOption}}
290 % Now, if a client wants a really odd setup not provided by the above
291 % interface, it can define |\mdwfonts| to declare its decision.
294 \ifx\mdwfonts\@@undefined\else
295 \def\@tempa#1\@@{\mdwfont{#1}}
296 \expandafter\@tempa\mdwfonts\@@
301 % \subsection{Setting up the actual fonts}
303 % \begin{macro}{\mdwf@iffont}
305 % I need to check whether a font's been used. This macro will help.
307 % First, I'll define some numeric values for various fonts.
312 \expandafter\chardef\csname mdwf@#1\endcsname\count@%
315 \@tempa{cmr}\@tempa{cmss}\@tempa{cmtt}
316 \@tempa{times}\@tempa{palatino}\@tempa{helvetica}\@tempa{courier}
319 % And now to check whether a font is being used. This is rather horrible.
322 \def\mdwf@iffont#1{\if1%
323 \ifnum\mdwf@bodyfont=#11\else%
324 \ifnum\mdwf@headfont=#11\else%
325 \ifnum\mdwf@sansfont=#11\else%
326 \ifnum\mdwf@ttfont=#11\else0%
333 % \subsubsection{Text fonts}
335 % \paragraph{Courier}
336 % The Courier family is redefined in its entirety here. I use the condensed
337 % Courier provided by David Carlisle's \package{pslatex} package, although
338 % I've extended it to cover all the shapes and not just medium roman.
340 \mdwf@iffont\mdwf@courier
341 \DeclareFontFamily{OT1}{pcr}{\hyphenchar\font=-1}
342 \DeclareFontShape{OT1}{pcr}{b}{n}{<-> pcrb7tn}{}
343 \DeclareFontShape{OT1}{pcr}{b}{sc}{<-> pcrbc7tn}{}
344 \DeclareFontShape{OT1}{pcr}{b}{sl}{<-> pcrbo7tn}{}
345 \DeclareFontShape{OT1}{pcr}{m}{n}{<-> pcrr7tn}{}
346 \DeclareFontShape{OT1}{pcr}{m}{sc}{<-> pcrrc7tn}{}
347 \DeclareFontShape{OT1}{pcr}{m}{sl}{<-> pcrro7tn}{}
348 \DeclareFontShape{OT1}{pcr}{bx}{n}{<->ssub * pcr/b/n}{}
349 \DeclareFontShape{OT1}{pcr}{bx}{sc}{<->ssub * pcr/b/sc}{}
350 \DeclareFontShape{OT1}{pcr}{bx}{sl}{<->ssub * pcr/b/sl}{}
351 \DeclareFontShape{OT1}{pcr}{b}{it}{<->ssub * pcr/b/sl}{}
352 \DeclareFontShape{OT1}{pcr}{bx}{it}{<->ssub * pcr/b/it}{}
353 \DeclareFontShape{OT1}{pcr}{m}{it}{<->ssub * pcr/m/sl}{}
354 \DeclareFontFamily{T1}{pcr}{\hyphenchar\font=-1}
355 \DeclareFontShape{T1}{pcr}{b}{n}{<-> pcrb8tn}{}
356 \DeclareFontShape{T1}{pcr}{b}{sc}{<-> pcrbc8tn}{}
357 \DeclareFontShape{T1}{pcr}{b}{sl}{<-> pcrbo8tn}{}
358 \DeclareFontShape{T1}{pcr}{m}{n}{<-> pcrr8tn}{}
359 \DeclareFontShape{T1}{pcr}{m}{sc}{<-> pcrrc8tn}{}
360 \DeclareFontShape{T1}{pcr}{m}{sl}{<-> pcrro8tn}{}
361 \DeclareFontShape{T1}{pcr}{bx}{n}{<->ssub * pcr/b/n}{}
362 \DeclareFontShape{T1}{pcr}{bx}{sc}{<->ssub * pcr/b/sc}{}
363 \DeclareFontShape{T1}{pcr}{bx}{sl}{<->ssub * pcr/b/sl}{}
364 \DeclareFontShape{T1}{pcr}{b}{it}{<->ssub * pcr/b/sl}{}
365 \DeclareFontShape{T1}{pcr}{bx}{it}{<->ssub * pcr/b/it}{}
366 \DeclareFontShape{T1}{pcr}{m}{it}{<->ssub * pcr/m/sl}{}
370 % \paragraph{Helvetica}
371 % Again the whole of Helvetica is defined here, this time so that the font
372 % can be scaled a little.
374 \mdwf@iffont\mdwf@helvetica
375 \DeclareFontFamily{OT1}{phv}{}
376 \DeclareFontShape{OT1}{phv}{b}{n}{<-> s * [.9] phvb7t}{}
377 \DeclareFontShape{OT1}{phv}{b}{sc}{<-> s * [.9] phvbc7t}{}
378 \DeclareFontShape{OT1}{phv}{b}{sl}{<-> s * [.9] phvbo7t}{}
379 \DeclareFontShape{OT1}{phv}{bc}{n}{<-> s * [.9] phvbrn7t}{}
380 \DeclareFontShape{OT1}{phv}{bc}{sc}{<-> s * [.9] phvbcn7t}{}
381 \DeclareFontShape{OT1}{phv}{bc}{sl}{<-> s * [.9] phvbon7t}{}
382 \DeclareFontShape{OT1}{phv}{m}{n}{<-> s * [.9] phvr7t}{}
383 \DeclareFontShape{OT1}{phv}{m}{sc}{<-> s * [.9] phvrc7t}{}
384 \DeclareFontShape{OT1}{phv}{m}{sl}{<-> s * [.9] phvro7t}{}
385 \DeclareFontShape{OT1}{phv}{mc}{n}{<-> s * [.9] phvrrn7t}{}
386 \DeclareFontShape{OT1}{phv}{mc}{sc}{<-> s * [.9] phvrcn7t}{}
387 \DeclareFontShape{OT1}{phv}{mc}{sl}{<-> s * [.9] phvron7t}{}
388 \DeclareFontShape{OT1}{phv}{bx}{n}{<->ssub * phv/b/n}{}
389 \DeclareFontShape{OT1}{phv}{bx}{sc}{<->ssub * phv/b/sc}{}
390 \DeclareFontShape{OT1}{phv}{bx}{sl}{<->ssub * phv/b/sl}{}
391 \DeclareFontShape{OT1}{phv}{b}{it}{<->ssub * phv/b/sl}{}
392 \DeclareFontShape{OT1}{phv}{bx}{it}{<->ssub * phv/b/it}{}
393 \DeclareFontShape{OT1}{phv}{bc}{it}{<->ssub * phv/bc/sl}{}
394 \DeclareFontShape{OT1}{phv}{m}{it}{<->ssub * phv/m/sl}{}
395 \DeclareFontShape{OT1}{phv}{mc}{it}{<->ssub * phv/mc/sl}{}
396 \DeclareFontFamily{T1}{phv}{}
397 \DeclareFontShape{T1}{phv}{b}{n}{<-> s * [.9] phvb8t}{}
398 \DeclareFontShape{T1}{phv}{b}{sc}{<-> s * [.9] phvbc8t}{}
399 \DeclareFontShape{T1}{phv}{b}{sl}{<-> s * [.9] phvbo8t}{}
400 \DeclareFontShape{T1}{phv}{bc}{n}{<-> s * [.9] phvbrn8t}{}
401 \DeclareFontShape{T1}{phv}{bc}{sc}{<-> s * [.9] phvbcn8t}{}
402 \DeclareFontShape{T1}{phv}{bc}{sl}{<-> s * [.9] phvbon8t}{}
403 \DeclareFontShape{T1}{phv}{m}{n}{<-> s * [.9] phvr8t}{}
404 \DeclareFontShape{T1}{phv}{m}{sc}{<-> s * [.9] phvrc8t}{}
405 \DeclareFontShape{T1}{phv}{m}{sl}{<-> s * [.9] phvro8t}{}
406 \DeclareFontShape{T1}{phv}{mc}{n}{<-> s * [.9] phvrrn8t}{}
407 \DeclareFontShape{T1}{phv}{mc}{sc}{<-> s * [.9] phvrcn8t}{}
408 \DeclareFontShape{T1}{phv}{mc}{sl}{<-> s * [.9] phvron8t}{}
409 \DeclareFontShape{T1}{phv}{bx}{n}{<->ssub * phv/b/n}{}
410 \DeclareFontShape{T1}{phv}{bx}{sc}{<->ssub * phv/b/sc}{}
411 \DeclareFontShape{T1}{phv}{bx}{sl}{<->ssub * phv/b/sl}{}
412 \DeclareFontShape{T1}{phv}{b}{it}{<->ssub * phv/b/sl}{}
413 \DeclareFontShape{T1}{phv}{bx}{it}{<->ssub * phv/b/it}{}
414 \DeclareFontShape{T1}{phv}{bc}{it}{<->ssub * phv/bc/sl}{}
415 \DeclareFontShape{T1}{phv}{m}{it}{<->ssub * phv/m/sl}{}
416 \DeclareFontShape{T1}{phv}{mc}{it}{<->ssub * phv/mc/sl}{}
420 % \paragraph{Palatino}
421 % Might as well define Palatino too, for completeness' sake.
423 \mdwf@iffont\mdwf@palatino
424 \DeclareFontFamily{OT1}{ppl}{}
425 \DeclareFontShape{OT1}{ppl}{b}{n}{<-> pplb7t}{}
426 \DeclareFontShape{OT1}{ppl}{b}{sc}{<-> pplbc7t}{}
427 \DeclareFontShape{OT1}{ppl}{b}{sl}{<-> pplbo7t}{}
428 \DeclareFontShape{OT1}{ppl}{b}{it}{<-> pplbi7t}{}
429 \DeclareFontShape{OT1}{ppl}{m}{n}{<-> pplr7t}{}
430 \DeclareFontShape{OT1}{ppl}{m}{sc}{<-> pplrc7t}{}
431 \DeclareFontShape{OT1}{ppl}{m}{sl}{<-> pplro7t}{}
432 \DeclareFontShape{OT1}{ppl}{m}{it}{<-> pplri7t}{}
433 \DeclareFontShape{OT1}{ppl}{bx}{n}{<->ssub * ppl/b/n}{}
434 \DeclareFontShape{OT1}{ppl}{bx}{sc}{<->ssub * ppl/b/sc}{}
435 \DeclareFontShape{OT1}{ppl}{bx}{sl}{<->ssub * ppl/b/sl}{}
436 \DeclareFontShape{OT1}{ppl}{bx}{it}{<->ssub * ppl/b/it}{}
437 \DeclareFontShape{OT1}{ppl}{l}{n}{<->ssub * ppl/m/n}{}
438 \DeclareFontShape{OT1}{ppl}{l}{sc}{<->ssub * ppl/m/sc}{}
439 \DeclareFontShape{OT1}{ppl}{l}{sl}{<->ssub * ppl/m/sl}{}
440 \DeclareFontShape{OT1}{ppl}{l}{it}{<->ssub * ppl/m/it}{}
441 \DeclareFontFamily{T1}{ppl}{}
442 \DeclareFontShape{T1}{ppl}{b}{n}{<-> pplb8t}{}
443 \DeclareFontShape{T1}{ppl}{b}{sc}{<-> pplbc8t}{}
444 \DeclareFontShape{T1}{ppl}{b}{sl}{<-> pplbo8t}{}
445 \DeclareFontShape{T1}{ppl}{b}{it}{<-> pplbi8t}{}
446 \DeclareFontShape{T1}{ppl}{m}{n}{<-> pplr8t}{}
447 \DeclareFontShape{T1}{ppl}{m}{sc}{<-> pplrc8t}{}
448 \DeclareFontShape{T1}{ppl}{m}{sl}{<-> pplro8t}{}
449 \DeclareFontShape{T1}{ppl}{m}{it}{<-> pplri8t}{}
450 \DeclareFontShape{T1}{ppl}{bx}{n}{<->ssub * ppl/b/n}{}
451 \DeclareFontShape{T1}{ppl}{bx}{sc}{<->ssub * ppl/b/sc}{}
452 \DeclareFontShape{T1}{ppl}{bx}{sl}{<->ssub * ppl/b/sl}{}
453 \DeclareFontShape{T1}{ppl}{bx}{it}{<->ssub * ppl/b/it}{}
454 \DeclareFontShape{T1}{ppl}{l}{n}{<->ssub * ppl/m/n}{}
455 \DeclareFontShape{T1}{ppl}{l}{sc}{<->ssub * ppl/m/sc}{}
456 \DeclareFontShape{T1}{ppl}{l}{sl}{<->ssub * ppl/m/sl}{}
457 \DeclareFontShape{T1}{ppl}{l}{it}{<->ssub * ppl/m/it}{}
462 % Finally, Times, for those who like it\dots
464 \mdwf@iffont\mdwf@times
465 \DeclareFontFamily{OT1}{ptm}{}
466 \DeclareFontShape{OT1}{ptm}{b}{n}{<-> ptmb7t}{}
467 \DeclareFontShape{OT1}{ptm}{b}{sc}{<-> ptmbc7t}{}
468 \DeclareFontShape{OT1}{ptm}{b}{sl}{<-> ptmbo7t}{}
469 \DeclareFontShape{OT1}{ptm}{b}{it}{<-> ptmbi7t}{}
470 \DeclareFontShape{OT1}{ptm}{m}{n}{<-> ptmr7t}{}
471 \DeclareFontShape{OT1}{ptm}{m}{sc}{<-> ptmrc7t}{}
472 \DeclareFontShape{OT1}{ptm}{m}{sl}{<-> ptmro7t}{}
473 \DeclareFontShape{OT1}{ptm}{m}{it}{<-> ptmri7t}{}
474 \DeclareFontShape{OT1}{ptm}{bx}{n}{<->ssub * ptm/b/n}{}
475 \DeclareFontShape{OT1}{ptm}{bx}{sc}{<->ssub * ptm/b/sc}{}
476 \DeclareFontShape{OT1}{ptm}{bx}{sl}{<->ssub * ptm/b/sl}{}
477 \DeclareFontShape{OT1}{ptm}{bx}{it}{<->ssub * ptm/b/it}{}
478 \DeclareFontShape{OT1}{ptm}{l}{n}{<->ssub * ptm/m/n}{}
479 \DeclareFontShape{OT1}{ptm}{l}{sc}{<->ssub * ptm/m/sc}{}
480 \DeclareFontShape{OT1}{ptm}{l}{sl}{<->ssub * ptm/m/sl}{}
481 \DeclareFontShape{OT1}{ptm}{l}{it}{<->ssub * ptm/m/it}{}
482 \DeclareFontFamily{T1}{ptm}{}
483 \DeclareFontShape{T1}{ptm}{b}{n}{<-> ptmb8t}{}
484 \DeclareFontShape{T1}{ptm}{b}{sc}{<-> ptmbc8t}{}
485 \DeclareFontShape{T1}{ptm}{b}{sl}{<-> ptmbo8t}{}
486 \DeclareFontShape{T1}{ptm}{b}{it}{<-> ptmbi8t}{}
487 \DeclareFontShape{T1}{ptm}{m}{n}{<-> ptmr8t}{}
488 \DeclareFontShape{T1}{ptm}{m}{sc}{<-> ptmrc8t}{}
489 \DeclareFontShape{T1}{ptm}{m}{sl}{<-> ptmro8t}{}
490 \DeclareFontShape{T1}{ptm}{m}{it}{<-> ptmri8t}{}
491 \DeclareFontShape{T1}{ptm}{bx}{n}{<->ssub * ptm/b/n}{}
492 \DeclareFontShape{T1}{ptm}{bx}{sc}{<->ssub * ptm/b/sc}{}
493 \DeclareFontShape{T1}{ptm}{bx}{sl}{<->ssub * ptm/b/sl}{}
494 \DeclareFontShape{T1}{ptm}{bx}{it}{<->ssub * ptm/b/it}{}
495 \DeclareFontShape{T1}{ptm}{l}{n}{<->ssub * ptm/m/n}{}
496 \DeclareFontShape{T1}{ptm}{l}{sc}{<->ssub * ptm/m/sc}{}
497 \DeclareFontShape{T1}{ptm}{l}{sl}{<->ssub * ptm/m/sl}{}
498 \DeclareFontShape{T1}{ptm}{l}{it}{<->ssub * ppl/m/it}{}
502 % \subsubsection{Maths fonts}
504 % \paragraph{Palatino}
507 \ifnum\mdwf@mathsfont=\mdwf@palatino
508 \DeclareSymbolFont{operators} {OT1}{pplcm}{m}{n}
509 \DeclareSymbolFont{letters} {OML}{pplcm}{m}{it}
510 \DeclareSymbolFont{bold} {OT1}{ppl}{bx}{n}
511 \DeclareSymbolFont{italic} {OT1}{ppl}{m}{it}
512 \DeclareSymbolFontAlphabet{\mathit}{italic}
519 \ifnum\mdwf@mathsfont=\mdwf@times
520 \DeclareSymbolFont{operators} {OT1}{ptmcm}{m}{n}
521 \DeclareSymbolFont{letters} {OML}{ptmcm}{m}{it}
522 \DeclareSymbolFont{bold} {OT1}{ptm}{bx}{n}
523 \DeclareSymbolFont{italic} {OT1}{ptm}{m}{it}
524 \DeclareSymbolFontAlphabet{\mathit}{italic}
528 % \paragraph{Computer Modern}
529 % Silliness required.
531 \ifnum\mdwf@mathsfont=\mdwf@cmr
532 \DeclareSymbolFont{operators} {OT1}{cmr}{m}{n}
533 \DeclareSymbolFont{letters} {OML}{cmr}{m}{it}
534 \DeclareSymbolFont{bold} {OT1}{cmr}{bx}{n}
535 \DeclareSymbolFont{italic} {OT1}{cmr}{m}{it}
536 \DeclareSymbolFontAlphabet{\mathit}{italic}
540 % \paragraph{General PostScript things}
541 % Set up the symbols and large symbols fonts. This lot is all from
544 \if1\ifnum\mdwf@mathsfont=\mdwf@times1\else
545 \ifnum\mdwf@mathsfont=\mdwf@palatino1\else0\fi\fi
546 \DeclareSymbolFont{symbols} {OMS}{pzccm}{m}{n}
547 \DeclareSymbolFont{largesymbols}{OMX}{psycm}{m}{n}
549 % Adjust the spacing around operators and things to fit PostScript fonts
553 \medmuskip=2.5mu plus 1mu minus 1mu
554 \thickmuskip=4mu plus 1.5mu minus 1mu
556 % There isn't a bold symbol font.
559 \@warning{there is no bold Symbol font}%
560 \global\let\boldmath=\relax
563 % Provide an |\omicron| character. No idea why\dots
565 \DeclareMathSymbol{\omicron}{0}{operators}{`\o}
567 % Make scripts a bit bigger.
569 \DeclareMathSizes{5}{5}{5}{5}
570 \DeclareMathSizes{6}{6}{5}{5}
571 \DeclareMathSizes{7}{7}{5}{5}
572 \DeclareMathSizes{8}{8}{6}{5}
573 \DeclareMathSizes{9}{9}{7}{5}
574 \DeclareMathSizes{10}{10}{7.4}{6}
575 \DeclareMathSizes{10.95}{10.95}{8}{6}
576 \DeclareMathSizes{12}{12}{9}{7}
577 \DeclareMathSizes{14.4}{14.4}{10.95}{8}
578 \DeclareMathSizes{17.28}{17.28}{12}{10}
579 \DeclareMathSizes{20.74}{20.74}{14.4}{12}
580 \DeclareMathSizes{24.88}{24.88}{17.28}{14.4}
582 % Redefine the standard font for the symbols encoding.
584 \DeclareFontSubstitution{OMS}{pzccm}{m}{n}
589 % \subsection{Setting the font families}
591 % First, define the family names for everything.
598 \def\mdwf@palatino{ppl}
599 \def\mdwf@helvetica{phv}
600 \def\mdwf@courier{pcr}
603 % Now assign families to the various variables.
606 \edef\rmdefault{\mdwf@bodyfont}
607 \edef\sfdefault{\mdwf@sansfont}
608 \edef\ttdefault{\mdwf@ttfont}
609 \edef\headdefault{\mdwf@headfont}
612 % Set various maths families.
615 \def\mdwf@mathsfam#1#2#3{%
616 \edef\@tempa{\noexpand\DeclareMathAlphabet{\noexpand#1}{#2}{#3}}%
619 \DeclareSymbolFontAlphabet{\mathit}{italic}
620 \DeclareSymbolFontAlphabet{\mathrm}{operators}
621 \DeclareSymbolFontAlphabet{\mathbf}{bold}
622 \mdwf@mathsfam{\mathsf}{OT1}{\sfdefault}{m}{n}
623 \mdwf@mathsfam{\mathtt}{OT1}{\ttdefault}{m}{n}
626 % Finally, set |\headfam| nicely.
629 \def\headfam{\fontfamily\headdefault\selectfont}
632 % \subsection{Clobber standard packages}
634 % Now, if I recognise this document class, patch it until it accepts
635 % |\headfam| correctly. This stuff isn't terribly pleasant, but I don't
638 % First see if I'm in familiar territory.
643 \if1\ifx\ver@article.cls\@@undefined
644 \ifx\ver@report.cls\@@undefined
645 \ifx\ver@book.cls\@@undefined
646 \ifx\ver@amsart.cls\@@undefined
647 \ifx\ver@amsproc.cls\@@undefined
648 \ifx\ver@amsbook.cls\@@undefined0%
657 % Looks like it. Now to patch the |\@startsection|-based commands. I'll
658 % redefine |\@startsection| to do the atching for me, and then just run
659 % all the commands which want patching.
662 \def\@startsection#1#2#3#4#5#6#7{%
663 \gdef#7{\@startsection{#1}{#2}{#3}{#4}{#5}{#6\headfam}}%
666 \subsection\subsection
667 \subsubsection\subsubsection
669 \subparagraph\subparagraph
670 \if1\ifx\ver@amsart.cls\@@undefined\ifx\ver@amsproc.cls\@@undefined0%
676 % Now for the difficult bits. Firstly, deal with part headings for normal
680 \long\def\mdwf@grab#1{\expandafter\mdwf@grab@i#1\@@delim}
681 \long\def\mdwf@grab@i#1\@@delim#2{#2{#1}}
682 \def\mdwf@patch@opt#1{\mdwf@grab{#1[##1]{##2}}\mdwf@patch@opt@i#1}
683 \long\def\mdwf@patch@opt@i#1#2{\gdef#2[##1]##2{%
684 \let\mdwf@@bfseries\bfseries\def\bfseries{\headfam\mdwf@@bfseries}%
686 \let\bfseries\mdwf@@bfseries%
688 \def\mdwf@patch#1{\mdwf@grab{#1{##1}}\mdwf@patch@i#1}
689 \long\def\mdwf@patch@i#1#2{\gdef#2##1{%
690 \let\mdwf@@bfseries\bfseries\def\bfseries{\headfam\mdwf@@bfseries}%
692 \let\bfseries\mdwf@@bfseries%
694 \if0\ifx\ver@amsart.cls\@@undefined\ifx\ver@amsproc.cls\@@undefined0%
696 \mdwf@patch@opt\@part
699 \ifx\@makechapterhead\@@undefined\else
700 \mdwf@patch\@makechapterhead
701 \mdwf@patch\@makeschapterhead
710 % That's it for the package.
717 % \section{Font installation script}
719 % If you're lucky you'll never need to use this.
726 % Firstly, some code for building squashed Courier fonts.
729 \def\squashcourier#1{%
730 \transformfont{pcr#18rn}{%
732 \reencodefont{8r}{\fromafm{pcr#18a}}}}}
739 % Now start installing fonts.
745 % Start with the Courier ones.
748 \installfont{pcrb7tn}{pcrb8rn,psyr,latin}{OT1tt}{OT1}{pcr}{b}{n}{}
749 \installfont{pcrb8tn}{pcrb8rn,psyr,latin}{T1}{T1}{pcr}{b}{n}{}
750 \installfont{pcrbc7tn}{pcrb8rn,psyr,latin}{OT1ctt}{OT1}{pcr}{b}{sc}{}
751 \installfont{pcrbc8tn}{pcrb8rn,psyr,latin}{T1c}{T1}{pcr}{b}{sc}{}
752 \installfont{pcrbo7tn}{pcrbo8rn,psyr,latin}{OT1tt}{OT1}{pcr}{b}{sl}{}
753 \installfont{pcrbo8tn}{pcrbo8rn,psyr,latin}{T1}{T1}{pcr}{b}{sl}{}
754 \installfont{pcrr7tn}{pcrr8rn,psyr,latin}{OT1tt}{OT1}{pcr}{m}{n}{}
755 \installfont{pcrr8tn}{pcrr8rn,psyr,latin}{T1}{T1}{pcr}{m}{n}{}
756 \installfont{pcrrc7tn}{pcrr8rn,psyr,latin}{OT1ctt}{OT1}{pcr}{m}{sc}{}
757 \installfont{pcrrc8tn}{pcrr8rn,psyr,latin}{T1c}{T1}{pcr}{m}{sc}{}
758 \installfont{pcrro7tn}{pcrro8rn,psyr,latin}{OT1tt}{OT1}{pcr}{m}{sl}{}
759 \installfont{pcrro8tn}{pcrro8rn,psyr,latin}{T1}{T1}{pcr}{m}{sl}{}
762 % Now build Palatino-based maths fonts. This lot seems to work. It's based
763 % on \package{mathptm}, and hacked a bit.
766 \installfamily{OT1}{pplcm}{}
767 \installfamily{OML}{pplcm}{\skewchar\font=127}
768 \transformfont{pplr8r}{\reencodefont{8r}{\fromafm{pplr8a}}}
769 \transformfont{pplri8r}{\reencodefont{8r}{\fromafm{pplri8a}}}
770 \transformfont{pzcmi8r}{\reencodefont{8r}{\fromafm{pzcmi8a}}}
771 \installfont{zpplcmr}
772 {pplr8r,psyr,latin,zrhax,kernoff,cmr10}
773 {OT1}{OT1}{pplcm}{m}{n}{}
774 \installfont{zpplcmrm}
775 {kernoff,cmmi10,kernon,unsetalf,unsetnum,pplri8r,psyr,mathit,zrmhax,kernoff,cmmi10}
776 {OML}{OML}{pplcm}{m}{it}{}
787 % But it's not over yet. For some reason, I don't have `|ot1tt.etx|' in my
788 % distribution. Here's one which ought to do.
793 % OT1tt.etx -- install an OT1-encoded typewriter font
801 % And again, for `|ot1ctt.etx|'.
806 % OT1tt.etx -- install an OT1-encoded typewriter font
814 % Before I leave this section, I'll just write out the appropriate magical
815 % definitions for the DVIPS |psfonts.map| file.
819 pcrb8rn Courier-Bold ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
820 pcrbo8rn Courier-BoldOblique ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
821 pcrr8rn Courier ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
822 pcrro8rn Courier-Oblique ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
827 % \section{Description file for Courier}
829 % Here's a short |.fd| file for the squashed Courier font which makes it
830 % work in my `|mTT|' encoding.
834 \DeclareFontFamily{mTT}{pcr}{\hyphenchar\font=-1}
835 \DeclareFontShape{mTT}{pcr}{b}{n}{<-> pcrb7tn}{}
836 \DeclareFontShape{mTT}{pcr}{b}{sc}{<-> pcrbc7tn}{}
837 \DeclareFontShape{mTT}{pcr}{b}{sl}{<-> pcrbo7tn}{}
838 \DeclareFontShape{mTT}{pcr}{m}{n}{<-> pcrr7tn}{}
839 \DeclareFontShape{mTT}{pcr}{m}{sc}{<-> pcrrc7tn}{}
840 \DeclareFontShape{mTT}{pcr}{m}{sl}{<-> pcrro7tn}{}
841 \DeclareFontShape{mTT}{pcr}{bx}{n}{<->ssub * pcr/b/n}{}%
842 \DeclareFontShape{mTT}{pcr}{bx}{sc}{<->ssub * pcr/b/sc}{}%
843 \DeclareFontShape{mTT}{pcr}{bx}{sl}{<->ssub * pcr/b/sl}{}%
844 \DeclareFontShape{mTT}{pcr}{b}{it}{<->ssub * pcr/b/sl}{}%
845 \DeclareFontShape{mTT}{pcr}{bx}{it}{<->ssub * pcr/b/it}{}%
846 \DeclareFontShape{mTT}{pcr}{m}{it}{<->ssub * pcr/m/sl}{}%
853 % \hfill Mark Wooding, \today