summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/kluwer/klulist.sty
blob: 1ed2157514108517731b83add11222ff951ef8b3 (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
%
%<*other>
%
\ifcat a\noexpand @\let\next\relax\else \def\next{%
\documentclass{kluwer}\usepackage{doc}\MakePercentIgnore}\fi\next
\NeedsTeXFormat{LaTeX2e}
\def\filedate{2000/04/29}
% \def\changes#1#2{}
% \changes{1999/10/21}{option margspec to let user-specified
%   values for \leftmargini[i[i]] persist. Under this option,
%   enumerate still enlarges \leftmargin if it would otherwise
%   be too small; only meaningful with kaplist.
%   restored @mklab to its function as a hook}
% \changes{2000/03/27}{set or preserve topsepm@th in
%   enumerate/itemize environments for trivm@th; see klumath}
\def\filename{klulist.sty}
%\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
%\newcommand{\Bs}{$\backslash$}      
%\parindent=0pt
%\parskip=3pt
%\hfuzz=10pt
%\MakeShortVerb{\|}
%\addtolength{\textwidth}{4pc}
%\begin{document}
%\begin{opening}
%\title{\filename}
%\date{\filedate}
%\author{Kluwer Academic Publishers\surname{}}
%\institute{~}
%\begin{abstract}
% This internal stylefile takes care of list definitions and `general'
% environments. There is one option: |kaplist|. 
%\end{abstract}
%\end{opening}
%\tableofcontents
%\section{Usage}
% For the time being, all environments for which it is not so clear
% where to put them are placed in this file. This came about because
% most of these are |\trivlist| alike, but is quite arbitrary.
%
% As a result, this stylefile defines the following `common'
% environments: \\[6pt]
%|verse|\\
%|quote|\\
%|quotation|\\
%|frontmatter|\\
%|acknowledgements|\\
%|notes|\\
%|vitae|\\
%|ao|\\
%~
% And, of course, |itemize|, |enumerate| and |description|.
%\section{Implementation}
%    \begin{macrocode}
\ProvidesPackage{klulist}[\filedate ]
%</other>
%<*head>
\newif\if@kaplist
\DeclareOption{kaplist}{\@kaplisttrue}
%    \end{macrocode}
% The following new option ensures that kaplist does not overrule
% existing settings of |leftmargini| etc.
%    \begin{macrocode}
\newif\if@margspec
\DeclareOption{margspec}{\@margspectrue}
%</head>
%<*other>
%\ExecuteOptions{...} % placeholder
\ProcessOptions\relax
%</other>
%<*main>
%    \end{macrocode}
% The label and counter default values for |enumerate|. Reference
% output at a level above 3 starts to look ridiculous.
%    \begin{macrocode}
\def\labelenumi{\arabic{enumi}.}        % 1.
\def\theenumi{\arabic{enumi}}           % 1
\def\labelenumii{\alph{enumii})}        % a)
\def\theenumii{\alph{enumii}}           % a
\def\p@enumii{\theenumi}                % 1a
\def\labelenumiii{\it\roman{enumiii})}  % \it i)
\def\theenumiii{\roman{enumiii}}        % i
\def\p@enumiii{\theenumi(\theenumii)}   % 1(a)\it i) 
\def\labelenumiv{\Alph{enumiv})}        % A)
\def\theenumiv{\Alph{enumiv}}           % A
\def\p@enumiv{\p@enumiii\theenumiii}    % 1(a)\it i)A
%    \end{macrocode}
% Itemize labels 
%    \begin{macrocode}
\def\labelitemi{\m@th$-$}            
\def\labelitemii{\m@th$\bullet$}    
\def\labelitemiii{\m@th$\ast$}      
\def\labelitemiv{{\footnotesize +}}  
%    \end{macrocode}
% Description list.
%    \begin{macrocode}
\def\descriptionlabel#1{\hspace\labelsep \bf #1}
\newenvironment{description}{%
  \list{}{%
    \labelwidth\z@
    \itemindent -\leftmargin
    \let\makelabel\descriptionlabel
    }}{\endlist}
%    \end{macrocode}
% \subsection{kaplist}
% This changes quite a lot of things. 
%
% Insert different options to |\list|
%    \begin{macrocode}
\newskip\topsepm@th
\if@kaplist
  \def\kapitemargs{%
   \topsep        \z@ \@plus 1pt
   \partopsep     \z@ \@plus 1pt
   \itemsep       \z@ \@plus \z@
   \parsep        \z@ \@plus 1pt
%      items separated by \itemsep plus \parsep
   \if@margspec \else \leftmargini   \z@ \fi
   \if@margspec \else \leftmarginii  1em \fi
   \if@margspec \else \leftmarginiii 1em \fi
   \if@margspec \else \leftmarginiv  1em \fi
   \if@margspec
     \leftmargin\csname leftmargin\romannumeral\@itemdepth\endcsname
     \labelwidth\leftmargin
     \advance\labelwidth-\labelsep
   \fi
   \rightmargin   \z@
   \listparindent \z@
   \itemindent    \z@
  }           
  \def\kapenumargs{%
   \topsep        \z@ \@plus 1pt
   \partopsep     \z@ \@plus 1pt
   \itemsep       \z@ \@plus \z@
   \parsep        \z@ \@plus 1pt
   \if@margspec \else \leftmargini   \z@ \fi
   \if@margspec \else \leftmarginii  1em \fi
   \if@margspec \else \leftmarginiii 1em \fi
   \if@margspec \else \leftmarginiv  1em \fi
   \if@margspec
     \leftmargin\csname leftmargin\romannumeral\@enumdepth\endcsname
     \labelwidth\leftmargin
     \advance\labelwidth-\labelsep
   \fi
   \rightmargin   \z@
   \listparindent \z@
   \itemindent    \z@
  }           
%    \end{macrocode}
% Changed |\@mklab| from |[    1]| to |[1     ]|
%    \begin{macrocode}
  \renewcommand{\@mklab}[1]{#1\hfil} % for custom list env-s only
\else
\def\kapenumargs{}
\def\kapitemargs{}
\fi
%    \end{macrocode}
% Label formatting for enumerate and itemize defined \emph{outside}
% these environments, for easier customization.
%    \begin{macrocode}
\def\@@enum@label#1{\hss \llap{#1}} % may stick out into l. margin
\def\@@item@label#1{\hss #1\hfil}
%    \end{macrocode}
% \subsection{Other environments}
% These are the environments that we {\it have\/} to define.
%
% This enumerate has an optional argument and uses that to implement dynamic
% resizing of the left margin.
%
% This itemize has an extra optional argument that gives the default label.
%    \begin{macrocode}
\def\enumerate{\@ifnextchar[%
    {\kap@enumerate}%
    {\if@margspec \kap@enumerate[] \else \kap@enumerate[00] \fi }}
\def\kap@enumerate[#1]{%
     \ifnum \@enumdepth >3 \@toodeep\else
       \advance\@enumdepth \@ne
       \edef\@enumctr{enum\romannumeral\the\@enumdepth}
       \list{\csname label\@enumctr\endcsname}{%
         \topsepm@th \topsep
         \kapenumargs 
         \usecounter{\@enumctr}
         \settowidth\labelwidth{#1.}
         \setlength{\@tempdima}{\labelwidth}
         \addtolength{\@tempdima}{\labelsep}
         \if@margspec
           \ifdim \@tempdima > \leftmargin
             \setlength{\leftmargin}{\@tempdima}
           \fi
         \else
             \setlength{\leftmargin}{\@tempdima}
         \fi
         \let\makelabel\@@enum@label}
     \fi
   }
\let\endenumerate\endlist

\def\itemize{\@ifnextchar[{\kap@itemize}{\kap@itemize[]}}
\def\kap@itemize[#1]{\def\klu@arg{#1}%  
    \ifnum \@itemdepth >3 \@toodeep
    \else
      \advance\@itemdepth \@ne 
      \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
      \ifx \klu@arg\empty 
        \list {\csname\@itemitem\endcsname}{%
        \topsepm@th \topsep
        \kapitemargs
          \let\makelabel\@@item@label}
      \else 
        \list {\klu@arg }{%
          \kapitemargs
          \let\makelabel\@@item@label
          }
      \fi
    \fi 
    }
\let\enditemize\endlist
\def\verse{\let\\=\@centercr
  \list{}{\itemsep\z@
      \itemindent -1.5em
      \listparindent \itemindent
      \rightmargin\leftmargin
      \advance\leftmargin 1.5em
  }\item[]}
\let\endverse\endlist               

\def\quotation{\quoteskip
  \list{}{%
     \listparindent 1.5em
     \topsep .5ex plus 2pt minus 1pt
     \itemindent\listparindent
     \parsep 0pt plus 1pt
     }\item[]
  \hskip-\listparindent}
\def\endquotation{\endlist\quoteskip}

\def\quote{\quoteskip\list{}{%
  \leftmargin 1.5em
  \topsep .5ex plus 2pt minus 1pt
  }\item[]}
\def\endquote{\endlist\quoteskip}
\def\quoteskip{}

\def\frontmatter{\begingroup\thispagestyle{empty}%
    \renewcommand{\thepage}{\roman{page}}\setcounter{page}{1}}
\def\endfrontmatter{\newpage\endgroup\setcounter{page}{1}}
%    \end{macrocode}
% \subsection{`New' environments}
% The |notes| environment is used for incapsulation of `endnotes' that
% are typed in.
%    \begin{macrocode}
\newenvironment{notes}{\sectioncmd*{\notesname}\footnotesize
                    \begin{enumerate}}{\end{enumerate}%
                      \par \vskip 6pt \@plus 12pt \@minus 2pt}
\def\notesname{Notes}
%    \end{macrocode}
% 
% This is the |vitae| environment. It does not use a list, but `item's
% are specified through |\Vauthor|. The name is defined in
% |\vitaename| and |\multiplevitaename|. 
%
% The choice between these two names is done by checking the value of
% |enumiv|, which is incremented by every |\Vauthor|.
%    \begin{macrocode}
\newenvironment{vitae}{%
    \begingroup 
    \setcounter{enumiv}{0}%
    \global\setbox0=\vbox\bgroup
    }{%
    \egroup
    \ifnum \c@enumiv > 1
      \par\section*{\multiplevitaename}%
    \else
      \par\section*{\vitaename}%
    \fi
    \unvbox0 \endgroup \par
    \vspace{24pt}%
  }
\newcommand{\Vauthor}[1]{%
    \addtocounter{enumiv}{1}%
    \subsubsection*{#1}%
    }
  \def\vitaename{Author's Vitae}%      
  \def\multiplevitaename{Authors' Vitae}%
%    \end{macrocode}
% |ao| will be typeset at the end of an article. 
% I exchanged the |\if| for a permanent |\box|, because
% the box is needed anyway. 
%    \begin{macrocode}
\newbox\aobox
\newenvironment{ao}{%
  \global\setbox\aobox
  \vbox\bgroup
    \footnotesize\noindent
%    \end{macrocode}
% Watch out for the fixed space here. 
%    \begin{macrocode}
    \ifx\offprintsaddress\empty 
    \leavevmode
    \else
      {\it \offprintsaddress:\/}\ 
    \fi
  }
  {\par\vskip18pt\egroup}
\newcommand{\make@ao}{%
    \@tempdima \ht\aobox 
    \ifdim \@tempdima > 0pt
    \vskip 1pc % added by SK
    \par\noindent \unvbox\aobox 
    \fi 
    }
%    \end{macrocode}                 
% This is a name that is not done at |\begin{document}|, because
% certain style may want to change this. The safeguard above is in
% case a style defines it to be empty.
%    \begin{macrocode}
\newcommand{\offprintsaddress}{Address for Offprints}
\newenvironment{thenomenclature}{\section*{Nomenclature}
    \parbox[t]{.48\textwidth}\bgroup\parindent 0pt
    \footnotesize \begin{tabular}{p{2pc}p{11pc}}}{%
              \end{tabular}\egroup}
\newcommand{\splitnomen}{\end{tabular}\egroup~\parbox[t]{.48\textwidth}%
    \bgroup\parindent 0pt \footnotesize \begin{tabular}{p{2pc}p{11pc}}}
\newcommand{\nmc}[1]{\parbox[t]{11pc}{\raggedright #1}}
\def\verbatim@font{\normalsize\tt}
\def\acknowledgementsname{Acknowledgements}%
\def\acknowledgements{\section*{\acknowledgementsname}%
  \message{\acknowledgementsname}}
\def\endacknowledgements{\par \bigskip} 
%</main>
%<*other>
\endinput
%    \end{macrocode}
%\PrintIndex
%\end{document} 
% end of klulist.sty

%</other>