summaryrefslogtreecommitdiff
path: root/fonts/malvern/doc/pdcpars.tex
blob: cc945db6a5046bf7922a68581af5eb9a023ebdee (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
%{{{ pdcpars.tex 1.1.9 1994/06/23 -- Misc paragraph macros
%  Copyright (c) 1991-1994 Damian Cugley.
\begingroup\catcode`\%=12 \toks0={\endgroup
	\gdef\version{1.1.9} \gdef\lastedit{pdc 1994/06/23}
}\the\toks0
\message{\version\space \lastedit}
\ifx\utilsversion\UNDEFINED \input pdcutil \fi

%  Permission is granted to distribute verbatim copies if this file provided
%  this copyright and permisions is preserved in all copies.

%  Permission is granted to distribute modified versions of this file
%  provided:
%    -- no deletions are made (but you can comment things out);
%    -- this copyright and permissions are preserved; and
%    -- it is called something else (so as to prevent confusion). 

%{{{  Active characters

\def\active#1{\catcode`#1=13 }
\def\plain#1{\catcode`#1=12 }

\def\minus{-}			% \let isn't good enuf

{\active\^^M \gdef\obeylines{\active\^^M\let^^M=\par}}%
\def\obeyspaces{\active\ }
%  Necessary because knuth uses \active to mean 13
%}}}
%{{{  Macros for making symbols etc

\def\overstrike#1#2%	Used to fudge some characters
{{%
    \leavevmode
    \setbox1=\hbox{#1}\setbox2=\hbox{#2}%
    \dimen0=\wd1 \ifdim\dimen0<\wd2 \dimen0=\wd2\fi % d0 := max(wd1, wd2)
    \rlap{\hbox to \dimen0{\hss#1\hss}}\hbox to \dimen0{\hss#2\hss}%
}}

\def\flushtop#1%
{{%
    \setbox0=\hbox{#1}\setbox1=\hbox{X}%
    \dimen0=\ht1 \advance\dimen0-\ht0 % d0 := ht(``X'') - ht(#1)
    \raise\dimen0\box0
}}


% \chdef CSNAME=cfxx \defs CSNAME to produce a math char with
%    class c, using sym xx from family f
%    Outside of maths mode, CSNAME produces the plain character
%    Used so that \bullet etc. can be used out of maths mode...

\def\chdef#1=#2#3#4#5%
{\def#1{\ifmmode
    \mathchar"#2#3#4#5
 \else
    \mathhexbox#3#4#5%
 \fi}
}

%  \deldef CSNAME=cfxxFXX
%     Similar except for thigns that are delimiters in maths mode.
%     FXX gives ``large'' symbol

\def\deldef#1=#2#3#4#5#6#7#8%
{\def#1{\ifmmode
    \delimiter"#2#3#4#5#6#7#8
 \else
    \mathhexbox#3#4#5%
 \fi}
}
%}}}
%{{{  Various symbols

\chdef\bullet	= 220F
\chdef\cdot	= 2201
\chdef\times	= 2202
\chdef\*	= 002A		% raised asterisk

\deldef\langle	= 426830A
\deldef\rangle	= 526930B
\deldef\lbrace	= 4266308 \let\{=\lbrace
\deldef\rbrace	= 5267309 \let\}=\rbrace

\def\poundsign{{\it\char36}}	% plain TeX method
\def\yensign{\overstrike=Y}	% ick

\def\hyphen{\ifmmode\hbox{-}\else-\fi}
\def\shortdash{\ifmmode\hbox{--}\else--\fi}
\def\longdash{\ifmmode\hbox{---}\else---\fi}

\def\tttilde{\leavevmode\lower 0.5ex\hbox{\tt\char`\~}}
\def\ttcirc{\leavevmode\lower 0.5ex\hbox{\tt\char`\^}}
\def\ttlq{\leavevmode\lower 0.125ex\hbox{\tt\char18}}
\def\ttrq{\leavevmode\lower 0.125ex\hbox{\tt\char19}}
\def\ttvert{{\tt\char`\|}}

\def\Mc{M\flushtop{\the\scriptfont\fam \b{c}}}
		% \Mc Gregor -> McGregor

%}}}
%{{{  Various logos etc

\def\LaTeX{L\negthinspace\flushtop{a}\kern-0.05em\TeX} 
%\def\AmSTeX{{\the\textfont2 A}\kern-.1667em\lower.5ex\hbox
%        {\the\textfont2 M}\kern-.125em{\the\textfont2 S}-\TeX}
\def\AMSTeX{AMS-\TeX}
\def\AMSLaTeX{AMS-\LaTeX}
\def\BibTeX{Bib\!\TeX}

%}}}
%{{{  Date and time-of-day

\def\shortdates
{\def\today
 {{\sfcode`\.=1000 \n{\number\day} 
  \ifcase\month\or
	Jan. \or Feb. \or Mar. \or Apr. \or May \or June \or
        July \or Aug. \or Sept. \or Oct. \or Nov. \or Dec. 
  \fi
  \n{\number\year}%
 }}
}

\def\longdates
{\def\today
 {\n{\number\day} 
  \ifcase\month\or
	January \or February \or March \or April \or May \or June \or
        July \or August \or September \or October \or November \or December
  \fi
  \n{\number\year}%
 }
}

\shortdates

\newcount\hour \newcount\minute
\hour=\time \global\divide\hour by 60	% H = T/60
\minute=-\hour \multiply\minute by 60 \advance\minute\time
				% M = T - 60*H = T\60

\def\nnumber#1{\ifnum#1<10 0\fi\number1}
\def\timeofday{\n{\number\hour}:\n{\nnumber\minute}}
%}}}
%{{{  Numerals

%  Numbers in a text context -- \n{12,345-56}
%    commas become thinspaces in scientific numerals
%    full stop becomes decimal point
%    hyphen becomes shortdash (for ranges)
%    \minus for minus sign 

\begingroup\active\-
    \gdef\n#1%
    {\leavevmode \counta=\fam
     \hbox{$\mathsurround=0pt
	\mathcode`\.="0201 
	\mathcode`\-="8000 \let-=\shortdash
	\mathchardef\minus="2200
	\fam=\counta \everyn
	#1$}%
    }
\endgroup

\begingroup \active\,
    \gdef\scientificnumerals{\def\everyn{\mathcode`\,="8000 \let,=\,}}
\endgroup

\def\oldstylenumerals
{\def\everyn{\ifnum\counta=0\mit\fi \mathcode`\,="702C }}

\def\rangingnumerals{\def\everyn{\mathcode`\,="0702C }}

%}}}
%{{{  Verbatim text, using |...|

\active\|

\def\verbatimplains{\\\\\\\{\\\}\\\_\\\$\\\#\\\&\\\%} % \{}_$#&%
\def\verbatimactives{\\\`\\\'\\\~\\\^\\\ } % `'~^<space>

\begingroup \active\' \active\` \active\^
    \gdef\setupverbatim
    {%
	\spaceskip0pt \xspaceskip0pt % use spacing of font
	\let\\\plain\verbatimplains
	\let\\\active\verbatimactives
	\let`=\ttlq \let'=\ttrq 
	\let~=\tttilde \let^=\ttcirc
	\hyphenchar\font=-1
	\the\everyverbatim
    }
\endgroup

\newif\ifdblvert

\def|%
{%
    \ifmmode
	\mathchar"026A
    \else
	\leavevmode
	\begingroup		% matched by closing |
	\aftergroup\verbatimsetspacefactor
	\tt \setupverbatim
	\let|\endgroup
	\ifnum\spacefactor=1003 \ttvert \fi
    \fi
}

\def\verbatimsetspacefactor{\spacefactor1003 }

% TeXbook, p.380
\def\listing#1%		list file #1 verbatim in 
{
    \medskip
    \begingroup
	\parindent=0pt \parskip=0pt
        \counta=0 \countb=5
	\def\par{\leavevmode\endgraf}%
	\obeylines \obeyspaces
	\everypar={\linenum}%
	\maketabstab
	\setupverbatim 
	\the\everylisting  
	\tt
	\input#1 
    \endgroup
    \medskip\noindent\ignorespaces
}

{\catcode`\^^I=13
 \gdef\maketabstab{\catcode`\^^I=13 \def^^I{\hskip 4em}}
}

\def\linenum
{%
    \strut
    \global\advance\counta+1 \global\advance\countb-1
    \ifnum\countb>0\else
	\global\advance\countb 5
	\rlap{\the\everylinenum \kern\hsize\kern1em \the\counta}%
    \fi
}%

{\obeyspaces\global\let =\ }	% active space = \SPACE
%}}}
%{{{  Misc

\def\thinspaceamount		% usually 1/6em in CMR
{\ifdim\spaceskip>0pt
    0.5\spaceskip
 \else
    0.5\fontdimen2\font
 \fi
}

\def\,{\ifmmode\mskip+\thinmuskip\else\kern+\thinspaceamount\fi}
\def\!{\ifmmode\mskip-\thinmuskip\else\kern-\thinspaceamount\fi}
\def\dots{.\,.\,.}

\def\makestrut#1#2{\vrule height#1 depth#2 width0pt }

\let\pTXunderline\underline
\def\underline#1%
{\ifmmode
    \pTXunderline{#1}%
 \else
    \setbox0=\hbox{#1}%
    \dp0=0pt
    $\pTXunderline{\box0}$%
 \fi
}

\def\crossedout#1%	print #1 with line through it
{{%
    \setbox0=\hbox{#1}%
    \dimen0 = 0.6ex \advance\dimen0 by -0.4pt
    \vrule height 0.6ex depth -\dimen0 width \wd0
    \kern -\wd0
    \box0
}}
%}}}
%{{{  Hooks

\rangingnumerals		% sets \everyn

\newtoks\everyverbatim	

\newtoks\everylisting  
\everylisting={\tentt\baselineskip=10pt}

\newtoks\everylinenum
\everylinenum={\sevenrm}
%}}}
%}}} parmac.tex

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