]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/matita/klusec.sty
ocaml 3.09 transition
[helm.git] / helm / papers / matita / klusec.sty
1 %
2 %
3 \ifcat a\noexpand @\let\next\relax\else \def\next{%
4 \documentclass{kluwer}\usepackage{doc}\MakePercentIgnore}\fi\next
5 \def\filedate{1998/03/13}
6 \def\filename{klusec.sty}
7 %\changes{1997/07/13}{Inserted mainmatter switch}{}
8 %\changes{1997/07/13}{Inserted tocentry in theindex}{}
9 %\DoNotIndex{\@M,\def,\c@secnumdepth,\baselineskip,\@pnumwidth,\else,\fi}
10 %\DoNotIndex{\newcommand,\z@,\relax,\renewcommand,\ifnum,\csname,\endcsname}
11 %\DoNotIndex{\baselineskip,\vskip,\hskip,\relax,\secdef,\refstepcounter}
12 %\DoNotIndex{\normalsize,\numberline,\protect,\endinput}
13 %\CodelineIndex         
14 %\changes{1997/02/12}{TH: added a space after 'partname'.}{}
15 %\newcommand{\Bs}{$\backslash$}
16 %\parindent=0pt
17 %\parskip=3pt
18 %\hfuzz=10pt
19 %\MakeShortVerb{\|}
20 %\setlength\marginparwidth{0pt}
21 %\addtolength{\textwidth}{4pc}
22 %\begin{document}
23 %\begin{opening}
24 %\title{\filename}
25 %\runningtitle{\filename\ -- \filedate}
26 %\date{\filedate}
27 %\author{Kluwer Academic Publishers}
28 %\runningauthor{Kluwer Academic Publishers}
29 %\institute{~}
30 %\begin{abstract}
31 %This internal stylefile  defines all sectioning commands used by
32 %all kluwer style files. In order to facilitate usage by different
33 %stylefiles, most command herein are parameterised. 
34 %There is an option to include a definition for \verb!\chapter!
35 %(|chapter|).
36 %\end{abstract}
37 %\end{opening}
38 %\tableofcontents
39 %\newpage
40 %\section{Interface}
41 %All `ordinary' sectioning command such as |\section| |\subsection| etc.
42 %Have the following macros defined:
43 %
44 %\begin{tabular}{ll}
45 %\Bs{\it X}hang       & (1arg)\\
46 %\Bs{\it X}spaceabove\\
47 %\Bs{\it X}spaceafter \\
48 %\Bs{\it X}flushstyle\\
49 %\Bs{\it X}numstyle\\
50 %\Bs{\it X}textstyle\\
51 %\Bs{\it X}case       & (1arg)
52 %\end{tabular}
53
54 %Where {\it X} is one of the following:
55
56 %\begin{tabular}{ll}
57 %C   &chapter\\
58 %S   &section\\
59 %SS  &subsection\\
60 %SSS &subsubsection\\
61 %P   &paragraph\\
62 %SP  &subparagraph
63 %\end{tabular}
64
65 %\begin{itemize}
66 %\item
67 %The {\it X}hang macro encapsulates the number and the separating
68 %space. In the default
69 %configuration, for instance, |\SShang| sets hanging indentation
70 %for the subsection title to the width of the number, resulting in 
71 %sections looking like this:
72
73 %\end{itemize}
74 %\subsection{This is a very long example of an otherwise quite 
75 %    ordinary section. I stretched it a lot so you can see the
76 %   runover..... }
77 %\begin{itemize}
78 %\item
79 %This is implemented by this line:
80
81 %\begin{verbatim}
82 %\newcommand{\SShang}[1]{\Forcedhang{#1}}
83 %\end{verbatim}
84
85 %where the macro \Bs Forcedhang calculates the needed \Bs hangafter. 
86 %Another use for this macro could be:
87
88 %\begin{verbatim}
89 %\renewcommand{\Shang}[1]{\charkern{#1}} 
90 %\end{verbatim}
91
92 %To get spaced out numbering (somewhat trivial example) or 
93
94 %\begin{verbatim}
95 %\renewcommand{\Shang}[1]{}
96 %\end{verbatim}
97  
98 %To force  |\section*| like layout.
99
100 %\item
101 %\Bs{\it X}spaceabove is a skip value in the vertical direction. 
102 %e.g.\\ |\renewcommand{\Pspaceabove}{.5\baselineskip}|
103
104 %\item
105 %\Bs{\it X}spaceafter is a `real' macro, that is supposed to typeset
106 %either a horizontal or a vertical skip. However, this macro can do
107 %anything:\\ |\renewcommand{\Pspaceafter}{\hskip 1em}|  
108
109 %\item
110 %\Bs{\it X}flushstyle is for |\centering| etc.
111
112 %\item
113 %\Bs{\it X}numstyle and \Bs{\it X}textstyle control things like 
114 %sizes and fontshape. These two and \Bs{\it X}flushstyle are inside the
115 %same group, so there is no need to define things like |\bfseries|
116 %twice in a row.
117
118 %\item
119 %\Bs{\it X}case behaves identical to \Bs{\it X}hang, but it braces
120 %the text of the sectioning command.
121 %\end{itemize}
122 % \section{Considerations}
123 %The following need extra attention:
124 %\begin{itemize}
125 %\item 
126 %|\part|, |\chapter| and |\index| set |\thispagestyle| to the pagestyle with 
127 %the same name. This needs to be taken care of in |kluopen.sty| of the 
128 % stylefile. This file (\filename) simply |\let|'s them all to |empty|.
129 %\item
130 %|\sectioncmd| is either  |\section| or |\chapter|. This is more efficient
131 % than doing everything twice. The stylefile has to set this like this:\\
132 %|\AtBeginDocument{\let\sectioncmd\section}|, or it will fail.
133 %
134 %\item 
135 %|\@secnumdepth| works, for the first time in  any kluwer stylefile that I 
136 %know of. It's default value is 4, so only |\subparagraph| does NOT have a
137 %section number attached.
138 %\item |\sectiondot| and |\chapterdot| contain a dot to be typeset after
139 %the number of the section$\|$chapter.
140 %\end{itemize}
141 % \section{Defaults}
142 % The following table contains the default values as set in this
143 % file. 
144 %
145 %{\little
146 %\begin{tabular}{llllllll} \hline
147 %Type&spaceabove&spacebelow&flushstyle&numstyle&textstyle&hang&case\\ \hline
148 %C  &33pt       &vskip 33pt       &centering  &large rm &- &-&-\\
149 %S  &2bs+6pt-4pt&vskip 1bs+3pt-2pt&centering  &bf       &- &Forcedhang&-\\
150 %SS &1bs+3pt-2pt&vskip 1bs+3pt-2pt&raggedright&rm       &sc&Forcedhang&-\\
151 %SSS&1bs+3pt-2pt&vskip 1sp        &raggedright&rm       &it&Forcedhang&-\\
152 %P  &1bs+3pt-2pt&hskip .5em       &-         &rm        &it&-&-\\
153 %SP &1bs+3pt-2pt&hskip .5em       &-         &rm        &it&-&-\\ \hline
154 %\end{tabular}
155 %
156 % bs = |\baselineskip|
157 %}
158 % \section{Implementation}  
159 %     \begin{macrocode}
160 \NeedsTeXFormat{LaTeX2e}
161 \ProvidesPackage{klusec}[\filedate ]
162 \newif\if@chapterdef  \@chapterdeffalse
163 \DeclareOption{chapter}{\@chapterdeftrue }
164 \ExecuteOptions{}
165 \ProcessOptions
166 %    \end{macrocode}
167 %\newpage\subsection{Part}
168 % Definition of |\part|. Not much work is done on this, because it is
169 % not used this often, and fairly easy to circumvent (if needed).
170 %    \begin{macrocode}
171 \newcommand{\part}{%
172   \cleardoublepage
173   \thispagestyle{part}%
174   \hbox{}\vskip 2in
175   \secdef\@part\@spart}
176 \def\@part[#1]#2{%
177   \ifnum \c@secnumdepth >-2\relax
178     \refstepcounter{part}%
179     \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
180   \else
181     \addcontentsline{toc}{part}{#1}%
182   \fi
183   \imarkboth{}{}%
184   {\centering
185     \ifnum \c@secnumdepth >-2\relax
186       \huge\bf \partname\ \thepart
187       \par
188       \vskip 20pt 
189     \fi
190     \Huge \bf #1\par
191   }%
192   \@endpart
193   }
194
195 \def\@spart#1{{\centering\Huge \bf #1\par}\@endpart}
196 \def\@endpart{\vfil\cleardoublepage}                       
197 \def\partname{Part}
198 \let\ps@part\ps@empty
199 %
200 %    \end{macrocode}
201 %\newpage\subsection{Chapter}
202 %    \begin{macrocode}
203                
204 \if@chapterdef
205
206   %
207   % Typeset text and number. 
208   %
209   \newcommand{\@makechapterhead}[2]{\vspace*{\Cspaceabove}%
210     {\parindent 0pt \hyphenpenalty 10000
211      \Cflushstyle \Cnumstyle
212      \Chang{#1}%
213      \Ctextstyle \Ccase{#2}\par
214      \nobreak \Cspaceafter \relax
215     }}
216
217   \newcommand{\chapter}{%
218 %    \end{macrocode}
219 %
220 % openright will be handled by the stylefile
221 %
222 %    \begin{macrocode}
223     \if@openright
224         \cleardoublepage 
225     \else
226        \clearpage
227     \fi
228     \thispagestyle{chapter}%
229     \global\@topnum\z@
230     \@afterindentfalse 
231     \secdef\@chapter\@schapter
232     }
233   \def\@chapter[#1]#2{%
234     \ifnum \c@secnumdepth >\m@ne
235       \refstepcounter{chapter}%
236       \message{\@chapapp\space\thechapter\chapterdot}%
237       \addcontentsline{toc}{chapter}{\protect
238         \numberline{\thechapter}#1}%
239     \else
240       \addcontentsline{toc}{chapter}{#1}%
241     \fi
242     \chaptermark{#1}%
243     \addtocontents{lof}{\protect\addvspace{10pt}}%
244     \addtocontents{lot}{\protect\addvspace{10pt}}%
245     \@makechapterhead{\thechapter\chapterdot\ }{#2}% 
246     \@afterheading
247     }
248   \newcommand{\@schapter}[1]{\@makechapterhead{}{#1} \@afterheading}
249  
250   \newcommand{\Chang}[1]{#1}
251   \newcommand{\Cspaceabove}{33pt}
252   \newcommand{\Cspaceafter}{\vskip 33pt}
253   \newcommand{\Cflushstyle}{\centering} 
254   \newcommand{\Cnumstyle}{\large\rm}
255   \newcommand{\Ctextstyle}{}
256   \newcommand{\Ccase}[1]{#1}
257   \newcommand{\@chapapp}{\chaptername}
258   \newcommand{\chapterdot}{.}
259   \let\ps@chapter\ps@empty
260 \fi                    
261 %    \end{macrocode}
262 %\newpage\subsection{Utility macro's}
263
264 % The |\@haveatleast| is (loosely) borrowed from the \TeX Book. Because
265 % of it's implementation, it will do `raggedbottom'-like things to pages,
266 % but the other option turned out to be worse. A page optimizer would come
267 % very handy indeed! The penalty is rather high, because we'd rather borrow 
268 % some whitespace from the rest of the page.
269 % \changes{1997/07/13}{Change of policy: penalty is 0 now}{}
270 % \changes{1997/07/13}{nobreak inserted between box and glue}{}
271 %    \begin{macrocode}
272 \newcommand{\vsecspace}[1]{%
273    \if@nobreak\else
274      \vskip #1\relax \fi}
275 \def\Shaveatleast{5\baselineskip}
276 \def\SShaveatleast{4\baselineskip}
277 \def\SSShaveatleast{4\baselineskip}
278 \newcommand{\@haveatleast}[1]{\relax\par \vskip #1 
279      \penalty 0\vskip -#1 \relax }
280 \def\@Xsect{%
281     \global\@nobreakfalse
282     \global\@noskipsectrue
283     \everypar{\setbox0\lastbox
284       \global\@noskipsecfalse
285       \begingroup \@Svsechd \endgroup 
286       \everypar{}%
287      }}
288 %    \end{macrocode}
289 %|\Forcedhang| is named after it's normal usage. However, it is a bit more  
290 % general than that, so maybe it will move to some other place eventually.
291 % Typesets its argument and sets the current paragraph's |\hangafter| to
292 % be the width of the argument.
293 %    \begin{macrocode}
294 \newcommand{\Forcedhang}[1]{\leavevmode
295     \setbox0=\hbox{#1}\hangindent\wd0
296     \hangafter=1 \box0 }
297 %    \end{macrocode}
298 %    \begin{macrocode}
299 \def\contentsname{Table of Contents}%
300 \def\listfigurename{List of Figures}%
301 \def\listtablename{List of Tables}%
302 \def\chaptername{Chapter}%
303 \def\sectionname{Section}%
304 \def\appendixname{Appendix}%
305 %    \end{macrocode} 
306 %\newpage\subsection{Section}
307 %    \begin{macrocode}
308 \newcommand{\@makesectionhead}[2]{\vsecspace{\Sspaceabove}%
309   {\parindent0pt \hyphenpenalty=10000 \baselineskip12pt
310    \Sflushstyle \Snumstyle                   
311    \Shang{#1}%
312    \Stextstyle \Scase{#2}\par
313    \nobreak \Sspaceafter \relax 
314    }}
315
316 \newcommand{\section}{\@haveatleast{\Shaveatleast
317     }\@afterindentfalse \secdef\@section\@ssection}
318
319 \def\@section[#1]#2{%
320   \ifnum \c@secnumdepth >\z@
321     \refstepcounter{section}%
322     \addcontentsline{toc}{section}{\protect \numberline{\thesection}#1}%
323   \else
324     \addcontentsline{toc}{section}{#1}%
325   \fi
326   \sectionmark{#1}%
327   \@makesectionhead{\thesection\sectiondot\hskip 0.7em}{#2}%
328   \@afterheading
329   }
330
331 \def\@ssection#1{\@makesectionhead{}{#1}\@afterheading}
332
333 \newcommand{\Shang}[1]{\Forcedhang{#1}}
334 \newcommand{\Sflushstyle}{\centering}
335 \newcommand{\Snumstyle}{\normalsize\bf}
336 \newcommand{\Stextstyle}{}
337 \newcommand{\Sspaceabove}{2\baselineskip plus6pt minus4pt}
338 \newcommand{\Sspaceafter}{\vskip 1\baselineskip plus3pt minus2pt}
339 \newcommand{\Scase}[1]{#1}
340 \newcommand{\sectiondot}{.}
341 %    \end{macrocode}
342 %\newpage\subsection{Subsection}
343 %    \begin{macrocode}
344 \newcommand{\@makesubsectionhead}[2]{\vsecspace{\SSspaceabove}% 
345   {\parindent0pt \hyphenpenalty=10000 \baselineskip12pt
346    \SSflushstyle \SSnumstyle
347    \SShang{#1}%
348    \SStextstyle \SScase{#2}\par
349    \nobreak \SSspaceafter \relax
350    }}
351
352 \newcommand{\subsection}{\@haveatleast{\SShaveatleast}%
353   \@afterindentfalse \secdef\@subsection\@ssubsection
354   }
355
356 \def\@subsection[#1]#2{%
357   \ifnum \c@secnumdepth >\@ne
358     \refstepcounter{subsection}%
359     \addcontentsline{toc}{subsection}{\protect
360       \numberline{\thesubsection}#1}%
361   \else
362     \addcontentsline{toc}{subsection}{#1}%
363   \fi
364   \subsectionmark{#1}
365   \@makesubsectionhead{\thesubsection\sectiondot\hskip 0.7em}{#2}%
366   \@afterheading
367   }
368 \def\@ssubsection#1{\@makesubsectionhead{}{#1}\@afterheading}
369
370
371 \newcommand{\SShang}[1]{\Forcedhang{#1}}
372 \newcommand{\SSflushstyle}{\raggedright}
373 \newcommand{\SSnumstyle}{\normalsize\rm}
374 \newcommand{\SStextstyle}{\sc}
375 \newcommand{\SSspaceabove}{1\baselineskip plus3pt minus2pt}
376 \newcommand{\SSspaceafter}{\vskip .8\baselineskip plus2pt minus2pt}
377 \newcommand{\SScase}[1]{#1}                           
378 %    \end{macrocode}
379 %\newpage\subsection{Subsubsection}
380 %    \begin{macrocode}
381 \newcommand{\@makesubsubsectionhead}[2]{\vsecspace{\SSSspaceabove}%         
382   {\parindent0pt \hyphenpenalty=10000 \baselineskip12pt
383     \SSSflushstyle \SSSnumstyle
384     \SSShang{#1}%
385     \SSStextstyle \SSScase{#2}\par
386     \nobreak \SSSspaceafter \relax
387     }}
388
389 \newcommand{\subsubsection}{\@haveatleast{\SSShaveatleast
390     }\@afterindentfalse 
391   \secdef\@subsubsection\@ssubsubsection}
392 \def\@subsubsection[#1]#2{%
393   \ifnum \c@secnumdepth >2
394     \refstepcounter{subsubsection}
395     \addcontentsline{toc}{subsubsection}{\protect
396        \numberline{\thesubsubsection}#1}%
397   \else
398      \addcontentsline{toc}{subsubsection}{#1}%
399   \fi
400   \subsubsectionmark{#1}
401   \@makesubsubsectionhead{\thesubsubsection\sectiondot\hskip0.7em}{#2}%
402   \@afterheading
403   }
404 \def\@ssubsubsection#1{\@makesubsubsectionhead{}{#1}\@afterheading}
405
406 \newcommand{\SSShang}[1]{\Forcedhang{#1}}
407 \newcommand{\SSSflushstyle}{\raggedright}
408 \newcommand{\SSSnumstyle}{\normalsize\rm}
409 \newcommand{\SSStextstyle}{\it}
410 \newcommand{\SSSspaceabove}{1\baselineskip plus3pt minus2pt}
411 \newcommand{\SSSspaceafter}{\vskip 1sp}
412 \newcommand{\SSScase}[1]{#1}
413 %    \end{macrocode}
414 %\newpage\subsection{Paragraph}
415 %    \begin{macrocode}
416 \newcommand{\@makeparagraphhead}[2]{%
417     \vsecspace{\Pspaceabove }%               
418  \def\@Svsechd{% 
419     {\Pflushstyle \Pnumstyle
420       \Phang{#1}%
421       \Ptextstyle \Pcase{#2}% 
422       \Pspaceafter \relax }}\@Xsect
423      }
424
425 \newcommand{\paragraph}{\par \@afterindentfalse 
426   \secdef\@paragraph\@sparagraph }
427
428 \def\@paragraph[#1]#2{%
429   \ifnum \c@secnumdepth >3
430     \refstepcounter{paragraph}%
431     \addcontentsline{toc}{paragraph}{\protect
432        \numberline{\theparagraph}#1}%
433   \else
434     \addcontentsline{toc}{paragraph}{#1}%
435   \fi
436   \paragraphmark{#1}%
437   \@makeparagraphhead{\theparagraph\sectiondot\hskip 0.7em}{#2}%
438   }
439 \def\@sparagraph#1{\@makeparagraphhead{}{#1}}
440                                             
441 \newcommand{\Pspaceabove}{1\baselineskip plus3pt minus2pt}
442 \newcommand{\Phang}[1]{#1}
443 \newcommand{\Pflushstyle}{}
444 \newcommand{\Pnumstyle}{\normalsize\rm}
445 \newcommand{\Ptextstyle}{\it}
446 \newcommand{\Pcase}[1]{#1}
447 \newcommand{\Pspaceafter}{\hskip 1em}
448 %    \end{macrocode}
449 %\newpage\subsection{Subparagraph}
450 %    \begin{macrocode}
451 \newcommand{\@makesubparagraphhead}[2]{%
452      \vskip \SPspaceabove
453  \def\@Svsechd{%
454     {\SPflushstyle \SPnumstyle
455       \SPhang{#1}%
456       \SPtextstyle \SPcase{#2}%
457       \SPspaceafter \relax}}\@Xsect
458      }
459 \newcommand{\subparagraph}{\par\@afterindentfalse 
460   \secdef\@subparagraph\@ssubparagraph }
461                                        
462 \def\@subparagraph[#1]#2{%
463   \ifnum \c@secnumdepth >4
464     \refstepcounter{subparagraph}%
465     \addcontentsline{toc}{subparagraph}{\protect
466        \numberline{\thesubparagraph}#1}%
467   \else
468     \addcontentsline{toc}{subparagraph}{#1}%
469   \fi
470   \paragraphmark{#1}%
471   \@makesubparagraphhead{\thesubparagraph\sectiondot\hskip 0.7em}{#2}%
472   }            
473 \def\@ssubparagraph#1{\@makesubparagraphhead{}{#1}}
474
475 \newcommand{\SPspaceabove}{1\baselineskip plus3pt minus2pt}
476 \newcommand{\SPhang}[1]{}
477 \newcommand{\SPflushstyle}{}
478 \newcommand{\SPnumstyle}{\normalsize\rm}
479 \newcommand{\SPtextstyle}{\it}
480 \newcommand{\SPcase}[1]{#1}
481 \newcommand{\SPspaceafter}{\hskip 1em}
482 %    \end{macrocode}
483 %\newpage\subsection{Counters}
484 %    \begin{macrocode}
485 \newcounter{part}
486 \renewcommand{\thepart}{\Roman{part}}
487 \if@chapterdef
488   \newcounter{chapter}
489   \renewcommand{\thechapter}{\arabic{chapter}}
490   \newcounter{section}[chapter]
491   \renewcommand{\thesection}{\thechapter.\arabic{section}}
492 \else
493   \newcounter{section}
494   \renewcommand{\thesection}{\arabic{section}}
495 \fi
496 \newcounter{subsection}[section]
497 \newcounter{subsubsection}[subsection]
498 \newcounter{paragraph}[subsubsection]
499 \newcounter{subparagraph}[paragraph]
500 \renewcommand{\thesubsection}{\thesection.\arabic{subsection}}
501 \renewcommand{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
502 \renewcommand{\theparagraph}{\thesubsubsection.\arabic{paragraph}}
503 \renewcommand{\thesubparagraph}{\theparagraph.\arabic{subparagraph}}
504 %    \end{macrocode}
505 %\newpage\subsection{Table of Contents}
506 %    \begin{macrocode}
507 \def\@pnumwidth{1.55em}
508 \def\@tocrmarg{2.55em}
509 \def\@dotsep{10000}
510
511 \setcounter{tocdepth}{2}
512 \setcounter{secnumdepth}{4}
513 %    \end{macrocode}
514 %The macro |\imarkboth| is defined in |kluopen.sty|, allowing the current
515 % pagestyle and/or stylefile to define the meaning.
516 %    \begin{macrocode}
517 \def\tableofcontents{\sectioncmd *{\contentsname}%
518   \imarkboth{\contentsname}{\contentsname}%
519   \message{\contentsname}%
520   \@starttoc{toc}\newpage}
521 \def\listoffigures{\sectioncmd *{\listfigurename}\imarkboth
522   {\listfigurename}{\listfigurename}%
523   \message{\listfigurename}%
524   \@starttoc{lof}}
525 \def\listoftables{\sectioncmd *{\listtablename}\imarkboth
526   {\listtablename}{\listtablename}%
527   \message{\listtablename}%
528   \@starttoc{lot}}
529
530 \def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
531 \let\l@table\l@figure
532
533 \def\l@part#1#2{%
534   \addpenalty{-\@highpenalty}
535   \addvspace{2.25em plus 1pt}
536   \begingroup
537      \@tempdima 3em
538      \parindent \z@ \rightskip \@pnumwidth
539      \parfillskip -\@pnumwidth
540      {\large \bf
541        \leavevmode
542        #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
543      \nobreak
544      \global\@nobreaktrue
545      \everypar{\global\@nobreakfalse\everypar{}}
546    \endgroup
547    }
548
549 \def\l@chapter#1#2{\addpenalty{-\@highpenalty}
550    \vskip 1.0em plus 1pt
551    \@tempdima 1.5em
552    \begingroup
553      \parindent \z@ \rightskip \@pnumwidth
554      \parfillskip -\@pnumwidth
555      \bf
556      \leavevmode
557      \advance\leftskip\@tempdima
558      \hskip -\leftskip
559      #1\nobreak\hfil \nobreak\hbox to\@pnumwidth{\hss #2}\par
560      \penalty\@highpenalty
561    \endgroup
562    }
563
564 \def\l@section{\@dottedtocline{1}{1.5em}{2.3em}}
565 \def\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
566 \def\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
567 \def\l@paragraph{\@dottedtocline{4}{10em}{5em}}
568 \def\l@subparagraph{\@dottedtocline{5}{12em}{6em}}
569 %    \end{macrocode}
570 %\newpage   
571 %
572 %    \begin{macrocode}
573 \newif\if@mainmatter \@mainmattertrue
574 \if@chapterdef 
575   \newcommand{\appendix}{\par 
576     \@mainmatterfalse
577     \setcounter{chapter}{0}%
578     \setcounter{section}{0}%
579     \renewcommand{\thechapter}{\Alph{chapter}}%
580     \renewcommand{\@chapapp}{\appendixname}%
581     \message{\appendixname}%
582     }
583 \else
584   \newcommand{\appendix}{\par
585     \section*{Appendix}%
586     \setcounter{section}{0}%
587     \setcounter{subsection}{0}%
588     \renewcommand{\thesection}{\Alph{section}}%
589     \message{\appendixname}%
590     }
591 \fi
592
593 \newenvironment{theindex}{%
594   \columnseprule \z@
595   \columnsep \indexsep
596   \if@chapterdef
597     \twocolumn[\@makechapterhead{}{\indexname}]
598     \addcontentsline{toc}{chapter}{\indexname}%
599   \else
600     \twocolumn[\@makesectionhead{}{\indexname}]
601     \addcontentsline{toc}{section}{\indexname}%
602   \fi
603   \imarkboth{\indexname}{\indexname}%
604   \message{\indexname}%
605   \thispagestyle{index}%
606   \parindent\z@
607   \parskip\z@ plus .3pt\relax
608   \let\item\@idxitem \indexfont
609   }{\onecolumn}   
610 \def\indexfont{\footnotesize}
611 \let\ps@index\ps@empty
612 \def\@idxitem{\par\hangindent 36pt}
613 \def\subitem{\par\hangindent 36pt \hspace*{12pt}}
614 \def\subsubitem{\par\hangindent 36pt \hspace*{24pt}}
615 \def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
616 \def\indexsep{24pt}
617 \endinput
618 %    \end{macrocode}
619 %\PrintIndex
620 %\end{document}
621 % end of klusec.sty
622
623
624
625