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/02/11}
7 \def\filename{klumac.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,\gdef,\@cla,\@clb}
11 %\DoNotIndex{\normalsize,\protect,\global,\setbox,\hbox,\vbox,\endinput}
12 %\DoNotIndex{\egroup,\endgroup,\bgroup,\begingroup,\let}
14 %\newcommand{\Bs}{$\backslash$}%
19 %\addtolength{\textwidth}{4pc}
24 %\author{Kluwer Academic Publishers\surname{}}
27 % This internal stylefile defines some handy macros and exports the special
28 % \AmSTeX\ fonts if available.
32 %\newpage\section{Usage}
33 %Here are tests for the macro commands used and defined in this file:
34 %{\def\mentry#1{$#1$ & \$\string #1\$ &}
35 %\def\tentry#1{#1 & \string #1 &}
37 %\begin{tabular}{lllllllll}\hline
38 %$\I $&\verb!$\I$! &$\iduaal$ &\verb!$\iduaal$! \\
39 %$\restrict $&\verb!$\restrict$! &$\diamond$ &\verb!$\diamond$! \\
40 %$\depth $&\verb!$\depth$! &$\dom$ &\verb!$\dom$! \\
41 %$\mapdown{a}$&\verb!$\mapdown{a}$!&$\dC$ &\verb!$\dC$! \\
42 %$\dF $&\verb!$\dF$! &$\dP$ &\verb!$\dP$! \\
43 %$\dZ $&\verb!$\dZ$! &$\dQ$ &\verb!$\dQ$! \\
44 %$\gsim $&\verb!$\gsim$! &$\logr$ &\verb!$\logr$! \\
45 %$\dres $&\verb!$\dres$! &\today &\verb!\today! \\
46 %$\forces $&\verb!$\forces$! &\.{a} & \verb!\.{a}! \\
47 %$\concat $&\verb!$\concat$! &$\lh$ &\verb!$\lh$! \\
48 %$\range $&\verb!$\range$! &$\mapright{a}$&\verb!$\mapright{a}$!\\
49 %$\dL $&\verb!$\dL$! &$\dE$ &\verb!$\dE$!\\
50 %$\dN $&\verb!$\dN$! &$\dR$ &\verb!$\dR$!\\
51 %$\nequiv $&\verb!$\nequiv$! &$\lsim$ &\verb!$\lsim$!\\
52 %$\grlo $&\verb!$\grlo$! &$\oast$ &\verb!$\oast$! \\
53 %$\res$ &\verb!$\res$! &$\dres$ &\verb!$\dres$! \\
54 %$\bigo{a}$ &\verb!$\bigo{a}$! &$\Res{a}$ &\verb!$\Res{a}$!\\
55 %$\down{a}$ &\verb!$\down{a}$! &\timenow &\verb!\timenow!& \\
56 %\TODAY &\verb!\TODAY! &\nbox{6}{500}{}{.}{4}{1}&
57 %\verb!\nbox{6}{500}{0}{.}{4}{1}! \\
58 %\cb[6pc]{Quite a bit to long a text to fit in one column}&
59 %\verb!\cb[6pc]{Qu.... mn}!& \nbox{6}{600}{}{.}{4}{74} &
60 %\verb!\nbox{6}{600}{0}{.}{4}{74}!\\
65 % \spitem spitem. (\verb!\spitem spitem. !)
66 % \spitem item) (\verb!\spitem spitem) !)
67 % \spitem em] (\verb!\spitem spitem] !)
68 % \spitem - (\verb!\spitem spitem- !)
69 % \spitem * (\verb!\spitem spitem* !)
71 %\newpage\section{Implementation}
72 % Input special fonts. The commands for kluwer's internal font are
73 % always valid, but this option defines the font. This is needed
74 % because we do not intend to supply the font to everyone.
76 % Policy is that we want the ams fonts defined. However, not everybody
77 % has these fonts installed, so it's better to be careful.
79 \ProvidesPackage{klumac}[\filedate ]
80 \font\@klusymfont=cmr10
81 \DeclareOption{klusym}{\font\@klusymfont=klusym10 }
84 \IfFileExists{amssymb.sty}{\RequirePackage{amssymb}%
85 \global\font\smallmsa=msam7
86 \gdef\Register{$^{\mbox{\smallmsa\char114}}$~}}{}
87 \IfFileExists{wasysym.sty}{\RequirePackage{wasysym}}{%
88 \IfFileExists{wasysym.tex}{\input{wasysym}}{}}
91 % \subsection{Math macro's}
93 \newcommand\I{{\bf I}}
94 \newcommand\iduaal{\overline{\I}}
96 \newcommand\rrestrict{\hbox{$\mid$ \kern-5pt \raise3.6pt\hbox{$
97 \scriptscriptstyle \backslash$}}}
98 \newcommand\restrict{\mathrel{\mathpalette\rrestrict{}}}
100 \newcommand\concat{\mathrel{\raise1pt\hbox{$\!\!^\frown\!\!$}}}
101 \newcommand\lh{\mathop\mathrm{lh}}
102 \newcommand\depth{\mathop\mathrm{depth}}
103 \newcommand\dom{\mathop\mathrm{dom}}
104 \newcommand\range{\mathop\mathrm{range}}
105 \newcommand\mapright[1]{\smash{\mathop{\longrightarrow}\limits^{#1}}}
106 \newcommand\mapdown[1]{\big\downarrow
107 \rlap{$\vcenter{\hbox{$\scriptstyle#1$}}$}}
108 \newcommand{\dC}{C \! \! \! \! {\scriptscriptstyle {}^{{}_|}}\ }
109 \newcommand{\dL}{I \! \! L}
110 \newcommand{\dE}{I \! \! E}
111 \newcommand{\dF}{I \! \! F}
112 \newcommand{\dP}{I \! \! P}
113 \newcommand{\dN}{I \! \! N}
114 \newcommand{\dR}{I \! \! R}
115 \newcommand{\dZ}{Z \! \! \! Z}
116 \newcommand{\dQ}{Q \! \! \! \! {\scriptscriptstyle {}^|}\ }
117 \newcommand{\nequiv}{\setbox0\hbox{$\equiv$}%
118 \rlap{\hbox{$\equiv$}}%
119 \hbox to \wd0{\hfil $/$\hfil}}
120 \newcommand{\lsim}{\rlap{\raise -.3ex\hbox{${\scriptstyle\sim}$}}%
121 \raise .6ex\hbox{${\scriptstyle <}$}}%
122 \newcommand{\gsim}{\rlap{\raise -.3ex\hbox{${\scriptstyle\sim}$}}%
123 \raise .6ex\hbox{${\scriptstyle >}$}}%
124 \newcommand{\logr}{\rlap{\raise -.3ex\hbox{${\scriptstyle <}$}}%
125 \raise .6ex\hbox{${\scriptstyle >}$}}%
126 \newcommand{\grlo}{\rlap{\raise -.3ex\hbox{${\scriptstyle >}$}}%
127 \raise .6ex\hbox{${\scriptstyle <}$}}%
128 \newcommand{\oast}{\setbox0\hbox{$\odot$}%
129 \rlap{\hbox to \wd0{\hfil$\ast$\hfil}}\box0}
130 \newcommand{\res}{\oalign{\hbox{$\grave{}$\kern-3pt$\mid$}}}
131 \newcommand{\dres}{\mid \! \res}
132 \newcommand{\bigo}[1]{\setbox0\hbox{$\bigcirc$}%
133 \rlap{\raise .2ex\hbox to \wd0{\hfil ${\scriptscriptstyle
135 \newcommand{\Res}[1]{\mathop{\hbox{Res}}\limits_{\scriptscriptstyle #1}}
136 \newcommand{\down}[1]{\raise -1ex\hbox{{$\scriptstyle #1$}}}
138 % \subsection{General}
143 \hyphenation{equiv-a-lent equiv-a-lent-ly sat-is-fy sat-is-fies
145 \newcommand\fn{\hspace*{14pt} \= \kill}
146 \newcommand\mc{\multicolumn}
147 \newcommand{\dummy}[1]{}
148 \def\today{\ifcase\month\or January\or February\or March\or April\or
149 May\or June\or July\or August\or September\or October\or November\or
150 December\fi \space\number\day, \number\year}
151 \def\TODAY{\number\day/\ifcase\month\or 01\or 02\or 03\or 04\or 05\or
152 06\or 07\or 08\or 09\or 10\or 11\or 12\fi/\number\year}
154 \@tempcnta=\time \divide\@tempcnta by 60 \number\@tempcnta:\multiply
155 \@tempcnta by 60 \@tempcntb=\time \advance\@tempcntb by -\@tempcnta
156 \ifnum\@tempcntb <10 0\number\@tempcntb\else\number\@tempcntb\fi}
157 \def\numtoword#1{\ifcase#1\or one\or two\or three\or four\or
158 five\or six\or seven\or eight\or nine\or ten\or eleven\or twelve\or
159 thirteen\or fourteen\or fifteen\or sixteen\or seventeen\or
160 eighteen\or nineteen\or twenty\fi}
161 \def\NUMTOWORD#1{\ifcase#1\or ONE\or TWO\or THREE\or FOUR\or
162 FIVE\or SIX\or SEVEN\or EIGHT\or NINE\or TEN\or ELEVEN\or TWELVE\or
163 THIRTEEN\or FOURTEEN\or FIFTEEN\or SIXTEEN\or SEVENTEEN\or
164 EIGHTEEN\or NINETEEN\or TWENTY\fi}
167 % |\genaccent| is defined below. |\ifempty| is a shortcut used inside
170 \def\ifempty#1#2#3{\def\inner{#1}\ifx\inner\empty
172 \def\ifdef#1{\edef\tempa{\expandafter\@gobble\string #1}%
173 \expandafter\expandafter\expandafter\ifx\expandafter\csname
174 \tempa \endcsname\relax
175 \let\next\nosw \else \let\next=\yessw \fi \next}
179 % \subsubsection{Spitem}
180 % This can be done better.
184 \def\onestep#1{\ifklaar\else
185 \if#1){)}\klaartrue\else
186 \if#1.{.}\klaartrue\else
187 \if#1]{]}\klaartrue\else
188 \if#1-{--}\klaartrue\else
189 \if#1*{*}\klaartrue\else
193 \def\subspitem#1{\scan#1\end}
195 \def\scan##1##2\end{\def\aux{##1}%
196 \ifklaar\global\setbox\bdj=\hbox{##1##2\space}\else
197 \ifx\aux\empty \else \def\aux{##2}\onestep{##1}%
198 \ifx\aux\empty \else \scan##2\end \fi \fi \fi}%
199 \global\setbox\bdj\hbox{}%
200 \klaarfalse\expandafter\item[\subspitem{#1}]%
203 % \subsubsection{Genaccent}
206 \def\genaccent#1#2#3#4#5{\protect\@genaccent{#1}{#2}{#3}{#4}{#5}}
207 \def\@genaccent#1#2#3#4#5{%
208 \leavevmode\setbox0=\hbox{#3}%
209 \vbox{\offinterlineskip
210 \ifempty{#1}{}{%\else
211 \hbox to\wd0{\hss\genacc \char#1\hss}}%
212 \ifempty{#4}{\kern -.8ex}{\kern #4}%
213 \vbox to\ht0{\copy0\vss}%
214 \vtop{\null\vbox to\dp0{\vss}%
215 \ifempty{#2}{}{%\else
216 \ifempty{#5}{\kern .2ex}{\kern#5}%
217 \hbox to \wd0{\hss \genacc\char #2\hss}}%
219 \renewcommand\.[1]{\genaccent{95}{}{#1}{}{}}
221 % \subsubsection{Table labels}
222 % Note that these are font-dependant, the option |klusym| is needed to
223 % initialize the correct font, otherwise the symbols will be in |cmr|.
225 \newcommand\BlackBox{\hbox{\@klusymfont B}~}
226 \newcommand\EmptyBox{\hbox{\@klusymfont E}~}
227 \newcommand\HstripeBox{\hbox{\@klusymfont H}~}
228 \newcommand\VstripeBox{\hbox{\@klusymfont V}~}
229 \newcommand\LstripeBox{\hbox{\@klusymfont L}~}
230 \newcommand\RstripeBox{\hbox{\@klusymfont R}~}
231 \newcommand\UpCrossBox{\hbox{\@klusymfont U}~}
232 \newcommand\DiagCrossBox{\hbox{\@klusymfont D}~}
234 % \subsection{Table macro's}
235 % |\cb| it a typing shortcut for |\parbox|, without forcing this
238 \def\cb{\@ifnextchar[{\@cbone}{\@cbone[8pc]}}
239 \def\@cbone[#1]#2{{\setbox0\hbox{#2}%
240 \ifdim\wd0 >#1 \parbox[t]{#1}{#2}\else #2\fi}}
242 % |\nbox| allows typesetting of aligned numbers. Arguments \#1, \#3
243 % and \#5 specify widths in number of digits for the arguments \#2,
244 % \#4 and \#6. Typeset as |lcr|. Empty arguments for widths means
245 % natural width. This macro is a lot easier to use inside of another
248 \def\nbox#1#2#3#4#5#6{\begingroup\setbox0\hbox{0}%
249 \ifempty{#1}{\hfil #2}{\hbox to #1\wd0{\hfil #2}}%
250 \ifempty{#3}{\hbox{#4}}{\hbox to #3\wd0{\hfil #4\hfil }}%
251 \ifempty{#5}{#6 \hfil}{\hbox to #5\wd0{#6\hfil }}%
256 % \subsection{Charkern macro's}
258 % These are not very readable, but they work quite well.
260 % Use dollars for inlinemath, not |\(....\)|.
262 % Special handling added for the (quite often appearing) case of
263 % |\charkern{\notesname}|, and a security check for the often
264 % appearing case of no argument at all.
266 \newif\ifkern@mathmode \kern@mathmodefalse
267 \def\charkerncharspace{\kern 0.5ex}
268 \def\charkernwordspace{\kern 0.5em\penalty 10}
269 \let\charkerncommand\uppercase
270 \def\@kap@tfor#1:=#2\do#3{\ifempty{#1}{}{%
271 \@tforloop#2\@nil\@nil\@@#1{#3}}}
275 \def\test##1##2!!!!{\def\@tempa{##2}}\test#1!!!!%
276 \ifx\@tempa\empty \edef\@@kc{#1}\else \def\@@kc{#1}\fi
278 \def\ck@@##1 @s@e@v@y\@@ck{\def\@@kc{##1}}%
279 \def\ck@##1 ##2\@@ck{\def\@kc{##1}\def\@@kc{##2}}%
281 % |\@kc| == first word of remaining sentence
283 \def\iterate{\expandafter\expandafter\expandafter\ck@
285 % The |\space| forces the line to end on with a space.
287 % In |\@kernword| most of the real work is done
291 \expandafter\@@kc\space @s@e@v@y\@@ck
292 \expandafter\@kernword\expandafter{\@kc}%
296 \expandafter\ck@@\@@kc\@@ck
297 \let\next\iterate\charkernwordspace
302 \def\@kernword#1{\def\d@ll@rm@th{$}\@kap@tfor\@nextchar:=#1\do{%
303 \ifx\@nextchar\d@ll@rm@th
308 % Here all collected math is typeset
319 \def\protect{\noexpand}%
322 % eat up math char by char
324 % |ab -> A\kern .5ex B\kern .5ex|
327 \xdef\kern@math{\kern@math\@nextchar}%
330 \charkerncommand\expandafter{\@nextchar}\charkerncharspace
335 \newcount\tracingkluwer
336 \def\kludebug#1{\relax\ifcase\tracingkluwer \or
337 \wlog{kap: #1}\or \typeout{kap: #1}\else
338 \immediate\wlog{kap*: #1}\typeout{kap: #1}\fi}
339 \global\tracingkluwer=3
340 \def\kluverbatim{\par\begingroup\vbox \bgroup\trivlist
341 \item\relax \vskip\parskip
342 \rightskip\z@skip \parindent\z@
343 \parfillskip\@flushglue \parskip0pt \@@par \@tempswafalse
344 \def\par{\if@tempswa \leavevmode\null\@@par\penalty\interlinepenalty
345 \else \@tempswatrue \ifhmode\@@par\penalty\interlinepenalty\fi \fi}
346 \let\do\@makeother \catcode`\|=0
347 \obeylines \verbatim@font \@noligs \dospecials \catcode`\%=14
348 \frenchspacing\@vobeyspaces
349 \everypar \expandafter{\the\everypar \unpenalty }}
350 \def\endkluverbatim{\endtrivlist\egroup\endgroup}