\typeout{'nnsp' Package for Latex2e - JL, 19/05/94 and CG, 3/04/96, 15/09/97}
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{nnsp2e}
        [1996/09/15 CG, 1994/05/19, JL]

%\setlength{\parindent}{0pt}
%\setlength{\parskip}{0.5\baselineskip}
\pagestyle{empty}

%
% Defines the sections/subsections/subsubsections.
%
% Sections are . bold uppercase (formerly \nnsection)
%              . 2 blank lines before and one after
% Subsections are . bold
%                 . 1 blank line before and one after
% Subsubsections are . bold with a period after the heading (except *)
%                    . 1 blank line before
%                    . run in with text
% \section and \subsection do no number the headings
% \subsubsection produces a dot after the heading. If you do not want
% a dot (eg if heading starts a phrase), use \subsubsection* instead.
%

%\newcounter{table}
\def\fnum@table{{\sc Table}~\thetable}
\def\ss@table{\sc}
\def\ss@figure{ }

\long\def\@caption#1[#2]#3{\par\addcontentsline{\csname ext@#1\endcsname}{#1}{%
   \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}
   \begingroup \@parboxrestore \normalsize
     \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}{\csname ss@#1\endcsname}\par
   \endgroup}




\def\@sect#1#2#3#4#5#6[#7]#8{
   \refstepcounter{#1}
   \let \@svsec\@empty%\edef\@svsec{\csname the#1\endcsname.\hskip 0.6em}
   \let \@svsechd\@empty
%    \def\@svsechd{%
%      #6{\hskip #3\relax
%      \@svsec #8}%
%      \csname #1mark\endcsname{#7}%
%      \addcontentsline{toc}{#1}{%
%        \ifnum #2>\c@secnumdepth \else
%          \protect\numberline{\csname the#1\endcsname}%
%        \fi
%        #7}}%
       \begingroup \ifnum #2=1\bf%\centering
          {\interlinepenalty \@M
             \@svsec
             \noindent \uppercase{#8}\par}\else\ifnum #2=2\bfseries
          \noindent{\interlinepenalty \@M \@svsec
                    \noindent #8\par}\else\ifnum #2=3\bfseries
          \noindent{\interlinepenalty \@M \@svsec
                    \noindent #8.}\else\itshape
          \@hangfrom{\hskip\parindent}{\interlinepenalty \@M
                     \@svsec
                     #8\par}\fi\fi\fi\endgroup
       \csname #1mark\endcsname{#7}\addcontentsline
         {toc}{#1}{\protect\numberline{\csname the#1\endcsname} #7}
     \@tempskipa #5\relax
     \@xsect{\@tempskipa}}

\renewcommand{\section}{\@startsection{section}{1}{0mm}%
                            {-2.0\baselineskip \@plus -.1ex \@minus -.1ex}%
                            {1.0\baselineskip \@plus .1ex}%
                            {\reset@font\normalsize\bfseries}}
\renewcommand{\subsection}{\@startsection{subsection}{2}{0mm}%
                            {-1.0\baselineskip \@plus -.1ex \@minus -.1ex}%
                            {1.0\baselineskip \@plus .1ex}%
                            {\reset@font\normalsize\bfseries}}
\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{0mm}%
                            {1.0\baselineskip \@plus -.1ex \@minus -.1ex}%
                            {-1ex}%
                            {\reset@font\normalsize\bfseries}}
\def\paragraph{\subsubsection}
\def\subparagraph{\subsubsection}


%% Redefinition des captions.
\setlength{\abovecaptionskip}{1ex}
\long\def\@makecaption#1#2#3{\small%
   \vskip\abovecaptionskip
   \setbox\@tempboxa\hbox{#3{ #1: #2}}%
   \ifdim \wd\@tempboxa > \hsize
     #3{#1: #2}\par
   \else
     \hbox to\hsize{\hfil\box\@tempboxa\hfil}
   \fi
   \vskip\abovecaptionskip
   }

%% Redefines the title. Puts the title in Uppercase.
%%\let\ps@plain=\ps@empty
\renewcommand{\maketitle}{\par
  \begingroup
    \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
    \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}%
    \long\def\@makefntext##1{\parindent 1em\noindent
            \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}%
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
      \newpage
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \fi
    \thispagestyle{empty}\@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \let\thanks\relax
  \let\maketitle\relax\let\@maketitle\relax
  \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}

\def\@maketitle{%
   \newpage
   \null
   \vskip 2em%
   \begin{center}%
     {\Large\sffamily\bfseries \@title \par}%
     \vskip 2.0em%
     {\normalsize \lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
   \end{center}%
   \par
   \vskip 1.5em}

\def\title#1{\gdef\@title{\uppercase{#1}}}

%% Redef. de l'abstract
\renewenvironment{abstract}{%
   \bfseries \noindent \abstractname{}.~}{\par}
%   {\vspace{0.0\baselineskip}\par}

%% Redef. de la biblio.
\renewcommand{\refname}{REFERENCES}

\renewenvironment{thebibliography}[1]
     {\section*{\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \setlength{\itemsep}{0pt}
      \setlength{\parskip}{0pt}
      \small
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}

%\makeatother

\renewcommand{\floatpagefraction}{0.98}
\renewcommand{\textfraction}{0.02}
\renewcommand{\topfraction}{0.50}
\renewcommand{\bottomfraction}{0.50}

%\renewcommand{\floatpagefraction}{0.98}
%\renewcommand{\textfraction}{0.02}
%\renewcommand{\topfraction}{0.98}
%\renewcommand{\bottomfraction}{0.98}


% Dimensions of the paper.
% Either 11.7 x 19.5 cm or 4 5/8 x 7 1/2 inch.
% - No header, no footer
\setlength{\hoffset}{2.06cm}
\setlength{\voffset}{2.46cm}
\setlength{\textheight}{19.5cm}
\setlength{\textwidth}{11.7cm}
\setlength{\oddsidemargin}{0cm}
\setlength{\evensidemargin}{0cm}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\footskip}{2cm}
% LC p. 62.
%\setlength{\topsep}{1ex}
\setlength{\partopsep}{0cm}
% For margin notes (\marginpar). LC p. 85.
\setlength{\marginparwidth}{0cm}
\setlength{\marginparsep}{0cm}
% Spaces above and below (short) formulas.
\setlength{\abovedisplayskip}{0.5\baselineskip}
\setlength{\belowdisplayskip}{0.5\baselineskip}
\setlength{\abovedisplayshortskip}{0.5\baselineskip}
\setlength{\belowdisplayshortskip}{0.5\baselineskip}
% Space between floats with t or b placing.
\setlength{\floatsep}{1ex}
% Space between float(s) and text with t or b placing.
\setlength{\textfloatsep}{1ex}
% Space above and below float placed h.
\setlength{\intextsep}{1ex}

%% The 'summary' option gives page dimensons that try to pack as much
%% as possible in the 6 pages alloted for ``extended summary''.
\DeclareOption{summary}{%
\setlength{\hoffset}{-1.04cm}
\setlength{\voffset}{-1.04cm}
\setlength{\textheight}{26.2cm}
\setlength{\textwidth}{18cm}
\setlength{\footskip}{0cm}
\setlength{\abovedisplayskip}{0.1\baselineskip}
\setlength{\belowdisplayskip}{0.1\baselineskip}
\setlength{\abovedisplayshortskip}{0.1\baselineskip}
\setlength{\belowdisplayshortskip}{0.1\baselineskip}
\setlength{\floatsep}{0ex}
\setlength{\textfloatsep}{2ex}
\setlength{\footskip}{1cm}
\pagestyle{plain}
%\let\bibfont=\small
\renewcommand{\maketitle}{\par
  \begingroup
    \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
    \def\@makefnmark{\hbox to\z@{$\m@th^{\@thefnmark}$\hss}}%
    \long\def\@makefntext##1{\parindent 1em\noindent
            \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}%
    \if@twocolumn
      \ifnum \col@number=\@ne
        \@maketitle
      \else
        \twocolumn[\@maketitle]%
      \fi
    \else
      \newpage
      \global\@topnum\z@   % Prevents figures from going at top of page.
      \@maketitle
    \fi
    \thispagestyle{plain}\@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \let\thanks\relax
  \let\maketitle\relax\let\@maketitle\relax
  \gdef\@thanks{}\gdef\@author{}\gdef\@title{}}
}
\ProcessOptions
