summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/add-wes.sty
blob: 857ca003988dea07064f671b98124e651cc74170 (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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
% Save file as: ADD-WES.STY            Source: FILESERV@SHSU.BITNET  
% Posted by pauld@cs.washington.edu (Paul Barton-Davis) to comp.text.tex
% on 23 Aug 91 20:09:12 GMT
% Original text accompanying post follows \endinput at bottom of file
%%                      addison-wesley.sty
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% A `book' style conforming (just!) to the Addison-Wesley house style
%% Paul Barton-Davis <pauld@cs.washington.edu> December 1988
%%
%% v1.05 nmm 29-jun-89 - include notes at head of index
%% v1.04 nmm 21-jun-89 - change 'part' handling
%% v1.03 pad 25-feb-89 - added `cexample' and `wexample' environments; fixed
%%			 error in `mycaption' which dropped figure
%%			 number when caption length > hsize.
%% v1.02 pad 15-feb-89 - added 'rhfig' to produce figures with captions
%%  			alongside instead of underneath, and 'mycaption' to
%%  			give nice captions.
%% v1.01 pad xx-jan-89 - change indents for display envts.
%%
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Copyright (c):
%% 	Freely copy, modify and redistribute on condition that this
%% 	copyright notice remains on all such copied, modified or
%% 	distributed versions.
%%    
%%      Portions of this file derived from material written by
%%      Leslie Lamport.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% NOTE:
%%
%% The author disclaims more or less all responsibility for the design
%% decisions implicitly represented in this file. This LaTeX
%% documentstyle was implememented to meet an external design
%% specification, and its existence neither condones or decries that
%% specification.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% TO DO:
%% 
%% right floating figures (properly)
%% references
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\typeout%
{Document Style `Addison-Wesley Book' v1.05 nmm 29-jun-89}

%% MATERIAL FROM BOOK.STY

\def\@ptsize{0} \@namedef{ds@11pt}{\def\@ptsize{1}}
\@namedef{ds@12pt}{\def\@ptsize{2}} 
\@twosidetrue \@mparswitchtrue \def\ds@draft{\overfullrule 5pt} 
\@options
\input bk1\@ptsize.sty\relax

\def\labelenumi{\arabic{enumi}.} 
\def\theenumi{\arabic{enumi}} 
\def\labelenumii{(\alph{enumii})}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}
\def\labelenumiii{\roman{enumiii}.}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\theenumi(\theenumii)}
\def\labelenumiv{\Alph{enumiv}.}
\def\theenumiv{\Alph{enumiv}} 
\def\p@enumiv{\p@enumiii\theenumiii}

\def\labelitemi{$\bullet$}
\def\labelitemii{\bf --}
\def\labelitemiii{$\ast$}
\def\labelitemiv{$\cdot$}

\def\verse{\let\\=\@centercr 
 \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent 
 \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
\let\endverse\endlist
\def\quotation{\list{}{\listparindent 1.5em
 \itemindent\listparindent
 \rightmargin\leftmargin\parsep 0pt plus 1pt}\item[]}
\let\endquotation=\endlist
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist

\def\descriptionlabel#1{\hspace\labelsep \bf #1}

\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \else \newpage \fi \thispagestyle{empty}\c@page\z@}
\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}

\arraycolsep 5pt \tabcolsep 6pt \arrayrulewidth .4pt \doublerulesep 2pt 
\tabbingsep \labelsep 
\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = .4pt 

\newcounter{part}
\newcounter {chapter}
\newcounter {section}[chapter]
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]

\def\thepart {\arabic{part}}
\def\thechapter {\arabic{chapter}}
\def\thesection {\thechapter.\arabic{section}}
\def\thesubsection {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}
\def\theparagraph {\thesubsubsection.\arabic{paragraph}}
\def\thesubparagraph {\theparagraph.\arabic{subparagraph}}
\def\@chapapp{Chapter}

\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{2}

\def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{Contents\@mkboth{CONTENTS}{CONTENTS}}
 \@starttoc{toc}\if@restonecol\twocolumn\fi}
\def\l@part#1#2{\addpenalty{-\@highpenalty}
 \addvspace{2.25em plus 1pt} \begingroup
 \@tempdima 3em \parindent \z@ \rightskip \@pnumwidth \parfillskip
-\@pnumwidth 
 {\large \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
 \nobreak \endgroup}

\def\@dottedtocline#1#2#3#4#5{\ifnum #1>\c@tocdepth \else
%  \vskip \z@ plus .2pt
  {\hangindent #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
    \parindent #2\relax\@afterindenttrue
   \interlinepenalty\@M
   \leavevmode 
   \@tempdima #3\relax
    #4\nobreak\leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern \@dotsep 
       mu$}\hfill \nobreak \hbox to\@pnumwidth{\hfil\rm #5}\vskip -\parskip
\par}\fi}

\def\l@chapter#1#2{\pagebreak[3] 
 \vskip 1.0em plus 1pt \@tempdima 1.5em \begingroup
 \parindent \z@ \rightskip \@pnumwidth 
 \parfillskip -\@pnumwidth 
 \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
 \endgroup}
\def\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
\def\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\def\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\def\l@paragraph{\@dottedtocline{4}{10em}{5em}}
\def\l@subparagraph{\@dottedtocline{5}{12em}{6em}}
\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{List of Figures\@mkboth
 {LIST OF FIGURES}{LIST OF FIGURES}}\@starttoc{lof}\if@restonecol\twocolumn
 \fi}
\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
\def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\chapter*{List of Tables\@mkboth
 {LIST OF TABLES}{LIST OF TABLES}}\@starttoc{lot}\if@restonecol\twocolumn
 \fi}
\let\l@table\l@figure

\def\thebibliography#1{\chapter*{Bibliography\@mkboth
 {BIBLIOGRAPHY}{BIBLIOGRAPHY}}\list
 {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus -.07em}
 \sloppy\clubpenalty4000\widowpenalty4000
 \sfcode`\.=1000\relax}
\let\endthebibliography=\endlist
 
\newif\if@restonecol
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@
\chaptermark{Index}\columnsep 35pt\twocolumn[\@makeschapterhead{Index}In this index, page numbers are shown
in {\bf bold} type to indicate a major source of information about the item
being indexed.  Page numbers in {\it italics} indicate a definition.\vskip 1.5cm]
 \@mkboth{INDEX}{INDEX}\thispagestyle{plain}\parindent\z@
 \parskip\z@ plus .3pt\relax\let\item\@idxitem}
\def\@idxitem{\par\hangindent 40pt}
\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
\def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}

\def\footnoterule{\kern-3\p@ 
 \hrule width .4\columnwidth 
 \kern 2.6\p@} 
\@addtoreset{footnote}{chapter} 
\long\def\@makefntext#1{\parindent 1em\noindent 
 \hbox to 1.8em{\hss$^{\@thefnmark}$}#1}

\setcounter{topnumber}{2}
\def\topfraction{.7}
\setcounter{bottomnumber}{1}
\def\bottomfraction{.3}
\setcounter{totalnumber}{3}
\def\textfraction{.2}
\def\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}

\long\def\@makecaption#1#2{
 \vskip 10pt 
 \setbox\@tempboxa\hbox{#1: #2}
 \ifdim \wd\@tempboxa >\hsize #1: #2\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil} 
 \fi}

\newcounter{figure}[chapter]
\def\thefigure{\thechapter.\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{Figure \thefigure}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
\newcounter{table}[chapter]
\def\thetable{\thechapter.\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{Table \thetable}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}

\def\maketitle{\begin{titlepage}
 \let\footnotesize\small 
 \let\footnoterule\relax 
 \setcounter{page}{0}
 \null
 \vfil
 \vskip 60pt 
 {\Huge\sf \@title} \vskip 36pt
 {\large \@author}
 \vfil
 \end{titlepage}
 \setcounter{footnote}{0}
 \let\maketitle\relax}

\mark{{}{}} 

\def\today{\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
 \space\number\day, \number\year}

\@addtoreset{equation}{chapter} 
\def\theequation{\thechapter.\arabic{equation}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                            FONTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Use PostScript fonts (Times as default)
%% For newer LaTeX's, you can simply insert a new version of
%% the font definitions here.

\input{psdef.sty}
\input{times.sty}

%% redefine \LARGE to be 24pt (more in line with A-W's font sizes)

\def\LARGE{\@setsize\LARGE{24pt}\xxpt\@xxpt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                        PAGE DIMENSIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\textwidth 15truecm
\textheight 22.5truecm
\baselineskip 14truept
\oddsidemargin 1cm
\evensidemargin 1cm
\topmargin 0cm

%% skip sizes

\parskip 5pt plus 1pt minus 0.5pt

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                    RUNNING HEADERS & FOOTERS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\headerfont{\normalsize\it}
\newdimen\headerspacer
\headerspacer 1truecm

\def\ps@headings
    {
    \let\@mkboth=\@gobbletwo
    \def\@oddhead{\hbox to \textwidth
		{\hfil {\headerfont \@chaptername%
			\hskip \headerspacer \thepage}}}
    \def\@oddfoot{\relax}

    \if@twoside
	\def\@evenhead{\hbox to \textwidth
		{{\headerfont \thepage%
			 \hskip \headerspacer  \the@title} \hfil}}
	\def\@evenfoot{\relax}
    \else
	\def\@evenhead{\relax}
	\def\@evenfoot{\relax}
    \fi
    }

%% Addison-Wesley `plain' headings (for chapter pages - just put the
%% page number in the bottom right corner)

\def\ps@plain
    {
   \let\@mkboth=\@gobbletwo
    \def\@oddhead{\relax}
    \def\@oddfoot{\hbox to \textwidth {\hfil \headerfont \thepage}}

    \if@twoside
	\def\@evenhead{\relax}
	\def\@evenfoot{\hbox to \textwidth {\headerfont \thepage \hfil}}
    \else
	\def\@evenhead{\relax}
	\def\@evenfoot{\hbox to \textwidth {\headerfont \thepage \hfil}}
    \fi
    }

\def\the@title{\@title}
\def\@title{} 		%% This is reset by a \title command in the text
\def\@chaptername{}	%% This is reset by a \chapter command in the text

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           ENVIRONMENTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% new environments, or new definitions of old ones
%%
%% - example       : for displaying computer interaction
%% - wexample      : as above, but full width
%% - cexample      : as above, but centered
%% - pseudocode    : for displaying pseudo-code
%% - outputstuff   : for displaying computer output
%% - description   : like description, but with equal left & right indents
%% - itemize       : as above, for itemized lists
%% - enumerate     : as above, for enumerated lists
%% - preface       : for prefaces
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% EXAMPLE environment
%%

\def\examplefont{\tb}      %% font (& style) used for all example environments
\newdimen\exampletopsep	   %% white space to leave above an example
\exampletopsep\parskip

\def\example{\list{}{%
\topsep\exampletopsep
\rightmargin\leftmargin
\examplefont}
\item[]}

\let\endexample\endlist

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% FULL WIDTH EXAMPLE ENVIRONMENT
%%

\def\wexample{\list{}{%
\topsep\exampletopsep
\leftmargin 0pt
\rightmargin \leftmargin
\examplefont}
\item[]}

\let\endwexample\endlist

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% CENTERED EXAMPLE ENVIRONMENT
%%

\def\cexample{%
\begin{center}
\examplefont}

\def\endcexample{\end{center}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% PSEUDO-PSUEDOCODE ENVIRONMENT
%%
%% usage:

%% \begin{pseudocode}
%%     if (test clause) \\
%%	\> action statement \\
%%     else \\
%%	\> alternative \\
%%     endif
%% \end{pseudocode}

%% extra levels of indentation can be achieved with additional \>'s.

\def\pseudocode{\list{}{%
\topsep \exampletopsep
\rightmargin \leftmargin
\examplefont}
\item[]
\begin{tabbing}
\hskip 1cm \= \hskip 1cm \= \hskip 1cm \= \hskip 1cm \= \hskip 1cm \= \kill}

\def\endpseudocode{\endtabbing\endlist}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% OUTPUTSTUFF ENVIRONMENT 
%%
%% for displaying the output from computer interaction

\def\outputfont{\op}		%% font to use for outputstuff
\newdimen\outputstufftopsep	%% space to leave above outputstuff
\outputstufftopsep\parskip

\def\outputstuff{\list{}{%
\rightmargin \leftmargin
\topsep\outputstufftopsep
\outputfont}
\item[]}

\let\endoutputstuff\endlist


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% DESCRIPTION ENVIRONMENT
%%
%% redefine the `description' environment
%% to give equal right and left margins,
%% and parametize its topsep

\newdimen\lrdesctopsep		%% space to leave above a description
\lrdesctopsep\parskip

\def\description{\list{}{%
\topsep\lrdesctopsep
\rightmargin\leftmargin
\itemindent -\leftmargin
\divide\itemindent by 2
\labelwidth\z@
\let\makelabel\descriptionlabel
}}

\let\enddescription\endlist

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% ITEMIZED LIST ENVIRONMENT
%%

\def\itemize{%
\ifnum \@itemdepth >3%
	\@toodeep%
\else%
	\advance\@itemdepth \@ne%
	\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
	\list{\csname\@itemitem\endcsname}%
	{\def\makelabel##1{\hss\llap{##1}}%
	\rightmargin\leftmargin}%
\fi}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% ENUMERATED LIST ENVIRONMENT
%%

\def\enumerate{%
\ifnum \@enumdepth >3%
	\@toodeep%
\else
	\advance\@enumdepth \@ne%
	\edef\@enumctr{enum\romannumeral\the\@enumdepth}%
	\list{\csname label\@enumctr\endcsname}%
	{\usecounter{\@enumctr}%
	\def\makelabel##1{\hss\llap{##1}}%
	\rightmargin\leftmargin}%
\fi}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% PREFACE ENVIRONMENT
%%
%% basically just uses roman page numbering, with a plain
%% pagestyle, and ships out the page(s) when done.
%% 
%% NB. should really save current pagenumbering and style,
%%     rather than just switching back to arabic/headings
%%     when done

\def\preface{%
\clearpage
\pagenumbering{roman}
\vbox to \chapterboxsize {%
	\noindent
	{\LARGE\hb  Preface}
	\vfill}
\pagestyle{plain}
\noindent

}

\def\endpreface{%
\clearpage
\pagenumbering{arabic}
\pagestyle{headings}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                             SECTIONING
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Boiler plate material for sectioning, parametizing all
%% spacing, style and font information for users who want
%% to modify these on the fly (not that they're encouraged to).

\newdimen\abovesectionskip
\newdimen\belowsectionskip
\newdimen\abovesubsectionskip
\newdimen\belowsubsectionskip
\newdimen\abovesubsubsectionskip
\newdimen\belowsubsubsectionskip
\newdimen\baselineskiptwice 

\baselineskiptwice=\baselineskip
\multiply\baselineskiptwice by 2

\abovesectionskip=-\baselineskiptwice
\belowsectionskip=\baselineskip

\abovesubsectionskip=-\baselineskip
\belowsubsectionskip=6pt

\abovesubsubsectionskip=-\baselineskip
\belowsubsubsectionskip=4truept

\def\sectionfont{\large\hb}
\def\subsectionfont{\normalsize\hb}
\def\subsubsectionfont{\normalsize\ho}

%% prevent subsubsections and below being numbered

\setcounter{secnumdepth}{2}

%% now define the sectioning commands

%% PART is an exception, in that it doesn't use
%% \@startsection, but instead just throws out a recto
%% page with a Part number and associated rubbish with it.

\def\part#1{%
\cleardoublepage
\thispagestyle{empty}
\refstepcounter{part}
\vbox to \vsize{%
	\vskip 60pt
	\hbox to \textwidth{\hfil\Huge\hb Part \thepart \hfil}
	\vskip 2cm
	\begin{center}
	{\LARGE\hb #1}
	\end{center}
	\vfill}
\newpage
}

\def\section%%
{\@startsection{section}{1}%
	{\z@}{\abovesectionskip}{\belowsectionskip}%
	{\sectionfont}}

\def\subsection%%
{\@startsection{subsection}{2}%
	{\z@}{\abovesubsectionskip}{\belowsubsectionskip}%
	{\subsectionfont}}

\def\subsubsection%%
{\@startsection{subsubsection}{3}%
	{\z@}{\abovesubsubsectionskip}{\belowsubsubsectionskip}%
	{\subsubsectionfont}}

%% \chapter - redefine to ensure chapters begin on a recto
%% 	page; use `awplain' for chapter pages; define the@chapter as the
%% 	chapter

\def\cleartoversopage{\clearpage \ifodd\c@page \hbox{} \newpage\fi}

\def\chapter{%%
	\cleardoublepage%%	
	\thispagestyle{plain}%%
	\global\@topnum\z@
	\@afterindentfalse%% 
	\secdef\@chapter%%
	\@schapter}

\def\chaptermark#1{\gdef\@chaptername{#1}}
	
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                        CAPTIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% \mycaption{figure number}{subnumber}{caption}
%%
%% Mysteriously, this macro seems to use absolute figure numbers
%% rather than relying on LaTeX to figure it out. Now, in 1991, I
%% don't know why this is. It was probably part of the general
%% book production scheme, which need to refer to figures by
%% and not by number; I just don't know. It does, however, allow
%% subnumbers (like 1.a, 1.b and 1.c).

\def\mycaption#1#2#3{%
	\setcounter{\@captype}{#1}
	\addcontentsline{\csname
	  ext@\@captype\endcsname}{\@captype}{\protect\numberline{\csname 
	  the\@captype\endcsname}{\ignorespaces #3}}
	\par
	\begingroup
	\@parboxrestore
	\vskip 10pt
	\setbox\@tempboxa\hbox{{\bf Figure \csname the\@captype\endcsname#2}
				 #3}
	\ifdim \wd\@tempboxa > \hsize 
		\setbox\@tempboxa\hbox{%
			\bf Figure \csname the\@captype\endcsname#2\ }%
		\@tempdima \textwidth
		\advance\@tempdima by -\wd\@tempboxa
		\hbox{%
		\box\@tempboxa	
		\vtop{\hsize \@tempdima #3}}
	\else 
		\par \hbox to \hsize{%
			\hfil\box\@tempboxa\hfil}
	\fi
	\endgroup}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                 RIGHT-HAND INDENTED FIGURES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newdimen\@txtwd
\newdimen\@figwd
\newdimen\rhfigindent
\rhfigindent 1cm

%% \rhfig{HEIGHT}{WIDTH}{FIGURE NUMBER}{SUBNUMBER}{CAPTION}

\def\rhfig#1#2#3#4#5{%
	\begin{figure}[htb]
%%
%% set up the figure counter and add stuff to the aux file
%%
	\setcounter{\@captype}{#3}
	\addcontentsline{\csname
	  ext@\@captype\endcsname}{\@captype}{\protect\numberline{\csname 
	  the\@captype\endcsname}{\ignorespaces #5}}
%%
%% now adjust \@txtwd to give the width of the caption
%%
	\@txtwd \textwidth
	\@figwd #2
	\advance \@txtwd by -\@figwd
	\advance \@txtwd by -\rhfigindent
	\setbox\@tempboxa\hbox{\bf Figure \csname the\@captype\endcsname#4\ }
	\advance \@txtwd by -\wd\@tempboxa
%%
%% now set up a pair of hboxed vboxes with the caption in the right hand
%% one and the figure (space) in the left.
%%
	\hbox to \textwidth{%
		\hbox{\hskip \rhfigindent%
		\vtop to #1{\vfill
				\hbox{%
				\box\@tempboxa
				\vtop{\hsize\@txtwd #5}}
		 	    \vfill}}
		\hfill
		\hbox to \@figwd{
			\vtop{\vskip #1}}}
	\end{figure}}

\newdimen\@figwd
\newdimen\@txtwd
\newdimen\@blah

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                    CHAPTER HEADINGS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newdimen\chapterboxsize
\newdimen\chapternumberwidth
\newdimen\chaptertitlewidth

%% set total depth of chapter heading to be 14 lines

\chapterboxsize \baselineskip \multiply\chapterboxsize by 14

\chapternumberwidth 4cm %% width for "Chapter <number>"
\chaptertitlewidth \textwidth 
\advance \chaptertitlewidth by -\chapternumberwidth

\def\chapterheadfont{\LARGE\hb}%
\def\chapternumfont{\LARGE\ho}%

\def\@makechapterhead#1{%
	\vbox to \chapterboxsize {%
		\parindent=0pt%
		\hbox to \textwidth{%
			\vtop{\hsize \chapternumberwidth \chapternumfont
				 \@chapapp{} \thechapter}
			\hss
			\vtop{\baselineskip=26pt \hsize \chaptertitlewidth 
				\chapterheadfont \raggedright #1}}
		\vfill}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 		BOXES (for buttons and such things)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% First a useful construct for putting `struts' into hboxes
%% to fix their height properly for boxing up.
%%

\newbox\@adbox%% box with ascenders and descenders present.
\def\@adstrut{%
\setbox\@adbox\hbox{bp}%% do this here to make sure we get the current font
\vrule height \ht\@adbox width 0pt depth \dp\@adbox}

%% \fbox - a new version with better spacing than lamport's
%%
%% We just set up two boxes - one the same as the argument,
%% and the other with its height adjusted to include ascenders and
%% descenders. It is this box that is used to set the dimensions
%% of the frame around the first (I hope).

\long\def\fbox#1{\leavevmode\setbox\@tempboxa\hbox{#1\@adstrut}
    \@tempdima 0pt \advance\@tempdima \fboxsep 
    \advance\@tempdima \dp\@tempboxa
   \hbox{\lower \@tempdima\hbox
  {\vbox{\hrule \@height \fboxrule
          \hbox{\vrule \@width \fboxrule \hskip\fboxsep
	    \vbox{\vskip\fboxsep \box\@tempboxa\vskip\fboxsep}\hskip 
			 \fboxsep\vrule \@width \fboxrule}
		   \hrule \@height \fboxrule}}}}

%% STUFF TO START WITH

\ps@headings 
\pagenumbering{arabic} 
\onecolumn 

\endinput

From: pauld@cs.washington.edu (Paul Barton-Davis)
Newsgroups: comp.text.tex
Subject: Addison-Wesley.sty (documentstyle provided)
Message-ID: <1991Aug23.200912.1556@beaver.cs.washington.edu>
Date: 23 Aug 91 20:09:12 GMT
Sender: news@beaver.cs.washington.edu (USENET News System)
Organization: Computer Science & Engineering, U. of Washington, Seattle
Lines: 790
Originator: pauld@stowe.cs.washington.edu

Below is a documentstyle I wrote for a book called "The X Window
System - A User's Guide" by Niall Mansfield, published in 1989 by
Addison-Wesley. As such, it is a style that closely (but not exactly)
matches A-W's house style for computer-related texts. This is the very
same file used to format the book, and it was written for this purpose
only. I have just gone through and added a few comments here and there
to help anyone else who might want to use it. I haven't used it in a
long time, and neither has Niall: we're both at work on a new style
called "STOP", based on the Hughes "STOP" format for user
documentation. I hope to be posting that within a month or so, but I
might wait until the new book that uses it is with A-W. If you have
problems with it, please send me mail. Note that it currently inputs
two files that set up PostScript Times Roman as the default font
family. These are not included, since I have posted them before.

Please remember that I know LaTeX a little better now than back then
(and still not well enough to hack floating indented figures). There
are several things in the style that I would change if I wrote it
again; I merely thought that some folks might like a chance to use a
"real book" documentstyle.

-- enjoy
    paul
--