| 1 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 2 |
% |
| 3 |
% Module: ZzTeX Sectioning Facilities |
| 4 |
% |
| 5 |
% Synopsis: |
| 6 |
% |
| 7 |
% Author: Paul C. Anagnostopoulos |
| 8 |
% Created: 25 August 1989 |
| 9 |
% |
| 10 |
% Copyright 1989--2020 by Paul C. Anagnostopoulos |
| 11 |
% under The MIT License (opensource.org/licenses/MIT) |
| 12 |
% |
| 13 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 14 |
|
| 15 |
% Part and Chapter Texts |
| 16 |
% ---- --- ------- ----- |
| 17 |
|
| 18 |
|
| 19 |
\long\def \setauthortext #1{% {text} %^modifier |
| 20 |
\with{\authortext = {#1}}} |
| 21 |
|
| 22 |
\long\def \setopenertext #1{% {text} %^modifier |
| 23 |
\with{\openertext = {#1}}} |
| 24 |
|
| 25 |
% Part |
| 26 |
% ---- |
| 27 |
|
| 28 |
|
| 29 |
\defineblock{\part}{\endpart}{\true}{} |
| 30 |
|
| 31 |
%~block part |
| 32 |
% \setflag \allowintoc = flag % Allow in ToC? |
| 33 |
% \authortext = {...} % Author needed for opener. |
| 34 |
% \def \comptextformat {...} % Composite number text formatter. |
| 35 |
% \def \paging {...} % Paging before part opener. |
| 36 |
% \def \partformat ##1{...} % Part page formatter. |
| 37 |
% \openertext = {...} % Special text needed for opener. |
| 38 |
% \def \providemark ##1{...} % Mark provider. |
| 39 |
% \resetnumber = {...} % List of numbers to reset. |
| 40 |
% \runners = {style,...} % Running head/foot styles. |
| 41 |
% \style = {...} % Heading style. |
| 42 |
%~end |
| 43 |
|
| 44 |
\def \part #1{% {title} |
| 45 |
\closeanychapter |
| 46 |
\beginblockscope{part}% |
| 47 |
\global\increment \partdepth |
| 48 |
\authortext = {}% %~default hard |
| 49 |
\openertext = {}% %~default hard |
| 50 |
\runners = {blind,normal}% %~default soft |
| 51 |
\zoldrunners{\blindheader\blindfooter}% |
| 52 |
\style = {Caps/lowercase, \noindent} %~default soft |
| 53 |
\processdesign{\part}{}% |
| 54 |
\global\increment \partnumber |
| 55 |
\setcomptext{\partcomptext}% |
| 56 |
\paging |
| 57 |
\remark{Starting PART \number\partnumber.}% |
| 58 |
% Next three things are done first, in case opener is more than one page. |
| 59 |
\providemark{#1}% |
| 60 |
\zpartchaptoc{\the\partcomptext}{#1}{80}% |
| 61 |
\settaginfo{\the\partcomptext}{#1} |
| 62 |
\zsetrunnerstoks{\runners}% |
| 63 |
{\partformat{#1}}% |
| 64 |
\endgraf} |
| 65 |
|
| 66 |
\def \endpart {% |
| 67 |
\global\decrement \partdepth |
| 68 |
\endblockscope{part}} |
| 69 |
|
| 70 |
\def \setpartnumber #1{% {number} |
| 71 |
\global\partnumber = #1\relax |
| 72 |
\global\decrement \partnumber} |
| 73 |
|
| 74 |
% Quasi-Part |
| 75 |
% ---------- |
| 76 |
|
| 77 |
|
| 78 |
\defineblock{\quasipart}{\endquasipart}{\true}{} |
| 79 |
|
| 80 |
%~block quasipart |
| 81 |
% \setflag \allowintoc = flag % Allow in ToC? |
| 82 |
% \openertext = {...} % Special text needed for opener. |
| 83 |
% \def \paging {...} % Paging before part opener. |
| 84 |
% \def \quasipartformat ##1{...} % Part page formatter. |
| 85 |
% \def \providemark ##1{...} % Mark provider. |
| 86 |
% \resetnumber = {...} % List of numbers to reset. |
| 87 |
% \runners = {style,...} % Running head/foot styles. |
| 88 |
% \style = {...} % Heading style. |
| 89 |
%~end |
| 90 |
|
| 91 |
\def \quasipart #1{% {title} |
| 92 |
\closeanychapter |
| 93 |
\beginblockscope{quasipart}% |
| 94 |
\global\increment \quasipartdepth |
| 95 |
\openertext = {}% %~default hard |
| 96 |
\runners = {blind,normal}% %~default soft |
| 97 |
\zoldrunners{\blindheader\blindfooter}% |
| 98 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 99 |
\processdesign{\quasipart}{}% |
| 100 |
\global\increment \quasipartnumber |
| 101 |
\paging |
| 102 |
\def \znext {#1}% |
| 103 |
\remark{Starting QUASIPART `\expandafter\zdefof \meaning\znext\zmark'.}% |
| 104 |
% Next three things are done first, in case opener is more than one page. |
| 105 |
\providemark{#1}% |
| 106 |
\zpartchaptoc{}{#1}{85}% |
| 107 |
\settaginfo{}{#1}% |
| 108 |
\zsetrunnerstoks{\runners}% |
| 109 |
{\quasipartformat{#1}}% |
| 110 |
\endgraf} |
| 111 |
%%% \endquasipart} |
| 112 |
|
| 113 |
\def \endquasipart {% |
| 114 |
\global\decrement \quasipartdepth |
| 115 |
\endblockscope{quasipart}} |
| 116 |
|
| 117 |
% Chapter |
| 118 |
% ------- |
| 119 |
|
| 120 |
\defineblock{\chapter}{\endchapter}{\true}{} |
| 121 |
|
| 122 |
%~block chapter |
| 123 |
% \setflag \allowintoc = boolean % Allow in ToC? |
| 124 |
% \authorlevel = integer % Author ToC entry level. |
| 125 |
% \authortext = {...} % Author text needed for opener. |
| 126 |
% \def \comptextformat {...} % Composite number text formatter. |
| 127 |
% \difficulty = integer % Level of difficulty. |
| 128 |
% \numberfont = {...} % Font for number. |
| 129 |
% \numberwordfont = {...} % Font for word like "chapter". |
| 130 |
% \def \numberformat {...} % Number format. |
| 131 |
% \numbersink = glue % Sinkage to number, or |
| 132 |
% \numberskip = glue % Space b/b to number. |
| 133 |
% \openertext = {...} % Special text needed for opener. |
| 134 |
% \def \paging {...} % Initial paging. |
| 135 |
% \def \providemark ##1{...} % Mark provider. |
| 136 |
% \resetnumber = {...} % List of numbers to reset. |
| 137 |
% \setflag \resetsection = boolean % Reset section number? |
| 138 |
% \runners = {style,...} % Running head/foot styles. |
| 139 |
% \style = {...} % Heading style. |
| 140 |
% \textsink = sinkage % Sinkage to text, or |
| 141 |
% \textskip = skip % Space b/b from rule to text. |
| 142 |
% \titlefont = {...} % Title font. |
| 143 |
% \def \titleformat ##1{...} % Title format. |
| 144 |
% \titlesink = glue % Sinkage to title, or |
| 145 |
% \titleskip = glue % Space b/b from number to title. |
| 146 |
%~end |
| 147 |
|
| 148 |
\def \chapter #1{% {title} |
| 149 |
\closeanychapter |
| 150 |
\beginblockscope{chapter}% |
| 151 |
\global\increment \chapterdepth |
| 152 |
\authorlevel = 0 %~default hard |
| 153 |
\authortext = {}% %~default hard |
| 154 |
\difficulty = 0 %~default with |
| 155 |
\openertext = {}% %~default hard |
| 156 |
\setflag \resetsection = \true %~default hard |
| 157 |
\runners = {chapter,normal}% %~default soft |
| 158 |
\zoldrunners{\chapterheader\chapterfooter}% |
| 159 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 160 |
\processdesign{\chapter}{}% |
| 161 |
\if \resetsection |
| 162 |
\global\sectionnumber = 0 |
| 163 |
\global\quasisectionnumber = 0 |
| 164 |
\global\chapterappendixnumber = 0 |
| 165 |
\fi |
| 166 |
\global\simpleheadnumber = 0 |
| 167 |
\global\increment \chapternumber |
| 168 |
\setcomptext{\chaptercomptext}% |
| 169 |
\paging |
| 170 |
\remark{Starting chapter \if \emptytoksp{\chaptercomptext}'#1'\else |
| 171 |
\the\chaptercomptext \fi.}% |
| 172 |
\zsetrunnerstoks{\runners}% |
| 173 |
\chapterformat{#1}% |
| 174 |
\deferfloats{\true}% |
| 175 |
\settaginfo{\the\chaptercomptext}{#1}} |
| 176 |
|
| 177 |
\def \endchapter {% |
| 178 |
\closeanysection |
| 179 |
\global\decrement \chapterdepth |
| 180 |
\endblockscope{chapter}} |
| 181 |
|
| 182 |
\def \chapterformat #1{% |
| 183 |
{\the\numberfont |
| 184 |
\zsinkskip{\numbersink}{\breakbest}{\numberskip}% |
| 185 |
\numberformat\par}% |
| 186 |
{\the\titlefont |
| 187 |
\zsinkskip{\titlesink}{\breaknever}{\titleskip}% |
| 188 |
\titleformat{#1}\par}% |
| 189 |
\providemark{#1}% |
| 190 |
\zpartchaptoc{\the\chaptercomptext}{#1}{70}% |
| 191 |
\zsinkskip{\textsink}{\breaknever}{\textskip}} |
| 192 |
|
| 193 |
\def \setchapternumber #1{% {number} |
| 194 |
\global\chapternumber = #1\relax |
| 195 |
\global\decrement \chapternumber} |
| 196 |
|
| 197 |
\def \setappendixnumber #1{% {number} |
| 198 |
\global\appendixnumber = #1\relax |
| 199 |
\global\decrement \appendixnumber} |
| 200 |
|
| 201 |
\def \setsectionnumber #1{% {number} |
| 202 |
\global\sectionnumber = #1\relax |
| 203 |
\global\decrement \sectionnumber} |
| 204 |
|
| 205 |
% Quasi-Chapter |
| 206 |
% ------------- |
| 207 |
|
| 208 |
|
| 209 |
\defineblock{\quasichapter}{\endquasichapter}{\true}{} |
| 210 |
|
| 211 |
%~block quasichapter |
| 212 |
% \setflag \allowintoc = boolean % Allow in ToC? |
| 213 |
% \authorlevel = integer % Author ToC entry level. |
| 214 |
% \authortext = {...} % Author text needed for opener. |
| 215 |
% \openertext = {...} % Special text needed for opener. |
| 216 |
% \def \paging {...} % Initial paging. |
| 217 |
% \def \providemark ##1{...} % Mark provider. |
| 218 |
% \resetnumber = {...} % List of numbers to reset. |
| 219 |
% \runners = {style,...} % Running head/foot styles. |
| 220 |
% \style = {...} % Heading style. |
| 221 |
% \textsink = sinkage % Sinkage to text, or |
| 222 |
% \textskip = skip % Skip from rule to text. |
| 223 |
% \titlefont = {...} % Title font. |
| 224 |
% \def \titleformat ##1{...} % Title format. |
| 225 |
% \titlesink = glue % Sinkage to title, or |
| 226 |
% \titleskip = glue % Space b/b to title. |
| 227 |
%~end |
| 228 |
|
| 229 |
\def \quasichapter #1{% {title} |
| 230 |
\closeanychapter |
| 231 |
\beginblockscope{quasichapter}% |
| 232 |
\global\increment \quasichapterdepth |
| 233 |
\authorlevel = 0 %~default hard |
| 234 |
\authortext = {}% %~default hard |
| 235 |
\openertext = {}% %~default hard |
| 236 |
\runners = {chapter,normal}% %~default soft |
| 237 |
\zoldrunners{\chapterheader\chapterfooter}% |
| 238 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 239 |
\processdesign{\quasichapter}{}% |
| 240 |
\global\increment \quasichapternumber |
| 241 |
\chaptercomptext = {}% |
| 242 |
\paging |
| 243 |
\def \znext {#1}% |
| 244 |
\remark{Starting quasichapter `\expandafter\zdefof \meaning\znext\zmark'.}% |
| 245 |
\zsetrunnerstoks{\runners}% |
| 246 |
\quasichapterformat{#1}% |
| 247 |
\deferfloats{\true}% |
| 248 |
\settaginfo{}{#1}} |
| 249 |
|
| 250 |
\def \endquasichapter {% |
| 251 |
\closeanysection |
| 252 |
\global\decrement \quasichapterdepth |
| 253 |
\endblockscope{quasichapter}} |
| 254 |
|
| 255 |
\def \quasichapterformat #1{% |
| 256 |
{\the\titlefont |
| 257 |
\zsinkskip{\titlesink}{\breaknever}{\titleskip}% |
| 258 |
\titleformat{#1}\par} |
| 259 |
\providemark{#1}% |
| 260 |
\zpartchaptoc{}{#1}{75}% |
| 261 |
\zsinkskip{\textsink}{\breaknever}{\textskip}} |
| 262 |
|
| 263 |
% Appendix |
| 264 |
% -------- |
| 265 |
|
| 266 |
|
| 267 |
\defineblock{\appendix}{\endappendix}{\true}{} |
| 268 |
|
| 269 |
%~block appendix |
| 270 |
% \setflag \allowintoc = boolean % Allow in ToC? |
| 271 |
% \authortext = {...} % Author text needed for opener. |
| 272 |
% \def \comptextformat {...} % Composite number text formatter. |
| 273 |
% \numberfont = {...} % Font for number. |
| 274 |
% \numberwordfont = {...} % Font for word like "appendix". |
| 275 |
% \def \numberformat {...} % Number format. |
| 276 |
% \numbersink = glue % Sinkage to number, or |
| 277 |
% \numberskip = glue % Space b/b to number. |
| 278 |
% \openertext = {...} % Special text needed for opener. |
| 279 |
% \def \paging {...} % Initial paging. |
| 280 |
% \def \providemark ##1{...} % Mark provider. |
| 281 |
% \resetnumber = {...} % List of numbers to reset. |
| 282 |
% \setflag \resetsection = boolean % Reset section number? |
| 283 |
% \runners = {style,...} % Running head/foot styles. |
| 284 |
% \style = {...} % Heading style. |
| 285 |
% \textsink = sinkage % Sinkage to text, or |
| 286 |
% \textskip = skip % Space b/b from rule to text. |
| 287 |
% \titlefont = {...} % Title font. |
| 288 |
% \def \titleformat ##1{...} % Title format. |
| 289 |
% \titlesink = glue % Sinkage to title, or |
| 290 |
% \titleskip = glue % Space b/b from number to title. |
| 291 |
%~end |
| 292 |
|
| 293 |
\def \appendix #1{% {title} |
| 294 |
\closeanychapter |
| 295 |
\beginblockscope{appendix}% |
| 296 |
\global\increment \appendixdepth |
| 297 |
\authortext = {}% %~default hard |
| 298 |
\openertext = {}% %~default hard |
| 299 |
\setflag \resetsection = \true %~default hard |
| 300 |
\runners = {chapter,normal}% %~default soft |
| 301 |
\zoldrunners{\chapterheader\chapterfooter}% |
| 302 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 303 |
\processdesign{\appendix}{}% |
| 304 |
\if \resetsection |
| 305 |
\global\sectionnumber = 0 |
| 306 |
\global\quasisectionnumber = 0 |
| 307 |
\global\chapterappendixnumber = 0 |
| 308 |
\fi |
| 309 |
\global\increment \appendixnumber |
| 310 |
\setcomptext{\chaptercomptext}% % Not \appendixcomptext! |
| 311 |
\paging |
| 312 |
\remark{Starting appendix \the\chaptercomptext.}% |
| 313 |
\zsetrunnerstoks{\runners}% |
| 314 |
\appendixformat{#1}% |
| 315 |
\deferfloats{\true}% |
| 316 |
\settaginfo{\the\chaptercomptext}{#1}} |
| 317 |
|
| 318 |
\def \endappendix {% |
| 319 |
\closeanysection |
| 320 |
\global\decrement \appendixdepth |
| 321 |
\endblockscope{appendix}} |
| 322 |
|
| 323 |
\def \appendixformat #1{% |
| 324 |
{\the\numberfont |
| 325 |
\zsinkskip{\numbersink}{\breakbest}{\numberskip}% |
| 326 |
\numberformat\par}% |
| 327 |
{\the\titlefont |
| 328 |
\zsinkskip{\titlesink}{\breaknever}{\titleskip}% |
| 329 |
\titleformat{#1}\par}% |
| 330 |
\providemark{#1}% |
| 331 |
\zpartchaptoc{\the\chaptercomptext}{#1}{71}% |
| 332 |
\zsinkskip{\textsink}{\breaknever}{\textskip}} |
| 333 |
|
| 334 |
% Section |
| 335 |
% ------- |
| 336 |
|
| 337 |
|
| 338 |
\defineblock{\section}{\endsection}{\true}{} |
| 339 |
|
| 340 |
%~block section |
| 341 |
% \aboveskip = glue % Space b/b above title. |
| 342 |
% \setflag \allowintoc = boolean % Allow in ToC? |
| 343 |
% \def \comptextformat {...} % Composite number text formatter. |
| 344 |
% \difficulty = integer % Level of difficulty. |
| 345 |
% \numberfont = {...} % Number font. |
| 346 |
% \def \providemark ##1{...} % Mark provider. |
| 347 |
% \resetnumber = {...} % List of numbers to reset. |
| 348 |
% \style = {...} % Heading style. |
| 349 |
% \textskip = skip % Skip from title to text. |
| 350 |
% \titlefont = {...} % Title font. |
| 351 |
% \def \titleformat ##1{...} % Title format. |
| 352 |
% \topadjust = dimen % Adjust if at top of page. |
| 353 |
%~end |
| 354 |
|
| 355 |
\def \section #1{% {title} |
| 356 |
\closeanysection |
| 357 |
\beginblockscope{section}% |
| 358 |
\global\increment \sectiondepth |
| 359 |
\difficulty = 0 %~default with |
| 360 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 361 |
\topadjust = \mindimen %~default hard |
| 362 |
\processdesign{\section}{}% |
| 363 |
\global\subsectionnumber = 0 |
| 364 |
\global\subsubsectionnumber = 0 |
| 365 |
\global\subsubsubsectionnumber = 0 |
| 366 |
\global\increment \sectionnumber |
| 367 |
\setcomptext{\sectioncomptext}% |
| 368 |
\sectionformat{#1}% |
| 369 |
\settaginfo{\the\sectioncomptext}{#1}} |
| 370 |
|
| 371 |
\def \endsection {% |
| 372 |
\closeanysubsection |
| 373 |
\global\decrement \sectiondepth |
| 374 |
\endblockscope{section}} |
| 375 |
|
| 376 |
\def \sectionformat #1{% |
| 377 |
{\if \emptytoksp{\numberfont}\the\titlefont \else \the\numberfont \fi |
| 378 |
\zskipabovehead{\breakbest}{\aboveskip}% |
| 379 |
\titleformat{#1}\par}% |
| 380 |
\providemark{#1}% |
| 381 |
\ztocentry{\the\sectioncomptext}{#1}{60}{\allowintoc}% |
| 382 |
\bbskipabove{\breaknever}{\textskip}% |
| 383 |
\overrideclubpenalty{\breaknever}} |
| 384 |
|
| 385 |
% Quasi-Section |
| 386 |
% ------------- |
| 387 |
|
| 388 |
|
| 389 |
\defineblock{\quasisection}{\endquasisection}{\true}{} |
| 390 |
|
| 391 |
%~block quasisection |
| 392 |
% \aboveskip = glue % Space b/b above title. |
| 393 |
% \setflag \allowintoc = boolean % Allow in ToC? |
| 394 |
% \difficulty = integer % Level of difficulty. |
| 395 |
% \def \providemark ##1{...} % Mark provider. |
| 396 |
% \resetnumber = {...} % List of numbers to reset. |
| 397 |
% \style = {...} % Heading style. |
| 398 |
% \textskip = skip % Skip from title to text. |
| 399 |
% \titlefont = {...} % Title font. |
| 400 |
% \def \titleformat ##1{...} % Title format. |
| 401 |
% \topadjust = dimen % Adjust if at top of page. |
| 402 |
%~end |
| 403 |
|
| 404 |
\def \quasisection #1{% {tile} |
| 405 |
\closeanysection |
| 406 |
\beginblockscope{quasisection}% |
| 407 |
\global\increment \quasisectiondepth |
| 408 |
\difficulty = 0 %~default with |
| 409 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 410 |
\topadjust = \mindimen %~default hard |
| 411 |
\processdesign{\quasisection}{}% |
| 412 |
\global\increment \quasisectionnumber % In case needed for \tagpageonly. |
| 413 |
\quasisectionformat{#1}% |
| 414 |
\settaginfo{}{#1}} |
| 415 |
|
| 416 |
\def \endquasisection {% |
| 417 |
\closeanysubsection |
| 418 |
\global\decrement \quasisectiondepth |
| 419 |
\endblockscope{quasisection}} |
| 420 |
|
| 421 |
\def \quasisectionformat #1{% |
| 422 |
{\the\titlefont |
| 423 |
\zskipabovehead{\breakbest}{\aboveskip}% |
| 424 |
\titleformat{#1}\par} |
| 425 |
\providemark{#1}% |
| 426 |
\ztocentry{}{#1}{65}{\allowintoc}% |
| 427 |
\bbskipabove{\breaknever}{\textskip}% |
| 428 |
\overrideclubpenalty{\breaknever}} |
| 429 |
|
| 430 |
% Chapter Appendix |
| 431 |
% ------- -------- |
| 432 |
|
| 433 |
|
| 434 |
\defineblock{\chapterappendix}{\endchapterappendix}{\true}{} |
| 435 |
|
| 436 |
%~block chapterappendix |
| 437 |
% \aboveskip = glue % Space b/b above title. |
| 438 |
% \setflag \allowintoc = boolean % Allow in ToC? |
| 439 |
% \def \comptextformat {...} % Composite number text formatter. |
| 440 |
% \difficulty = integer % Level of difficulty. |
| 441 |
% \numberfont = {...} % Number font. |
| 442 |
% \def \providemark ##1{...} % Mark provider. |
| 443 |
% \resetnumber = {...} % List of numbers to reset. |
| 444 |
% \style = {...} % Heading style. |
| 445 |
% \textskip = skip % Skip from title to text. |
| 446 |
% \titlefont = {...} % Title font. |
| 447 |
% \def \titleformat ##1{...} % Title format. |
| 448 |
% \topadjust = dimen % Adjust if at top of page. |
| 449 |
%~end |
| 450 |
|
| 451 |
\def \chapterappendix #1{% {title} |
| 452 |
\closeanysection |
| 453 |
\beginblockscope{chapterappendix}% |
| 454 |
\global\increment \chapterappendixdepth |
| 455 |
\difficulty = 0 %~default with |
| 456 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 457 |
\topadjust = \mindimen %~default hard |
| 458 |
\processdesign{\chapterappendix}{}% |
| 459 |
\global\subsectionnumber = 0 |
| 460 |
\global\subsubsectionnumber = 0 |
| 461 |
\global\subsubsubsectionnumber = 0 |
| 462 |
\global\increment \chapterappendixnumber |
| 463 |
\setcomptext{\sectioncomptext}% % Not \chapterappendixcomptext! |
| 464 |
\chapterappendixformat{#1}% |
| 465 |
\settaginfo{\the\sectioncomptext}{#1}} |
| 466 |
|
| 467 |
\def \endchapterappendix {% |
| 468 |
\closeanysubsection |
| 469 |
\global\decrement \chapterappendixdepth |
| 470 |
\endblockscope{chapterappendix}} |
| 471 |
|
| 472 |
\def \chapterappendixformat #1{% |
| 473 |
{\if \emptytoksp{\numberfont}\the\titlefont \else \the\numberfont \fi |
| 474 |
\zskipabovehead{\breakbest}{\aboveskip}% |
| 475 |
\titleformat{#1}\par}% |
| 476 |
\providemark{#1}% |
| 477 |
\ztocentry{\the\sectioncomptext}{#1}{61}{\allowintoc}% |
| 478 |
\bbskipabove{\breaknever}{\textskip}% |
| 479 |
\overrideclubpenalty{\breaknever}} |
| 480 |
|
| 481 |
% Subsection |
| 482 |
% ---------- |
| 483 |
|
| 484 |
|
| 485 |
\defineblock{\subsection}{\endsubsection}{\false}{} |
| 486 |
|
| 487 |
%~block subsection |
| 488 |
% \aboveskip = glue % Space b/b above title. |
| 489 |
% \setflag \allowintoc = flag % Allow in ToC? |
| 490 |
% \def \comptextformat {...} % Composite number text formatter. |
| 491 |
% \difficulty = integer % Level of difficulty. |
| 492 |
% \numberfont = {...} % Font for number. |
| 493 |
% \def \providemark ##1{...} % Mark provider. |
| 494 |
% \style = {...} % Heading style. |
| 495 |
% \textskip = skip % Skip from title to text. |
| 496 |
% \titlefont = {...} % Title font. |
| 497 |
% \def \titleformat ##1{...} % Title format. |
| 498 |
% \topadjust = dimen % Adjust if at top of page. |
| 499 |
%~end |
| 500 |
|
| 501 |
\def \subsection #1{% {title} |
| 502 |
\closeanysubsection |
| 503 |
\beginblockscope{subsection}% |
| 504 |
\global\increment \subsectiondepth |
| 505 |
\difficulty = 0 %~default with |
| 506 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 507 |
\topadjust = \mindimen %~default hard |
| 508 |
\processdesign{\subsection}{}% |
| 509 |
\global\subsubsectionnumber = 0 |
| 510 |
\global\subsubsubsectionnumber = 0 |
| 511 |
\global\increment \subsectionnumber |
| 512 |
\setcomptext{\subsectioncomptext}% |
| 513 |
\subsectionformat{#1}% |
| 514 |
\settaginfo{\the\subsectioncomptext}{#1}% |
| 515 |
\ignorespaces} |
| 516 |
|
| 517 |
\def \endsubsection {% |
| 518 |
\closeanysubsubsection |
| 519 |
\global\decrement \subsectiondepth |
| 520 |
\endblockscope{subsection}} |
| 521 |
|
| 522 |
\def \subsectionformat #1{% |
| 523 |
{\if \emptytoksp{\numberfont}\the\titlefont \else \the\numberfont \fi |
| 524 |
\zskipabovehead{\breakbetter}{\aboveskip}% |
| 525 |
\titleformat{#1}}% |
| 526 |
\providemark{#1}% |
| 527 |
\ztocentry{\the\subsectioncomptext}{#1}{50}{\allowintoc}% |
| 528 |
\if \dimposp{\textskip}% |
| 529 |
\par |
| 530 |
\bbskipabove{\breaknever}{\textskip}% |
| 531 |
\fi |
| 532 |
\overrideclubpenalty{\breaknever}} |
| 533 |
|
| 534 |
% Quasi-Subsection |
| 535 |
% ---------------- |
| 536 |
|
| 537 |
|
| 538 |
\defineblock{\quasisubsection}{\endquasisubsection}{\false}{} |
| 539 |
|
| 540 |
%~block quasisubsection |
| 541 |
% \aboveskip = glue % Space b/b above title. |
| 542 |
% \setflag \allowintoc = boolean % Allow in ToC? |
| 543 |
% \difficulty = integer % Level of difficulty. |
| 544 |
% \def \providemark ##1{...} % Mark provider. |
| 545 |
% \style = {...} % Heading style. |
| 546 |
% \textskip = skip % Skip from title to text. |
| 547 |
% \titlefont = {...} % Title font. |
| 548 |
% \def \titleformat ##1{...} % Title format. |
| 549 |
% \topadjust = dimen % Adjust if at top of page. |
| 550 |
%~end |
| 551 |
|
| 552 |
\def \quasisubsection #1{% {title} |
| 553 |
\closeanysubsection |
| 554 |
\beginblockscope{quasisubsection}% |
| 555 |
\global\increment \quasisubsectiondepth |
| 556 |
\difficulty = 0 %~default with |
| 557 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 558 |
\topadjust = \mindimen %~default hard |
| 559 |
\processdesign{\quasisubsection}{}% |
| 560 |
\quasisubsectionformat{#1}% |
| 561 |
\settaginfo{}{#1}% |
| 562 |
\ignorespaces} |
| 563 |
|
| 564 |
\def \endquasisubsection {% |
| 565 |
\closeanysubsubsection |
| 566 |
\global\decrement \quasisubsectiondepth |
| 567 |
\endblockscope{quasisubsection}} |
| 568 |
|
| 569 |
\def \quasisubsectionformat #1{% |
| 570 |
{\the\titlefont |
| 571 |
\zskipabovehead{\breakbetter}{\aboveskip}% |
| 572 |
\titleformat{#1}} |
| 573 |
\providemark{#1}% |
| 574 |
\ztocentry{}{#1}{55}{\allowintoc}% |
| 575 |
\if \dimposp{\textskip}% |
| 576 |
\par |
| 577 |
\bbskipabove{\breaknever}{\textskip}% |
| 578 |
\fi |
| 579 |
\overrideclubpenalty{\breaknever}} |
| 580 |
|
| 581 |
% Subsubsection |
| 582 |
% ------------- |
| 583 |
|
| 584 |
|
| 585 |
\defineblock{\subsubsection}{\endsubsubsection}{\false}{} |
| 586 |
|
| 587 |
%~block subsubsection |
| 588 |
% \aboveskip = glue % Space b/b above title. |
| 589 |
% \setflag \allowintoc = flag % Allow in ToC? |
| 590 |
% \def \comptextformat {...} % Composite number text formatter. |
| 591 |
% \difficulty = integer % Level of difficulty. |
| 592 |
% \numberfont = {...} % Font for number. |
| 593 |
% \def \providemark ##1{...} % Mark provider. |
| 594 |
% \style = {...} % Heading style. |
| 595 |
% \textskip = skip % Skip from title to text. |
| 596 |
% \titlefont = {...} % Title font. |
| 597 |
% \def \titleformat ##1{...} % Title format. |
| 598 |
% \topadjust = dimen % Adjust if at top of page. |
| 599 |
%~end |
| 600 |
|
| 601 |
\def \subsubsection #1{% {title} |
| 602 |
\closeanysubsubsection |
| 603 |
\beginblockscope{subsubsection}% |
| 604 |
\global\increment \subsubsectiondepth |
| 605 |
\difficulty = 0 %~default with |
| 606 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 607 |
\topadjust = \mindimen %~default hard |
| 608 |
\processdesign{\subsubsection}{}% |
| 609 |
\global\subsubsubsectionnumber = 0 |
| 610 |
\global\increment \subsubsectionnumber |
| 611 |
\setcomptext{\subsubsectioncomptext}% |
| 612 |
\subsubsectionformat{#1}% |
| 613 |
\settaginfo{\the\subsubsectioncomptext}{#1}% |
| 614 |
\ignorespaces} |
| 615 |
|
| 616 |
\def \endsubsubsection {% |
| 617 |
\closeanysubsubsubsection |
| 618 |
\global\decrement \subsubsectiondepth |
| 619 |
\endblockscope{subsubsection}} |
| 620 |
|
| 621 |
\def \subsubsectionformat #1{% |
| 622 |
{\if \emptytoksp{\numberfont}\the\titlefont \else \the\numberfont \fi |
| 623 |
\zskipabovehead{\breakgood}{\aboveskip}% |
| 624 |
\titleformat{#1}}% |
| 625 |
\providemark{#1}% |
| 626 |
\ztocentry{\the\subsubsectioncomptext}{#1}{40}{\allowintoc}% |
| 627 |
\if \dimposp{\textskip}% |
| 628 |
\par |
| 629 |
\bbskipabove{\breaknever}{\textskip}% |
| 630 |
\fi |
| 631 |
\overrideclubpenalty{\breaknever}} |
| 632 |
|
| 633 |
% Subsubsubsection |
| 634 |
% ---------------- |
| 635 |
|
| 636 |
|
| 637 |
\defineblock{\subsubsubsection}{\endsubsubsubsection}{\false}{} |
| 638 |
|
| 639 |
%~block subsubsubsection |
| 640 |
% \aboveskip = glue % Space b/b above title. |
| 641 |
% \setflag \allowintoc = flag % Allow in ToC? |
| 642 |
% \def \comptextformat {...} % Composite number text formatter. |
| 643 |
% \difficulty = integer % Level of difficulty. |
| 644 |
% \numberfont = {...} % Font for number. |
| 645 |
% \def \providemark ##1{...} % Mark provider. |
| 646 |
% \style = {...} % Heading style. |
| 647 |
% \textskip = skip % Skip from title to text. |
| 648 |
% \titlefont = {...} % Title font. |
| 649 |
% \def \titleformat ##1{...} % Title format. |
| 650 |
% \topadjust = dimen % Adjust if at top of page. |
| 651 |
%~end |
| 652 |
|
| 653 |
\def \subsubsubsection #1{% {title} |
| 654 |
\closeanysubsubsubsection |
| 655 |
\beginblockscope{subsubsubsection}% |
| 656 |
\global\increment \subsubsubsectiondepth |
| 657 |
\difficulty = 0 %~default with |
| 658 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 659 |
\topadjust = \mindimen %~default hard |
| 660 |
\processdesign{\subsubsubsection}{}% |
| 661 |
\global\increment \subsubsubsectionnumber |
| 662 |
\setcomptext{\subsubsubsectioncomptext}% |
| 663 |
\subsubsubsectionformat{#1}% |
| 664 |
\settaginfo{\the\subsubsubsectioncomptext}{#1}% |
| 665 |
\ignorespaces} |
| 666 |
|
| 667 |
\def \endsubsubsubsection {% |
| 668 |
\global\decrement \subsubsubsectiondepth |
| 669 |
\endblockscope{subsubsubsection}} |
| 670 |
|
| 671 |
\def \subsubsubsectionformat #1{% |
| 672 |
{\if \emptytoksp{\numberfont}\the\titlefont \else \the\numberfont \fi |
| 673 |
\zskipabovehead{\breakgood}{\aboveskip}% |
| 674 |
\titleformat{#1}}% |
| 675 |
\providemark{#1}% |
| 676 |
\ztocentry{\the\subsubsubsectioncomptext}{#1}{30}{\allowintoc}% |
| 677 |
\if \dimposp{\textskip}% |
| 678 |
\par |
| 679 |
\bbskipabove{\breaknever}{\textskip}% |
| 680 |
\fi |
| 681 |
\overrideclubpenalty{\breaknever}} |
| 682 |
|
| 683 |
% Simple Head |
| 684 |
% ------ ---- |
| 685 |
|
| 686 |
|
| 687 |
\defineblock{\simplehead}{\endsimplehead}{\false}{} |
| 688 |
|
| 689 |
%~block simplehead Type |
| 690 |
% \aboveskip = glue % Space b/b above title. |
| 691 |
% \setflag \allowclubline = flag % True if club allowed below. |
| 692 |
% \setflag \allowintoc = boolean % Allow in ToC? |
| 693 |
% \difficulty = integer % Level of difficulty. |
| 694 |
% \style = {...} % Heading style. |
| 695 |
% \textskip = skip % Skip from title to text. |
| 696 |
% \titlefont = {...} % Title font. |
| 697 |
% \def \titleformat ##1{...} % Title format. |
| 698 |
% \tocentrylevel = integer % ToC entry level number (optional). |
| 699 |
% \topadjust = dimen % Adjust if at top of page. |
| 700 |
%~end |
| 701 |
|
| 702 |
\definecount{\tocentrylevel}{0} |
| 703 |
|
| 704 |
|
| 705 |
\def \simplehead #1#2{% {type}{title} |
| 706 |
\endgraf |
| 707 |
\beginblockscope{simplehead}% |
| 708 |
\global\increment \simpleheaddepth |
| 709 |
\setflag \allowclubline = \false %~default soft |
| 710 |
\setflag \allowintoc = \true %~default with |
| 711 |
\difficulty = 0 %~default with |
| 712 |
\style = {Caps/lowercase, \noindent}% %~default soft |
| 713 |
\tocentrylevel = 0 %~default soft |
| 714 |
\topadjust = \mindimen %~default hard |
| 715 |
\processdesign{\simplehead}{#1}% |
| 716 |
\global\increment \simpleheadnumber |
| 717 |
\simpleheadformat{#2}% |
| 718 |
\endsimplehead} |
| 719 |
|
| 720 |
\def \endsimplehead {% |
| 721 |
\global\decrement \simpleheaddepth |
| 722 |
\endblockscope{simplehead}% |
| 723 |
\ignorespaces} |
| 724 |
|
| 725 |
\def \simpleheadformat #1{% |
| 726 |
{\the\titlefont |
| 727 |
\zskipabovehead{\breakgood}{\aboveskip}% |
| 728 |
\titleformat{#1}}% |
| 729 |
\if \dimzerop{\textskip}% |
| 730 |
\nobreak |
| 731 |
\else |
| 732 |
\endgraf |
| 733 |
\bbskipabove{\breaknever}{\textskip}% |
| 734 |
\fi |
| 735 |
\if \posp{\tocentrylevel}% |
| 736 |
\ztocentry{}{#1}{\tocentrylevel}{\allowintoc}% |
| 737 |
\fi |
| 738 |
\if \notp{\allowclubline}\overrideclubpenalty{\breaknever}\fi} |
| 739 |
|
| 740 |
% Useful Utilities |
| 741 |
% ------ --------- |
| 742 |
|
| 743 |
|
| 744 |
\def \chapterorchapterappendixcomptext {% |
| 745 |
\if \inblockp{\chapterappendix}% |
| 746 |
\the\sectioncomptext |
| 747 |
\else |
| 748 |
\the\chaptercomptext |
| 749 |
\fi} |
| 750 |
|
| 751 |
\def \textonlyhead {% %^modifier |
| 752 |
\with{\setflag\allowintoc=\false |
| 753 |
\def\providemark##1{}}} |
| 754 |
|
| 755 |
\def \closeanychapter {% |
| 756 |
\closeifinblock{\part}{\endpart}% |
| 757 |
\closeifinblock{\quasipart}{\endquasipart}% |
| 758 |
\closeifinblock{\quasichapter}{\endquasichapter}% |
| 759 |
\closeifinblock{\chapter}{\endchapter}% |
| 760 |
\closeifinblock{\appendix}{\endappendix}} |
| 761 |
|
| 762 |
\def \closeanysection {% |
| 763 |
\closeifinblock{\quasisection}{\endquasisection}% |
| 764 |
\closeifinblock{\section}{\endsection}% |
| 765 |
\closeifinblock{\chapterappendix}{\endchapterappendix}} |
| 766 |
|
| 767 |
\def \closeanysubsection {% |
| 768 |
\closeifinblock{\quasisubsection}{\endquasisubsection}% |
| 769 |
\closeifinblock{\subsection}{\endsubsection}} |
| 770 |
|
| 771 |
\def \closeanysubsubsection {% |
| 772 |
\closeifinblock{\subsubsection}{\endsubsubsection}} |
| 773 |
|
| 774 |
\def \closeanysubsubsubsection {% |
| 775 |
\closeifinblock{\subsubsubsection}{\endsubsubsubsection}} |
| 776 |
|
| 777 |
\def \zsinkskip #1#2#3{% {sink}{penalty}{skip} |
| 778 |
\if \dimposp{#3}% |
| 779 |
\bbskipabove{#2}{#3}% |
| 780 |
\else |
| 781 |
\vsinkfromtypearea{#1}% |
| 782 |
\fi} |
| 783 |
|
| 784 |
\def \zskipabovehead #1#2{% {penalty}{skip} |
| 785 |
\bbskipabove{#1}{#2}% |
| 786 |
\if \dimneqlp{\topadjust}{\mindimen}% |
| 787 |
\vskip -\topadjust |
| 788 |
\tdimena = \prevdepth |
| 789 |
\rule{height 0pt depth 0pt width 0pt}% |
| 790 |
\prevdepth = \tdimena |
| 791 |
\penalty \breaknever |
| 792 |
\vskip \topadjust |
| 793 |
\fi} |
| 794 |
|
| 795 |
% If the author level is negative, the ToC entry goes before the chapter's |
| 796 |
% entry. Otherwise it goes after the chapter's entry. |
| 797 |
|
| 798 |
\def \zpartchaptoc #1#2#3{% |
| 799 |
\edef \znext {\noexpand\tocentry{}{\the\authortext}}% |
| 800 |
\if \andp{\notp{\emptytoksp{\authortext}}}{\negp{\authorlevel}}% |
| 801 |
\znext{-\authorlevel}% |
| 802 |
\fi |
| 803 |
\ztocentry{#1}{#2}{#3}{\allowintoc}% |
| 804 |
\if \andp{\notp{\emptytoksp{\authortext}}}{\posp{\authorlevel}}% |
| 805 |
\znext{\authorlevel}% |
| 806 |
\fi} |