summaryrefslogtreecommitdiff
path: root/fonts/malvern/doc/cmdoc.tex
blob: b9e1fdc6cf72c39b841e9dc54f1598d11116ce3f (plain)
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
% cmdoc.tex 1.1.9 1994/07/20 -- sets up for general docs
% Copyright  1991-4 P. Damian Cugley.

%%% @TeX-macro-file {
%%%   filename       = "cmdoc.tex",
%%%   version        = "1.1.9",
%%%   date           = "1994/07/20",
%%%   package        = "Malvern 1.1",
%%%   author         = "P. Damian Cugley",
%%%   email          = "damian.cugley@comlab.ox.ac.uk",
%%%   address        = "Oxford University Computing Laboratory,
%%%                     Parks Road, Oxford  OX1 3QD, UK",
%%%   codetable      = "USASCII",
%%%   keywords       = "TeX, plain TeX, style file",
%%%   supported      = "Maybe",
%%%   abstract       = "Top-level macro file for documents in
%%%			Computer Modern fonts.",
%%%   dependencies   = "other program files",
%%% }

%{{{ cmdoc.tex
\begingroup\catcode`\%=12 \toks0={\endgroup
    \def\docversion{1.1.9 <pdc 1994/07/20>}
}\the\toks0
\message{\docversion}

\input pdcimth
\input pdcmigr
\input pdcpars
\input pdcfmt
\input pdchyex
\input pdcoput
\input pdcfsel

% Comment out following 1 line for TeX 2.x:
\errorcontextlines=100 

%  Ensure top/bot margins large enough to fit headlines on
%  even if printed on American paper:
\topmarge=297mm \advance\topmarge-11in \advance\topmarge7mm
\botmarge=\topmarge
\advance\topmarge\ht\strutbox \advance\topmarge\headlineskip
\ifdim \topmarge<20mm \topmarge=20mm \fi
\ifdim \botmarge<27mm \botmarge=27mm \fi

\setpaper{210mm}{297mm}

\hyphenpenalty=200
\exhyphenpenalty=100

%{{{  layout

\setnkgrid{4}{3}
\leftmargin=\gridwd \advance\leftmargin\colsep
\everypage={\ifdim\leftmargin>0pt \setbox\leftbox=\hbox to \gridwd{}\fi}
\colrule=0pt

\everyfootnote={\notefonts}
\everylinenum={\smallfonts}
\everytag={\bf}

%}}}
%{{{  fonts

\autoloadfonts

\def\HEADINGtemplate
{%
    \f{rm}{cmss}\f{mi}{eurb}\f{sy}{eusb}%
    \f{it}{cmssi}\f{tt}{cmtt}\f{mf}{logo}\f{mfi}{logosl}%
}

\font\headingrm=cmss17 \font\headingit=cmssi17
\fontset{subheading}\HEADINGtemplate{10 scaled 1200}{14pt}
	{subheading}{subheading}
\fontset{heading}\HEADINGtemplate{10 scaled 1728}{20pt}
	{subheading}{subheading}

\def\BODYtemplate
{%
    \m{rm}{cmr}\m{it}{cmti}%
    \m{bf}{cmbx}\@\f{bi}{cmbxti10}%
    \m{mi}{cmmi}\m{sy}{cmsy}%
    \@\f{mf}{logo10}\@\f{mfi}{logosl10}%
    \f{tt}{cmtt}\@\f{tb}{cmsltt10}%
}

\font\bodysy=cmsy10 at 12pt

\fontset{tiny}\BODYtemplate{7}{9pt}{tiny}{tiny}
\fontset{small}\BODYtemplate{9}{11pt}{tiny}{tiny}
\fontset{note}\BODYtemplate{10}{12pt}{tiny}{tiny}
\fontset{body}\BODYtemplate{12}{14pt}{small}{tiny}

\def\everyloadfont#1#2{\fontdimen3#1=0pt \fontdimen4#1=0pt}
\rightskip=0pt plus 2em
\bodyfonts
\tolerance=1000

\let\sc=\relax
\let\csc=\relax
\let\mc=\relax
\let\n=\relax

%}}}
%{{{  malvern maths

\mathcode`,="602C

%}}}
%{{{  TOC

\newwrite\TOCfile
\openout\TOCfile=\jobname.toc

%  #1 is \TOCentryfoo control sequence
%  #2 is stuff to be evaluated NOW -- e.g., section number
%  #3 is stuff to be evaluated WHEN PRINTED -- e.g., section title
%  folio is written after this in file
\def\TOCwrite#1#2#3%
{%
    \def\tmp{#3}%
    \edef\tmp{\string#1{#2}{\expandafter\TOCtrim\meaning\tmp}}
    \write\TOCfile\expandafter{\tmp{\folio}}
}
\def\TOCtrim#1:->{}		% strip off "macro:->"

\def\TOCentrypart#1#2#3%
{
    \smallskip
    \dimen0=\hsize \advance\dimen0\leftmargin
    \moveleft\leftmargin\hbox to\dimen0{\strut\bf #1. #2\hfil}
    \smallskip
}

\def\TOCentrysection#1#2#3%
{
    \smallskip\noindent\llap{#1\quad}%
	{\bf \ignorespaces #2\quad\rm \n{#3}}\par
}

\def\TOCentrysubsec#1#2#3%
{
    \noindent{#1\enspace}{\ignorespaces #2\quad\rm \n{#3}}\par
}

\def\TOCentrysubsubsec#1#2#3%
{
    \indent\indent\llap{#1\enspace}{\ignorespaces #2\quad\rm \n{#3}}\par
}

%}}}
%{{{  sectioning

%  sections run continuously
%  divisions start new page but do not reset section counters

\newcount\partno
\def\thepartno
{%
    \ifcase\partno O\or I\or II\or III\or IV\or V\else
	\expandafter\uppercase\expandafter{\romannumeral\partno}%
    \fi
}
\def\part#1%
{%
    \global\advance\partno1
    \newpageheading{2\baselineskip}{\headingfonts}{}{\thepartno.\quad#1}
    \TOCwrite\TOCentrypart{\thepartno}{#1}
}

\newcount\secno \newcount\subsecno \newcount\subsubsecno

\def\thesecno
{%
    \n{%
	\number\secno
	\ifnum\subsecno>0 
	    .\number\subsecno
	    \ifnum\subsubsecno>0
		.\number\subsubsecno
	    \fi
	\fi
    }%
}

\def\sectionheading#1 \par{\dosectionheading{#1}}
\def\dosectionheading#1%
{
    \par
    \removelastskip
    \vskip 0pt plus 0.3\vsize 
    \penalty-200
    \vskip 1\bigskipamount plus -0.3\vsize
    \begingroup \advance\leftskip-\leftmargin
	\parskip=0pt \parindent=0pt
	\hyphenpenalty=10000 \exhyphenpenalty=500 
	\interlinepenalty=100
	\headingfonts
	\hbox{\hskip-\leftmargin 
		\vrule height 2pt depth 0pt width \leftmargin
		\vrule height 2pt depth 0pt width \hsize}
	\nobreak\medskip
        \enspace#1\par
	\nobreak\smallskip
    \endgroup
}

\def\section#1 \par
{
    \counta=\secno \advance\counta1
    \mark{\thesecno \noexpand\else \n{\number\counta}}% OLD \else NEW
    \global\secno=\counta \global\subsecno=0 \global\subsubsecno=0
    \dosectionheading{\thesecno\quad #1}
    \mark{\thesecno \noexpand\else \thesecno}% NEW \else NEW
    \TOCwrite\TOCentrysection{\thesecno}{#1}
}

\def\subsec#1 \par
{%
    \counta=\subsecno \advance\counta1
    \mark{\thesecno \noexpand\else \n{\number\secno.\number\counta}}
    \global\subsecno=\counta  \global\subsubsecno=0
    \doheading\medskipamount{\subheadingfonts}{}{\thesecno\quad#1}
    \mark{\thesecno \noexpand\else \thesecno}
    \TOCwrite\TOCentrysubsec{\thesecno}{#1}
}

\def\subsubsec#1 \par
{%
    \global\advance\subsubsecno+1
    \doheading\smallskipamount{}{}{\ifdim\leftmargin=0pt\thesecno\quad\fi#1}	
    \TOCwrite\TOCentrysubsubsec{\thesecno}{#1}
}

\newif\ifnoheader
\newif\iftwosided

\footline={%
    \ifnoheader 
	\global\noheaderfalse
	\hfil\bodyfonts\n\folio\hfil 
    \else
	\hfil
    \fi
}

\headline={%
    \ifnoheader
	\hfil
    \else
	\bodyfonts \hskip-\leftmargin
	\iftwosided
	    \ifodd\pageno
		\iftrue\botmark\fi
		\hfil 
		{\bf\n\folio}%
	    \else
		{\bf\n\folio}\quad
		\hfil
		\expandafter\iffalse\topmark\fi
	    \fi
	\else
	    \expandafter\iffalse\topmark\fi
	    \hfil 
	    {\bf\n\folio}%
	\fi
    \fi
}

%}}}
%{{{  abbrevs

\def\pt{\,{\rm pt}}
\def\mm{\,{\rm mm}}

\def\MF{{\ifdim\fontdimen1\font>0pt \mfi \else \mf \fi META}\-%
	{\ifdim\fontdimen1\font>0pt \mfi \else \mf \fi FONT}}
\def\MSDOS{\leavevmode\hbox{MS-DOS}}
\def\PS{PostScript}

{\plain|
\gdef\dfn#1{\index{#1|idxunderline}{\bi #1}}
}

\def\<#1>{\leavevmode\hbox{\langle{\it#1\/}\rangle}} 

\active\* \def*#1*{{\it#1\/}}
\append\verbatimplains\*

%  _xxx_ is xxx as typed by user to a program.
\active\_
\def_%    _xxx_ is bold verbatim text
{%
    \ifmmode
	\sb
    \else
	\begingroup		% matched by closing _
	\tb\setupverbatim
  	\plain\|\active\_%
	\let_\endgroup
    \fi
}

%}}}
%}}} cmdoc.tex

%Local variables:
%fold-folded-p: t
%tex-macros-p: t
%End: