3 % $Id: mdwfonts.dtx,v 1.1 2002/02/19 22:54:13 mdw Exp $
5 % PostScript fonts for more excitement
7 % (c) 1996 Mark Wooding
9 %----- Revision history -----------------------------------------------------
11 % $Log: mdwfonts.dtx,v $
12 % Revision 1.1 2002/02/19 22:54:13 mdw
15 % Revision 1.1 1996/11/19 22:02:15 mdw
21 % \begin{meta-comment} <general public licence>
22 %<*sty|mttpcr|fontinst>
24 %% mdwtools common declarations
25 %% Copyright (c) 1996 Mark Wooding
27 %% This program is free software; you can redistribute it and/or modify
28 %% it under the terms of the GNU General Public License as published by
29 %% the Free Software Foundation; either version 2 of the License, or
30 %% (at your option) any later version.
32 %% This program is distributed in the hope that it will be useful,
33 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
34 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 %% GNU General Public License for more details.
37 %% You should have received a copy of the GNU General Public License
38 %% along with this program; if not, write to the Free Software
39 %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
43 % \begin{meta-comment} <file preamble>
44 %<+sty>\NeedsTeXFormat{LaTeX2e}
45 %<+sty>\ProvidesPackage{mdwfonts}
46 %<+mttpcr>\ProvidesFile{mTTpcr.fd}
48 \ifx\ProvidesFile\mdwundefined
49 \def\ProvidesFile#1[#2]{\wlog{File: #1 #2}}
51 \ProvidesFile{mdwfonts.tex}
53 [1997/01/11 1.2 PostScript fonts for my documents]
58 %% {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
59 %% 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
60 %% Digits \0\1\2\3\4\5\6\7\8\9
61 %% Exclamation \! Double quote \" Hash (number) \#
62 %% Dollar \$ Percent \% Ampersand \&
63 %% Acute accent \' Left paren \( Right paren \)
64 %% Asterisk \* Plus \+ Comma \,
65 %% Minus \- Point \. Solidus \/
66 %% Colon \: Semicolon \; Less than \<
67 %% Equals \= Greater than \> Question mark \?
68 %% Commercial at \@ Left bracket \[ Backslash \\
69 %% Right bracket \] Circumflex \^ Underscore \_
70 %% Grave accent \` Left brace \{ Vertical bar \|
71 %% Right brace \} Tilde \~}
74 % \begin{meta-comment}
75 %</sty|mttpcr|fontinst>
80 \describespackage{mdwfonts}
87 %^^A-------------------------------------------------------------------------
90 % This suite of \LaTeX\ bits is intended to provide some configurability
91 % for the fonts used by documents. It lets users define their favourite
92 % collection of fonts, and any documents using this package will
93 % automatically honour those design decisions.
95 % It goes a little beyond this brief, however, by supplying some missing
96 % PostScript fonts which may be useful. (Well, the author uses them a lot.)
99 % \item The `squashed' Courier from David Carlisle's \package{pslatex}
100 % package is included, and extended to cover the other known variants of
101 % Courier (e.g., bold and oblique).
102 % \item A maths symbol font for Palatino has been added. It works in a
103 % similar way to the \package{mathptm} package's support for Times (i.e.,
104 % it grabs glyphs from the normal Palatino font, and from the Computer
109 % \section{Installing \package{mdwfonts}}
111 % The package comes with a large number of miscellaneous font files. They
112 % ought to be placed in appropriate directories where \TeX and/or other
113 % programs can find them. Exactly where this will be depends heavily on your
114 % installation: try looking for the other fonts and put these with them.
115 % The various extensions for the font files are:
116 % \begin{description}
117 % \item [.tfm] is a \TeX\ Font Metric file, needed by \TeX.
118 % \item [.vf] is a virtual font description file, needed by DVI-drivers.
119 % \item [.fd] is a font description file, required by \LaTeX.
122 % You'll also need to put |mdwfonts.sty| somewhere where \LaTeX\ will find
123 % it. What you do with the documentation file is up to you.
125 % The files |mTTpcr.fd| and |mdwfonts.sty| may not have been included in
126 % your distribution. If you don't have them, run \LaTeX\ on |mdwfonts.ins|
127 % to build them. I'm explicitly not giving instructions for building all
128 % the other font files, because I'd much prefer it if they were distributed
129 % as they are, please -- building them is a fiddly business, and I'd rather
130 % that only I had to do it.
132 % Once you've done all that, you must tell \textit{dvips} about your new
133 % fonts, so add the following lines to the |psfonts.map| file, unless they're
136 %pcrb8rn Courier-Bold ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
137 %pcrbo8rn Courier-BoldOblique ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
138 %pcrr8rn Courier ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
139 %pcrro8rn Courier-Oblique ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
141 % The |pcrr8rn| line will already be in the file if you've installed the
142 % \package{pslatex} package, so don't bother putting it in again.
145 % \section{Using \package{mdwfonts}}
147 % \subsection{Defining fonts to use}
149 % The font faces you can use, with their names as used by this package,
152 % \item Computer Modern Roman (|cmr|)
153 % \item Computer Modern Sans (|cmss|)
154 % \item Times Roman (|times|)
155 % \item Helvetica (|helvetica|)
156 % \item Palatino (|palatino|)
157 % \item Computer Modern Typewriter (|cmtt|)
158 % \item Courier (condensed version) (|courier|)
160 % Only Computer Modern Roman, Times Roman and Palatino may be used as a maths
163 % The \package{mdwfonts} package knows about five font families which
164 % documents probably want to use. The available families you can set, with
165 % their names as used by this package, are:
166 % \begin{description}
167 % \item [The body text family] (|body|) is the main font your document uses.
168 % The default body family is Computer Modern Roman.
169 % \item [The maths family] (|maths|) is the font used for mathematics.
170 % The default maths family is the same as the body family.
171 % \item [The sans serif family] (|sans|) is used for sans serif text.
172 % The default sans serif family is Computer Modern Sans.
173 % \item [The headings family] (|head|) is used for headings, if your
174 % document class supports this.\footnote{
175 % The \texttt{\char`\\headfam} command is configured to change to the
176 % chosen headings family. Co-operating document classes should use this
177 % hook when typesetting chapter and section headings, etc.}
178 % Most document classes don't support this, but \package{mdwfonts} patches
179 % the standard \LaTeX\ classes so that they work. The default headings
180 % family is Computer Modern Roman.
181 % \item [The typewriter family] (|tt|) is used for monospaced text. The
182 % default typewriter family is Computer Modern Typewriter.
184 % American users not used to spelling \lit{maths} correctly may use the
185 % alternative spelling \lit{math} instead. If only the rest of \LaTeX\ were
189 % \subsection{Assigning faces to families}
191 % \DescribeMacro\mdwfont
192 % This is fairly simple, really. The |\mdwfont| will attach a typeface to a
193 % given family. The syntax is as follows:
195 % "\\mdwfont" "{" \< <family-name> "=" <face-name> \\ "," \> "}"
197 % For example, saying
199 %\mdwfont{body=palatino, maths=palatino,
200 % sans=helvetica, head=helvetica
203 % uses Palatino for the main body text, and for maths, Helvetica for sans
204 % serif text, and for headings (again, only if your document class supports
207 % The \package{mdwfonts} package also supports a collection of options which
208 % may be passed to the package. The syntax of the package invocation is:
212 % \< \( <face-name> \\ <family-name> "=" <face-name> \) \\ "," \>
218 % A face name on its own configures families sensibly to use that face.
219 % The actual behaviour is as follows:
220 % \begin{description}
221 % \item [times] Set body and maths families to Times Roman.
222 % \item [palatino] Set body and maths families to Palatino.
223 % \item [cmr] Set body, headings and maths families to Computer Modern Roman.
224 % \item [helvetica] Set sans serif and headings families to Helvetica.
225 % \item [cmss] Set sans serif family to Computer Modern Sans.
226 % \item [courier] Set typewriter family to Courier.
227 % \item [cmtt] Set typewriter family to Computer Modern Typewriter.
229 % Astute readers will be able to deduce the author's personal preferences
230 % for assigning typefaces to families from the above rules. However, they
231 % should suffice for most simple configurations. Moreover, the direct
232 % assignment of faces to families is supported in case the above aren't
235 % When \package{mdwfonts} starts up, it reads a file called |mdwfonts.cfg|,
236 % if it exists. This file should set up defaults for the various families
237 % according to the user's preferences. The decisions made by the
238 % configuration file may be overridden by the document, however, since
239 % package options are processed after running |mdwfonts.cfg|.
244 % \section{The package}
251 % \subsection{Options handing}
253 % There are several font choices to be made. These can be made from the
254 % package options or the configuration file; the former takes precedence over
257 % I'll use David Carlisle's rather good \package{keyval} package to handle
258 % this lot because it saves a lot of hassle in the long run.
261 \RequirePackage{keyval}
264 % Now to define how all this actually works. Maintain a variable for each
265 % family that I understand, and a list of which fonts people have expressed
269 \def\mdwf@bodyfont{\mdwf@cmr}
270 \def\mdwf@mathsfont{\mdwf@bodyfont}
271 \def\mdwf@sansfont{\mdwf@cmss}
272 \def\mdwf@headfont{\mdwf@cmr}
273 \def\mdwf@ttfont{\mdwf@cmtt}
276 % Now to define the keys and values which I'll accept.
279 \def\mdwf@set#1#2{\edef#1{\expandafter\noexpand\csname mdwf@#2\endcsname}}
280 \define@key{mdwf}{body}{\mdwf@set\mdwf@bodyfont{#1}}
281 \define@key{mdwf}{maths}{\mdwf@set\mdwf@mathsfont{#1}}
282 \define@key{mdwf}{math}{\mdwf@set\mdwf@mathsfont{#1}}
283 \define@key{mdwf}{sans}{\mdwf@set\mdwf@sansfont{#1}}
284 \define@key{mdwf}{head}{\mdwf@set\mdwf@headfont{#1}}
285 \define@key{mdwf}{tt}{\mdwf@set\mdwf@ttfont{#1}}
288 % Now input the configuration file.
291 \def\mdwfont{\setkeys{mdwf}}
292 \@input{mdwfonts.cfg}
295 % Set up some package options which handle the common cases. Then add
296 % a catch-all option which just gets bundled to \package{keyval}.
299 \DeclareOption{times}{\mdwfont{body=times, maths=times}}
300 \DeclareOption{palatino}{\mdwfont{body=palatino, maths=palatino}}
301 \DeclareOption{cmr}{\mdwfont{body=cmr, maths=cmr, head=cmr}}
302 \DeclareOption{helvetica}{\mdwfont{sans=helvetica, head=helvetica}}
303 \DeclareOption{cmss}{\mdwfont{sans=cmss}}
304 \DeclareOption{courier}{\mdwfont{tt=courier}}
305 \DeclareOption{cmtt}{\mdwfont{tt=cmtt}}
306 \DeclareOption*{\expandafter\mdwfont\expandafter{\CurrentOption}}
310 % Now, if a client wants a really odd setup not provided by the above
311 % interface, it can define |\mdwfonts| to declare its decision.
314 \ifx\mdwfonts\@@undefined\else
315 \def\@tempa#1\@@{\mdwfont{#1}}
316 \expandafter\@tempa\mdwfonts\@@
321 % \subsection{Setting up the actual fonts}
323 % \begin{macro}{\mdwf@iffont}
325 % I need to check whether a font's been used. This macro will help.
327 % First, I'll define some numeric values for various fonts.
332 \expandafter\chardef\csname mdwf@#1\endcsname\count@%
335 \@tempa{cmr}\@tempa{cmss}\@tempa{cmtt}
336 \@tempa{times}\@tempa{palatino}\@tempa{helvetica}\@tempa{courier}
339 % And now to check whether a font is being used. This is rather horrible.
342 \def\mdwf@iffont#1{\if1%
343 \ifnum\mdwf@bodyfont=#11\else%
344 \ifnum\mdwf@headfont=#11\else%
345 \ifnum\mdwf@sansfont=#11\else%
346 \ifnum\mdwf@ttfont=#11\else0%
353 % \subsubsection{Text fonts}
355 % \paragraph{Courier}
356 % The courier family is redefined in its entirety here. I use the condensed
357 % courier provided by David Carlisle's \package{pslatex} package, although
358 % I've extended it to cover all the shapes and not just medium roman.
360 \mdwf@iffont\mdwf@courier
361 \DeclareFontFamily{OT1}{pcr}{\hyphenchar\font=-1}
362 \DeclareFontShape{OT1}{pcr}{b}{n}{<-> pcrb7tn}{}
363 \DeclareFontShape{OT1}{pcr}{b}{sc}{<-> pcrbc7tn}{}
364 \DeclareFontShape{OT1}{pcr}{b}{sl}{<-> pcrbo7tn}{}
365 \DeclareFontShape{OT1}{pcr}{m}{n}{<-> pcrr7tn}{}
366 \DeclareFontShape{OT1}{pcr}{m}{sc}{<-> pcrrc7tn}{}
367 \DeclareFontShape{OT1}{pcr}{m}{sl}{<-> pcrro7tn}{}
368 \DeclareFontShape{OT1}{pcr}{bx}{n}{<->ssub * pcr/b/n}{}
369 \DeclareFontShape{OT1}{pcr}{bx}{sc}{<->ssub * pcr/b/sc}{}
370 \DeclareFontShape{OT1}{pcr}{bx}{sl}{<->ssub * pcr/b/sl}{}
371 \DeclareFontShape{OT1}{pcr}{b}{it}{<->ssub * pcr/b/sl}{}
372 \DeclareFontShape{OT1}{pcr}{bx}{it}{<->ssub * pcr/b/it}{}
373 \DeclareFontShape{OT1}{pcr}{m}{it}{<->ssub * pcr/m/sl}{}
374 \DeclareFontFamily{T1}{pcr}{\hyphenchar\font=-1}
375 \DeclareFontShape{T1}{pcr}{b}{n}{<-> pcrb8tn}{}
376 \DeclareFontShape{T1}{pcr}{b}{sc}{<-> pcrbc8tn}{}
377 \DeclareFontShape{T1}{pcr}{b}{sl}{<-> pcrbo8tn}{}
378 \DeclareFontShape{T1}{pcr}{m}{n}{<-> pcrr8tn}{}
379 \DeclareFontShape{T1}{pcr}{m}{sc}{<-> pcrrc8tn}{}
380 \DeclareFontShape{T1}{pcr}{m}{sl}{<-> pcrro8tn}{}
381 \DeclareFontShape{T1}{pcr}{bx}{n}{<->ssub * pcr/b/n}{}
382 \DeclareFontShape{T1}{pcr}{bx}{sc}{<->ssub * pcr/b/sc}{}
383 \DeclareFontShape{T1}{pcr}{bx}{sl}{<->ssub * pcr/b/sl}{}
384 \DeclareFontShape{T1}{pcr}{b}{it}{<->ssub * pcr/b/sl}{}
385 \DeclareFontShape{T1}{pcr}{bx}{it}{<->ssub * pcr/b/it}{}
386 \DeclareFontShape{T1}{pcr}{m}{it}{<->ssub * pcr/m/sl}{}
390 % \paragraph{Helvetica}
391 % Again the whole of helvetica is defined here, this time so that the font
392 % can be scaled a little.
394 \mdwf@iffont\mdwf@helvetica
395 \DeclareFontFamily{OT1}{phv}{}
396 \DeclareFontShape{OT1}{phv}{b}{n}{<-> s * [.9] phvb7t}{}
397 \DeclareFontShape{OT1}{phv}{b}{sc}{<-> s * [.9] phvbc7t}{}
398 \DeclareFontShape{OT1}{phv}{b}{sl}{<-> s * [.9] phvbo7t}{}
399 \DeclareFontShape{OT1}{phv}{bc}{n}{<-> s * [.9] phvbrn7t}{}
400 \DeclareFontShape{OT1}{phv}{bc}{sc}{<-> s * [.9] phvbcn7t}{}
401 \DeclareFontShape{OT1}{phv}{bc}{sl}{<-> s * [.9] phvbon7t}{}
402 \DeclareFontShape{OT1}{phv}{m}{n}{<-> s * [.9] phvr7t}{}
403 \DeclareFontShape{OT1}{phv}{m}{sc}{<-> s * [.9] phvrc7t}{}
404 \DeclareFontShape{OT1}{phv}{m}{sl}{<-> s * [.9] phvro7t}{}
405 \DeclareFontShape{OT1}{phv}{mc}{n}{<-> s * [.9] phvrrn7t}{}
406 \DeclareFontShape{OT1}{phv}{mc}{sc}{<-> s * [.9] phvrcn7t}{}
407 \DeclareFontShape{OT1}{phv}{mc}{sl}{<-> s * [.9] phvron7t}{}
408 \DeclareFontShape{OT1}{phv}{bx}{n}{<->ssub * phv/b/n}{}
409 \DeclareFontShape{OT1}{phv}{bx}{sc}{<->ssub * phv/b/sc}{}
410 \DeclareFontShape{OT1}{phv}{bx}{sl}{<->ssub * phv/b/sl}{}
411 \DeclareFontShape{OT1}{phv}{b}{it}{<->ssub * phv/b/sl}{}
412 \DeclareFontShape{OT1}{phv}{bx}{it}{<->ssub * phv/b/it}{}
413 \DeclareFontShape{OT1}{phv}{bc}{it}{<->ssub * phv/bc/sl}{}
414 \DeclareFontShape{OT1}{phv}{m}{it}{<->ssub * phv/m/sl}{}
415 \DeclareFontShape{OT1}{phv}{mc}{it}{<->ssub * phv/mc/sl}{}
416 \DeclareFontFamily{T1}{phv}{}
417 \DeclareFontShape{T1}{phv}{b}{n}{<-> s * [.9] phvb8t}{}
418 \DeclareFontShape{T1}{phv}{b}{sc}{<-> s * [.9] phvbc8t}{}
419 \DeclareFontShape{T1}{phv}{b}{sl}{<-> s * [.9] phvbo8t}{}
420 \DeclareFontShape{T1}{phv}{bc}{n}{<-> s * [.9] phvbrn8t}{}
421 \DeclareFontShape{T1}{phv}{bc}{sc}{<-> s * [.9] phvbcn8t}{}
422 \DeclareFontShape{T1}{phv}{bc}{sl}{<-> s * [.9] phvbon8t}{}
423 \DeclareFontShape{T1}{phv}{m}{n}{<-> s * [.9] phvr8t}{}
424 \DeclareFontShape{T1}{phv}{m}{sc}{<-> s * [.9] phvrc8t}{}
425 \DeclareFontShape{T1}{phv}{m}{sl}{<-> s * [.9] phvro8t}{}
426 \DeclareFontShape{T1}{phv}{mc}{n}{<-> s * [.9] phvrrn8t}{}
427 \DeclareFontShape{T1}{phv}{mc}{sc}{<-> s * [.9] phvrcn8t}{}
428 \DeclareFontShape{T1}{phv}{mc}{sl}{<-> s * [.9] phvron8t}{}
429 \DeclareFontShape{T1}{phv}{bx}{n}{<->ssub * phv/b/n}{}
430 \DeclareFontShape{T1}{phv}{bx}{sc}{<->ssub * phv/b/sc}{}
431 \DeclareFontShape{T1}{phv}{bx}{sl}{<->ssub * phv/b/sl}{}
432 \DeclareFontShape{T1}{phv}{b}{it}{<->ssub * phv/b/sl}{}
433 \DeclareFontShape{T1}{phv}{bx}{it}{<->ssub * phv/b/it}{}
434 \DeclareFontShape{T1}{phv}{bc}{it}{<->ssub * phv/bc/sl}{}
435 \DeclareFontShape{T1}{phv}{m}{it}{<->ssub * phv/m/sl}{}
436 \DeclareFontShape{T1}{phv}{mc}{it}{<->ssub * phv/mc/sl}{}
440 % \paragraph{Palatino}
441 % Might as well define palatino too, for completeness' sake.
443 \mdwf@iffont\mdwf@palatino
444 \DeclareFontFamily{OT1}{ppl}{}
445 \DeclareFontShape{OT1}{ppl}{b}{n}{<-> pplb7t}{}
446 \DeclareFontShape{OT1}{ppl}{b}{sc}{<-> pplbc7t}{}
447 \DeclareFontShape{OT1}{ppl}{b}{sl}{<-> pplbo7t}{}
448 \DeclareFontShape{OT1}{ppl}{b}{it}{<-> pplbi7t}{}
449 \DeclareFontShape{OT1}{ppl}{m}{n}{<-> pplr7t}{}
450 \DeclareFontShape{OT1}{ppl}{m}{sc}{<-> pplrc7t}{}
451 \DeclareFontShape{OT1}{ppl}{m}{sl}{<-> pplro7t}{}
452 \DeclareFontShape{OT1}{ppl}{m}{it}{<-> pplri7t}{}
453 \DeclareFontShape{OT1}{ppl}{bx}{n}{<->ssub * ppl/b/n}{}
454 \DeclareFontShape{OT1}{ppl}{bx}{sc}{<->ssub * ppl/b/sc}{}
455 \DeclareFontShape{OT1}{ppl}{bx}{sl}{<->ssub * ppl/b/sl}{}
456 \DeclareFontShape{OT1}{ppl}{bx}{it}{<->ssub * ppl/b/it}{}
457 \DeclareFontShape{OT1}{ppl}{l}{n}{<->ssub * ppl/m/n}{}
458 \DeclareFontShape{OT1}{ppl}{l}{sc}{<->ssub * ppl/m/sc}{}
459 \DeclareFontShape{OT1}{ppl}{l}{sl}{<->ssub * ppl/m/sl}{}
460 \DeclareFontShape{OT1}{ppl}{l}{it}{<->ssub * ppl/m/it}{}
461 \DeclareFontFamily{T1}{ppl}{}
462 \DeclareFontShape{T1}{ppl}{b}{n}{<-> pplb8t}{}
463 \DeclareFontShape{T1}{ppl}{b}{sc}{<-> pplbc8t}{}
464 \DeclareFontShape{T1}{ppl}{b}{sl}{<-> pplbo8t}{}
465 \DeclareFontShape{T1}{ppl}{b}{it}{<-> pplbi8t}{}
466 \DeclareFontShape{T1}{ppl}{m}{n}{<-> pplr8t}{}
467 \DeclareFontShape{T1}{ppl}{m}{sc}{<-> pplrc8t}{}
468 \DeclareFontShape{T1}{ppl}{m}{sl}{<-> pplro8t}{}
469 \DeclareFontShape{T1}{ppl}{m}{it}{<-> pplri8t}{}
470 \DeclareFontShape{T1}{ppl}{bx}{n}{<->ssub * ppl/b/n}{}
471 \DeclareFontShape{T1}{ppl}{bx}{sc}{<->ssub * ppl/b/sc}{}
472 \DeclareFontShape{T1}{ppl}{bx}{sl}{<->ssub * ppl/b/sl}{}
473 \DeclareFontShape{T1}{ppl}{bx}{it}{<->ssub * ppl/b/it}{}
474 \DeclareFontShape{T1}{ppl}{l}{n}{<->ssub * ppl/m/n}{}
475 \DeclareFontShape{T1}{ppl}{l}{sc}{<->ssub * ppl/m/sc}{}
476 \DeclareFontShape{T1}{ppl}{l}{sl}{<->ssub * ppl/m/sl}{}
477 \DeclareFontShape{T1}{ppl}{l}{it}{<->ssub * ppl/m/it}{}
482 % Finally, times, for those who like it\dots
484 \mdwf@iffont\mdwf@times
485 \DeclareFontFamily{OT1}{ptm}{}
486 \DeclareFontShape{OT1}{ptm}{b}{n}{<-> ptmb7t}{}
487 \DeclareFontShape{OT1}{ptm}{b}{sc}{<-> ptmbc7t}{}
488 \DeclareFontShape{OT1}{ptm}{b}{sl}{<-> ptmbo7t}{}
489 \DeclareFontShape{OT1}{ptm}{b}{it}{<-> ptmbi7t}{}
490 \DeclareFontShape{OT1}{ptm}{m}{n}{<-> ptmr7t}{}
491 \DeclareFontShape{OT1}{ptm}{m}{sc}{<-> ptmrc7t}{}
492 \DeclareFontShape{OT1}{ptm}{m}{sl}{<-> ptmro7t}{}
493 \DeclareFontShape{OT1}{ptm}{m}{it}{<-> ptmri7t}{}
494 \DeclareFontShape{OT1}{ptm}{bx}{n}{<->ssub * ptm/b/n}{}
495 \DeclareFontShape{OT1}{ptm}{bx}{sc}{<->ssub * ptm/b/sc}{}
496 \DeclareFontShape{OT1}{ptm}{bx}{sl}{<->ssub * ptm/b/sl}{}
497 \DeclareFontShape{OT1}{ptm}{bx}{it}{<->ssub * ptm/b/it}{}
498 \DeclareFontShape{OT1}{ptm}{l}{n}{<->ssub * ptm/m/n}{}
499 \DeclareFontShape{OT1}{ptm}{l}{sc}{<->ssub * ptm/m/sc}{}
500 \DeclareFontShape{OT1}{ptm}{l}{sl}{<->ssub * ptm/m/sl}{}
501 \DeclareFontShape{OT1}{ptm}{l}{it}{<->ssub * ptm/m/it}{}
502 \DeclareFontFamily{T1}{ptm}{}
503 \DeclareFontShape{T1}{ptm}{b}{n}{<-> ptmb8t}{}
504 \DeclareFontShape{T1}{ptm}{b}{sc}{<-> ptmbc8t}{}
505 \DeclareFontShape{T1}{ptm}{b}{sl}{<-> ptmbo8t}{}
506 \DeclareFontShape{T1}{ptm}{b}{it}{<-> ptmbi8t}{}
507 \DeclareFontShape{T1}{ptm}{m}{n}{<-> ptmr8t}{}
508 \DeclareFontShape{T1}{ptm}{m}{sc}{<-> ptmrc8t}{}
509 \DeclareFontShape{T1}{ptm}{m}{sl}{<-> ptmro8t}{}
510 \DeclareFontShape{T1}{ptm}{m}{it}{<-> ptmri8t}{}
511 \DeclareFontShape{T1}{ptm}{bx}{n}{<->ssub * ptm/b/n}{}
512 \DeclareFontShape{T1}{ptm}{bx}{sc}{<->ssub * ptm/b/sc}{}
513 \DeclareFontShape{T1}{ptm}{bx}{sl}{<->ssub * ptm/b/sl}{}
514 \DeclareFontShape{T1}{ptm}{bx}{it}{<->ssub * ptm/b/it}{}
515 \DeclareFontShape{T1}{ptm}{l}{n}{<->ssub * ptm/m/n}{}
516 \DeclareFontShape{T1}{ptm}{l}{sc}{<->ssub * ptm/m/sc}{}
517 \DeclareFontShape{T1}{ptm}{l}{sl}{<->ssub * ptm/m/sl}{}
518 \DeclareFontShape{T1}{ptm}{l}{it}{<->ssub * ppl/m/it}{}
522 % \subsubsection{Maths fonts}
524 % \paragraph{Palatino}
527 \ifnum\mdwf@mathsfont=\mdwf@palatino
528 \DeclareSymbolFont{operators} {OT1}{pplcm}{m}{n}
529 \DeclareSymbolFont{letters} {OML}{pplcm}{m}{it}
530 \DeclareSymbolFont{bold} {OT1}{ppl}{bx}{n}
531 \DeclareSymbolFont{italic} {OT1}{ppl}{m}{it}
532 \DeclareSymbolFontAlphabet{\mathit}{italic}
539 \ifnum\mdwf@mathsfont=\mdwf@times
540 \DeclareSymbolFont{operators} {OT1}{ptmcm}{m}{n}
541 \DeclareSymbolFont{letters} {OML}{ptmcm}{m}{it}
542 \DeclareSymbolFont{bold} {OT1}{ptm}{bx}{n}
543 \DeclareSymbolFont{italic} {OT1}{ptm}{m}{it}
544 \DeclareSymbolFontAlphabet{\mathit}{italic}
548 % \paragraph{Computer Modern}
549 % Silliness required.
551 \ifnum\mdwf@mathsfont=\mdwf@cmr
552 \DeclareSymbolFont{operators} {OT1}{cmr}{m}{n}
553 \DeclareSymbolFont{letters} {OML}{cmr}{m}{it}
554 \DeclareSymbolFont{bold} {OT1}{cmr}{bx}{n}
555 \DeclareSymbolFont{italic} {OT1}{cmr}{m}{it}
556 \DeclareSymbolFontAlphabet{\mathit}{italic}
560 % \paragraph{General PostScript things}
561 % Set up the symbols and large symbols fonts. This lot is all from
564 \if1\ifnum\mdwf@mathsfont=\mdwf@times1\else
565 \ifnum\mdwf@mathsfont=\mdwf@palatino1\else0\fi\fi
566 \DeclareSymbolFont{symbols} {OMS}{pzccm}{m}{n}
567 \DeclareSymbolFont{largesymbols}{OMX}{psycm}{m}{n}
569 % Adjust the spacing around operators and things to fit PostScript fonts
573 \medmuskip=2.5mu plus 1mu minus 1mu
574 \thickmuskip=4mu plus 1.5mu minus 1mu
576 % There isn't a bold symbol font.
579 \@warning{there is no bold Symbol font}%
580 \global\let\boldmath=\relax
583 % Provide an |\omicron| character. No idea why\dots
585 \DeclareMathSymbol{\omicron}{0}{operators}{`\o}
587 % Make scripts a bit bigger.
589 \DeclareMathSizes{5}{5}{5}{5}
590 \DeclareMathSizes{6}{6}{5}{5}
591 \DeclareMathSizes{7}{7}{5}{5}
592 \DeclareMathSizes{8}{8}{6}{5}
593 \DeclareMathSizes{9}{9}{7}{5}
594 \DeclareMathSizes{10}{10}{7.4}{6}
595 \DeclareMathSizes{10.95}{10.95}{8}{6}
596 \DeclareMathSizes{12}{12}{9}{7}
597 \DeclareMathSizes{14.4}{14.4}{10.95}{8}
598 \DeclareMathSizes{17.28}{17.28}{12}{10}
599 \DeclareMathSizes{20.74}{20.74}{14.4}{12}
600 \DeclareMathSizes{24.88}{24.88}{17.28}{14.4}
602 % Redefine the standard font for the symbols encoding.
604 \DeclareFontSubstitution{OMS}{pzccm}{m}{n}
609 % \subsection{Setting the font families}
611 % First, define the family names for everything.
618 \def\mdwf@palatino{ppl}
619 \def\mdwf@helvetica{phv}
620 \def\mdwf@courier{pcr}
623 % Now assign families to the various variables.
626 \edef\rmdefault{\mdwf@bodyfont}
627 \edef\sfdefault{\mdwf@sansfont}
628 \edef\ttdefault{\mdwf@ttfont}
629 \edef\headdefault{\mdwf@headfont}
632 % Set various maths families.
635 \def\mdwf@mathsfam#1#2#3{%
636 \edef\@tempa{\noexpand\DeclareMathAlphabet{\noexpand#1}{#2}{#3}}%
639 \DeclareSymbolFontAlphabet{\mathit}{italic}
640 \DeclareSymbolFontAlphabet{\mathrm}{operators}
641 \DeclareSymbolFontAlphabet{\mathbf}{bold}
642 \mdwf@mathsfam{\mathsf}{OT1}{\sfdefault}{m}{n}
643 \mdwf@mathsfam{\mathtt}{OT1}{\ttdefault}{m}{n}
646 % Finally, set |\headfam| nicely.
649 \def\headfam{\fontfamily\headdefault\selectfont}
652 % \subsection{Clobber standard packages}
654 % Now, if I recognise this document class, patch it until it accepts
655 % |\headfam| correctly. This stuff isn't terribly pleasant, but I don't
658 % First see if I'm in familiar territory.
663 \if1\ifx\ver@article.cls\@@undefined
664 \ifx\ver@report.cls\@@undefined
665 \ifx\ver@book.cls\@@undefined
666 \ifx\ver@amsart.cls\@@undefined
667 \ifx\ver@amsproc.cls\@@undefined
668 \ifx\ver@amsbook.cls\@@undefined0%
677 % Looks like it. Now to patch the |\@startsection|-based commands. I'll
678 % redefine |\@startsection| to do the atching for me, and then just run
679 % all the commands which want patching.
682 \def\@startsection#1#2#3#4#5#6#7{%
683 \gdef#7{\@startsection{#1}{#2}{#3}{#4}{#5}{#6\headfam}}%
686 \subsection\subsection
687 \subsubsection\subsubsection
689 \subparagraph\subparagraph
690 \if1\ifx\ver@amsart.cls\@@undefined\ifx\ver@amsproc.cls\@@undefined0%
696 % Now for the difficult bits. Firstly, deal with part headings for normal
700 \long\def\mdwf@grab#1{\expandafter\mdwf@grab@i#1\@@delim}
701 \long\def\mdwf@grab@i#1\@@delim#2{#2{#1}}
702 \def\mdwf@patch@opt#1{\mdwf@grab{#1[##1]{##2}}\mdwf@patch@opt@i#1}
703 \long\def\mdwf@patch@opt@i#1#2{\gdef#2[##1]##2{%
704 \let\mdwf@@bfseries\bfseries\def\bfseries{\headfam\mdwf@@bfseries}%
706 \let\bfseries\mdwf@@bfseries%
708 \def\mdwf@patch#1{\mdwf@grab{#1{##1}}\mdwf@patch@i#1}
709 \long\def\mdwf@patch@i#1#2{\gdef#2##1{%
710 \let\mdwf@@bfseries\bfseries\def\bfseries{\headfam\mdwf@@bfseries}%
712 \let\bfseries\mdwf@@bfseries%
714 \if0\ifx\ver@amsart.cls\@@undefined\ifx\ver@amsproc.cls\@@undefined0%
716 \mdwf@patch@opt\@part
719 \ifx\@makechapterhead\@@undefined\else
720 \mdwf@patch\@makechapterhead
721 \mdwf@patch\@makeschapterhead
730 % That's it for the package.
737 % \section{Font installation script}
739 % If you're lucky you'll never need to use this.
746 % Firstly, some code for building squashed courier fonts.
749 \def\squashcourier#1{%
750 \transformfont{pcr#18rn}{%
752 \reencodefont{8r}{\fromafm{pcr#18a}}}}}
759 % Now start installing fonts.
765 % Start with the courier ones.
768 \installfont{pcrb7tn}{pcrb8rn,psyr,latin}{OT1tt}{OT1}{pcr}{b}{n}{}
769 \installfont{pcrb8tn}{pcrb8rn,psyr,latin}{T1}{T1}{pcr}{b}{n}{}
770 \installfont{pcrbc7tn}{pcrb8rn,psyr,latin}{OT1ctt}{OT1}{pcr}{b}{sc}{}
771 \installfont{pcrbc8tn}{pcrb8rn,psyr,latin}{T1c}{T1}{pcr}{b}{sc}{}
772 \installfont{pcrbo7tn}{pcrbo8rn,psyr,latin}{OT1tt}{OT1}{pcr}{b}{sl}{}
773 \installfont{pcrbo8tn}{pcrbo8rn,psyr,latin}{T1}{T1}{pcr}{b}{sl}{}
774 \installfont{pcrr7tn}{pcrr8rn,psyr,latin}{OT1tt}{OT1}{pcr}{m}{n}{}
775 \installfont{pcrr8tn}{pcrr8rn,psyr,latin}{T1}{T1}{pcr}{m}{n}{}
776 \installfont{pcrrc7tn}{pcrr8rn,psyr,latin}{OT1ctt}{OT1}{pcr}{m}{sc}{}
777 \installfont{pcrrc8tn}{pcrr8rn,psyr,latin}{T1c}{T1}{pcr}{m}{sc}{}
778 \installfont{pcrro7tn}{pcrro8rn,psyr,latin}{OT1tt}{OT1}{pcr}{m}{sl}{}
779 \installfont{pcrro8tn}{pcrro8rn,psyr,latin}{T1}{T1}{pcr}{m}{sl}{}
782 % Now build palatino-based maths fonts. This lot seems to work. It's based
783 % on \package{mathptm}, and hacked a bit.
786 \installfamily{OT1}{pplcm}{}
787 \installfamily{OML}{pplcm}{\skewchar\font=127}
788 \transformfont{pplr8r}{\reencodefont{8r}{\fromafm{pplr8a}}}
789 \transformfont{pplri8r}{\reencodefont{8r}{\fromafm{pplri8a}}}
790 \transformfont{pzcmi8r}{\reencodefont{8r}{\fromafm{pzcmi8a}}}
791 \installfont{zpplcmr}
792 {pplr8r,psyr,latin,zrhax,kernoff,cmr10}
793 {OT1}{OT1}{pplcm}{m}{n}{}
794 \installfont{zpplcmrm}
795 {kernoff,cmmi10,kernon,unsetalf,unsetnum,pplri8r,psyr,mathit,zrmhax,kernoff,cmmi10}
796 {OML}{OML}{pplcm}{m}{it}{}
807 % But it's not over yet. For some reason, I don't have `|ot1tt.etx|' in my
808 % distribution. Here's one which ought to do.
813 % OT1tt.etx -- install an OT1-encoded typewriter font
821 % And again, for `|ot1ctt.etx|'.
826 % OT1tt.etx -- install an OT1-encoded typewriter font
834 % Before I leave this section, I'll just write out the appropriate magical
835 % definitions for the DVIPS |psfonts.map| file.
839 pcrb8rn Courier-Bold ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
840 pcrbo8rn Courier-BoldOblique ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
841 pcrr8rn Courier ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
842 pcrro8rn Courier-Oblique ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc
847 % \section{Description file for courier}
849 % Here's a short |.fd| file for the squashed courier font which makes it
850 % work in my `|mTT|' encoding.
854 \DeclareFontFamily{mTT}{pcr}{\hyphenchar\font=-1}
855 \DeclareFontShape{mTT}{pcr}{b}{n}{<-> pcrb7tn}{}
856 \DeclareFontShape{mTT}{pcr}{b}{sc}{<-> pcrbc7tn}{}
857 \DeclareFontShape{mTT}{pcr}{b}{sl}{<-> pcrbo7tn}{}
858 \DeclareFontShape{mTT}{pcr}{m}{n}{<-> pcrr7tn}{}
859 \DeclareFontShape{mTT}{pcr}{m}{sc}{<-> pcrrc7tn}{}
860 \DeclareFontShape{mTT}{pcr}{m}{sl}{<-> pcrro7tn}{}
861 \DeclareFontShape{mTT}{pcr}{bx}{n}{<->ssub * pcr/b/n}{}%
862 \DeclareFontShape{mTT}{pcr}{bx}{sc}{<->ssub * pcr/b/sc}{}%
863 \DeclareFontShape{mTT}{pcr}{bx}{sl}{<->ssub * pcr/b/sl}{}%
864 \DeclareFontShape{mTT}{pcr}{b}{it}{<->ssub * pcr/b/sl}{}%
865 \DeclareFontShape{mTT}{pcr}{bx}{it}{<->ssub * pcr/b/it}{}%
866 \DeclareFontShape{mTT}{pcr}{m}{it}{<->ssub * pcr/m/sl}{}%
873 % \hfill Mark Wooding, \today