% Speech Coding and Synthesis -- Version September 1994
% Derived from
%         Handbook of Geometry document style -- Version March 1992
%         Derived from 
%                 houch10.sty (24 May 1989)
%         Created by Willem jan Maas (Elsevier Science)
% Adapted by Fer D. Mesman (Elsevier Science)


%  ****************************************
%  *               FONTS                  *
%  ****************************************
%

\lineskip 1pt            % \lineskip is 1pt for all font sizes.
\normallineskip 1pt
\def\baselinestretch{1}

% Each size-changing command \SIZE executes the command
%        \@setsize\SIZE{BASELINESKIP}\FONTSIZE\@FONTSIZE
% where:
%   BASELINESKIP = Normal value of \baselineskip for that size.  (Actual 
%                  value will be \baselinestretch * BASELINESKIP.)
%
%  \FONTSIZE     = Name of font-size command.  The currently available
%                  (preloaded) font sizes are: \vpt (5pt), \vipt (6pt),
%                  \viipt (etc.), \viiipt, \ixpt, \xpt, \xipt, \xiipt,
%                  \xivpt, \xviipt, \xxpt, \xxvpt.
%  \@FONTSIZE    = The same as the font-size command except with an
%                  '@' in front---e.g., if \FONTSIZE = \xivpt then
%                  \@FONTSIZE = \@xivpt.
%
% For reasons of efficiency that needn't concern the designer,
% the document style defines \@normalsize instead of \normalsize .  This is
% done only for \normalsize, not for any other size-changing commands.

\def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt
\abovedisplayskip 12pt plus1pt minus2pt%
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  6pt plus2pt%   
\belowdisplayshortskip  6pt plus1pt minus2pt%
\let\@listi\@listI}   % Setting of \@listi added 9 Jun 87

\def\small{\@setsize\small{11pt}\ixpt\@ixpt
\abovedisplayskip 8.5pt plus 3pt minus 4pt%
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus2pt%
\belowdisplayshortskip 4pt plus2pt minus 2pt
\let\@listi\@listI}

\def\footnotesize{\@setsize\footnotesize{10pt}\viiipt\@viiipt
\abovedisplayskip 10pt plus 1pt minus 2pt%
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip 5pt plus2pt%
\belowdisplayshortskip 5pt plus1pt minus 2pt
\def\@listi{\leftmargin\leftmargini %% Added 22 Dec 87
\topsep 4pt plus 2pt minus 2pt\parsep 0pt
\itemsep \parsep}}

\def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
\def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
\def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}

\normalsize  % Choose the normalsize font.

%  ****************************************
%  *            PAGE LAYOUT               *
%  ****************************************
%
% All margin dimensions measured from a point one inch from top and side
% of page.  

% SIDE MARGINS:
\oddsidemargin 1.0in     % Left margin on odd-numbered pages.
\evensidemargin 1.0in    % Left margin on even-numbered pages.

\marginparwidth 0.75in   %   Width of marginal notes.
\marginparsep 7pt        % Horizontal space between outer margin and 
                         % marginal note


% VERTICAL SPACING:        
                         % Top of page:
\topmargin 0.75in        %    Nominal distance from top of page to top of
                         %    box containing running head.
\headheight 12pt         %    Height of box containing running head.
\headsep   12pt          %    Space between running head and text.
\topskip = 10pt        %    '\baselineskip' for first line of page.
                         % Bottom of page:
\footskip 24pt           %    Distance from baseline of box containing foot 
                         %    to baseline of last line of text.


% DIMENSION OF TEXT:
% \textheight is the height of text (including footnotes and figures, 
% excluding running head and foot).

\textheight = 44\baselineskip
\advance\textheight by \topskip

\textwidth 30pc          % Width of text line.
                         % For two-column mode: 
\columnsep 10pt          %    Space between columns 
\columnseprule 0pt       %    Width of rule between columns.

% A \raggedbottom command causes 'ragged bottom' pages: pages set to
% natural height instead of being stretched to exactly \textheight.

% FOOTNOTES:

\footnotesep 6.65pt   % Height of strut placed at the beginning of every
                      % footnote = height of normal \footnotesize strut,
                      % so no extra space between footnotes.

\skip\footins 9pt plus 4pt minus 2pt  % Space between last line of text and 
                                      % top of first footnote.

% FLOATS: (a float is something like a figure or table)
%
%  FOR FLOATS ON A TEXT PAGE:
%
% One-column mode or single-column floats in two-column mode:
\floatsep 15pt plus 10pt minus 4pt       % Space between adjacent floats moved
                                         % to top or bottom of text page.
\textfloatsep 30pt plus 10pt minus 4pt   % Space between main text and floats
                                         % at top or bottom of page.
\intextsep 15pt plus 10pt minus 4pt      % Space between in-text figures and 
                                         % text.
\@maxsep 30pt                            % The maximum of \floatsep, 
                                         % \textfloatsep and \intextsep (minus
                                         % the stretch and shrink).
% Two-column floats in two-column mode:
\dblfloatsep 15pt plus 10pt minus 4pt    % Same as \floatsep for double-column
                                         % figures in two-column mode.
\dbltextfloatsep 30pt plus 10pt minus 4pt% \textfloatsep for double-column 
                                         % floats.
\@dblmaxsep 30pt                         % The maximum of \dblfloatsep and 
                                         % \dbltexfloatsep.

%  For floats on a separate float page or column:
%  one-column mode or single-column floats in two-column mode:
\@fptop 0pt plus 1fil       % Stretch at top of float page/column. (Must be    
                            % 0pt plus ...)                                    
\@fpsep 10pt plus 1000fil   % Space between floats on float page/column.       
\@fpbot 0pt plus 1fil       % Stretch at bottom of float page/column. (Must be 
                            % 0pt plus ... )                                   

% Double-column floats in two-column mode.
\@dblfptop 0pt plus 1fil    % Stretch at top of float page. (Must be 0pt plus ...)
\@dblfpsep 10pt plus 1000fil% Space between floats on float page.
\@dblfpbot 0pt plus 1fil    % Stretch at bottom of float page. (Must be 
                            % 0pt plus ... )                                   
% Marginal notes:
%
\marginparpush 5pt          % Minimum vertical separation between two marginal 
                            % notes.



%  ****************************************
%  *           PARAGRAPHING               *
%  ****************************************
%
\parskip 0pt                       % No vertical space between paragraphs.
\parindent 1em                     % Paragraph indentation.
%\topsep 8pt plus 2pt minus 4pt    % Extra vertical space, in addition to 
                                   % \parskip, added above and below list and
                                   % paragraphing environments.
\partopsep 2pt plus 1pt minus 1pt  % Extra vertical space, in addition to 
                                   % \parskip and \topsep, added when user
                                   % leaves blank line before environment.
%\itemsep 4pt plus 2pt minus 1pt   % Extra vertical space, in addition to
                                   % \parskip, added between list items.
% See \@listI for values of \topsep and \itemsep
% (Change made 9 Jun 87)

% The following page-breaking penalties are defined

\@lowpenalty   51      % Produced by \nopagebreak[1] or \nolinebreak[1]
\@medpenalty  151      % Produced by \nopagebreak[2] or \nolinebreak[2]
\@highpenalty 301      % Produced by \nopagebreak[3] or \nolinebreak[3]

\@beginparpenalty -\@lowpenalty    % Before a list or paragraph environment.
\@endparpenalty   -\@lowpenalty    % After a list or paragraph environment.
\@itempenalty     -\@lowpenalty    % Between list items.

% \clubpenalty         % 'Club line'  at bottom of page.
% \widowpenalty        % 'Widow line' at top of page.
% \displaywidowpenalty % Math display widow line.
% \predisplaypenalty   % Breaking before a math display.
% \postdisplaypenalty  % Breaking after a math display.
% \interlinepenalty    % Breaking at a line within a paragraph.
% \brokenpenalty       % Breaking after a hyphenated line.



%    ****************************************
%    *        CHAPTERS AND SECTIONS         *
%    ****************************************
%
%
% Authors are supposed to type the following sequence of instructions
% at the beginning of each chapter (course):
%
%   \author[SHORT]{FULL}             % FULL  = full name 
%                                    % SHORT = name that appears in
%                                    % running title and table of contents
%                                    % (initials + surname)
%   \address{<address of author>}    % \\ separate lines of address
%   \chapter{<title of course>}

% 
\def\author{\@dblarg{\@xauthor}}

%% \author adds a line with the author name to the \@authorbox to take care 
%% of multiple authors. The preamble of the sourcefile should look something 
%% like this:
%%
%% \author[..]{..}
%% \address{..}
%% \author[..]{..}
%% \address{..}
%%
%% The latter \author should have the desired running head as optional 
%% argument

\newbox\@authorbox

\def\no@harm{\let\thanks=\@gobble \let\\=\@empty \let\LaTeX\relax}

\def\@xauthor[#1]#2{% remove \thanks commands from #1
  \begingroup 
    \no@harm \xdef\@argi{#1}\endgroup
  \edef\@shortauthor{\@argi}\def\@author{#2}
  \setbox\@authorbox=\vbox{\box\@authorbox\centering\vskip\baselineskip
  \large\@author}
  \addtocontents{toc}{\def\protect\@shortauthor{\@argi}}}

\def\address#1{\gdef\@address{#1}
               \setbox\@authorbox=\vbox{\box\@authorbox\centering
                                 \footnotesize
                                 \vskip0.5\baselineskip
                                 \em\@address
                                 \vskip12pt}}
\def\support#1{\gdef\@support{#1}}

% initialize to empty
\def\@shortauthor{} \def\@author{} 
\def\@address{}
\def\@support{}

% \secdef{UNSTARCMDS}{STARCMDS} :
%    When defining a \chapter or \section command without using
%    \@startsection, you can use \secdef as follows:
%       \def\chapter { ... \secdef \CMDA \CMDB }
%       \def\CMDA    [#1]#2{ ... }  % Command to define \chapter[...]{...}
%       \def\CMDB    #1{ ... }      % Command to define \chapter*{...}

\def\chapter{\cleardoublepage \markboth{}{}% empty marks
   \def\thesection{\arabic{section}}% original definition of \thesection
   \cs@number % `number' citation style is default
   \setcounter{footnote}{1}% for \thanks mechanism
   \gdef\thefootnote{\arabic{footnote}}
   \global\@topnum\z@% no floats at top of this page
   \secdef\@chapter\@schapter}

\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
    \refstepcounter{chapter} \cur@count=\csname c@chapter\endcsname
    \typeout{\chaptername\space\thechapter, by \@shortauthor.}
  \else \cur@count=-1 \fi  
  \thispagestyle{plain} 
% remove \thanks commands from #1
% use cleaned argument #1 for .toc entry and mark
  \begingroup
    \no@harm
    \xdef\@argi{#1}\endgroup
  \addcontentsline{toc}{chapter}{\@argi}%
  \xdef\@shorttitle{\@argi}
  \section@normal \addtocontents{toc}{\protect\section@normal}%
  \let\end@chapter\end@seminar
  \@makechapterhead{#2}%
  \begingroup
    \no@harm
    \xdef\@tempc{\noexpand\end@chapter{\@argi}}\endgroup
  \@tempc}

\def\@schapter#1{\cur@count=-1 
  \addcontentsline{toc}{chapter}{#1}%
  \section@normal \addtocontents{toc}{\protect\section@normal}%
  \thispagestyle{plain}%
  \@makeschapterhead{#1}}      

% \@makechapterhead{TEXT}: Makes the heading for the \chapter command.
%
\def\@makechapterhead#1{\vspace*{12pt}
  {\normalsize\centering  
   \edef\@act{\noexpand\uppercase{\@chapapp}~\@@chapter}\@act
   \par \vskip 24pt
   {\LARGE\bf #1\relax\par}  %Eighteen bold
   \par \vskip 27pt}
   \box\@authorbox}

%  Trick due to Howard Trickey and Victor Eijkhout
\def\uc@title#1\thanks{\uppercase{#1}\futurelet\@tempa\uc@tx}
\def\uc@tx{\ifx\@tempa\relax % reached end of argument (\thanks\relax)
  \else \expandafter\uc@ty \fi}
\def\uc@ty#1{\thanks{#1}\uc@title}

% \@makeschapterhead{TEXT}: Makes the heading for the \chapter* command.
%
\def\@makeschapterhead#1{\vspace*{12pt}                
  {\parindent 0pt \centering
   \large\bf #1 \par \nobreak \vskip 25pt}}

% \end@chapter finishes the chapter page; this macro must be 
% \let to \end@course or \end@seminar by the calling macro

\def\@copyright{\noindent
  \parbox{0.9\textwidth}{\noindent\footnotesize
  \@support}
  \vskip12pt\noindent
  \parbox{0.75\textwidth}{\raggedright \footnotesize
  Speech Coding and Synthesis\\
  \ifx\@editor\empty@field  \else Edited by \@editor \\ \fi
  $\copyright$\,\@pubyear\ Elsevier Science B.V. 
  All rights reserved}}

\def\end@seminar#1{%
        \let\@oldfootnoterule\footnoterule
        \let\footnoterule\relax
        \insert\footins{\@copyright}
	\setcounter{footnote}{0}% reset footnote counter
  {\footnotesize %%WJ
  \tableofcontents\cleardoublepage
  \gdef\@thanks{}% empty \@thanks
  \chaptermark{#1}}\let
  \footnoterule\@oldfootnoterule}

% \@startsection {NAME}{LEVEL}{INDENT}{BEFORESKIP}{AFTERSKIP}{STYLE} 
%            optional * [ALTHEADING]{HEADING}
%    Generic command to start a section.  
%    NAME       : e.g., 'subsection'
%    LEVEL      : a number, denoting depth of section -- e.g., chapter=1,
%                 section = 2, etc.  A section number will be printed if
%                 and only if LEVEL < or = the value of the secnumdepth
%                 counter.
%    INDENT     : Indentation of heading from left margin
%    BEFORESKIP : Absolute value = skip to leave above the heading.  
%                 If negative, then paragraph indent of text following 
%                 heading is suppressed.
%    AFTERSKIP  : if positive, then skip to leave below heading,
%                       else - skip to leave to right of run-in heading.
%    STYLE      : commands to set style
%  If '*' missing, then increments the counter.  If it is present, then
%  there should be no [ALTHEADING] argument.  A sectioning command
%  is normally defined to \@startsection + its first six arguments.

\newcount\cur@count
% re-define \@startsection, \@sect, etc. (from latex.tex)
\def\@nopresecnum{}
\def\@appresecnum{Appendix }
\let\@presecnum=\@nopresecnum
\def\@postsecnum{.\hskip 0.5em}

\def\@startsection#1#2#3#4#5#6{\if@noskipsec \leavevmode \fi
   \par \@tempskipa #4\relax
   \@afterindenttrue
   \ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse\fi
   \if@nobreak \everypar{}\else
     \addpenalty{\@secpenalty}\addvspace{\@tempskipa}\fi
   \@ifstar{\@dblarg{\@ssect{#1}{#2}{#3}{#4}{#5}{#6}}}
           {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}

\def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth
  \cur@count=-1 \def\@svsec{}\else 
   \refstepcounter{#1} \cur@count=\csname c@#1\endcsname
   \edef\@svsec{\@presecnum\csname the#1\endcsname\@postsecnum}\fi
   \@tempskipa #5\relax
   \ifdim \@tempskipa>\z@ 
     \begingroup #6\relax
       \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty\@M
                  \rightskip\z@ \@rightskip\rightskip #8\par}%
     \endgroup
    \csname #1mark\endcsname{#7}\addcontentsline{toc}{#1}{#7}\else
    \def\@svsechd{#6\hskip #3\@svsec #8\csname #1mark\endcsname
                  {#7}\addcontentsline{toc}{#1}{#7}}\fi
  \@xsect{#5}}

\def\@ssect#1#2#3#4#5#6[#7]#8{\@tempskipa #5\relax \cur@count=-1
% \addcontentsline{toc}{#1}{#7}
  \ifdim \@tempskipa>\z@
    \begingroup #6\@hangfrom{\hskip #3}{\interlinepenalty\@M 
                                        \rightskip\z@ \@rightskip\rightskip
                                        #8\par}\endgroup
  \else \def\@svsechd{#6\hskip #3\relax #8}\fi
  \@xsect{#5}}

\newskip\Bls@  \Bls@=5ex plus 1.0ex minus 0.2ex % approx. 2 baselineskip
\newskip\bls@  \bls@=2.5ex plus 0.5ex minus 0.2ex % approx. 1 baselineskip
\newskip\eps@  \eps@=0.001pt                      % small positive skip

\def\section{\@startsection{section}{1}
  {\z@}{-\Bls@}{\bls@}{\normalsize\bf}}
\def\subsection{\@startsection{subsection}{2}
  {\z@}{-\Bls@}{\bls@}{\normalsize\em}}
\def\subsubsection{\@startsection{subsubsection}{3}
  {\z@}{-\Bls@}{\eps@}{\normalsize\em}}
\def\paragraph{\@startsection{paragraph}{4}
  {\z@}{\Bls@}{-1em}{\normalsize\em}}
\def\subparagraph{\@startsection{subparagraph}{4}
  {\parindent}{\Bls@}{-1em}{\normalsize\em}}

% Default initializations of \...mark commands.  (See below for their
% us in defining page styles.

\def\chaptermark#1{}
\def\sectionmark#1{\markboth{\thesection}{\thesection}} % Preloaded definitions
% \def\subsectionmark#1{}
% \def\subsubsectionmark#1{}
% \def\paragraphmark#1{}
% \def\subparagraphmark#1{}

% The value of the counter secnumdepth gives the depth of the
% highest-level sectioning command that is to produce section numbers.
%

\setcounter{secnumdepth}{3}

% APPENDIX
%
% The \appendix command must do the following:
%    -- redefine the section counter to produce appendix numbers
%    -- reset the section counter to zero
%    -- redefine sectional-unit commands if appendix titles and headings
%       are to look different from chapter titles and headings.

\newif\if@appendixletter \@appendixletterfalse

\def\appendix{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \section@appendix \addtocontents{toc}{\protect\section@appendix}}

\def\section@appendix{\let\@presecnum=\@appresecnum
  \let\l@section=\l@appendixsection
  \if@appendixletter \def\thesection{\alph{section}}\else
  \def\thesection{\arabic{section}}\fi}

\def\section@normal{\let\@presecnum=\@nopresecnum
  \let\l@section=\l@normalsection
  \def\thesection{\arabic{section}}}



%    ****************************************
%    *                LISTS                 *
%    ****************************************
%
% The following commands are used to set the default values for the list
% environment's parameters. See the LaTeX manual for an explanation of
% the meanings of the parameters.  Defaults for the list environment are
% set as follows.  First, \rightmargin, \listparindent and \itemindent
% are set to 0pt.  Then, for a Kth level list, the command \@listK is
% called, where 'K' denotes 'i', 'ii', ... , 'vi'.  (I.e., \@listiii is
% called for a third-level list.)  By convention, \@listK should set
% \leftmargin to \leftmarginK.
%
\leftmargini 12pt
\leftmarginii 19pt   % > \labelsep + width of '(m)'
\leftmarginiii 26pt  % > \labelsep + width of 'vii.'
\leftmarginiv 33pt   % > \labelsep + width of 'M.'
\leftmarginv 40pt
\leftmarginvi 47pt

\leftmargin\leftmargini
\labelsep 0.4em
\labelwidth\leftmargini\advance\labelwidth-\labelsep

% \@listI defines top level and \@listi values of
% \leftmargin, \topsep, \parsep, and \itemsep
% (Added 9 Jun 87)
\def\@listI{\leftmargin\leftmargini \parsep 4pt plus 2pt minus 1pt%
\topsep 8pt plus 2pt minus 4pt%
\itemsep 4pt plus 2pt minus 1pt}

\let\@listi\@listI
\@listi 

\def\@listii{\leftmargin\leftmarginii
   \labelwidth\leftmarginii\advance\labelwidth-\labelsep
   \topsep 4pt plus 2pt minus 1pt
   \parsep 2pt plus 1pt minus 1pt
   \itemsep \parsep}

\def\@listiii{\leftmargin\leftmarginiii
    \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
    \topsep 2pt plus 1pt minus 1pt 
    \parsep \z@ \partopsep 1pt plus 0pt minus 1pt
    \itemsep \topsep}

\def\@listiv{\leftmargin\leftmarginiv
     \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}

\def\@listv{\leftmargin\leftmarginv
     \labelwidth\leftmarginv\advance\labelwidth-\labelsep}

\def\@listvi{\leftmargin\leftmarginvi
     \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}
