summaryrefslogtreecommitdiff
path: root/support/pcwritex/PCWSTY.TEX
blob: db2ee4c99c286ebd1b74b074290b449d8aad4263 (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
% PCWSTY.TEX - This is the file of definitions to handle the PR.DOC output
%              which converts a file from PC-WRITE format to TeX format.
% 
\magnification=\magstep1
%\hsize=6truein \hoffset=.5truein % use this line for theses to give 1«" margin
% sans-serif fonts invoked by Alt-E (elite typesize, originally 12cpi)
\font\zrm=cmss10 
\font\zit=cmssi10
\font\zbf=cmssbx10
\font\zsc=cmss8
%
% small cmr fonts invoked by Alt-C (originally compressed type)
\font\srm=cmr8
\font\sbf=cmbx8
\font\sit=cmti8
\font\ssl=cmsl8
\font\stt=cmtt8
\font\ssc=cmr6
%
% use the narrower bold for default bold (Alt-B)
\font\bf=cmb10
% and bold extended for Alt-S (originally shadow-print)
\font\bx=cmbx10
%
% 17pt fonts for the Alt-D (double-width type) command
\font\brm=cmr17
\font\bit=cmti10 scaled \magstep2
\font\bsl=cmsl10 scaled \magstep2
\font\bbf=cmbx10 scaled \magstep2
\font\btt=cmtt10 scaled \magstep2
\font\bsc=cmcsc10 scaled \magstep2
%
% cmu gives us the upright pounds sterling sign 
\font\upr=cmu10
% caps and small caps invoked by Alt-P 
\font\sc=cmcsc10
% also grab bold italics
%\font\ibf=cmbxti10 scaled \magstep1
%\font\slbf=cmbxsl10 scaled \magstep1
%\font\cu=cuplt60 at 60truept
%
% define the three typestyle changes
\def\sans{\let\rm=\zrm\let\it=\zit\let\bf=\zbf\let\sl=\zit\let\bx=\zbf
          \let\sc=\zsc\rm}
\def\smaller{\let\rm=\srm\let\it=\sit\let\bf=\sbf\let\sl=\ssl\let\bx=\sbf
             \let\sc=\ssc\let\tt=\stt\rm\baselineskip=9pt}
\def\bigger{\let\rm=\brm\let\it=\bit\let\bf=\bbf\let\sl=\bsl\let\tt=\btt
            \let\sc=\bsc\let\bx=\bbf\let\stt=\tt\rm}
%\def\bold{\let\rm=\bf\let\bf=\bx\let\it=\ibf\let\sl=\slbf\let\sc=\sbf\rm}
%\def\temp{}
%\def\ital{\let\temp=\rm\let\rm=\it\let\it=\temp\let\bf=\ibf\let\sl=\slbf
%          \let\sc=\ssl\let\bx=\ibf\rm}
%
% redefine vertical bar character to active and equate it with a prime mark
% for use as abbreviation for feet (or twice for inches)
\catcode`\|=13 
\def|{\ifmmode\vert\else\ifnum\uflag=1 \char'174 \else$'$\fi\fi} 
% redefine slash to active so it can be used in math mode for \over
\catcode`\/=13
\def/{\ifmmode\over\else\char'057 \fi}
% make backslash and otErs produce the right thing in typewriter type
\newcount\fflag \fflag=0
\def\\{\ifnum\fam=\ttfam\char'134 \else\ifnum\fflag=1 \char'134 
\else$\backslash$\fi\fi}
\def\lb{\ifnum\fam=\ttfam\char'173 \else\ifnum\uflag=1 \char'173 
\else\ifmmode\bgroup\else$\{$\fi\fi\fi}
\def\rb{\ifnum\fam=\ttfam\char'175 \else\ifnum\uflag=1 \char'175
\else\ifmmode\egroup\else$\}$\fi\fi\fi}
\def\lt{\ifnum\fam=\ttfam\char'074 \else\ifnum\uflag=1 \char'074 
\else\ifmmode<\else$\langle$\fi\fi\fi}
\def\gt{\ifnum\fam=\ttfam\char'076 \else\ifnum\uflag=1 \char'076 
\else\ifmmode>\else$\rangle$\fi\fi\fi}
\def\tilde{\ifnum\fam=\ttfam\char'176 \else\ifnum\uflag=1 \char'176 
\else$\sim$\fi\fi}
% similarly with caret, but take account of superscripting work
\def\caret{\ifnum\fam=\ttfam{\char'136}%
\else\ifnum\uflag=1 \char'136%
\else\ifmmode^\else{$\wedge$}\fi\fi\fi}
% get math characters to work right in and out of math mode
\def\mt#1{\ifmmode#1\else$#1$\fi}
% ditto sub- and super-scripts
\def\sup#1{\ifmmode{^{\rm #1}}\else$\rm^{#1}$\fi}
\def\sub#1{\ifmmode{_{\rm #1}}\else$\rm_{#1}$\fi}
% define a verbatim mode
\newcount\uflag \uflag=0
\def\verbon{\medbreak\begingroup\stt\baselineskip=9pt\parskip=0pt plus.1pt
\global\uflag=1 \global\fflag=1 \obeylines\obeyspaces}
{\obeyspaces\global\let =\ }
\def\verboff{\endgroup\global\uflag=0 }
% define neater itemisation
\def\element#1 {\item{#1}}
%
% define pounds sterling sign, cents, yen
\def\pounds{{\upr\$}}
\def\cents{\hbox{\rm\rlap/c}} 
\def\yen{\hbox{\rm\rlap{Y}{$-$}}}
%
% define double-quote char as active and make it toggle between left and right
% (opening and closing quotes). Can't do this with single-quote because it
% also gets used as an apostrophe which would upset the counter logic. Maybe
% someone could work out a way of testing if the character preceding a single
% quote was a space or line-end, then you could say if so, make it an opening
% single quote. Check also made for if you are in typewriter type, if so, use
% plain double-quote character and try to do the same in underlined mode,
% which is a math box, family -1, which failed before.
\catcode`\"=13 \newcount\quotes
\def"{\ifnum\fam=\ttfam\char'042 \else
      \ifnum\uflag=1 \char'042 \else
%      \ifnum\fam<0 \char'042 \else
      \global\advance\quotes by1 \ifodd\quotes``\else''\fi\fi\fi}
%
% tidy up footnoting, using the normal \footnote macro but doing automatic
% numbering
\newcount\footnum
\setbox\strutbox=\hbox{\vrule height10pt depth4pt width0pt}% for tabulations
\def\footstrut{\vbox to 9pt{}}
\newbox\fstrutbox
\setbox\fstrutbox=\hbox{\vrule height1pt depth 1pt width0pt}
\def\fstrut{\relax\ifmmode\copy\fstrutbox\else\unhcopy\fstrutbox\fi}
\begingroup\catcode`\@=11
\global\def\@foot{\fstrut\egroup}
\global\def\vfootnote#1{\insert\footins\bgroup%
\interlinepenalty\interfootnotelinepenalty%
\splittopskip\ht\strutbox%topbaseline for broken footnotes%
\splitmaxdepth\dp\strutbox\floatingpenalty\@MM%
\leftskip\z@skip\rightskip\z@skip\spaceskip\z@skip\xspaceskip\z@skip%
\baselineskip=9pt\item{#1}\footstrut\futurelet\next\fo@t}
\endgroup
\def\fn#1{\global\advance\footnum by1 \footnote{$^{\number\footnum}$}
{\global\fflag=1 {\smaller #1}}\global\fflag=0 }
%
% fudge \narrower to apply to one paragraph only
\def\squeeze{\par\noindent\ignorespaces\let\endgraf=\par%
\edef\restorehsize{\leftskip=0pt\rightskip=\leftskip}%
\def\par{\endgraf\restorehsize\noindent\ignorespaces\let\par=\endgraf}%
\leftskip=2\parindent\rightskip=\leftskip}
%
% define fractions (TeXbook, p311)
\def\frac#1/#2 {\leavevmode\kern.1em
 \raise.6ex\hbox{\the\scriptfont0 #1}\kern-.1em
 /\kern-.2em\lower.2ex\hbox{\the\scriptfont0 #2}}
% define the fixed-space character
\def\fixspace{{\tt\char'040}}
%
% ensure baselines are 12pt apart to begin with
\baselineskip=12pt \parskip=.5em plus.25em minus.25em
\tolerance=5000
%
% Fudge a \la for the beginning of \latex
\def\La{{\rm L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em}}
%
\def\insertplot:#1,#2,#3!{\par\hbox{\hskip#3 
\vbox to#2 {\special{hp: plotfile #1 }\vfil}}}
%
\def\wider{\global\parindent=1in}
\def\normal{\global\parindent=20pt}
\def\tighter{\global\divide\parskip by2}
\def\looser{\global\multiply\parskip by2}
\def\front{\global\pageno=0}
\def\folio{\ifnum\pageno=0 \else\ifnum\pageno<0 \romannumeral-\pageno
    \else\number\pageno\fi\fi}
\def\emgap{\vskip1em\noindent\ignorespaces}%
\def\newpage{\vfill\eject\noindent\ignorespaces}%
\def\newline{\par\vskip-\parskip\noindent\ignorespaces}
\def\csc#1{{\sc\lowercase{#1}}}
\def\uline#1{$\underline{\global\uflag=1\hbox{#1}\global\uflag=0}$} 
\def\newpara{\par\noindent\ignorespaces}%
%
\message{PC-WRITeX v2.3}
%
\hbox{}