]> matita.cs.unibo.it Git - helm.git/blob - helm/papers/matita/klulist.sty
ocaml 3.09 transition
[helm.git] / helm / papers / matita / klulist.sty
1 %
2 %
3 \ifcat a\noexpand @\let\next\relax\else \def\next{%
4 \documentclass{kluwer}\usepackage{doc}\MakePercentIgnore}\fi\next
5 \NeedsTeXFormat{LaTeX2e}
6 \def\filedate{1998/03/17}
7 \def\filename{klulist.sty}
8 %\DoNotIndex{\@M,\def,\c@secnumdepth,\baselineskip,\@pnumwidth,\else,\fi}
9 %\DoNotIndex{\newcommand,\z@,\relax,\renewcommand,\ifnum,\csname,\endcsname}
10 %\DoNotIndex{\baselineskip,\vskip,\hskip,\relax,\secdef,\refstepcounter}
11 %\DoNotIndex{\normalsize,\numberline,\protect,\endinput}
12 %\CodelineIndex
13 %\newcommand{\Bs}{$\backslash$}      
14 %\parindent=0pt
15 %\parskip=3pt
16 %\hfuzz=10pt
17 %\MakeShortVerb{\|}
18 %\addtolength{\textwidth}{4pc}
19 %\begin{document}
20 %\begin{opening}
21 %\title{\filename}
22 %\date{\filedate}
23 %\author{Kluwer Academic Publishers\surname{}}
24 %\institute{~}
25 %\begin{abstract}
26 % This internal stylefile takes care of list definitions and `general'
27 % environments. There is one option: |kaplist|. 
28 %\end{abstract}
29 %\end{opening}
30 %\tableofcontents
31 %\newpage\section{Usage}
32 % For the time being, all environments for which it is not so clear
33 % where to put them are placed in this file. This came about because
34 % most of these are |\trivlist| alike, but is quite arbitrary.
35 %
36 % As a result, this stylefile defines the following `common'
37 % environments: \\[6pt]
38 %|verse|\\
39 %|quote|\\
40 %|quotation|\\
41 %|frontmatter|\\
42 %|acknowledgements|\\
43 %|notes|\\
44 %|vitae|\\
45 %|ao|\\
46 %~
47 % And, of course, |itemize|, |enumerate| and |description|.
48 %\newpage\section{Implementation}
49 %    \begin{macrocode}
50 \ProvidesPackage{klulist}[\filedate ]
51 \newif\if@kaplist
52 \DeclareOption{kaplist}{\@kaplisttrue}
53 \ExecuteOptions{}
54 \ProcessOptions
55 %    \end{macrocode}
56 % The label and counter default values for |enumerate|. Reference
57 % output at a level above 3 starts to look ridiculous.
58 %    \begin{macrocode}
59 \def\labelenumi{\arabic{enumi}.}        % 1.
60 \def\theenumi{\arabic{enumi}}           % 1
61 \def\labelenumii{\alph{enumii})}        % a)
62 \def\theenumii{\alph{enumii}}           % a
63 \def\p@enumii{\theenumi}                % 1a
64 \def\labelenumiii{\it\roman{enumiii})}  % \it i)
65 \def\theenumiii{\roman{enumiii}}        % i
66 \def\p@enumiii{\theenumi(\theenumii)}   % 1(a)\it i) 
67 \def\labelenumiv{\Alph{enumiv})}        % A)
68 \def\theenumiv{\Alph{enumiv}}           % A
69 \def\p@enumiv{\p@enumiii\theenumiii}    % 1(a)\it i)A
70 %    \end{macrocode}
71 % Itemize labels 
72 %    \begin{macrocode}
73 \def\labelitemi{\m@th$-$}            
74 \def\labelitemii{\m@th$\bullet$}    
75 \def\labelitemiii{\m@th$\ast$}      
76 \def\labelitemiv{{\footnotesize +}}  
77 %    \end{macrocode}
78 % Description list.
79 %    \begin{macrocode}
80 \def\descriptionlabel#1{\hspace\labelsep \bf #1}
81 \newenvironment{description}{%
82   \list{}{%
83     \labelwidth\z@
84     \itemindent -\leftmargin
85     \let\makelabel\descriptionlabel
86     }}{\endlist}
87 %    \end{macrocode}
88 %\newpage
89 % \subsection{kaplist}
90 % This changes quite a lot of things. 
91 %
92 % Insert different options to |\list|
93 %    \begin{macrocode}
94 \if@kaplist
95   \def\kapitemargs{%
96    \topsep        \z@ \@plus 1pt
97    \partopsep     \z@ \@plus 1pt
98    \itemsep       \z@ \@plus \z@
99    \parsep        \z@ \@plus 1pt
100    \leftmargini   \z@
101    \leftmarginii  1em
102    \leftmarginiii 1em
103    \leftmarginiv  1em
104    \rightmargin   \z@
105    \listparindent \z@
106    \itemindent    \z@
107   }           
108   \let\kapenumargs\kapitemargs
109 %    \end{macrocode}
110 % Changed |\@mklab| from |[    1]| to |[1     ]|
111 %    \begin{macrocode}
112   \renewcommand{\@mklab}[1]{#1\hfil}
113 \else
114 \def\kapenumargs{}
115 \def\kapitemargs{}
116 \fi
117 %    \end{macrocode}
118 % \newpage \subsection{Other environments}
119 % These are the environments that we {\it have\/} to define.
120 %
121 % This enumerate has an optional argument and uses that to implement dynamic
122 % resizing of the left margin.
123 %
124 % This itemize has an extra optional argument that gives the default label.
125 %    \begin{macrocode}
126 \def\enumerate{%
127     \@ifnextchar[{\kap@enumerate}{\kap@enumerate[00]}}
128 \def\kap@enumerate[#1]{%
129      \ifnum \@enumdepth >3 \@toodeep\else
130      \advance\@enumdepth \@ne
131      \edef\@enumctr{enum\romannumeral\the\@enumdepth}
132      \list{\csname label\@enumctr\endcsname}{%
133        \kapenumargs 
134        \usecounter{\@enumctr}
135        \settowidth\labelwidth{#1.}
136        \setlength{\leftmargin}{\labelwidth} 
137        \addtolength{\leftmargin}{\labelsep}
138        \def\makelabel##1{\hss \llap{##1}}}%
139      \fi
140    }
141 \let\endenumerate\endlist
142 \def\itemize{\@ifnextchar[{\kap@itemize}{\kap@itemize[]}}
143 \def\kap@itemize[#1]{\def\klu@arg{#1}%  
144     \ifnum \@itemdepth >3 \@toodeep
145     \else
146       \advance\@itemdepth \@ne 
147       \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
148       \ifx \klu@arg\empty 
149         \list {\csname\@itemitem\endcsname}%
150         {\kapitemargs
151          \def\makelabel##1{\hss ##1\hfil}}%
152       \else 
153         \list {\klu@arg }%
154         {\kapitemargs
155          \def\makelabel##1{\hss ##1\hfil}}%
156       \fi
157     \fi 
158     }
159 \let\enditemize\endlist
160 \def\verse{\let\\=\@centercr
161   \list{}{\itemsep\z@
162       \itemindent -1.5em
163       \listparindent \itemindent
164       \rightmargin\leftmargin
165       \advance\leftmargin 1.5em
166   }\item[]}
167 \let\endverse\endlist               
168
169 \def\quotation{\quoteskip
170   \list{}{%
171      \listparindent 1.5em
172      \topsep .5ex plus 2pt minus 1pt
173      \itemindent\listparindent
174      \parsep 0pt plus 1pt
175      }\item[]
176   \hskip-\listparindent}
177 \def\endquotation{\endlist\quoteskip}
178
179 \def\quote{\quoteskip\list{}{%
180   \leftmargin 1.5em
181   \topsep .5ex plus 2pt minus 1pt
182   }\item[]}
183 \def\endquote{\endlist\quoteskip}
184 \def\quoteskip{}
185
186 \def\frontmatter{\begingroup\thispagestyle{empty}%
187     \renewcommand{\thepage}{\roman{page}}\setcounter{page}{1}}
188 \def\endfrontmatter{\newpage\endgroup\setcounter{page}{1}}
189 %    \end{macrocode}
190 % \newpage\subsection{`New' environments}
191 % The |notes| environment is used for incapsulation of `endnotes' that
192 % are typed in.
193 %    \begin{macrocode}
194 \newenvironment{notes}{\sectioncmd*{\notesname}\footnotesize
195                     \begin{enumerate}}{\end{enumerate}%
196                       \par \vskip 6pt \@plus 12pt \@minus 2pt}
197 \def\notesname{Notes}
198 %    \end{macrocode}
199
200 % This is the |vitae| environment. It does not use a list, but `item's
201 % are specified through |\Vauthor|. The name is defined in
202 % |\vitaename| and |\multiplevitaename|. 
203 %
204 % The choice between these two names is done by checking the value of
205 % |enumiv|, which is incremented by every |\Vauthor|.
206 %    \begin{macrocode}
207 \newenvironment{vitae}{%
208     \begingroup 
209     \setcounter{enumiv}{0}%
210     \global\setbox0=\vbox\bgroup
211     }{%
212     \egroup
213     \ifnum \c@enumiv > 1
214       \par\section*{\multiplevitaename}%
215     \else
216       \par\section*{\vitaename}%
217     \fi
218     \unvbox0 \endgroup \par
219     \vspace{24pt}%
220   }
221 \newcommand{\Vauthor}[1]{%
222     \addtocounter{enumiv}{1}%
223     \subsubsection*{#1}%
224     }
225   \def\vitaename{Author's Vitae}%      
226   \def\multiplevitaename{Authors' Vitae}%
227 %    \end{macrocode}
228 % |ao| will be typeset at the end of an article. 
229 % I exchanged the |\if| for a permanent |\box|, because
230 % the box is needed anyway. 
231 %    \begin{macrocode}
232 \newbox\aobox
233 \newenvironment{ao}{%
234   \global\setbox\aobox
235   \vbox\bgroup
236     \footnotesize\noindent
237 %    \end{macrocode}
238 % Watch out for the fixed space here. 
239 %    \begin{macrocode}
240     \ifx\offprintsaddress\empty 
241     \leavevmode
242     \else
243       {\it \offprintsaddress:\/}\ 
244     \fi
245   }
246   {\par\vskip18pt\egroup}
247 \newcommand{\make@ao}{%
248     \@tempdima \ht\aobox 
249     \ifdim \@tempdima > 0pt
250     \par\noindent \unvbox\aobox 
251     \fi 
252     }
253 %    \end{macrocode}                 
254 % This is a name that is not done at |\begin{document}|, because
255 % certain style may want to change this. The saveguard above is in
256 % case a style defines it to be empty.
257 %    \begin{macrocode}
258 \newcommand{\offprintsaddress}{Address for Offprints}
259 \newenvironment{thenomenclature}{\section*{Nomenclature}
260     \parbox[t]{.48\textwidth}\bgroup\parindent 0pt
261     \footnotesize \begin{tabular}{p{2pc}p{11pc}}}{%
262               \end{tabular}\egroup}
263 \newcommand{\splitnomen}{\end{tabular}\egroup~\parbox[t]{.48\textwidth}%
264     \bgroup\parindent 0pt \footnotesize \begin{tabular}{p{2pc}p{11pc}}}
265 \newcommand{\nmc}[1]{\parbox[t]{11pc}{\raggedright #1}}
266 \def\verbatim@font{\normalsize\tt}
267 \def\acknowledgementsname{Acknowledgements}%
268 \def\acknowledgements{\section*{\acknowledgementsname}%
269   \message{\acknowledgementsname}}
270 \def\endacknowledgements{\par \bigskip} 
271 \endinput
272 %    \end{macrocode}
273 %\PrintIndex
274 %\end{document} 
275 % end of klulist.sty
276