% MULTIINT.STY
%
% Donald Arseneau      Oct, 1992
%
% Create the command  \multiint  for printing multiple integral signs
% with common limits.  It takes one parameter: the number of integral
% symbols.  For example:
%
% \multiint{3}_{\vec r}
%
% means a triple integral over the three-space vector r.
%
% Specify "multiint" as one of the options for the \documentstyle
% command, or incorporate this file in another style file.

\newmuskip \intlabmu    \intlabmu=4.70584mu

\def\multiint#1{\begingroup \@tempcnta#1\relax \def\MI@script{}\t@stscript}

\def\t@stscript{\@ifnextchar_{\@ppendscript-}{\@ifnextchar^{\@ppendscript+}%
  {\multiint@}}}

\def\@ppendscript#1#2#3{\expandafter\def\expandafter\MI@script\expandafter
   {\MI@script#2{\kern#1\@tempdima#3\kern-#1\@tempdima}}\t@stscript}

\def\multiint@{\mathchoice 
% displaystyle first:
  {\setbox\z@\hbox{$\displaystyle\int_{==}$}%
   \setbox\tw@\hbox{$\displaystyle{\int}_{==}$}%
   \@tempdima\wd\tw@ \advance\@tempdima -\wd\z@  \@tempdima.58822\@tempdima 
   \mathop{\int \@whilenum \@tempcnta>\@ne \do
     {\!\!\!\int\advance\@tempcnta\m@ne}}%
   \limits\MI@script}%
% other styles are the same; limits follow integrals
   {\textstyle\multiint@@@}%
   {\scriptstyle\multiint@@@}%
   {\scriptscriptstyle\multiint@@@}%
   \endgroup}

\def\multiint@@@{\int 
  \@whilenum \@tempcnta>\@ne \do{\!\!\int\advance\@tempcnta\m@ne}%
  \MI@script}

