summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/kluwer/klusec.sty
blob: 749eb9224bb7cf222ae705d17d4664edecab4e41 (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
%
%<*other>
%
\ifcat a\noexpand @\let\next\relax\else \def\next{%
\documentclass{kluwer}\usepackage{doc}\MakePercentIgnore}\fi\next
\def\filedate{2000/04/29}
\def\filename{klusec.sty}
%\changes{1997/07/13}{Inserted mainmatter switch}{}
%\changes{1997/07/13}{Inserted tocentry in theindex}{}
%\DoNotIndex{\@M,\def,\c@secnumdepth,\baselineskip,\@pnumwidth,\else,\fi}
%\DoNotIndex{\newcommand,\z@,\relax,\renewcommand,\ifnum,\csname,\endcsname}
%\DoNotIndex{\baselineskip,\vskip,\hskip,\relax,\secdef,\refstepcounter}
%\DoNotIndex{\normalsize,\numberline,\protect,\endinput}
%\CodelineIndex         
%\changes{1997/02/12}{TH: added a space after 'partname'.}{}
%\changes{2000/03/22}{SK: changed 'spacebelow' to 'spaceafter' in comment}{}
%\newcommand{\Bs}{$\backslash$}
%\parindent=0pt
%\parskip=3pt
%\hfuzz=10pt
%\MakeShortVerb{\|}
%\setlength\marginparwidth{0pt}
%\addtolength{\textwidth}{4pc}
%\begin{document}
%\begin{opening}
%\title{\filename}
%\runningtitle{\filename\ -- \filedate}
%\date{\filedate}
%\author{Kluwer Academic Publishers}
%\runningauthor{Kluwer Academic Publishers}
%\institute{~}
%\begin{abstract}
%This internal stylefile  defines all sectioning commands used by
%all kluwer style files. In order to facilitate usage by different
%stylefiles, most command herein are parameterised. 
%There is an option to include a definition for \verb!\chapter!
%(|chapter|).
%\end{abstract}
%\end{opening}
%\tableofcontents
%\newpage
%\section{Interface}
%All `ordinary' sectioning command such as |\section| |\subsection| etc.
%Have the following macros defined:
%
%\begin{tabular}{ll}
%\Bs{\it X}hang       & (1arg)\\
%\Bs{\it X}spaceabove\\
%\Bs{\it X}spaceafter \\
%\Bs{\it X}flushstyle\\
%\Bs{\it X}numstyle\\
%\Bs{\it X}textstyle\\
%\Bs{\it X}case       & (1arg)
%\end{tabular}

%Where {\it X} is one of the following:

%\begin{tabular}{ll}
%C   &chapter\\
%S   &section\\
%SS  &subsection\\
%SSS &subsubsection\\
%P   &paragraph\\
%SP  &subparagraph
%\end{tabular}

%\begin{itemize}
%\item
%The {\it X}hang macro encapsulates the number and the separating
%space. In the default
%configuration, for instance, |\SShang| sets hanging indentation
%for the subsection title to the width of the number, resulting in 
%sections looking like this:

%\end{itemize}
%\subsection{This is a very long example of an otherwise quite 
%    ordinary section. I stretched it a lot so you can see the
%   runover..... }
%\begin{itemize}
%\item
%This is implemented by this line:

%\begin{verbatim}
%\newcommand{\SShang}[1]{\Forcedhang{#1}}
%\end{verbatim}

%where the macro \Bs Forcedhang calculates the needed \Bs hangafter. 
%Another use for this macro could be:

%\begin{verbatim}
%\renewcommand{\Shang}[1]{\charkern{#1}} 
%\end{verbatim}

%To get spaced out numbering (somewhat trivial example) or 

%\begin{verbatim}
%\renewcommand{\Shang}[1]{}
%\end{verbatim}
 
%To force  |\section*| like layout.

%\item
%\Bs{\it X}spaceabove is a skip value in the vertical direction. 
%e.g.\\ |\renewcommand{\Pspaceabove}{.5\baselineskip}|

%\item
%\Bs{\it X}spaceafter is a `real' macro, that is supposed to typeset
%either a horizontal or a vertical skip. However, this macro can do
%anything:\\ |\renewcommand{\Pspaceafter}{\hskip 1em}|  

%\item
%\Bs{\it X}flushstyle is for |\centering| etc.

%\item
%\Bs{\it X}numstyle and \Bs{\it X}textstyle control things like 
%sizes and fontshape. These two and \Bs{\it X}flushstyle are inside the
%same group, so there is no need to define things like |\bfseries|
%twice in a row.

%\item
%\Bs{\it X}case behaves identical to \Bs{\it X}hang, but it braces
%the text of the sectioning command.
%\end{itemize}
% \section{Considerations}
%The following need extra attention:
%\begin{itemize}
%\item 
%|\part|, |\chapter| and |\index| set |\thispagestyle| to the pagestyle with 
%the same name. This needs to be taken care of in |kluopen.sty| of the 
% stylefile. This file (\filename) simply |\let|'s them all to |empty|.
%\item
%|\sectioncmd| is either  |\section| or |\chapter|. This is more efficient
% than doing everything twice. The stylefile has to set this like this:\\
%|\AtBeginDocument{\let\sectioncmd\section}|, or it will fail.
%
%\item 
%|\@secnumdepth| works, for the first time in  any kluwer stylefile that I 
%know of. It's default value is 4, so only |\subparagraph| does NOT have a
%section number attached.
%\item |\sectiondot| and |\chapterdot| contain a dot to be typeset after
%the number of the section$\|$chapter.
%\end{itemize}
% \section{Defaults}
% The following table contains the default values as set in this
% file. 
%
%{\little
%\begin{tabular}{llllllll} \hline
%Type&spaceabove&spaceafter&flushstyle&numstyle&textstyle&hang&case\\ \hline
%C  &33pt       &vskip 33pt       &centering  &large rm &- &-&-\\
%S  &2bs+6pt-4pt&vskip 1bs+3pt-2pt&centering  &bf       &- &Forcedhang&-\\
%SS &1bs+3pt-2pt&vskip 1bs+3pt-2pt&raggedright&rm       &sc&Forcedhang&-\\
%SSS&1bs+3pt-2pt&vskip 1sp        &raggedright&rm       &it&Forcedhang&-\\
%P  &1bs+3pt-2pt&hskip .5em       &-         &rm        &it&-&-\\
%SP &1bs+3pt-2pt&hskip .5em       &-         &rm        &it&-&-\\ \hline
%\end{tabular}
%
% bs = |\baselineskip|
%}
% \section{Implementation}  
%     \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{klusec}[\filedate ]
%</other>
%<*head>
\newif\if@chapterdef  \@chapterdeffalse
\DeclareOption{chapter}{\@chapterdeftrue }
%\ExecuteOptions{}
%</head>
%<*other>
\ProcessOptions
%</other>
%<*main>
%    \end{macrocode}
%\newpage\subsection{Part}
% Definition of |\part|. Not much work is done on this, because it is
% not used this often, and fairly easy to circumvent (if needed).
%    \begin{macrocode}
\newcommand{\part}{%
  \cleardoublepage
  \thispagestyle{part}%
  \hbox{}\vskip 2in
  \secdef\@part\@spart}
\def\@part[#1]#2{%
  \ifnum \c@secnumdepth >-2\relax
    \refstepcounter{part}%
    \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
  \else
    \addcontentsline{toc}{part}{#1}%
  \fi
  \imarkboth{}{}%
  {\centering
    \ifnum \c@secnumdepth >-2\relax
      \huge\bf \partname\ \thepart
      \par
      \vskip 20pt 
    \fi
    \Huge \bf #1\par
  }%
  \@endpart
  }

\def\@spart#1{{\centering\Huge \bf #1\par}\@endpart}
\def\@endpart{\vfil\cleardoublepage}                       
\def\partname{Part}
\let\ps@part\ps@empty
%
%    \end{macrocode}
%\newpage\subsection{Chapter}
%    \begin{macrocode}
               
\if@chapterdef

  %
  % Typeset text and number. 
  %
  \newcommand{\@makechapterhead}[2]{\vspace*{\Cspaceabove}%
    {\parindent 0pt \hyphenpenalty 10000
     \Cflushstyle \Cnumstyle
     \Chang{#1}%
     \Ctextstyle \Ccase{#2}\par
     \nobreak \Cspaceafter \relax
    }}

  \newcommand{\chapter}{%
%    \end{macrocode}
%
% openright will be handled by the stylefile
%
%    \begin{macrocode}
    \if@openright
        \cleardoublepage 
    \else
       \clearpage
    \fi
    \thispagestyle{chapter}%
    \global\@topnum\z@
    \@afterindentfalse 
    \secdef\@chapter\@schapter
    }
  \def\@chapter[#1]#2{%
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{chapter}%
      \message{\@chapapp\space\thechapter\chapterdot}%
      \addcontentsline{toc}{chapter}{\protect
        \numberline{\thechapter}#1}%
    \else
      \addcontentsline{toc}{chapter}{#1}%
    \fi
    \chaptermark{#1}%
    \addtocontents{lof}{\protect\addvspace{10pt}}%
    \addtocontents{lot}{\protect\addvspace{10pt}}%
    \@makechapterhead{\thechapter\chapterdot\ }{#2}% 
    \@afterheading
    }
  \newcommand{\@schapter}[1]{\@makechapterhead{}{#1} \@afterheading}
 
  \newcommand{\Chang}[1]{#1}
  \newcommand{\Cspaceabove}{33pt}
  \newcommand{\Cspaceafter}{\vskip 33pt}
  \newcommand{\Cflushstyle}{\centering} 
  \newcommand{\Cnumstyle}{\large\rm}
  \newcommand{\Ctextstyle}{}
  \newcommand{\Ccase}[1]{#1}
  \newcommand{\@chapapp}{\chaptername}
  \newcommand{\chapterdot}{.}
  \let\ps@chapter\ps@empty
\fi                    
%    \end{macrocode}
%\newpage\subsection{Utility macro's}
% 
% The |\@haveatleast| is (loosely) borrowed from the \TeX Book. Because
% of it's implementation, it will do `raggedbottom'-like things to pages,
% but the other option turned out to be worse. A page optimizer would come
% very handy indeed! The penalty is rather high, because we'd rather borrow 
% some whitespace from the rest of the page.
% \changes{1997/07/13}{Change of policy: penalty is 0 now}{}
% \changes{1997/07/13}{nobreak inserted between box and glue}{}
%    \begin{macrocode}
\newcommand{\vsecspace}[1]{%
   \if@nobreak\else
     \vskip #1\relax \fi}
\def\Shaveatleast{5\baselineskip}
\def\SShaveatleast{4\baselineskip}
\def\SSShaveatleast{4\baselineskip}
\newcommand{\@haveatleast}[1]{\relax\par \vskip #1 
     \penalty 0\vskip -#1 \relax }
\def\@Xsect{%
    \global\@nobreakfalse
    \global\@noskipsectrue
    \everypar{\setbox0\lastbox
      \global\@noskipsecfalse
      \begingroup \@Svsechd \endgroup 
      \everypar{}%
     }}
%    \end{macrocode}
%|\Forcedhang| is named after it's normal usage. However, it is a bit more  
% general than that, so maybe it will move to some other place eventually.
% Typesets its argument and sets the current paragraph's |\hangafter| to
% be the width of the argument.
%    \begin{macrocode}
\newcommand{\Forcedhang}[1]{\leavevmode
    \setbox0=\hbox{#1}\hangindent\wd0
    \hangafter=1 \box0 }
%    \end{macrocode}
%    \begin{macrocode}
\def\contentsname{Table of Contents}%
\def\listfigurename{List of Figures}%
\def\listtablename{List of Tables}%
\def\chaptername{Chapter}%
\def\sectionname{Section}%
\def\appendixname{Appendix}%
%    \end{macrocode} 
%\newpage\subsection{Section}
%    \begin{macrocode}
\newcommand{\@makesectionhead}[2]{\vsecspace{\Sspaceabove}%
  {\parindent0pt \hyphenpenalty=10000 \baselineskip12pt
   \Sflushstyle \Snumstyle                   
   \Shang{#1}%
   \Stextstyle \Scase{#2}\par
   \nobreak \Sspaceafter \relax 
   }}

\newcommand{\section}{\@haveatleast{\Shaveatleast
    }\@afterindentfalse \secdef\@section\@ssection}

\def\@section[#1]#2{%
  \ifnum \c@secnumdepth >\z@
    \refstepcounter{section}%
    \addcontentsline{toc}{section}{\protect \numberline{\thesection}#1}%
  \else
    \addcontentsline{toc}{section}{#1}%
  \fi
  \sectionmark{#1}%
  \@makesectionhead{\thesection\sectiondot\hskip 0.7em}{#2}%
  \@afterheading
  }

\def\@ssection#1{\@makesectionhead{}{#1}\@afterheading}

\newcommand{\Shang}[1]{\Forcedhang{#1}}
\newcommand{\Sflushstyle}{\centering}
\newcommand{\Snumstyle}{\normalsize\bf}
\newcommand{\Stextstyle}{}
\newcommand{\Sspaceabove}{2\baselineskip plus6pt minus4pt}
\newcommand{\Sspaceafter}{\vskip 1\baselineskip plus3pt minus2pt}
\newcommand{\Scase}[1]{#1}
\newcommand{\sectiondot}{.}
%    \end{macrocode}
%\newpage\subsection{Subsection}
%    \begin{macrocode}
\newcommand{\@makesubsectionhead}[2]{\vsecspace{\SSspaceabove}% 
  {\parindent0pt \hyphenpenalty=10000 \baselineskip12pt
   \SSflushstyle \SSnumstyle
   \SShang{#1}%
   \SStextstyle \SScase{#2}\par
   \nobreak \SSspaceafter \relax
   }}

\newcommand{\subsection}{\@haveatleast{\SShaveatleast}%
  \@afterindentfalse \secdef\@subsection\@ssubsection
  }

\def\@subsection[#1]#2{%
  \ifnum \c@secnumdepth >\@ne
    \refstepcounter{subsection}%
    \addcontentsline{toc}{subsection}{\protect
      \numberline{\thesubsection}#1}%
  \else
    \addcontentsline{toc}{subsection}{#1}%
  \fi
  \subsectionmark{#1}
  \@makesubsectionhead{\thesubsection\sectiondot\hskip 0.7em}{#2}%
  \@afterheading
  }
\def\@ssubsection#1{\@makesubsectionhead{}{#1}\@afterheading}


\newcommand{\SShang}[1]{\Forcedhang{#1}}
\newcommand{\SSflushstyle}{\raggedright}
\newcommand{\SSnumstyle}{\normalsize\rm}
\newcommand{\SStextstyle}{\sc}
\newcommand{\SSspaceabove}{1\baselineskip plus3pt minus2pt}
\newcommand{\SSspaceafter}{\vskip .8\baselineskip plus2pt minus2pt}
\newcommand{\SScase}[1]{#1}                           
%    \end{macrocode}
%\newpage\subsection{Subsubsection}
%    \begin{macrocode}
\newcommand{\@makesubsubsectionhead}[2]{\vsecspace{\SSSspaceabove}%         
  {\parindent0pt \hyphenpenalty=10000 \baselineskip12pt
    \SSSflushstyle \SSSnumstyle
    \SSShang{#1}%
    \SSStextstyle \SSScase{#2}\par
    \nobreak \SSSspaceafter \relax
    }}

\newcommand{\subsubsection}{\@haveatleast{\SSShaveatleast
    }\@afterindentfalse 
  \secdef\@subsubsection\@ssubsubsection}
\def\@subsubsection[#1]#2{%
  \ifnum \c@secnumdepth >2
    \refstepcounter{subsubsection}
    \addcontentsline{toc}{subsubsection}{\protect
       \numberline{\thesubsubsection}#1}%
  \else
     \addcontentsline{toc}{subsubsection}{#1}%
  \fi
  \subsubsectionmark{#1}
  \@makesubsubsectionhead{\thesubsubsection\sectiondot\hskip0.7em}{#2}%
  \@afterheading
  }
\def\@ssubsubsection#1{\@makesubsubsectionhead{}{#1}\@afterheading}

\newcommand{\SSShang}[1]{\Forcedhang{#1}}
\newcommand{\SSSflushstyle}{\raggedright}
\newcommand{\SSSnumstyle}{\normalsize\rm}
\newcommand{\SSStextstyle}{\it}
\newcommand{\SSSspaceabove}{1\baselineskip plus3pt minus2pt}
\newcommand{\SSSspaceafter}{\vskip 1sp}
\newcommand{\SSScase}[1]{#1}
%    \end{macrocode}
%\newpage\subsection{Paragraph}
%    \begin{macrocode}
\newcommand{\@makeparagraphhead}[2]{%
    \vsecspace{\Pspaceabove }%               
 \def\@Svsechd{% 
    {\Pflushstyle \Pnumstyle
      \Phang{#1}%
      \Ptextstyle \Pcase{#2}% 
      \Pspaceafter \relax }}\@Xsect
     }

\newcommand{\paragraph}{\par \@afterindentfalse 
  \secdef\@paragraph\@sparagraph }

\def\@paragraph[#1]#2{%
  \ifnum \c@secnumdepth >3
    \refstepcounter{paragraph}%
    \addcontentsline{toc}{paragraph}{\protect
       \numberline{\theparagraph}#1}%
  \else
    \addcontentsline{toc}{paragraph}{#1}%
  \fi
  \paragraphmark{#1}%
  \@makeparagraphhead{\theparagraph\sectiondot\hskip 0.7em}{#2}%
  }
\def\@sparagraph#1{\@makeparagraphhead{}{#1}}
                                            
\newcommand{\Pspaceabove}{1\baselineskip plus3pt minus2pt}
\newcommand{\Phang}[1]{#1}
\newcommand{\Pflushstyle}{}
\newcommand{\Pnumstyle}{\normalsize\rm}
\newcommand{\Ptextstyle}{\it}
\newcommand{\Pcase}[1]{#1}
\newcommand{\Pspaceafter}{\hskip 1em}
%    \end{macrocode}
%\newpage\subsection{Subparagraph}
%    \begin{macrocode}
\newcommand{\@makesubparagraphhead}[2]{%
     \vskip \SPspaceabove
 \def\@Svsechd{%
    {\SPflushstyle \SPnumstyle
      \SPhang{#1}%
      \SPtextstyle \SPcase{#2}%
      \SPspaceafter \relax}}\@Xsect
     }
\newcommand{\subparagraph}{\par\@afterindentfalse 
  \secdef\@subparagraph\@ssubparagraph }
                                       
\def\@subparagraph[#1]#2{%
  \ifnum \c@secnumdepth >4
    \refstepcounter{subparagraph}%
    \addcontentsline{toc}{subparagraph}{\protect
       \numberline{\thesubparagraph}#1}%
  \else
    \addcontentsline{toc}{subparagraph}{#1}%
  \fi
  \paragraphmark{#1}%
  \@makesubparagraphhead{\thesubparagraph\sectiondot\hskip 0.7em}{#2}%
  }            
\def\@ssubparagraph#1{\@makesubparagraphhead{}{#1}}

\newcommand{\SPspaceabove}{1\baselineskip plus3pt minus2pt}
\newcommand{\SPhang}[1]{}
\newcommand{\SPflushstyle}{}
\newcommand{\SPnumstyle}{\normalsize\rm}
\newcommand{\SPtextstyle}{\it}
\newcommand{\SPcase}[1]{#1}
\newcommand{\SPspaceafter}{\hskip 1em}
%    \end{macrocode}
%\newpage\subsection{Counters}
%    \begin{macrocode}
\newcounter{part}
\renewcommand{\thepart}{\Roman{part}}
\if@chapterdef
  \newcounter{chapter}
  \renewcommand{\thechapter}{\arabic{chapter}}
  \newcounter{section}[chapter]
  \renewcommand{\thesection}{\thechapter.\arabic{section}}
\else
  \newcounter{section}
  \renewcommand{\thesection}{\arabic{section}}
\fi
\newcounter{subsection}[section]
\newcounter{subsubsection}[subsection]
\newcounter{paragraph}[subsubsection]
\newcounter{subparagraph}[paragraph]
\renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
\renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
\renewcommand{\theparagraph}{\thesubsubsection.\arabic{paragraph}}
\renewcommand{\thesubparagraph}{\theparagraph.\arabic{subparagraph}}
%    \end{macrocode}
%\newpage\subsection{Table of Contents}
%    \begin{macrocode}
\def\@pnumwidth{1.55em}
\def\@tocrmarg{2.55em}
\def\@dotsep{10000}

\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{4}
%    \end{macrocode}
%The macro |\imarkboth| is defined in |kluopen.sty|, allowing the current
% pagestyle and/or stylefile to define the meaning.
%    \begin{macrocode}
\def\tableofcontents{\sectioncmd *{\contentsname}%
  \imarkboth{\contentsname}{\contentsname}%
  \message{\contentsname}%
  \@starttoc{toc}\newpage}
\def\listoffigures{\sectioncmd *{\listfigurename}\imarkboth
  {\listfigurename}{\listfigurename}%
  \message{\listfigurename}%
  \@starttoc{lof}}
\def\listoftables{\sectioncmd *{\listtablename}\imarkboth
  {\listtablename}{\listtablename}%
  \message{\listtablename}%
  \@starttoc{lot}}

\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
\let\l@table\l@figure

\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
     \global\@nobreaktrue
     \everypar{\global\@nobreakfalse\everypar{}}
   \endgroup
   }

\def\l@chapter#1#2{\addpenalty{-\@highpenalty}
   \vskip 1.0em plus 1pt
   \@tempdima 1.5em
   \begingroup
     \parindent \z@ \rightskip \@pnumwidth
     \parfillskip -\@pnumwidth
     \bf
     \leavevmode
     \advance\leftskip\@tempdima
     \hskip -\leftskip
     #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
     \penalty\@highpenalty
   \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}}
%    \end{macrocode}
%\newpage   
%
%    \begin{macrocode}
\newif\if@mainmatter \@mainmattertrue
\if@chapterdef 
  \newcommand{\appendix}{\par 
    \@mainmatterfalse
    \setcounter{chapter}{0}%
    \setcounter{section}{0}%
    \renewcommand{\thechapter}{\Alph{chapter}}%
    \renewcommand{\@chapapp}{\appendixname}%
    \message{\appendixname}%
    }
\else
  \newcommand{\appendix}{\par
    \section*{Appendix}%
    \setcounter{section}{0}%
    \setcounter{subsection}{0}%
    \renewcommand{\thesection}{\Alph{section}}%
    \message{\appendixname}%
    }
\fi

\newenvironment{theindex}{%
  \columnseprule \z@
  \columnsep \indexsep
  \if@chapterdef
    \twocolumn[\@makechapterhead{}{\indexname}]
    \addcontentsline{toc}{chapter}{\indexname}%
  \else
    \twocolumn[\@makesectionhead{}{\indexname}]
    \addcontentsline{toc}{section}{\indexname}%
  \fi
  \imarkboth{\indexname}{\indexname}%
  \message{\indexname}%
  \thispagestyle{index}%
  \parindent\z@
  \parskip\z@ plus .3pt\relax
  \let\item\@idxitem \indexfont
  }{\onecolumn}   
\def\indexfont{\footnotesize}
\let\ps@index\ps@empty
\def\@idxitem{\par\hangindent 36pt}
\def\subitem{\par\hangindent 36pt \hspace*{12pt}}
\def\subsubitem{\par\hangindent 36pt \hspace*{24pt}}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
\def\indexsep{24pt}
%</main>
%<*other>
\endinput
%    \end{macrocode}
%\PrintIndex
%\end{document}
% end of klusec.sty
%</other>