%
% Mbook.sty -- definitions for book.cls LaTeX files in MuPAD style

%% Copyright 2002 SciFace Software GmbH
%
% This program may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX 
% version 1999/12/01 or later.
%
% This program consists of the files Mhelp.sty, Mhyper.sty,
% Mcompat.sty, Mbook.sty, Mreprt.sty, Mfonts.sty, Mwrite.sty,
% and MuPAD.mf.

\splitcvs $Id: Mbook.sty,v 1.1.1.2 2004/10/04 17:25:17 nthiery Exp $ to %
  \filename\fileversion\filedate\relax
%
\ProvidesPackage{\filename}[\filedate]
\immediate\typeout{Package: `\filename'
    \fileversion \space \filedate \space (roehrig, metzner, billing, ccr)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ifiMlayout
 \setcounter{secnumdepth}{3}
 \renewcommand\tableofcontents{%
   \if@twocolumn%
    \@restonecoltrue\onecolumn%
   \else%
    \@restonecolfalse%
   \fi%
   {\chapter*{\contentsname}%
     \chaptermark{\contentsname}% Sollte ueberfluessig sein.
%    \addcontentsline{toc}{chapter}{\contentsname}%
     \@starttoc{toc}%
     \if@restonecol\twocolumn\fi%
     }}%
 \renewcommand*{\listoffigures}{%
   \if@twocolumn\@restonecoltrue\onecolumn
   \else\@restonecolfalse\fi
   \chapter*{\listfigurename}%
   \chaptermark{\listfigurename}%
%  \addcontentsline{toc}{chapter}{\listfigurename}%
   \@starttoc{lof}%
   \if@restonecol\twocolumn\fi%
   }
 \renewcommand*{\listoftables}{%
   \if@twocolumn\@restonecoltrue\onecolumn
   \else\@restonecolfalse\fi
   \chapter*{\listtablename}%
   \chaptermark{\listtablename}%
   \@starttoc{lot}%
   \if@restonecol\twocolumn\fi%
   }
 \renewenvironment{thebibliography}[1]
 {\chapter*{\bibname%
            %\@mkboth{\textsc{\bibname}}{\textsc{\bibname}}%
     }%
   \chaptermark{\bibname}% Sollte eigentlich von \chapter* schon gesetzt
                                 % sein.
   \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}}%
   \sloppy\clubpenalty4000\widowpenalty4000%
   \sfcode`\.\@m}%
 {\def\@noitemerr%
   {\@latex@warning{Empty `thebibliography' environment}}%
   \endlist}%
% Im Index wollen wir
% - \iMindexhead als Eintrag in der Kopfzeile (anklickbare Buchstaben)
% aus book.cls, entsprechend modifiziert:
 \renewenvironment{theindex}%
 {%
   \if@twocolumn%
    \@restonecolfalse%
   \else%
    \@restonecoltrue%
   \fi%
   \columnseprule \z@%
   \columnsep 35\p@%
   \iMindextrue%
% pages in index are "really large", too, just less so.
   \ifiMreallylarge\setlength{\textheight}{500mm}\fi%
   \twocolumn[\@makeschapterhead{\indexname}]%
   \chaptermark{\indexname}%
   \ifhypermode\markright{\iMindexhead}%
                                 % HyTeX-Label "index" setzen.
    \@ifundefined{nn@index}{\Mnode{index}}{}%
   \else%
    \thispagestyle{plain}%
   \fi%
   \parindent\z@%
   \parskip\z@ \@plus .3\p@\relax%
   \raggedright%
   \let\item\@idxitem}%
 {\if@restonecol\onecolumn\else\clearpage\fi}%
\fi% \ifiMlayout
% Pagestyle muheadings
\def\ps@muheadings{\ps@headings\relax
  \ifprint
   \let\@mkboth\markboth
   \def\@oddfoot{}\def\@evenfoot{}%       No feet.
   \def\@evenhead{\rmfamily \thepage \hfil {\leftmark}}%        Left heading.
   \def\@oddhead{{\rightmark} \hfil \rmfamily\thepage}% Right heading.
  \else
   \let\@mkboth\markboth
   \def\@oddfoot{}\def\@evenfoot{}%       No feet.
   \def\@evenhead{% Left and right heading.
     {{\rightmark}\hfil \rmfamily\thepage}%
     }%
   \let\@oddhead\@evenhead% right heading equals left heading
  \fi
  \ifiM@springer%
   \def\chaptermark##1{\markboth{{\small\rm ##1}}{{\small\rm ##1}}}%
   \def\sectionmark##1{\markright{{\small\rm ##1}}}%
  \else%
   \def\chaptermark##1{\markboth{{\scshape ##1}}{{\scshape ##1}}}%
   \def\sectionmark##1{\markright{{\scshape ##1}}}%
  \fi%
  }
