summaryrefslogtreecommitdiff
path: root/macros/plain/contrib/pdcmac/pdcmondo.tex
blob: 76c6eac3cab84b11990e24c7c36ad3e80545fbca (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
% Combined listing of the PDCMAC macros
% hacked together pdc 1995-03-28

\relax
\input pdccode
\input epsf
\errorcontextlines10000
\document

\input pdcmacvn

%  Redefine the PDCCODE macros

%\def\codefile#1{}
%\def\endcodefile{}
%\begingroup\obeylines \toksa={\endgroup %
%    \def\CODElinei#1^^M{%
%        \indent\the\everycodeline #1\par %
%        \endgroup % matches \CODEline
%    }%
%    \def\CODElinex#1^^M{%
%        {\indent\the\everycodeline #1\par}%
%    }%
%} \the\toksa


% abbreviated TOC macros taken from pdcsty

\newwrite\TOCfile
\openout\TOCfile=\jobname.toc
\def\TOCwrite#1#2#3{%
    \begingroup\def\n{\string\n}
    \def\tmp{#3}%
    \edef\tmp{\string#1{#2}{\expandafter\TOCtrim\meaning\tmp}}
    \write\TOCfile\expandafter{\tmp{\folio}}\endgroup
}
\def\TOCtrim#1:->{}
\def\TOCentryfile#1#2#3{
    \medbreak\noindent{\subsecfont #2}\smallskip
}
\def\TOCentrysection#1#2#3{
    \indent \llap{\S#1\enspace}
	\ignorespaces #2\quad#3\par
}
\def\TOCentrysubsec#1#2#3{}


% Abbreviated fontmatter definitions from pdcsty:

\def\frontmatter{
    \write\TOCfile{\string\endinput}
    \closeout\TOCfile
    \vfill\supereject
    \pageno=-1 \secnofalse \headline{\hfil}
    \def\TOCwrite##1##2##3{}
}
\def\endfrontmatter{
    \section{Contents}
    \input\jobname.toc
    \vfill\supereject
}
\newif\ifsecno \secnotrue


% sectioning taken from pdccode -- adapted to include TOC entries.

\def\section#1{%
    \advance\seccount1 \subseccount=0
    \bigbreak
    \begingroup
        \secfont \hyphenpenalty=10000 \tolerance=1000
        \rightskip=0pt plus 2em
        \ifsecno \noindent\llap{\number\seccount.\enspace}\fi #1
	\TOCwrite\TOCentrysection{\number\seccount}{#1}
        \nobreak\medskip
    \endgroup
    \noindenttrue
}
\def\subsec#1{%
    \advance\subseccount1
    \medbreak
    \begingroup
        \subsecfont \hyphenpenalty=10000 \tolerance=1000
        \parskip=0pt \parindent=0pt \rightskip=0pt plus 2em
        \ifsecno \noindent\llap{\number\seccount.%
		\number\subseccount.\enspace}\fi #1
	\TOCwrite\TOCentrysubsec{\number\seccount.\number\subseccount}{#1}
        \nobreak\smallskip
    \endgroup
    \noindenttrue
}
\def\title#1{
    \vglue2\baselineskip
    \begingroup \titlefont \parindent-\leftmargin \hyphenpenalty10000
	 #1\smallskip
    \endgroup
    \leftline{Version \fileversion,
        last changed \fileauthor\space \mungedate\filedate}
    \ifx\filelocker\empty\else
        \leftline{Edited by \filelocker\unskip\ \today}
    \fi
    \medskip
    \hrule \vskip1pt \hrule \vskip1pt \hrule \vskip1pt \hrule
    \medskip
    \rightline{\theauthor}
    \bigskip
    \headline{\hfil\global\headline{%
        \hskip-\leftmargin \sevenbf \themarks \hfil #1
        \fileversion
        \ifx\filelocker\empty
            \space\mungedate\filedate
        \else
            e\space\today
        \fi
    }}
    \TOCwrite\TOCentryfile{}{#1}
}

% A command to include another complete document in this one.

\def\includedocument#1{
    \begingroup
	\let\RELAX\relax
	\def\relax{\let\relax\RELAX \iffalse}
	\let\document=\fi
	\let\enddocument\endinput
	\lineno=0
	\input #1
	\vfil\eject \mark{}
    \endgroup
}

\includedocument{maamac.dtx}
\includedocument{magrmac.dtx}
\includedocument{pdcadobe.dtx}
\includedocument{pdccode.dtx}
\includedocument{pdcfsel.dtx}
\includedocument{pdcfmt2.dtx}
\includedocument{pdcl1maa.dtx}
\includedocument{pdcmisc.dtx}
\includedocument{pdcoput5.dtx}

\headline{\hfil}
\null		
% need a blank page (unfortunate kludge)
% This is because each embedded document is followed by a page break
%  but we need the a page break before the TOC to finish writing out
%  the TOC file.  Argh.
\frontmatter
\vfill
\leftline{\titlefont PDCMAC Mondo Combined Listing}
\leftline{\titlefont For release 1\kern-0.07em \raise0.5ex\hbox{.}0}

\section{Preface}

	PDCMAC is a package of plain \TeX\ macro files.  The macro files
	are generated by running plain \TeX\ on |dtx| files, which
	produces both a copy of the macros and printed documentation
	(see the {\it PDCMAC User Guide}\/ for more information).  This
	`combined listing' is a compilation of most of the |dtx| files
	in the PDCMAC distribution (|pdcsty.dtx|, which generates the
	sample style files, is not included).

	This compilation document works as follows.  First it reads
	|pdcmac.tex| and then redefines some macros to write entries for
	a table of contents, and then reads the |dtx| files one after
	another.  The results should be same as running \TeX\ on each of
	the |dtx| files separately, except that the pages are numbered
	continuously and there is a contents list.

	This is useful for two different purposes: (1)~to make a printed
	copy of the macros for reference while using them, and (2)~to
	generate all the macro files in one \TeX\ command instead of
	several.  This is useful when you cannot use the makefile
	supplied with the package.  If you do have the makefile, it will
	probably be the more convenient way to keep the macro files
	up-to-date.

	The files are included in alphabetical order.  See the PDCCODE
	chapter below for information on the PDCCODE system.

\endfrontmatter
\enddocument
\bye

%Local Variables:
%fill-prefix: "	"
%tex-has-children: t
%End: