%------------------------------------------------------------------------
%File: Mhelp.sty
%
%Style-File zur Erstellung von MuPAD-Helpseiten.
%------------------------------------------------------------------------

%% 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.

\errorcontextlines=1600

\NeedsTeXFormat{LaTeX2e}[97/01/01]
%
% automatisiertes Erzeugen der Datumsangaben und Versionsnummern
% aus dem cvs-String:
\def\splitcvs $#1: #2.sty,v #3 #4 #5$ to #6#7#8\relax{%
        \def#6{#2}%
        \def#7{v#3}%
        \def#8{#4}%
}
\splitcvs $Id: Mhelp.sty,v 1.7 2003/11/21 15:23:43 nthiery Exp $ to %
  \filename\fileversion\filedate\relax
%
\ProvidesPackage{\filename}[\filedate]
\immediate\typeout{Package: `\filename'
    \fileversion \space \filedate \space (roehrig, metzner, billing, ccr)}
\RequirePackage{Mwrite}
%%
\RequirePackage{verbatim,longtable,keyval,afterpage,calc}
\RequirePackage{float,everyshi,count1to,array,tabularx,graphicx}
\RequirePackage[ngerman,german,francais,english]{babel}
\RequirePackage{Mhyper}[2003/10/20]
\RequirePackage{ifpdf,hhparmrk,booktabs}
% \RequirePackage{listings}[2002/04/01]
\errorcontextlines=255

\providecommand*{\smallcube}{\ensuremath{\bullet}}

\providecommand*{\T}[1]{}

%---------------- Wichtige Einstellungen und Definitionen ---------------

\def\iM@layout{
  \setlongtables
%  \setlength{\parindent}{0pt}
%  \setlength{\parskip}{1ex plus 0.4ex minus 0.2ex}
  \raggedbottom
}

\newread\LTOCIN

%------------------------------------------------------------------------

%--------------------- Zeichendefinition --------------------------------
\chardef\Mhat="5E               % ^
%------------------------------------------------------------------------

%------Definition der am Anfang bzw. Ende des Dokuments -----------------
%----------- auszufuehrenden  Befehle -----------------------------------

\AtBeginDocument
 {%
 \ifhypermode
  \iMhytexpagesize
%  \Mhelpindexref
 \fi
 \Mnoaddtoc
 \global\textwidth=\columnwidth
 \write\@auxout{\string\catcode`\string\%=11\string\relax}%
 }

\AtEndOfPackage{\Mlanggerman}

%------------------------------------------------------------------------

%-------------- if-Definitionen und Initialisierungen ------------------

\newif\ifnoteof         % if-Definition fuer das Mcontents-Makro
% xxx das sollte durch einen eleganteren Mechanismus ersetzt werden.
\newif\ifprint          % if-Definitionen fuer die Wahl des             
                        % Ausgabeformats.
\newif\ifhytex          % Werden in den Stil-Optionen gesetzt.
\newif\ifascii
\newif\ifhtml
\newif\iffullscreen
\newif\iflaptop
\newif\ifpaper
\newif\ifpaperwide
\newif\ifpackage        % if-Definition zur Feststellung, ob man
                        % sich in einer Package-Umgebung befindet
\newif\ifMwarning       % true  - nur Warnungen bei Verwendung alter Makros
                        % false - Fehler
\newif\ifMDebug         % besondere Meldungen und Hervorhebungen im Text:
                        % 1. fehlende Knoten in \Mup, \Mhref werden eingerahmt
                        %    ...
\newif\ifMextref       % global f"ur: Abschalten von `externen Referenzen'
\newif\ifMnoextref     % extreftrue - immer zweites Argument von \Mextref
                        % noextreftrue - immer erstes Argument von \Mextref
                        % false - \Mextref entscheidet selbst (siehe dort)
\newif\ifMfailref       % true  - trotz fehlendem Knoten wird eine HyTeX-
                        %         Referenz angelegt (nicht Datei-"ubergreifend!!)
\newif\ifbookversion    % Ist Mhelp im Handbuch verwendet worden
\newif\ifiaddtoc        % Wird von den Makros \Maddtoc und \Mnoaddtoc
                        % gesetzt bzw. gel"oscht
\newif\ifkomma          % Soll \Mup Kommata setzen?
\newif\ifiMreallylarge
\newif\ifiMmark         % Sollen Hyperlinks im dvi markiert werden?
\newif\ifiMformat       % Ist ein Ausgabeformat gewaehlt worden?
\newif\ifiMindex        % Sind wir im Index?
\newif\ifiMlayout       % Mhelp-Layout verwenden?
\newif\ifMbspmode
\newif\ifhytexwarnings
\newif\ifhypermode

\newif\ifiM@Mvintest    % Fuer die Parameter von Mvin und Mvout
\newif\ifiM@Mvinclick
\newif\ifiM@Mvinhide
\newif\ifiM@Mvincollect
\newif\ifiM@Mvinsamepage
\newif\ifiM@Mvinfirstinseries
\newif\ifiM@Mvinplot
\newif\ifiM@MvoutTeX
\newif\ifiM@Mvout       % input or output?

\newif\ifiM@springer    % Layout nach Springer-Vorgaben?

\newif\ifiM@meth@read   % Methoden bereits eingelesen?
\newif\ifM@helppage     % Momentan auf einer Hilfeseite?
\newif\if@tempswb
\newif\if@Msplittoc
\newif\if@Mnonewcontext
\newif\if@Mhadintro
\newif\if@M@anim
\newif\if@M@wideparam

\newlength{\iMtmplength}     % Temporaere Variable in der Mchange Umgebung

\printtrue
\hytexfalse
\asciifalse
\htmlfalse
\fullscreenfalse
\laptopfalse
\papertrue
\paperwidefalse
\packagefalse
\Mwarningfalse
\MDebugfalse
\Mextreftrue
\Mnoextreffalse
\Mfailreffalse
\kommatrue
\iMreallylargefalse
\iMmarkfalse
\iMindexfalse
\iMlayouttrue
\Mbspmodefalse
\hytexwarningstrue
\iM@springerfalse
\M@helppagefalse
\@Msplittoctrue
\@Mnonewcontextfalse
\@Mhadintrofalse

%----------------------- Tokenregister ----------------------------------

\newtoks\iM@tok         % Scratch-Register
\newtoks\iM@tok@

\newtoks\M@allpages     % collect help page titles,
\M@allpages{}           % for checking consistency with the interface

\long\def\iM@appendtok#1+=#2\iM@appendtok{#1=\expandafter\expandafter\expandafter{\expandafter\the\expandafter#1#2}}

%------------------------------------------------------------------------

%----------------------- Die Counterdefinitionen ------------------------

%----------------------- interne Counter --------------------------------

\newcounter{first} % Zaehler fuer die Anzahl der gedruckten
   % Helpseiten in der Mpackage-Umgebung. Wird fuer
   % die Kommasetzung im Mcontents-Makro benoetigt.

\newcounter{iManzMargs} %Z"ahler f"ur die Schachtelungstiefe von
                        %Margs-Makros

\newcounter{iMenv} % "Environment-Variable". Wird benoetigt, da
   % manche Makros (Mmeta,Mvar,Mfunc ...)
   % Ihr "verhalten" aendern, je nachdem in welchem
   % Zusammenhang sie benutzt werden.
   % Dabei werden folgende Werte angenommen:
   % 0 Standard, 1 Mseealso-Umgebung,
   % 2 Margs-Makro & Moverloading-Umgebung,
   % 3 M[d]math-Makro, 4 Msuperdomain-
   % & Mcategories- & Maxioms-Umgebung,
   % 5 Mmethod-Makro & 6 Msyntax-Umgebung.

\newcounter{iMpack} % Flag fuer Mpackage-Umgebungen

\newcounter{iMtitlepage} % Flag fuer Verwendung von Mpacktitle

\newcounter{iMdepth} % Zaehler fuer die Schachtelungstiefe bei
                     % optionalen Parametern. "Merkt" sich, in welcher
                     % Tiefe man sich gerade "befindet".

\newcounter{iMhelppage} % Counter fuer die Nr. der aktuellen
                        % Mhelppage-Umgebung. Wird benoetigt,
                        % um am Anfang der ersten Helpseite die
                        % Fileausgaben zu oeffnen.

\newcounter{iM@example}[iMhelppage] % Z�hlt die Beispiele auf einer Helppage
%\newcounter{iM@Methoddetails}[iMhelppage]

\newcounter{iM@inputs}[iMhelppage] % Zaehlt die Mvin-Umgebungen einer Hilfeseite
                                   % wird momentan benutzt, um plot-Ausgaben zuzuordnen

\newcounter{iMlang} % Counter fuer die gewuenschte Ausgabesprache.
                    % Wird mit dem Mlanggerman- bzw.
                    % Mlangenglish-Makro veraendert.
                    % Belegung: 0 -- Englisch
                    %           1 -- Deutsch (default)
                    %           2 -- French

\newcounter{iMoutput} % Flag fuer Ausgabe der Versionsnr.
                      % Belegung: 0 -- keine Ausgabe
                      %           1 -- Ausgabe der Versionsnr.
                      %   unter der Helpseiten-
                      %   ueberschrift (default).

\newcounter{iMenglish} % Werden zum Einstellen der benutzten
\newcounter{iMgerman}  % Ausgabesprache mit dem Mlanguage-Makro
\newcounter{iMfrench}  % benoetigt.

\newcounter{iMhead}    % Schalter f"ur die "Anderung der Kopfzeilen
                       % f"ur Mpacktitle. Werte: 
                       % 1 an(default), 0 aus (durch die Option "nohead"). 

\newcounter{iM@tempa}  % F�r tempor�ren Platz.
\newcounter{iM@tempb}

% F�r autobutton:
\newcounter{iM@allchap} % In article.sty steht dort in Wahrheit section drin
\newcounter{iM@allsect}[iM@allchap]


%Initialisierung: 

\setcounter{first}{1}
\setcounter{iManzMargs}{0}
\setcounter{iMpack}{0}
\setcounter{iMtitlepage}{0}
\setcounter{iMenv}{0}
\setcounter{iMdepth}{0}
\setcounter{iMlang}{1}
\setcounter{iMoutput}{1}
\setcounter{iMenglish}{0}
\setcounter{iMgerman}{1}
\setcounter{iMfrench}{2}
\setcounter{iMhelppage}{0}
\setcounter{iMhead}{1}
\setcounter{iM@allchap}{0}
\setcounter{iM@allsect}{0}
\setcounter{iM@inputs}{0}
%------------------------------------------------------------------------
\gdef\iMhytexpagesize{%
  \ifbookversion\else
   \ifhypermode
    \topmargin -25mm
    \oddsidemargin -20mm
    \evensidemargin -20mm
    \textwidth 150mm
    \ifiMreallylarge
    \textheight 800mm
   \else
    \textheight 160mm
   \fi\fi\fi%
}
% Die \usepackage-Befehle m�ssen entweder vor dem ersten \DeclareOption
% oder nach \ProcessOptions stehen.
% Das hier dient zur automatisierten Setzung von next chapter/section-Kn�pfen:
\DeclareOption{autobutton}{\M@autobutton}% Definiert in Mhyper.sty

\DeclareOption{nosplittoc}{\@Msplittocfalse}

% "no change of layout"
\DeclareOption{nclayout}{\global\iMformattrue%
  \global\iMlayoutfalse%
  \global\let\iMhytexpagesize\relax%
  \@Msplittocfalse
  }
\DeclareOption{nohead}
{%
\setcounter{iMhead}{0}
}
\DeclareOption{springer}{\global\let\ps@plain\ps@empty\global\iM@springertrue}
\DeclareOption{nomark}
{\global\iMmarkfalse}
\DeclareOption{a4}%
{%
        \global\iMformattrue
        \global\printtrue
        \global\hytexfalse
        \global\hypermodefalse
        \global\asciifalse
        \global\htmlfalse
% aus a4.sty
\ifcase \@ptsize
    \textheight 53\baselineskip
\or
    \textheight 46\baselineskip
\or
    \textheight 42\baselineskip
\fi
\advance\textheight by \topskip
\ifcase \@ptsize
    \textwidth      5.00in
    \marginparwidth 1.00in
  \if@twoside
    \oddsidemargin  0.55in
    \evensidemargin 0.75in
  \else
    \oddsidemargin  0.55in
    \evensidemargin 0.55in
  \fi
\or
    \textwidth      5.20in
    \marginparwidth 1.00in
  \if@twoside
    \oddsidemargin  0.45in
    \evensidemargin 0.65in
  \else
    \oddsidemargin  0.45in
    \evensidemargin 0.45in
  \fi
\or
    \textwidth      5.70in
    \marginparwidth 0.80in
  \if@twoside
    \oddsidemargin  0.20in
    \evensidemargin 0.40in
  \else
    \oddsidemargin  0.20in
    \evensidemargin 0.20in
  \fi
\fi
}
\DeclareOption{a4wide}%
{%
        \global\iMformattrue
        \global\printtrue
        \global\hytexfalse
        \global\hypermodefalse
        \global\asciifalse
        \global\htmlfalse
\ifcase \@ptsize        % Aus "a4wide.sty"
    % mods for 10 pt
    \oddsidemargin  0.15 in     %   Left margin on odd-numbered pages.
    \evensidemargin 0.35 in     %   Left margin on even-numbered pages.
    \marginparwidth 1 in        %   Width of marginal notes.
    \oddsidemargin 0.25 in      %   Note that \oddsidemargin = \evensidemargin
    \evensidemargin 0.25 in
    \marginparwidth 0.75 in
    \textwidth 5.875 in % Width of text line.
\or % mods for 11 pt
    \oddsidemargin 0.1 in      %   Left margin on odd-numbered pages.
    \evensidemargin 0.15 in    %   Left margin on even-numbered pages.
    \marginparwidth 1 in       %   Width of marginal notes.
    \oddsidemargin 0.125 in    %   Note that \oddsidemargin = \evensidemargin
    \evensidemargin 0.125 in
    \marginparwidth 0.75 in
    \textwidth 6.125 in % Width of text line.
\or % mods for 12 pt
    \oddsidemargin -10 pt      %   Left margin on odd-numbered pages.
    \evensidemargin 10 pt      %   Left margin on even-numbered pages.
    \marginparwidth 1 in       %   Width of marginal notes.
    \oddsidemargin 0 in      %   Note that \oddsidemargin = \evensidemargin
    \evensidemargin 0 in
    \marginparwidth 0.75 in
    \textwidth 6.375 in % Width of text line.
\fi     
}
\DeclareOption{hytex}{\iMhytexoutput}%
\def\iMhytexoutput{%
        \global\iMformattrue
        \global\printfalse
        \global\hytextrue
        \global\hypermodetrue
        \global\asciifalse
        \global\htmlfalse
        \global\fullscreentrue
        \global\laptopfalse
        \global\paperwidefalse
        \global\paperfalse
        \ifiMlayout
        \global\setlength{\textheight}{160mm}%
        \global\setlength{\textwidth}{150mm}%
        \pagestyle{hyperheads}%
        \fi
%        \gdef\smallcube{\ensuremath{\bullet}}%
}
\DeclareOption{hytexsmall}%
{%
        \global\iMformattrue
        \global\printfalse
        \global\hytextrue
        \global\hypermodetrue
        \global\asciifalse
        \global\htmlfalse
        \global\fullscreenfalse
        \global\laptoptrue
        \global\paperwidefalse
        \global\paperfalse
        \ifiMlayout
        \setlength{\textheight}{100mm}%
        \setlength{\textwidth}{150mm}%
        \pagestyle{hyperheads}%
        \fi
%        \gdef\smallcube{\ensuremath{\bullet}}%
}
\DeclareOption{ascii}%
{%
  \AtEndOfPackage{
    \def\DeclareMathAlphabet#1#2#3#4#5{}%
    \providecommand{\@svsechd}{}%
  }
%  \def\startpar{\special{html:<p>}}
  
%  \let\orig@xsect\@xsect
%  \let\orig@startsec\@startsection
%  \def\@startsection#1#2{%
%    \def\@xsect##1{%
%      \@tempskipa ##1\relax
%      \ifdim \@tempskipa>\z@
%        \par \nobreak
%        \vskip \@tempskipa
%%% added
%%        \special{html:</h#2>}%
%%% end of added
%        \@afterheading
%      \else
%        \@nobreakfalse
%        \global\@noskipsectrue
%        \everypar{%
%          \if@noskipsec 
%          \global\@noskipsecfalse
%          {\setbox\z@\lastbox}%
%          \clubpenalty\@M 
%          \begingroup \@svsechd \endgroup 
%          \unskip
%%% added
%%          \special{html:</h#2>}%
%%% end of added
%          \@tempskipa ##1\relax
%          \hskip -\@tempskipa
%          \else
%          \clubpenalty \@clubpenalty
%          \everypar{}%
%          \fi}%
%      \fi
%      \ignorespaces}%
%    \expandafter\def\expandafter\startpar\expandafter{\expandafter%
%      \def\expandafter\startpar\expandafter{\startpar}% 
%      \special{html:<h#2>}%
%    }%
%    \orig@startsec{#1}{#2}}%
% 
%  \newtoks\evpar
%  \evpar{}
%
%  \everypar{\startpar\the\evpar}
%  \let\everypar\evpar

%  \let\clearpage\relax
%  \let\cleardoublepage\relax

  \global\iMformattrue
  \global\printfalse
  \global\hytexfalse
  \global\hypermodefalse
  \global\asciitrue
  \global\htmltrue
  \global\fullscreenfalse
  \global\laptopfalse
  \global\paperwidefalse
  \global\papertrue
  \global\def\smallcube{o}%
  \pagestyle{empty}%
  \global\let\ps@plain\ps@empty
%  \setlength{\textheight}{1000mm}
%  \setlength{\textwidth}{100mm}%
%        \renewcommand*{\rmdefault}{\ttdefault}%
%        \renewcommand*{\sfdefault}{\ttdefault}%
%        \renewcommand*{\bfdefault}{\ttdefault}%
  \lefthyphenmin=100000
  \raggedright
}

\DeclareOption{html4}%
{%
  \providecommand{\@svsechd}{}%
  
  \let\@orig@startsection\@startsection
  \global\def\@startsection#1#2{%
    \ifnum#2<4\relax% bis zur subsubsection
       % Ein Seitenumbruch kommt, wenn seit der letzten Ueberschrift
       % Text ausgegeben wurde.
       % Sonst macht ein Seitenumbruch wenig Sinn.
    \if@nobreak\else\clearpage\null\vspace*{-1.2cm}\fi\fi
    \csname iM@prep@#1\endcsname%
    \@orig@startsection{#1}{#2}%
  }%

  \global\iMformattrue
  \global\printfalse
  \global\hytexfalse
  \global\hypermodefalse
  \global\asciifalse
  \global\htmltrue
  \global\fullscreenfalse
  \global\laptopfalse
  \global\paperwidefalse
  \global\papertrue
  \global\def\smallcube{\HCode{<img src="smallcube.gif" alt="o ">}}%
  \pagestyle{empty}%
  \global\let\ps@plain\ps@empty
%  \setlength{\textheight}{1000mm}
%  \setlength{\textwidth}{100mm}%
%        \renewcommand*{\rmdefault}{\ttdefault}%
%        \renewcommand*{\sfdefault}{\ttdefault}%
%        \renewcommand*{\bfdefault}{\ttdefault}%
  \lefthyphenmin=100000
  \raggedright
% fonts should not become too small
  \DeclareMathSizes{10}{10}{9}{8}%
  \DeclareMathSizes{11}{11}{10}{8}%
  \DeclareMathSizes{12}{12}{10}{8}%
  \DeclareMathSizes{14}{14}{12}{10}%
  \DeclareMathSizes{17}{17}{14}{11}%
}


% Die Option hytexlarge bewirkt, da� die Seitenl�nge auf 1m
% eingestellt wird und bei jedem Abschnittsbefehl bis zu subsubsection
% ein Seitenumbruch stattfindet.
% Au�erdem wird der Seitenstil plain umdefiniert und der Abstand
% ueber einer Kapitelueberschrift wird verkleinert.

\DeclareOption{hytexlarge}{%
        \global\iMformattrue
        \global\@twosidefalse
        \global\printfalse
        \global\hytextrue
        \global\asciifalse
        \global\htmlfalse
        \global\fullscreenfalse
        \global\laptopfalse
        \global\paperwidefalse
        \global\paperfalse
        \global\iMreallylargetrue
        \global\hypermodetrue
        \global\textheight 800mm\relax
        \global\setlength{\textwidth}{150mm}%
        \global\setlength{\paperheight}{1000mm}%
        \global\setlength{\paperwidth}{160mm}%
        \special{papersize=\the\paperwidth,\the\paperheight}%
%        \global\setlength{\@fptop}{\z@}%
%       \global\setlength{\@dblfptop}{\z@}%
        \global\let\cleardoublepage\clearpage
%        \gdef\smallcube{\ensuremath{\bullet}}%
        \pagestyle{hyperheads}%
% \iM@layout must be called prior to \iM@prepare@largepages
        \ifiMlayout
         \iM@layout
         \global\let\iM@layout\relax
        \fi
% Aus Mhyper.sty:
        \iM@prepare@largepages
}%

%% pagestyles

\def\ps@helppage{%
  \def\@oddfoot{}\def\@evenfoot{}%
  \def\@evenhead{\hfil {\large\rightmark\rlap{\hskip\bigskipamount\thepage}}}%
  \let\@oddhead\@evenhead
}

\def\ps@helppagefirst{%
  \def\@oddfoot{}\def\@evenfoot{}%
  \def\@evenhead{\hfil {\large\rlap{\hskip\bigskipamount\thepage}}}%
  \let\@oddhead\@evenhead
}

\def\ps@hyperheads{
  \def\@oddfoot{}\def\@evenfoot{}%
  \def\@evenhead{\hfil {\large\rightmark\rlap{\hskip\bigskipamount\thepage}}}%
  \let\@oddhead\@evenhead  
}

\def\ps@mymuheadings{\let\@mkboth\@gobbletwo
 \def\@oddfoot{}\def\@evenfoot{}%       No feet.
 \def\@evenhead{\rmfamily \thepage \hfil {\leftmark}}%        Left heading.
 \def\@oddhead{{\rightmark} \hfil \rmfamily\thepage}% Right heading.
 \ifiM@springer%
   \def\chaptermark##1{\markboth{{\small\rm ##1}}{}}%
   \def\sectionmark##1{\markright{{\small\rm ##1}}}%
 \else%
   \def\chaptermark##1{\markboth {{\scshape ##1}}{}}%
% Stichwort Kapitel erscheint nicht im Kopf
   \def\sectionmark##1{\markright {{\scshape ##1}}}%
 \fi}%
                                %Definition f"ur Kopfzeilen:
\gdef\iMmyline{\hbox to\hsize\relax}
\gdef\iMmyheadlineodd#1{\vbox
  {\hrule
    \iMmyline{\strut {\small\sffamily #1}}
    \hrule}}
\gdef\iMmyheadlineeven#1{\vbox
  {\hrule
    \iMmyline{\strut {\small\sffamily #1}}
    \hrule}}
\headheight 16pt
\ifhypermode
\def\ps@Mlibheadings{\let\@mkboth\@gobbletwo
  \def\@oddhead{\iMmyheadlineodd{\rlap{\rightmark}\hfill\textrm{\thepage}}}
  \def\@oddfoot{}
  \def\@evenhead{\@oddhead}
  \def\@evenfoot{\@oddfoot}
  \def\sectionmark##1{}
  \def\subsectionmark##1{}}
\else
\def\ps@Mlibheadings{\let\@mkboth\@gobbletwo
  \def\@oddhead{\iMmyheadlineodd\rightmark\hfill}
  \def\@oddfoot{\hfill \textrm{\thepage}\hfill}
  \def\@evenhead{\iMmyheadlineeven\rightmark\hfill}
  \def\@evenfoot{\hfill \textrm{\thepage}\hfill}
  \def\sectionmark##1{}
  \def\subsectionmark##1{}}
\fi

%% and process the options
\iMformatfalse
\ProcessOptions
\relax
\ifiMformat\else\iMhytexoutput\fi % Default/Fallback
\def\iMhytexoutput{}
\ifiMlayout\iM@layout\fi
\ifhtml
  \RequirePackage[Mhelp-tex4ht,html4,hyperref,html]{tex4ht}
  \RequirePackage[extension=html,hypertex]{hyperref}%
  \newtoks\M@csscollect
  \M@csscollect{}%
  \newcommand*{\M@flushcss}{%
    \the\M@csscollect
    \M@csscollect{}%
  }
  \bgroup
    \lccode`\@=`\#
    \lowercase{\egroup
      \AtBeginDocument{%
        \renewcommand*{\toprule}[1][1pt]{%
          \global\iM@appendtok\M@csscollect+=\Css{tr@TBL-\TableNo-1- td{border-top:#1  solid}}\iM@appendtok%
          \aftergroup\M@flushcss
        }
        \renewcommand*{\bottomrule}[1][1pt]{%
          \global\iM@appendtok\M@csscollect+=\Css{tr@TBL-\TableNo-\HRow- td{border-bottom:#1  solid}}\iM@appendtok%
          \aftergroup\M@flushcss
        }
        \renewcommand*{\midrule}[1][0.5pt]{%
          \global\iM@appendtok\M@csscollect+=\Css{tr@TBL-\TableNo-\HRow- td{border-bottom:#1  solid}}\iM@appendtok%
          \aftergroup\M@flushcss
        }
      }
    }
\else
  \ifpdf
    \RequirePackage{hyperref}%
    \pdfstringdefDisableCommands{\def\Mex#1{#1}\def\Mup#1{#1}}
  \else
    \RequirePackage[extension=mdvi,hypertex]{hyperref}%
  \fi
\fi

\@ifundefined{chapter}{% nicht book.cls
  \usepackage{Mreprt}%
}{%book.cls
  \usepackage{Mbook}%
}

%----------------------- externe Counter --------------------------------

\newcounter{norule} % Flag zur Unterdrueckung einer Linie

%--------------- Counter zum Merken der env-Einstellungen ---------------

\newcounter{envMargs}
\newcounter{envMmetas}
\newcounter{envMdmath}
\newcounter{envMmath}
\newcounter{envMmethod}
\newcounter{envMseealso}
\newcounter{envMoverloading}
\newcounter{envMsyntax}
\newcounter{envMsuperdomain}
\newcounter{envMcategories}
\newcounter{envMaxioms}

%------------------------------------------------------------------------

%-- Counter fuer Zeilenwechsel ((Nicht) erstes Makro in der Umgebung?) --

\newcounter{firstMsyntax}

%------------------------------------------------------------------------

%------ Counter f"ur die Umgebungen zur Beispielausgabe (Mvin...) -------

\newcounter{iMexcounter}

% Initialisierung:
\setcounter{iMexcounter}{0}

%--------------- Interne Makros -----------------------------------------

\def\shouldbe@samepage{%
        \interlinepenalty10000%
        \postdisplaypenalty500%
        \interdisplaylinepenalty9000%
        \@beginparpenalty\@M%
        \@endparpenalty\@M%
        \@itempenalty600%
        \@secpenalty250%
        \interfootnotelinepenalty1000%
}

\def\iMleer{}%   % Mehrfach benoetigte Vergleichsvariable
   % zum Pruefen auf leere Eingabe.

\def\iM@filename{\jobname}% Wird im Makro \Minput umdefiniert

\def\iMspace{ }

\let\Mpackname\@empty
\let\Mdirname\@empty
\let\Mprefix\@empty
\def\iMpacknode{\Mprefix} % Dummydefinition

\newsavebox{\iMupwarningcontents}       % Wird nur fuer das 
\sbox{\iMupwarningcontents}{%           % "\Mwarning-Makro" benoetigt.
  \unitlength1.0mm
  \begin{picture}(10,10)
    \thicklines
    \put(0,0){\line(1,0){10}}
    \put(0,0){\line(1,2){5}}
    \put(10,0){\line(-1,2){5}}
    \put(0,-1){\makebox(10,10){\LARGE !}}
  \end{picture}
}

\DeclareRobustCommand{\iMtt}[1]   % Makro f"ur Typewriting im Mathe- UND Textmodus
{%
  \ifmmode%  
   \mathtt{#1}%
  \else%
   \texttt{\frenchspacing{}#1}%
  \fi%
}

\newcommand*{\iMversioncheck}% % Falls als viertes Argument eine Version
                                % angegeben wurde,und die
                                % Versionsnummernausgabe eingestellt
                                % ist, so wird diese
                                % unter der Helpseitenueberschrift
                                % ausgegeben.
                                % Ansonsten erscheint eine Warnung.
{\ifx\iMversion\iMleer%
  \ifnum\value{iMlang}=\value{iMgerman}%
    \\[-2.5mm]
    \fbox{\large\bfseries\sc%
      ACHTUNG: Diese Helpseite ist nicht mehr aktuell}\\%
    \else%
    \fbox{\large\bfseries\sc%
      WARNING: This Helppage isn't up-to-date}\\%
    \fi\vspace*{-5mm}%
  \else%
  \ifnum\value{iMoutput}=1
    {\footnotesize V\iMversion ~}%
   \fi%
    %\ifx\iMauthor\iMleer%  % Falls als drittes Argument ein Autor
    % angegeben wurde, so wird dieser
    % ausgegeben.
    % \else {\footnotesize \iMauthor}%
          %\fi%
  \fi}

\newcommand*{\iMfileopen}
{\ifnum\value{iMhelppage}=1
  \Mwrite{mltoc}{\jobname.mltoc}
  \ifnum\value{iMpack}=1
      \vspace{.5cm}
   \ifprint
      \hrule \nopagebreak[4]
      \vspace{.5cm}
   \fi
  \fi
 \else
  \ifprint
     \ifnum\value{norule}=0
     \hrule \nopagebreak[4]
       \vspace{.5cm}
   \fi
   \setcounter{norule}{0}
  \fi
 \fi}

\newcommand*{\iMwriteout}% Benutzt die globalen Variablen
                        % \iMnod, \iMobject, \iMdescription
  {{\def\_{\noexpand\_}%
    \Mwrite{mltoc}{\iMnod}%
    \Mwrite{mtoc}{\string\tocMhelppage{\iMnod}}%
 {\iM@tok=\expandafter{\iMobject}%
  \Mwrite{mltoc}{\the\iM@tok}%
  \Mwrite{mtoc}{{\the\iM@tok}}%
  }%
 {\iM@tok=\expandafter{\iMdescription}%
  \Mwrite{mltoc}{\the\iM@tok}%
  \Mwrite{mtoc}{{\the\iM@tok}{\thepage}{\iMidx@entry}}%
  }%
}}

\providecommand*{\M@new@all@parts}{}

\newcommand*{\Mpart}[1]{%
  \clearpage
  \Mwrite{mtoc}{\string\Msection{#1}}%
  \gdef\M@cur@part{#1}%
  \xdef\M@new@all@parts{\M@new@all@parts\string\do{#1}}%
}

\AtEndDocument{\immediate\write\@auxout{\string\gdef\string\M@all@parts{\M@new@all@parts}}}

\newcommand*{\tocentry}[3]{%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname l@#2\endcsname\relax
    \@dottedtocline{1}{0pt}{1em}{#1}{#3}%
  \else
    \csname l@#2\endcsname{#1}{#3}%
  \fi
}

\newcommand*{\tocMhelppage}[5]{{%
  \tocentry{{\iM@foreach{#2}{,}{\Mup[#5]}{, %
        \hskip\z@ plus0.001fil\penalty10\hskip\z@ plus-0.001fil\relax
  \ignorespaces}}~~---\ \ #3}{helppage}{#4}%
}}

\newcommand*{\Mprintconts}[1][\jobname]{{%
\parindent\z@\relax
\parskip.5\baselineskip\relax
\catcode`\%=12\relax
\renewcommand*{\numberline}[1]{%
  \setbox0=\hbox{##1\ }%
  \@tempdima=0pt%
  \loop
     \advance\@tempdima by 1em\relax
  \ifdim\@tempdima<\wd0 \repeat
  \wd0=\@tempdima
  \box0}%
\raggedright
\ifhtml\tableofcontents{}\fi
\makeatletter
\catcode`\^=7 %
\InputIfFileExists{#1.mtoc}{}{}\relax
}}

\let\M@addcont=\addcontentsline
\renewcommand*{\addcontentsline}[3]{{%
    \def\temp@a{toc}%
    \def\temp@b{#1}%
    \ifx\temp@a\temp@b\iM@protected@Mwrite{mtoc}{\string\tocentry{\string\Mhref[\iMidx@entry]{#3}}{#2}{\thepage}}\fi
    \M@addcont{#1}{#2}{#3}%
}}


\def\expanded#1{%
  \edef\M@expanded{\noexpand#1}%
  \M@expanded
}

%
% Makro \iMwritehelp 
% Dieses dient zum Eintragen von Begriffen in die Help-Index Dateien
%
\newcommand*{\iMwritehelp}[2]  % Schreibt die n"otigen Informationen
                              % in die MuPAD-Help-Index Dateien
{%
 \if\relax#1\relax\else
                                % Ausgabe in die Helpdatei f"ur die HyTeX
                                % Version
   \expanded{\Mwrite{help}{#1\string\\#2}}%

   \if!\Mpackname!%
        {\ifx\iM@filename\@empty\else
          \expanded{\Mwrite{helpascii}{#1\string\\%
              \if!\Mdirname!\else\Mdirname/\fi\iM@filename}}\fi}%
   \else
     \if!\Mdirname!%
        {\ifx\iM@filename\@empty\else
          \expanded{\Mwrite{helpascii}{#1\string\\%
              \iMpacknode\iM@filename}}\fi}%
     \else%
        {\ifx\iM@filename\@empty\else
          \expanded{\Mwrite{helpascii}{#1\string\\%
              \Mdirname/\iM@filename}}\fi}%
     \fi
   \fi
 \fi
}

% \tabularx mit Seitenumbr�chen drin.
% Leider k�nnen wir nicht einfach ltablex.sty laden, der kommt nicht
% damit klar, dass \tabularx innerhalb einer anderen Umgebung
% verwendet wird.
\newif\ifTX@convertX@
\TX@convertX@true

\ifhtml\else
\renewcommand\TX@endtabularx{%
  \expandafter\TX@newcol\expandafter{\tabularxcolumn{\TX@col@width}}%
  \let\verb\TX@verb
  \def\@elt##1{\global\value{##1}\the\value{##1}\relax}%
  \edef\TX@ckpt{\cl@@ckpt}%
  \let\@elt\relax
  \TX@old@table=\maxdimen
  \TX@col@width=\TX@target
  \global\TX@cols=\@ne
  \TX@typeout@
    {\@spaces Table Width\@spaces Column Width\@spaces X Columns}%
   
  %
  % define \endhead, etc. to be \\ so that in this part
  % of the process they are just rows
  %
  \let\savecaption\caption
  \@namedef{caption}{\\} % Not using \def, to make font-lock happy
  \let\saveendhead\endhead
  \def\endhead{\\}
  \let\saveendfirsthead\endfirsthead
  \def\endfirsthead{\\}
  \let\saveendfoot\endfoot
  \def\endfoot{\\}
  \let\saveendlastfoot\endlastfoot
  \def\endlastfoot{\\}
  \let\saveMmath\Mmath
  \def\Mmath##1##2{\ensuremath{##2}}
  \let\saveMdmath\Mdmath
  \def\Mdmath##1##2{\ensuremath{##2}}
  %
  %
  \ifTX@convertX@
    \TX@trial{\def\NC@rewrite@X{\NC@find l}}
    \ifdim\wd\@tempboxa<\TX@target
      \TX@newcol{l}
    \else
      \TX@convertX@false
    \fi
  \fi

  \ifTX@convertX@
    \relax
  \else
    \TX@trial{\def\NC@rewrite@X{%
        \global\advance\TX@cols\@ne\NC@find p{\TX@col@width}}}%
    \loop
      \TX@arith
      \ifTX@
      \TX@trial{}%
    \repeat
  \fi
  {\let\@footnotetext\TX@ftntext\let\@xfootnotenext\TX@xftntext
    % we may as well set \LTchunksize to be \maxdimen as the whole
    % thing is already in memory anyway so we may as well do it in one
    % chunk. if it is too big for one chunk we are already dead.. 
    \LTchunksize\maxdimen
    % 
    % restore \endhead, etc.
    %
    \let\caption\savecaption
    \let\endhead\saveendhead
    \let\endfirsthead\saveendfirsthead
    \let\endfoot\saveendfoot
    \let\endlastfoot\saveendlastfoot
    \let\Mmath\saveMmath
    \let\Mdmath\saveMdmath
    %
    \expandafter\longtable
      \the\toks@
    \endlongtable
    }%
  \global\TX@ftn\expandafter{\expandafter}\the\TX@ftn
  \ifnum0=`{\fi}%
   \expandafter\end\expandafter{\@currenvir}
}
\fi% \ifhtml

\TX@convertX@false

%---------------------------- Makros ------------------------------------

\def\@makeother#1{\catcode`#1=12\relax}

%% Das Drumherum mit der Gruppe ist erst dann notwendig, wenn z.B. \_ auf _
%% gemappt werden soll.  Argumente werden aber unevaluiert �bergeben.
%\bgroup
%  \@makeother\_\@makeother\$
%  \def\x{
\DeclareRobustCommand*{\iM@sanitize}{%
  \@makeother\_%
  \@makeother\$%
  \@makeother\^%
  }%
%}%
%\expandafter\egroup\x
% Makros f"ur einige Sonderzeichen

\def\Mbsl{\ifmmode\backslash\else$\backslash$\fi}

\newcommand*{\iMout}{\ifvmode\else\/\fi\tt}

\newcommand*{\Mproofread}[3]{}

\newskip\iM@presectskip
\iM@presectskip=3ex \@plus 1ex \@minus .2ex\relax
\ifhtml
\newcommand*\Msection[1]{\HCode{<h4 class="Msection">}#1\HCode{</h4>}}
\newcommand*\iM@sect@line[1]{\par\HCode{<hr>}%
  \HCode{<h4 class="Msection">}#1\HCode{</h4>}}
\newcommand*\iM@sect@nobreak[1]{%
  \HCode{<h4 class="Msection-nobreak">}#1\HCode{</h4>}}
\newcommand*\iM@sect@line@nobreak[1]{\par\HCode{<hr>}%
  \HCode{<h4 class="Msection-nobreak">}#1\HCode{</h4>}}
\else
\newcommand*\Msection{\@startsection{none}{10}{\z@}%
  {-\iM@presectskip}%
  {1ex \@plus .2ex}%
  {\normalfont\normalsize\bfseries}*}
\newcommand*\iM@sect@line{\@startsection{none}{10}{\z@}%
  {-\iM@presectskip}%
  {1ex \@plus .2ex}%
  {\hrule\vskip\iM@presectskip%
    \normalfont\normalsize\bfseries}*}
\newcommand*\iM@sect@nobreak{\@startsection{none}{10}{\z@}%
  {-\iM@presectskip}%
  {-1.5ex \@plus -.2ex}%
  {\normalfont\normalsize\bfseries}*}
\newcommand*\iM@sect@line@nobreak{\@startsection{none}{10}{\z@}%
  {-0.5\iM@presectskip}%
  {-1.5ex \@plus -.2ex}%
  {\hrule\vskip\iM@presectskip%
    \normalfont\normalsize\bfseries}*}
\fi
\gdef\mupad{\textsf{MuPAD}}
\gdef\xmupad{\textsf{XMuPAD}} %??%
\gdef\hytex{\textsf{Hy{\TeX}}}
\gdef\scilab{\textsf{Scilab}}

% Das Makro \Maddtoc sorgt daf"ur, da\3 f"ur jede Helpseite ( Environment
% Mhelppage ) ein Eintrag in das Inhaltsverzeichnis durchgef"uhrt wird.
% \Mnoaddtoc stellt dies ab.
%
% Standardeinstellung ist \Mnoaddtoc
%
% \Msysfun sorgt daf"ur, da\3 f"ur die  Helpseite ( Environment
% Mhelppage ) ein Indexeintrag als subsection unter system functions
% durchgef"uhrt wird.  Hierbei enth"alt \iMhzwei das zweite Argument
% aus der Mhelpumgebung.
%
% \Menvvar sorgt daf"ur, da\3 f"ur die Helpseite ( Environment
% Mhelppage ) ein Indexeintrag als subsection unter environment variables
% durchgef"uhrt wird. Hierbei enth"alt \iMhzwei das zweite Argument
% aus der Mhelpumgebung.
%
% \Mbook wird benutzt wenn Mhelp Style und Handbuch zusammenarbeiten sollen
%    - HyTeX Seitenlayout Initialisierung findet nicht statt.
%
% \Mclearbuttons l"oscht die Buttons beim HyPage Previewer. 
%
% \Mbookbuttons Setzt die HyTeX Buttons welche auf jeder Seite 
%     vorhanden seien sollten.
%
% \Msynopsison sorgt daf"ur, da\3 der Inhalt der Msynopsis Umgebung ausgegeben
%     wird.
% \Msynopsisoff sorgt daf"ur, da\3 der Inhalt der Msynopsis Umgebung
%     nicht ausgegeben wird.
%
% Standardeinstellung ist \Msynopsison
%
% Autor:     tom      03.04.96
%
%

\def\iMsysfun{system function}
\def\iMenvvar{environment variable}

%bij% neuer Index-Befehl
\def\Msysfun{\MIndex[\iMsysfun]{\iMhzwei}}
\def\Menvvar{\MIndex[\iMenvvar]{\iMhzwei}}

%bij% - Anfang -------------------------

% xxx Das hier auch in Mhyper.sty?
   
% Indexeintr"age
% Ausgabeoption hytex: alle Index-Befehle mit HyTeX-Unterst"utzung
%                      (sonst normal)
% \index        normaler Index-Eintrag
% \Index        hervorgehobener Index-Eintrag
% \Mindex       normaler Index-Eintrag eines MuPAD-Objektes
% \MIndex       hervorgehobener Index-Eintrag eines MuPAD-Objektes
% 06.08.97 - bij -

\def\innnbf#1#2{\hyperlink{#1}{\bf#2}}
\def\ibf#1{{\bf#1}}

\def\makeindex{%
  \def\iindex{\@bsphack\begingroup%
              \@sanitize%
              \@wrindex}%
  \def\iIndex{\@bsphack\begingroup%
              \@sanitize%
              \@wrIndex}%
  \immediate\typeout{Writing index file \jobname.idx via \jobname.col}%
  \let\makeindex\@empty%
}%
\@onlypreamble\makeindex%
\def\@wrindex#1{%
   \iM@protected@Mwrite{idx}{\string\indexentry{#1}{\thepage}}%
 \endgroup%
 \@esphack}%
\def\iindex{\@bsphack\begingroup\@sanitize\@index}

\ifhypermode%
\renewcommand*{\index}[1]{\iindex{#1|hyperlink{\iMidx@entry}}}%
\newcommand*{\Index}[1]{\iindex{#1|innnbf{\iMidx@entry}}}%
\else%
\renewcommand*{\index}[1]{\iindex{#1}}%
\newcommand*{\Index}[1]{\iindex{#1|ibf}}%
\fi%
%
\newcommand*{\Mindex}[2][]%
  {{%
    \iMescapeChar{_}{\noexpand\_}{#1}%
    \let\@tempa\iMescaped%
    \def\${\noexpand\$}%
    \def\iMtt{\noexpand\iMtt}%
    \iMescapeChar{_}{\noexpand\_}{#2}%
    \ifx\@tempa\@empty%
     \edef\@tempb{\iMescaped{}@\noexpand\iMtt{\iMescaped}}%
    \else%
     \edef\@tempb{\@tempa!\iMescaped{}@\noexpand\iMtt{\iMescaped}}%
    \fi%
    \ifhypermode%
     \expandafter\iindex\expandafter{\@tempb|hyperlink{\iMidx@entry}}%
    \else%
     \expandafter\iindex\expandafter{\@tempb}%
    \fi%
  }}%
%
\newcommand*{\MIndex}[2][]
  {{%
    \iMescapeChar{_}{\noexpand\_}{#1}%
    \let\@tempa\iMescaped%
    \def\${\noexpand\$}%
    \def\iMtt{\noexpand\iMtt}%
    \iMescapeChar{_}{\noexpand\_}{#2}%
    \ifx\@tempa\@empty\edef\@tempb{\iMescaped{}@\protect\iMtt{\iMescaped}}%
     \else\edef\@tempb{\@tempa!\iMescaped{}@\protect\iMtt{\iMescaped}}%
    \fi%
    \ifhypermode%
     \expandafter\iindex\expandafter{\@tempb|innnbf{\iMidx@entry}}%
    \else%
     \expandafter\iindex\expandafter{\@tempb|ibf}%
    \fi%
  }}%
%

% Referenzen
% \label        Markierung im Text f"ur LaTeX-  u n d  HyTeX-Referenzen
%               Nur lokal f�r die Datei.

\AtBeginDocument{%
  \let\globallabel=\label%
  \def\label#1{%
    \Mnode{#1}%
    \globallabel{#1}%
    \Mnode{\iM@docname @\iM@filename @#1}%
    \globallabel{\iM@docname @\iM@filename @#1}%
    }
%
  \let\globalref=\ref%
  \def\ref#1{\@ifundefined{r@\iM@docname @\iM@filename @#1}%
    {\globalref{#1}}{\globalref{\iM@docname @\iM@filename @#1}}}%
%
  \let\globalpageref=\pageref%
  \def\pageref#1{\globalpageref{\iM@docname @\iM@filename @#1}}%
  }
\def\MTutoriumSetup{%
%%  \AtBeginDocument{%
%%    \def\label##1{%
%%      \Mnode{##1}%
%%      \Mnode{\iM@docname @\iM@filename @##1}%
%%      \globallabel{\iM@docname @\iM@filename @##1}%
%%      }}
}
% In der .aux-Datei k�nnen Label mit %-Zeichen etc. vorkommen.
\AtBeginDocument{%
  \let\M@newlabel=\@newl@bel%
  \def\M@@newlabel#1#2#3{\egroup\M@newlabel{#1}{#2}{#3}}%
  \def\@newl@bel{\bgroup\iM@sanitize\@makeother{\%}\M@@newlabel}%
  \let\M@testdef=\@testdef%
  \def\M@@testdef#1#2#3{\egroup\M@testdef{#1}{#2}{#3}}%
  \def\@testdef{\bgroup\iM@sanitize\@makeother{\%}\M@@testdef}%
}
%
\edef\iM@docname{\jobname}
\def\Mdocname#1{\def\iM@docname{#1}}
% global label: \iM@globallabel{label name} sets a global label
% inside the current document as defined by \Mdocname resp. \iM@docname
\def\iM@globallabel#1{%
  \Mnode{#1}%
  \globallabel{#1}%
  \Mnode{\iM@docname @#1}%
  \@bsphack\iM@protected@Mwrite{exl}{\string\iMdefgloballabel%
    {\iM@docname}{#1}{\iM@therealpage}{\thepage}{\iMidx@entry}{\@currentlabel}}%
  }

% For the Method descriptions, possibly imported from other files.
\newcommand*{\iMMethod}{\bgroup\iM@sanitize\iM@Method}
\newcommand*{\iM@Method}[2]{\egroup%
  \iM@@Method{#1}{#2}}
\newcommand*{\iM@@Method}[3]{%
  \expandafter\gdef\csname iM@Method@descr@#1@#2\endcsname{#3}}

\newcommand*{\iM@useMethod}[2]{%
  \Mex{#2} &
  \@ifundefined{iM@Method@descr@#1@#2}{%
    \ifcase\value{iMlang}%
      no description yet (package #1)
    \or%
      noch nicht beschrieben (Paket #1)
    \or%
      pas encore document� (biblioth�que #1)
    \fi%
    }{\csname iM@Method@descr@#1@#2\endcsname%
    \def\temp@a{#1}%
    \edef\temp@b{\if!\Mprefix!\else\Mprefix::\fi%
      \iM@func}%
% xxx Das Sprungziel ist noch falsch.
    \ifx\temp@a\temp@b\else\space \Mhref[#1]{(inherited)}\fi}\\}

%% % input dependencies, but only .exl files
%% \def\iM@readthose#1: #2\iM@readthose{%
%%   \def\iM@readifexl##1{\def\temp@a{##1}%
%%     \ifx\@empty\temp@a\else%
%%       \filename@parse{\temp@a}%
%%       \def\temp@b{exl}%
%%       \ifx\temp@b\filename@ext%
%%         \InputIfFileExists{##1}{}{}%
%%       \fi%
%%     \fi}%
%%   \iM@foreach{#2}{ }{\iM@readifexl}{\ignorespaces}\relax%
%%   }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% \AtBeginDocument{%
%%   \InputIfFileExists{\jobname.exl}{}{}%
%% %  \IfFileExists{\jobname.Mde}{%
%% %    \openin\LTOCIN=\jobname.Mde\relax
%% %    \read\LTOCIN to \iM@Mdepline%
%% %    \closein\LTOCIN%
%% %    \expandafter\iM@readthose\iM@Mdepline\iM@readthose%
%% %    }{%
%% %    \PackageWarning{Mhelp}{\jobname.Mde non-existent.  External references %
%% %      won't work.}%
%% %    }
%% }

% rp@<document name>@<label> is a page reference to a physical page number,
% p@<document name>@<label> is a reference to the printed page number, and
% la@<document name>@<label> is a reference to a hypage node.
% r@<document name>@<label> is a reference to the last \refstepcounter,
%  as those you reach via \ref{} in normal \LaTeX.
\def\iMdefgloballabel{\bgroup\iM@sanitize\@makeother{\%}\M@defgloballabel}
\def\M@defgloballabel#1#2#3#4#5#6{\egroup%
  \expandafter\gdef\csname rp@#1@#2\endcsname{#3}%
  \expandafter\gdef\csname p@#1@#2\endcsname{#4}%
% I'd love to get rid of constructing macros here.  However, I need
% to compare #1 with \jobname, independently of catcodes.
  \edef\temp@a{\expandafter\noexpand\csname #1\endcsname}%
  \edef\temp@b{\expandafter\noexpand\csname\jobname\endcsname}%
  \ifx\temp@a\temp@b
   \expandafter\xdef\csname la@#1@#2\endcsname{#5}%
  \else
   \expandafter\xdef\csname la@#1@#2\endcsname{#1??#5}%
  \fi
  \expandafter\gdef\csname r@#1@#2\endcsname{{#6}{#4}}%
  }

% Da das '!' als Trennzeichen verwendet wird, aber nebenbei auch
% noch in Indexeintraegen auftauchen koennen soll, muss ihm ein $
% vorangestellt werden. Folgende Routine macht das durch
% \iMescapeChar{!}{$!}{<Indexeintrag>}. Allgemeiner:
% Das dritte Argument wird tokenweise analysiert, ob es beim Vergleich
% mit \if mit dem ersten Argument uebereinstimmt. Wenn ja, wird
% das zweite Argument ausgegeben, sonst das Token aus dem Aufruf.
% die Ausgabe steht nachher in \iMescaped.

\long\def\iMescapeChar#1#2#3{%
  \gdef\iMescaped{}%
  \long\def\iMesc@peCh@r##1#1##2\iMesc@peCh@r{%
    \def\temp@a{##2}%
    \ifx\temp@a\@empty\expandafter\gdef%
      \expandafter\iMescaped\expandafter{\iMescaped ##1}%
    \else\expandafter\gdef%
      \expandafter\iMescaped\expandafter{\iMescaped ##1#2}%
      \iMesc@peCh@r##2\iMesc@peCh@r%
    \fi}%
  {\iMesc@peCh@r#3#1\iMesc@peCh@r}%
  }

\def\iM@gobblespaces@andcall#1{%
  \@ifnextchar\space{%
    \expandafter\iM@gobblespaces@andcall\expandafter#1%
    \let\next=}{#1}}

% In einigen Umgebungen der Hilfeseite werden Parameter mit Kommata
% getrennt angegeben.  Diese Routine ruft eine Funktion f�r jeden
% dieser Parameter auf und eine weitere zwischen den Parametern.
% Die erste der beiden (der dritte Parameter) bekommt ein Argument,
% die zweite (der vierte Parameter) wird einfach aufgerufen.
% Typischer Aufruf: \iM@foreach{#1}{,}{\Mupc}{, }
\def\iM@foreach#1#2#3#4{%
  \def\iM@foreach@x{#2}%
  \def\iM@foreach@y{ }%
  \def\iM@step##1#2##2\end@iM@step{%
    #3{##1}\relax%
    \def\iM@foreach@temp@a{##2}%
    \ifx\iM@foreach@temp@a\@empty% Ende der Liste erreicht
    \else%
     #4\relax%
     \if\iM@foreach@y\iM@foreach@x\else\@ReturnAfterFi\iM@gobblespaces@andcall\fi%
       \iM@step##2\end@iM@step%
    \fi%
    }%
  \iM@step#1#2\end@iM@step%
  }

% \Mlibtitle{Paketname}{Einzeiler}{Autor(en)}
\newcommand*{\Mlibtitle}[3]{%
  \Mclearbuttons
  \thispagestyle{empty}%
  \noindent%
     \Mgraphic[height=0.1\linewidth]{sciface}%
     \hfill%
     \Mgraphic[height=0.1\linewidth]{mupad}%
     \par%
  \vskip6\baselineskip\relax%
  \begin{raggedleft}%
    {\sffamily\Huge The \Mex{#1} package\par}
    \bigskip
    {\sffamily\large #2\par}
    \medskip
    {\sffamily\large #3\par}
  \end{raggedleft}%
  \newpage%
}


\newcommand*{\newMpacktitle}[6][]{
                                % 6 Parameter:
                                % #2   Nummer
                                % #3   Titel
                                % #4   Autor
                                % #5   Datum
                                % #6   Ueberblick
                                %       #1   Versionsnummer (optional) 

  \errorcontextlines=255
  \clearpage
  \enlargethispage*{2cm}%
  \thispagestyle{empty}%
  \vbox to \pagegoal{{%
    \hbox to\z@{\hskip-2.2in\vbox to\z@{%
        \vskip-1.2in
        \Mgraphic[width=1.1\paperwidth]{cubetitle}
        \vss
      }\hss}
    \advance\textwidth by 1cm

    \noindent
    \Mgraphic[width=.75\linewidth]{mupad_schriftzug}%

    \vskip1.5cm
    \ifiMreallylarge\else\vfill\fi
    \raggedleft{\textsf{\fontsize{38}{42}\selectfont #3}\par}

    \bigskip
    \bigskip

    \raggedleft{\textsf{\fontsize{20}{24}\selectfont #4}}

    \vskip 5.5cm
    \ifiMreallylarge\else\vfill\fi

    \hfill
    \Mgraphic[width=.45\linewidth]{sciface}%

    \vskip2cm
  }}%
  \eject
  \thispagestyle{empty}%
  ~

  \ifiMreallylarge\vskip{4cm}\else\vfill\fi
  \@ifundefined{abstract}{%
    \centerline{\eng{Abstract}\de{Zusammenfassung}\fr{R�sum�}}%
    \begin{quote}\noindent #6 \end{quote}%
  }{%
    \begin{abstract} \noindent #6 \end{abstract}%
  }%
  \clearpage
  \setcounter{page}{0}%
}

\newcommand*{\Mpacktitle}[6][]{
                                % 6 Parameter:
                                % #2   Nummer
                                % #3   Titel
                                % #4   Autor
                                % #5   Datum
                                % #6   Ueberblick
                                %       #1   Versionsnummer (optional) 

%  \RequirePackage{Mfonts}%
  \@ifundefined{Muni}{\newfont{\Muni}{unilogo}
    \newfont{\Mfont}{MuPAD}}{}

%------- Diese Schriften werden nur auf der Titelseite von Library-Papers
%------- verwendet.
  \font\iMfett=cmssi17 at 70.0pt
  \font\mupssf=cmbx10 scaled \magstep5
  \font\mupsma=cmss12 scaled \magstep2
  \font\mupvsma=cmss10 scaled \magstep2
  \def\iMsernum{#2}
  \def\iMvernum{#1}
  \enlargethispage{10cm}
  \begin{minipage}{\textwidth}
    \thispagestyle{empty}
                                %\iM@node{firstpage}
                                %\vspace*{-3cm}
    \begin{minipage}{\textwidth}
      {\parbox[]{2cm}{{\Muni M}}}\hfill
      {\parbox{9cm}{\flushright
          {\sffamily Universit{\"a}t Paderborn}\\[5pt]
          {\Huge\bfseries\sffamily A u t o m a t h}\\
          {\footnotesize\sffamily Institut f{\"u}r Automatisierung und Instrumentelle Mathematik\par}}}\\[-2pt]
      \rule{\textwidth}{0.5pt}
    \end{minipage}
    \flushright
    ~\\
    \iflaptop
     \vspace*{.1cm}
    \else
     \vspace*{2cm}
    \fi
    {\iMfett MuPAD}\\[3pt]
    \vspace*{0.3cm}
    {\mupvsma Multi Processing Algebra Data Tool}\\
    \iflaptop
     \vspace*{.5cm}
    \else
     \vspace*{5cm}
    \fi
    {\mupssf #3\par}%\\
    \iflaptop
     \vspace*{.5cm}
    \else
     \vspace*{1.2cm}
    \fi
    {\mupsma #4}\\
    \iflaptop
     \vspace*{.2cm}
    \else
     \vspace*{.5cm}
    \fi
    {\mupvsma #5}\\
    \vfill
%{\mupvsma {\Muni A} Automath \iflanguage{english}{Technical Report}{Technischer Bericht}}
    {\mupvsma {\Muni A} Automath Technical
      Report\ifx\@empty\iMsernum\else\space No #2\fi}
    \ifx\@empty\iMvernum
    \else
     \linebreak
     {\mupvsma Version #1}
    \fi
  \end{minipage}
%\endgroup
%}
%\ifprint
  \newpage
%\fi
  $ $\\
  \ifiMreallylarge\else\vfill\fi
  \@ifundefined{abstract}{%
    \centerline{\eng{Abstract}\de{Zusammenfassung}\fr{R�sum�}}%
    \begin{quote}\noindent #6 \end{quote}%
    }{%
    \begin{abstract} \noindent #6 \end{abstract}%
    }%
  \ifnum\value{iMhead}=1
  {%\ifprint
    \@ifundefined{chapter}{
      \pagestyle{Mlibheadings}
      \markboth{#4 \hfill #3}{#4 \hfill #3}}{}
   %\fi
    }
  \fi
  \newpage
  \setcounter{iMtitlepage}{1}
  }


\newcommand*{\Mlanguage}[1]% Makro zum Einstellen der Ausgabesprache
{\@ifundefined{iM@lang@#1}{%
    \PackageError{Mhelp}{Language #1\space undefined}{}}%
    {\csname iM@lang@#1\endcsname}%
}

\newcommand*{\Mlanggerman}% % Makro zum Einstellen der
    % Ausgabesprache Deutsch.
 {\setcounter{iMlang}{\value{iMgerman}}
 \selectlanguage{ngerman}
 \noextrasenglish % Wenn wir im german Style sind, wollen wir keine 
        % englischen Sonderbedeutungen
    % Umgebung fuer englische Beschreibung:
    % Ausgabe unterdruecken.
        \let\Menglish=\comment%
        \let\endMenglish=\endcomment%
        \let\Mfrench=\comment%
        \let\endMfrench=\endcomment%
        \let\eng=\@gobble%
        \def\de{}%
        \let\fr=\@gobble%

      \renewenvironment{Mgerman}
    % Umgebung fuer deutsche Beschreibung:
    % Ohne Funktion, d.h. normale Ausgabe.
       {}{}
 }
\let\iM@lang@de=\Mlanggerman

\newcommand*{\Mlangenglish}% % Makro zum Einstellen der
    % Ausgabesprache Englisch.
 {\setcounter{iMlang}{\value{iMenglish}}
 \selectlanguage{english}
 \noextrasgerman % Um Deutsche Sondereinstellungen zu entfernen
% \catcode`\"=12  % Da \noextrasgernan nicht sauber funktioniert, das 
       % Zeichen beh"alt leider seinen aktiven Status
    % Umgebung fuer deutsche Beschreibung:
    % Ausgabe unterdruecken.
        \let\Mgerman=\comment%
        \let\endMgerman=\endcomment%
        \let\Mfrench=\comment%
        \let\endMfrench=\endcomment%
        \def\eng{}%
        \let\de=\@gobble%
        \let\fr=\@gobble%

      \renewenvironment{Menglish}
    % Umgebung fuer englische Beschreibung:
    % Ohne Funktion, d.h. normale Ausgabe.
       {}{}
 }
\let\iM@lang@eng=\Mlangenglish

\newcommand*{\iM@lang@fr}% % Makro zum Einstellen der
    % Ausgabesprache Franz�sich.
 {\setcounter{iMlang}{\value{iMfrench}}
 \selectlanguage{french}
 \noextrasgerman % Um Deutsche Sondereinstellungen zu entfernen
% \catcode`\"=12  % Da \noextrasgernan nicht sauber funktioniert, das 
       % Zeichen beh"alt leider seinen aktiven Status
    % Umgebung fuer deutsche Beschreibung:
    % Ausgabe unterdruecken.
        \let\Mgerman=\comment%
        \let\endMgerman=\endcomment%
        \let\Menglish=\comment%
        \let\endMenglish=\endcomment%
        \let\eng=\@gobble
        \let\de=\@gobble%
        \def\fr{}%

      \renewenvironment{Mfrench}
    % Umgebung fuer englische Beschreibung:
    % Ohne Funktion, d.h. normale Ausgabe.
       {}{}
 }

\newcommand*{\Mversion}%  % Makro zum Ein-/Ausstellen der
    % Versionsnummernausgabe.
 [1] {\setcounter{iMoutput}{\value{#1}}}

\newcommand*{\Maddtoconts}[3][]% % Makro zur Ausgabe eines weiteren
                                % Inhaltseintrags in das .mltoc
 {\def\iMread{#1}%% Zum Merken von leeren
   % optionalen Argumenten.
 \ifx\iMread\iMleer%
  \gdef\iMnod{#2}%
 \else%
  \iMscanoptlabel{#1}{#2}%
 \fi%
 \gdef\iMobject{#2}%
 \gdef\iMdescription{#3}%
 \Mnode{\iMnod}%
 \iMwriteout}

%\DeclareRobustCommand*{\Mex}[1]{%
%  \expandafter\iMtt\expandafter{%
%    \expandafter\string\csname #1\endcsname}%
%}

\DeclareRobustCommand*{\Mex}  % Makro zur Markierung von Ausdruecken.
 [1] {%
   \M@clearunderlines{#1}%
   \ifnum\value{iMenv}=6%    % Innerhalb von Msyntax
     \ifnum\value{firstMsyntax}=0 ~\\ \fi%
     \setcounter{firstMsyntax}{0}%
     \iMtt{\iMescaped} \ignorespaces% Typewriting 
  \else
    \ifhtml\HCode{<span class="mupin">}\fi
    \iMtt{\iMescaped}%  % Typewriting
    \ifhtml\HCode{</span>}\fi
  \fi}

\let\Mupx\Mex

\DeclareRobustCommand*{\Mslot}% Zur Markierung von slots
{\bgroup\iM@sanitize\M@slot}

\newcommand*{\M@slot}[1]
{\egroup
  \ifhtml\HCode{<span class="mupin">}\fi
  \texttt{\char`\"}\Mex{#1}\texttt{\char`\"}%
    \ifhtml\HCode{</span>}\fi
}

\newcommand*{\Mmeta}%  % Makro zur Markierung von Metawoertern.
 [1] {{\rmfamily\emph{#1}}}%

\newcommand*{\Mpar}%  % Makro zur Markierung von Parametern.
 [2][] {%
  \def\iMin{#1}% % Zum Merken von leeren
                 % optionalen Argumenten.
  \ifx\iMin\iMleer%
%   \def\iMtype{}%
  \else%
%   \def\iMtype{\emph{#1}~}%
    \textit{#1}~%
  \fi%
  \ifhtml\HCode{<span class="mupin">}\fi
  \iMtt{#2}%
  \ifhtml\HCode{</span>}\fi
%   \ifcase\value{iMenv}%  %0: Typewriting (Standard)
%       {\iMtype \iMtt{#2}}%
%     \or %1: nicht benoetigt (Mseealso-Umg.)
%       {}%
%     \or %2:: Typewriting
%         % (Margs-Makro und Moverloading-Umgebung)
%       {\iMtype \iMtt{#2}}%
%    \or %3: M[d]math
%    {#2}%
%    \or %4: 
%     {\iMtype \iMtt{#2}}%
%    \or %5: Typewriting
%        %  (Mmethod-Makro)
%    {%
%                         \iMtype \iMtt{#2}%
%    }%
%    \or %6: Typewriting (Msyntax-Umgebung)
%     {\iMtype \iMtt{#2}}%
%    \else
%     {\iMtype \iMtt{#2}}%
%   \fi%
  }%


\newcommand*{\Mopt}%  % Makro zur Markierung von optionalen
    % Parametern.
 [1] {\Mex{%\hskip\z@\@plus.001fil\penalty10\hskip\z@\@plus-.001fil%
     \ensuremath{<}#1\ensuremath{>}}}

\DeclareRobustCommand*{\Mseq}{\bgroup\iM@sanitize\@Mseq}

\newcommand*{\@Mseq}%  % Makro zur Markierung von
    % Argumentsequenzen im Margs-Makro.
 [1] {\egroup\def\@tempa{#1}\ifx\@tempa\iMleer\texttt{\textellipsis}%
      \else\M@clearunderlines{#1}%
       \ifhtml\HCode{<span class="mupin">}\fi
       \texttt{\iMescaped, \textellipsis}% % Anfuegen von "..."
       \ifhtml\HCode{</span>}\fi
      \fi}%

\newcommand*{\Mkeyb}%  % Ausgabe einer Tastatur-Eingabe (HB)
       [1] {\textsc{\iMtt{<}#1\iMtt{>}}}%

\newcommand*{\Mnew}%  % Erstmaliges Auftreten eines wichtigen
                      % Begriffes im Text (HB) + Index
       [1] {\Index{#1}%
            \ifmmode{\slfamily #1}\else{\em #1}\fi}%

\newcommand*{\Mcat}%  % Ausgabe einer MuPAD-Kategorie (HB)
                      % Ersatz f"ur \Mupcat
       [1] {{\sl #1}}%

\newcommand*{\Margs}%  % Makro zur Angabe eines Funktions-
                      % aufrufs in der Msyntax-Umgebung.
 [2][] {{\ifmmode\else\ttfamily\fi%
   \ifnum\value{iMenv}=6%    % Innerhalb von Msyntax
     \ifnum\value{firstMsyntax}=0 ~\\ \fi%
     \setcounter{firstMsyntax}{0}%
   \fi%
   \ifnum\value{iManzMargs}=0%   %"Au\3erstes einer Margs-Schachtelung
     \setcounter{envMargs}{\value{iMenv}}%
   \fi%
   \addtocounter{iManzMargs}{1}%
   \def\inMargs{#1}%
   \ifx\inMargs\iMleer \def\inMargs{\Mthis}%
          \else \def\inMargs{\iMtt{#1}} \fi%
   \setcounter{iMenv}{2}%
   \inMargs(#2)%
   \addtocounter{iManzMargs}{-1}%
   \ifnum\value{iManzMargs}=0%
     \setcounter{iMenv}{\value{envMargs}}%
   \fi%
}}

% \newcommand*{\Mkernel}%   % Makro zur Angabe des folgenden
%                          % oft benoetigten Satzes.
% {\ifnum\value{iMlang}=\value{iMgerman}%
%    \Mthis\ ist eine Funktion des Systemkerns.
%  \else%
%    \Mthis\ is a kernel function.
%  \fi}
 
\newcommand*{\Mconts}% % Makro zur Ausgabe des Inhalts
   % (Helpseiten) einer Mpackage-Umgebung.
 {\Mnode{firstpage}%
% \Malias[\iMpacknode\Mlabel firstpage]{\iMpacknode}
 \Malias{\iMpacknode}%
 % F"ur jedes Paket mit Helpseiten auch einen Eintrag f"ur die
 % Einstiegsseite der ASCII-Hilfe wegschreiben.
 \Mwrite{helpascii}{\iMpacknode\space\iMpacknode}%
 \openin\LTOCIN=\jobname.mltoc
 \ifeof\LTOCIN\noteoffalse\else\noteoftrue\fi%
 \ifnoteof
   \endlinechar=-1% % Verhindern des Anhaengens
    % von Leerzeichen beim Einlesen
    \read\LTOCIN to\Min%
   \read\LTOCIN to\Mnod% % Knotenname
   \ifeof\LTOCIN \noteoffalse \else \noteoftrue \fi%
   \ifnoteof
   \begin{center}
     \loop%
        \read\LTOCIN to\Mtitle% % Helpseitentitel
        \ifnum\value{first}=1
     \iMnoderef{\Mnod}{{\ttfamily\Mtitle}}\hspace*{1.1mm}%
        \else
    {, \iMnoderef{\Mnod}{{\ttfamily\Mtitle}}\hspace*{1.1mm}
   }\fi%
        \addtocounter{first}{1}%
       \read\LTOCIN to\Mnod% % Knotenname
       \read\LTOCIN to\Mdes% % Nicht benoetigte Beschreibung auslesen.
        \ifeof\LTOCIN \noteoffalse \else \noteoftrue \fi%
        \ifnoteof\hspace{-1.2mm}%
     \repeat%
   \end{center}%
   \fi
   \endlinechar=13 % Zuruecksetzen auf den
    % Defaultwert.
 \fi
 \setcounter{first}{1}\closein\LTOCIN}

% Hier mu� das Leerzeichen mit verschiedenen \catcodes im Befehl stehen
\begingroup
\lccode`\:=`\ \relax
\catcode`\:=13\relax
\lccode`\M=`\M\relax
\lccode`\~=`\~\relax
\lowercase{\def\x{%
\newcommand*{\Mcontents}% % Makro zur Ausgabe des Inhalts
    % (Helpseiten) einer Mpackage-Umgebung
    % mit Kurzbeschreibung zu jeder Helpseite
    % und HyTeX-Referenzen zu den Seiten.
 {{%\iM@node{firstpage}
% \Malias[\iMpacknode\Mlabel firstpage]{\iMpacknode}
 % F"ur jedes Paket mit Helpseiten auch einen Eintrag f"ur die
 % Einstiegsseite der ASCII-Hilfe wegschreiben.
% \Mwrite{helpascii}{\iMpacknode\space \iMpacknode}%
 \def\M####1{\expandafter\Mup\expandafter[\Mnod]{####1}}%
 \@makeother{\%}
 \openin\LTOCIN=\jobname.mltoc
 \ifeof\LTOCIN\noteoffalse\else\noteoftrue\fi%
 \ifnoteof
    \read\LTOCIN to\Min% % Fileanfang "Ueberlesen"
  \endlinechar=-1% Verhindern des Anhaengens
                 % von Leerzeichen beim Einlesen
  \bgroup
    \iM@sanitize
    \global\read\LTOCIN to\Mnod% % Knotenname
  \egroup
    \ifeof\LTOCIN\noteoffalse\else\noteoftrue\fi%
    \ifnoteof~\\
  \Mnode{iM-toc}%
  \loop%
  \bgroup
    \catcode`\ =13\relax
    \iM@sanitize
    \global\read\LTOCIN to\Mtitle% % Helpseitentitel
  \egroup
  \read\LTOCIN to\Mdes%  % Kurzbeschreibung
  \begin{minipage}{\linewidth}%
  \parbox[t]{0.5cm}{~}%
  \parbox[t]{\linewidth}{{%
%    \renewcommand{\baselinestretch}{0.9}%
%    \small\normalsize
      \raggedright
    \expandafter\iM@foreach\expandafter{\Mtitle}{:}{\M}{\ }\strut\par}}
%   ~---~~~
  \\\nopagebreak\null\hskip 2cm\relax
  \@tempdima=\linewidth
  \advance\@tempdima by -2.5cm\relax
  \parbox[t]{\@tempdima}{%
%   \renewcommand{\baselinestretch}{0.9}%
%   \small\normalsize
    \raggedright\Mdes\strut}%
  \end{minipage}\\[2mm]\penalty0%
  \bgroup
    \iM@sanitize
    \global\read\LTOCIN to\Mnod%  % Knotenname
  \egroup
  \ifeof\LTOCIN \noteoffalse \else \noteoftrue \fi%
  \ifnoteof%
  \repeat
  \fi
  \endlinechar=13  % Zuruecksetzen auf den
                   % Defaultwert.
 \fi
 \closein\LTOCIN\relax}}}}
\expandafter\endgroup\x

% New command for loading help pages      11.12.96   tom
% It defines a global macro \iM@filename
% Parameters:
%       #1 - Directory
%       #2 - Filename (without suffix .tex)
%
\def\iM@file@dir{}%
\def\Minput#1#2{%
  \bgroup%
  \def\iM@filename{#2}%
  \def\on@line{ on input line \the \inputlineno\space in file #2}%
  \edef\iM@incdir{\iM@incdir#1/}%
  \def\x{.}\def\y{#1}%
  \ifx\x\y\else
    \edef\iM@file@dir{\iM@file@dir#1_}%
  \fi
  \input{\iM@incdir/#2.tex}
  \relax%
  \@ifundefined{cb@end}{}{% changebar.sty
    % do not use change bars spanning more than one file
    \ifx\cb@currentstack\@empty
    \else
    \loop
      \cb@end
      \@tempswafalse
      \ifx\cb@currentstack\@empty\else\@tempswatrue\fi
    \if@tempswa\repeat
    \fi
    }%
  \egroup%
}

\newcommand*\Mincpath[1]{\gdef\iM@incdir{#1/}}
\def\iM@incdir{}

\newcommand*{\M@alias@withpacknode}[1]{%
  \if!\Mprefix!\Malias{#1}\else\Malias{\Mprefix::#1}\fi}

\newcommand\Mfilelabel{??}

\newcommand*{\Malias}[2][]  % Ausgabe zum .mnodes-File
 {%
   \def\iMin{#1}%
   \ifx\iMin\@empty% Verweis auf diese Seite
%     \@ifundefined{iMnod}{
       \@ifundefined{iM@func@nonesc}%
       {\iMwritehelp{#2}{\if!\Mpackname!%
           \else\Mpackname\Mfilelabel\fi\iMidx@entry}}%
       {\iMwritehelp{#2}{\if!\Mpackname!%
           \else\Mpackname\Mfilelabel\fi\iM@func@nonesc}}%
%     }%
%     {\iMwritehelp{#2}{\if!\Mpackname!%
%           \else\Mpackname\Mfilelabel\fi\iMnod}}
     \@ifundefined{nn@#2}{\Mnode{#2}}{}%
   \else
        \iMscanoptlabel{#1}{#2}% setzt \iMnod@help
        \iMwritehelp{#2}{\iMnod@help}%
   \fi%
   \@ifundefined{Malias@hook@\M@Helppage@Type}%
   {}{\@nameuse{Malias@hook@\M@Helppage@Type}{#1}{#2}}%
 }

% A macro calling \iM@run@as@math should have a \bgroup open
\newcommand*{\iM@stop@run@as@math}{\)\egroup}
\newcommand*{\iM@run@as@math}{%
% We want to insert '\aftergroup\iM@stop@run@as@math' into the group
% which is about to start.  Therefore, we simply open a group and
% gobble the { (which is a \bgroup) via \let. %% }
  \@ifnextchar\bgroup{\(\bgroup\aftergroup\iM@stop@run@as@math%
    \let\temp@a=}%
                     {\PackageError{Mhelp}{There should be a \char`\{\space here.}}}

\newcommand*{\iM@stop@run@as@displaymath}{\]\egroup\ignorespaces}
\newcommand*{\iM@run@as@displaymath}{%
  \@ifnextchar\bgroup{\[\bgroup\aftergroup\iM@stop@run@as@displaymath%
    \let\temp@a=}%
                     {\PackageError{Mhelp}{There should be a \char`\{\space here.}}}

% A generic way to add something after the following group.
\newcommand{\iM@run@as@text}[1]{%
  \bgroup%
  \def\x{\egroup#1}%
% This is the same thing as above.
  \@ifnextchar\bgroup{\bgroup\aftergroup\x%
    \let\temp@a=}%
                     {\PackageError{Mhelp}{There should be a \char`\{\space here.}}}


% Von Bernd Raichle (german.sty)
\long\def\@ReturnAfterFi#1\fi{\fi#1}
\long\def\@ReturnAfterElseFi#1\else#2\fi{\fi#1}
%
%  \if...#1...
%    \@ReturnAfterElseFi{#2}%
%  \else
%    \@ReturnAfterFi{#3}%
%  \fi

\newcommand*{\Mmath}{%
  \bgroup
  \iM@sanitize
  \@Mmath}
\newcommand*{\@Mmath}[1]{%
  \egroup
  \@@Mmath{#1}}
\newcommand*{\@@Mmath}[2]
    % Ausgabe einer mathematischen Formel
    % innerhalb eines Absatzes.
    % Je nachdem, welches Ausgabeformat
    % eingestellt ist, wird die
    % Ausgabe angepasst.
% This version does not allow \verb+...+ etc. in its second argument.
 {\bgroup%
 \setcounter{iMenv}{3}%
% \ifascii {\ttfamily #1}\else $#2$\fi%
 $#2$%
 \egroup%
 }
%
% This one does.
% {%
%   \bgroup%
%   \setcounter{iMenv}{3}%
%   \@tempswafalse% Use \if@tempswa to decide whether first or second argument
%                 % should be taken.
%   \ifhytex\@tempswatrue\fi%
%   \ifprint\@tempswatrue\fi%
%   \if@tempswa%
%     \@ReturnAfterElseFi{\expandafter\iM@run@as@math\@gobble}%
%   \else%
%     \@ReturnAfterFi{\@sanitize\def\x##1{\texttt{##1}\egroup\@gobble}\x}%
%   \fi%
% }
% 
\newcommand{\Mdmath}%[2] %Die Argumente werden weiter unten gelesen.
    % Ausgabe einer mathematischen Formel
    % in einer eigenen Zeile.
    % Je nachdem, welches Ausgabeformat
    % eingestellt ist, wird die
    % Ausgabe angepasst.
{%
  \bgroup
  \setcounter{iMenv}{3}
  \@tempswafalse%
  \ifhtml\@tempswatrue\fi%
  \ifhytex\@tempswatrue\fi%
  \ifprint\@tempswatrue\fi%
  \if@tempswa%
    \@ReturnAfterElseFi{\expandafter\iM@run@as@displaymath\@gobble}%
  \else%
    \@ReturnAfterFi{\@sanitize%
      \def\x##1{\begin{quote}\ttfamily ##1\end{quote}\egroup\@gobble}%
      \x}%
  \fi%
}

\newcommand{\Mwarning}   % Ausgabe eines Warnzeichens
    % (Ausrufezeichen in einem
    % Dreieck).
{\marginpar[\hfill\raisebox{-13.5mm}
{\usebox{\iMupwarningcontents}}]{\raisebox{-13.5mm}
{\usebox{\iMupwarningcontents}}}}

\ifhtml
\newcommand{\Mwarn}[1]{%
  \par
  \HCode{<div class="Warning">}%
  #1
  \HCode{</div>}%
  \par
}
\else
\newcommand{\Mwarn}[1]{%
\par
\begin{minipage}[t]{\linewidth}
% Folgende Definition ist aus hhparmrk.sty kopiert,
% ge�ndert ist, da� die unteren Begerenzungssymbole
% nur ausgegeben werden, wenn genug Platz verbraucht ist.
%%% Anfang der Kopie
\def\h@Kmspan{\h@savelocals\botsqueezeout\endbroadboxed
  % Now \@tempdima will be used to store the total height of \@tempboxa;
  \setlength\@tempdima{\ht\@tempboxa}\addtolength\@tempdima{\dp\@tempboxa}%
  % \@tempdime will be used to store the amount of fill necessary
  % for the left mark
  \setlength\@tempdime\@tempdima
  \addtolength\@tempdime{-\ht\@tempboxb}\addtolength\@tempdime{-\ht\@tempboxc}%
  % Compose the left mark
  \setbox\@tempboxb\vbox{%
   \hsize\@tempdimb \offinterlineskip
   \h@markspanalign l\h@msplalign{\box\@tempboxb}%
   % Leave out the fill if there is no room
%%% CHANGED (ccr): Leave out bottom part as well.
   \ifdim\@tempdime<\z@\else\h@markspanalign l\h@msplalign{\h@msplfill\@tempdime}%
   \h@markspanalign l\h@msplalign{\box\@tempboxc}\fi}%
  \sbox\@tempboxb{\lower\ht\@tempboxb\box\@tempboxb}%
  % Now \@tempdime will be used to store the amount of fill for the right mark
  \setlength\@tempdime\@tempdima
  \addtolength\@tempdime{-\ht\@tempboxd}\addtolength\@tempdime{-\ht\@tempboxe}%
  % Compose the right mark
  \setbox\@tempboxc\vbox{%
   \hsize\@tempdimd \offinterlineskip
   \h@markspanalign r\h@mspralign{\box\@tempboxd}%
   % Leave out the fill if there is no room
%%% CHANGED (ccr): Leave out the bottom part as well.
   \ifdim\@tempdime<\z@\else\h@markspanalign r\h@mspralign{\h@msprfill\@tempdime}%
   \h@markspanalign r\h@mspralign{\box\@tempboxe}\fi}%
  \sbox\@tempboxc{\lower\ht\@tempboxc\box\@tempboxc}%
  % Determine depth of last line of spanned text
  \h@getvirtualdepth\@tempboxa
  \setlength\@tempdima{\ht\@tempboxa}%
  % Now put it all together
  \topsqueezein
  \h@soberhmode
  \hbox{%
   % Realize left offset
   \kern\@tempdimc
   % Put left mark on the left (including the specified mark seperation)
   \llap{\raise\@tempdima\box\@tempboxb\kern \h@msplsep}%
   \box\@tempboxa
   % Put right mark on the right (including the specified mark seperation)
   \rlap{\kern \h@msprsep\raise\@tempdima\box\@tempboxc}}%
  \par
  \botsqueezein
  \endgroup
  % Set \prevdepth to depth of last line of spanned text
  \prevdepth\h@virtualdepth
  \muffin
  \ignorespaces}
%%% Ende der Kopie
\markspan%
% links: Nichts
({}{}\z@(%
% rechts: Oben ein Kreis mit ! drin,
)%{\ringbox:{\large\bf!}}%
{{\Mfont !}}%
% in der Mitte ein Strich variabler L�nge,
  [\msprule]%
% unten noch einmal dasselbe wie oben.
%  {\ringbox:{\large\bf!}}%
  {\rule{10pt}{.4pt}}%
  {.5em}){#1}%
% "Meistens unnn�tig, vermeidet aber merkw�rdige Fehler".
% Behauptet zumindest der Autor von hhparmrk.sty.
\scopecorrection
\end{minipage}
\null
}
\fi


%------------------------------------------------------------------------

\ifhtml
\let\M@orig@item\item
\newcommand*\M@gobble@optarg[1][]{}%
\def\M@cubelist@name{M@cubelist}
\def\item{%
  \ifx\@currenvir\M@cubelist@name
    \HCode{<li>}%
    \expandafter\M@gobble@optarg
  \else
    \expandafter\M@orig@item
  \fi
}
\newenvironment*{M@cubelist}[1]{%
%  \itemize
  \HCode{<ul class="cubelist">}%
}{
%  \enditemize
  \HCode{</ul>}%
}
\else
\newenvironment*{M@cubelist}[1]{\list{\smallcube}{#1}\relax}{\endlist}
\fi

%------------------------------------------------------------------------

\newcommand*{\MsetInfoString}{\bgroup\iM@sanitize\@MsetInfoString}
\newcommand*{\@MsetInfoString}[2]{%
  \@ifundefined{@MsetInfoString@\M@Helppage@Type}{%
    \@@MsetInfoString{#1}{#2}%
  }{%
    \csname @MsetInfoString@\M@Helppage@Type\endcsname{#1}{#2}%
  }%
  \egroup
  \expandafter\def\csname M@desc@#1\endcsname{#2}%
}

\newcommand*{\@@MsetInfoString}[2]{%
  % to allow \eng and \de in the second arg, expand it
  % we need this bit to strip off braces:
  \ifcase\value{iMlang}
    \def\eng##1{##1}%
  \or
    \def\de##1{##1}%
  \or
    \def\fr##1{##1}%
  \fi
  \let\iMtt\relax
  \if!\Mprefix!%
    \if!\Mpackname!%
      \Mwrite{mantoc}{1 #1 \string\\\space#1}%
      \iM@protected@Mwrite{info}{#1\string\\#2}%
    \else
      \Mwrite{mantoc}{1 #1 \string\\\Mpackname\Mfilelabel#1}%
      \iM@protected@Mwrite{info}%
      {\Mpackname\Mfilelabel#1\string\\#2}%
    \fi
  \else
    \Mwrite{mantoc}%
    {1 \Mprefix::#1 \string\\ \Mpackname\Mfilelabel#1}%
    \iM@protected@Mwrite{info}%
    {\Mprefix::#1\string\\#2}%
  \fi
}

%---------------------- Umgebungen --------------------------------------

\newenvironment{MInfo}
  {%
   \ifcase\value{iMlang}
    \long\def\eng##1{\def\iM@desc{##1}\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \long\def\eng##1{\ignorespaces}%
    \def\de##1{\def\iM@desc{##1}\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr##1{\def\iM@desc{##1}\ignorespaces}%
   \fi%
   }%
{%
  % Kopf ausgeben
  \noindent
  \if!\Mprefix!%
    \def\next##1{##1}%
  \else
    \def\next##1{\Mprefix::##1}%
  \fi
  \ifhtml
    \HCode{<h2>}%
  \fi
  {\large\vrule height1.5em depth.5ex width\z@\relax
    \if!\iM@func@nonesc!\else%
    {\ttfamily\expandafter\iM@foreach\expandafter{\iM@func}%
      {,}{\next}{, %
        \hskip\z@ plus0.001fil\penalty50\hskip\z@ plus-0.001fil\relax
        \ignorespaces}} -- \fi\bfseries\iM@desc}\par%
  \ifhtml\HCode{</h2>}\fi
  %% status information
%\iffalse
  \expandafter\ifx\csname M@statename@\M@Impl@State\endcsname\relax
  \else\hbox to \linewidth{\small\hfill\M@typename@implementation:\M@rlspace\csname M@statename@\M@Impl@State\endcsname}\fi
  \expandafter\ifx\csname M@statename@\M@Doc@State\endcsname\relax
  \else\hbox to \linewidth{\small\hfill\M@typename@documentation:\M@rlspace\csname M@statename@\M@Doc@State\endcsname}\fi
  \expandafter\ifx\csname M@statename@\M@Test@State\endcsname\relax
  \else\hbox to \linewidth{\small\hfill\M@typename@test:\M@rlspace\csname M@statename@\M@Test@State\endcsname}\fi
%\fi
  %% end of status information
  % .info und .mantoc schreiben -- fuer Windows
  {%
    \def\next##1{%
      \@ifundefined{M@desc@##1}%
      {\MsetInfoString{##1}{\iM@desc}}{}}%
    \expandafter\iM@foreach\expandafter{\iM@func}{,}{\next}{\ignorespaces}%
    }
  % .mltoc schreiben
  {%
    \def\_{\noexpand\_}%
    \def\iMobject, {}%
    \if!\Mprefix!%
      \def\next##1{\expandafter\def\expandafter\iMobject\expandafter{\iMobject, ##1}%
        \@ifundefined{MInfo@hook@\M@Helppage@Type}{}{%
          \@nameuse{MInfo@hook@\M@Helppage@Type}{##1}{\iM@desc}%
        }}%    
    \else
      \def\next##1{\expandafter\def\expandafter\iMobject\expandafter{\iMobject, \Mprefix::##1}%
        \@ifundefined{MInfo@hook@\M@Helppage@Type}{}{%
          \@nameuse{MInfo@hook@\M@Helppage@Type}{\Mprefix::##1}{\iM@desc}%
        }}%
    \fi
    \expandafter\iM@foreach\expandafter{\iM@func}{,}{\next}{\ignorespaces}%
    \let\iMdescription=\iM@desc%
    \let\iMauthor=\iM@author%
    \let\iMnod=\iM@func@nonesc%
    \iMwriteout%
    }%
  \par%
  }

\newenvironment{MIntro}{%
  \begingroup% so the hook is after the group
  \ifcase\value{iMlang}%
    \def\eng{\iM@run@as@text{\ifhtml\HCode{<p>}\else\par\fi\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
   \fi%
   \everypar{%
     \parindent=0cm\relax%
%     \hangindent=2ex\relax%
%     \hangafter=1\relax%
     \parskip=0.5\baselineskip%
     }%
%   \if!\Mprefix!\else%
%     \let\iM@@this=\Mthis%
%     \def\Mthis{\Mex{\Mprefix::\iM@@this}}%
%   \fi%
   \the\everypar% Call it once for the first paragraph
   }%
{\null\par\endgroup\@nameuse{MIntro@posthook@\M@Helppage@Type}}

\let\M@Intro=\MIntro
\newcommand*{\M@next@intro@uses@line}{%
  \def\MIntro{\par\vskip\iM@presectskip
    \hrule\vskip\iM@presectskip
    \aftergroup\@Mhadintrotrue
    \M@Intro}%
  \@Mhadintrofalse
}
\def\MIntro{%
  \aftergroup\M@next@intro@uses@line
  \M@Intro}

\newenvironment{MEnvVarType}{%
  \ifcase\value{iMlang}
    \Msection{Type:}%
    \def\eng{\iM@run@as@text{\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
  \or
    \Msection{Typ:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
  \or
    \Msection{Type:}
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\ignorespaces}}%
  \fi}{\null\par}

\newenvironment{MEnvVarDefault}{%
  \ifcase\value{iMlang}
    \Msection{Default Value:}%
    \def\eng{\iM@run@as@text{\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
  \or
    \Msection{Voreinstellung:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
  \or
    \Msection{Valeur par d�faut:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\ignorespaces}}%
  \fi}{\null\par}

\newenvironment{MDomConst}{%
  \ifcase\value{iMlang}
    \Msection{Domain:}% Constructor:}%
  \or
    \Msection{Domain:}%konstruktor:}%
  \or
    \Msection{Domaine:}%konstruktor:}%
  \fi%
  \def\MCall##1{\item\Mex{%\if!\Mprefix!\else\Mprefix::\fi
      \Mthis}%
    \ifx\\##1\\\else\Mex{(##1)}\fi\par\ignorespaces}%
  \let\call\MCall
  \renewcommand*{\Mopt}[1]%
  {\Mex{\hskip\z@\@plus.001fil\penalty10\hskip\z@\@plus-.001fil%
      \ensuremath{<}##1\ensuremath{>}}}%
  \vskip-\topsep
  \@nameuse{MDomConst@hook@\M@Helppage@Type}%
  \iM@sanitize
  \begin{M@cubelist}{\setlength\itemsep{0pt}}\relax
  }{\end{M@cubelist}\leavevmode\vskip-3\iM@presectskip\vskip0pt\null\par}

\newenvironment{MDomElConst}{%
  \ifcase\value{iMlang}
    \if@Mhadintro
      \@ReturnAfterElseFi\Msection
    \else
      \@ReturnAfterFi\iM@sect@line
    \fi{Creating Elements:}%
  \or
    \if@Mhadintro
      \@ReturnAfterElseFi\Msection
    \else
      \@ReturnAfterFi\iM@sect@line
    \fi{Elementkonstruktor(en):}%
  \or
    \if@Mhadintro
      \@ReturnAfterElseFi\Msection
    \else
      \@ReturnAfterFi\iM@sect@line
    \fi{Construction d'�l�ments:}%
  \fi%
  \def\call{\bgroup\iM@sanitize\iM@call}%
  \def\iM@call{}
  \renewcommand{\iM@call}[2][\Mthis]{\egroup%
  \item
    \parbox[t]{\linewidth}{{\@hangfrom{\Mex{##1(%)
          }}\Mex{##2%(
          )}\@@par\ignorespaces}}}%
  \let\Mcall\call%
  \let\MCall\call%
  \renewcommand*{\Mopt}[1]%
  {\Mex{\hskip\z@\@plus.001fil\penalty10\hskip\z@\@plus-.001fil%
      \ensuremath{<}##1\ensuremath{>}}}%
  \vskip-\topsep
  \@nameuse{MDomElConst@hook@\M@Helppage@Type}%
  \iM@sanitize
  \begin{M@cubelist}{\setlength\itemsep{0pt}}\relax
  }{\end{M@cubelist}\leavevmode\vskip-3\iM@presectskip\vskip0pt\null\par}

\newenvironment{MCatConst}{%
  \ifcase\value{iMlang}%
    \Msection{Generating the category:}%
  \or%
    \Msection{Erzeugen der Kategorie:}%
  \or%
    \Msection{Cr�ation de la cat�gorie:}%
  \fi%
%   \if!\Mprefix!\else%
%     \let\iM@@this=\Mthis%
%     \def\Mthis{\Mex{\Mprefix::\iM@@this}}%
%   \fi%
  \def\MCall##1{\item\Mthis\ifx\\##1\\\else\Mex{(##1)}\fi\par\ignorespaces}%
  \renewcommand*{\Mopt}[1]%
  {\Mex{\hskip\z@\@plus.001fil\penalty10\hskip\z@\@plus-.001fil%
      \ensuremath{<}##1\ensuremath{>}}}%
  \vskip-\topsep
  \@nameuse{MCatConst@hook@\M@Helppage@Type}%
  \iM@sanitize
  \begin{M@cubelist}{\setlength\itemsep{0pt}}\relax
  }{\end{M@cubelist}\leavevmode\vskip-3\iM@presectskip\vskip0pt\null\par}

\newenvironment{MAxConst}{%
  \ifcase\value{iMlang}%
    \Msection{Generating the axiom:}%
  \or%
    \Msection{Erzeugen des Axioms:}%
  \or%
    \Msection{Cr�ation des axiomes:}%
  \fi%
%   \if!\Mprefix!\else%
%     \let\iM@@this=\Mthis%
%     \def\Mthis{\Mex{\Mprefix::\iM@@this}}%
%   \fi%
  \def\MCall##1{\item\Mthis\ifx\\##1\\\else\Mex{(##1)}\fi\par\ignorespaces}%
  \renewcommand*{\Mopt}[1]%
  {\Mex{\hskip\z@\@plus.001fil\penalty10\hskip\z@\@plus-.001fil%
      \ensuremath{<}##1\ensuremath{>}}}%
  \vskip-\topsep
  \@nameuse{MAxConst@hook@\M@Helppage@Type}%
  \iM@sanitize
  \begin{M@cubelist}{\setlength\itemsep{0pt}}\relax
  }{\end{M@cubelist}\leavevmode\vskip-3\iM@presectskip\vskip0pt\null\par}

\newenvironment{MCalls}
  {\ifcase\value{iMlang}
    \Msection{Call(s):}%
   \or
    \Msection{Aufruf(e):}%
   \or
    \Msection{Appel(s):}%
   \fi
   \def\call{\bgroup\iM@sanitize\iM@call}%
   \def\iM@call{}
   \renewcommand{\iM@call}[2][\Mthis]{\egroup%
     \item
     \parbox[t]{\linewidth}{{\@hangfrom{\Mex{##1(%)
         }}\Mex{##2%(
         )}\@@par\ignorespaces}}}%
   \let\Mcall\call%
   \newcommand*{\Mkeyword}[1]{\underline{##1}}% Zur Markierung fester Worte
   \newcommand*{\Mindent}[1][]{\ifx\\##1\\\hspace*{4em}\else%
     \setbox0\hbox{##1}\hspace*{\wd0}\fi}%
%   \if!\Mprefix!\else%
%     \let\iM@@this=\Mthis%
%     \def\Mthis{\Mex{\Mprefix::\iM@@this}}%
%   \fi%
   \renewcommand*{\Mopt}[1]%
   {\Mex{\hskip\z@\@plus.001fil\penalty10\hskip\z@\@plus-.001fil%
       \ensuremath{<}##1\ensuremath{>}}}%
   \vskip-\topsep
   \ttfamily\selectfont\raggedright
   \@nameuse{MCalls@hook@\M@Helppage@Type}%
   \iM@sanitize
   \begin{M@cubelist}{\setlength\itemsep{0pt}}\relax
   }
{\end{M@cubelist}\vskip-\lastskip\vskip0pt}
% Reduce the distance to the following "Parameters" section
% The \vskip0pt is necessary, because one skip gets eaten by \Msection

\newenvironment{MSyntax}
  {\ifcase\value{iMlang}
    \Msection{Syntax:}%
   \or
    \Msection{Syntax:}%
   \or
    \Msection{Syntaxe:}%
   \fi
   \def\call##1{\Mex{##1}\par\ignorespaces}%
   \let\Mcall\call%
   \newcommand*{\Mkeyword}[1]{\underline{##1}}% Zur Markierung fester Worte
   \newcommand*{\Mindent}{\hspace*{4em}}%
   \renewcommand*{\Mopt}[1]%
   {\Mex{\hskip\z@\@plus.001fil\penalty10\hskip\z@\@plus-.001fil%
       \ensuremath{<}##1\ensuremath{>}}}%
   \vskip-\topsep
   \@nameuse{MSyntax@hook@\M@Helppage@Type}%
   \list{}{}\item\relax
   \ttfamily\selectfont\raggedright
   \iM@sanitize
   }
{\endlist\vskip-\lastskip\vskip0pt}
% Reduce the distance to the following "Parameters" section
% The \vskip0pt is necessary, because one skip gets eaten by \Msection


\newenvironment{MParameters}{%
  \@nameuse{MParameters@prehook@\M@Helppage@Type}%
  \ifcase\value{iMlang}%
    \Msection{Parameters:}%
%    \def\eng{\iM@run@as@text{&\\}}%
    \long\def\eng##1{##1&\\}%
    \long\def\de##1{}%
    \long\def\fr##1{}%
   \or
    \Msection{Parameter:}%
    \long\def\eng##1{}%
    \def\de{\iM@run@as@text{&\\}}%
    \long\def\fr##1{}%
   \or
    \Msection{Param�tres:}%%
    \long\def\eng##1{}%
    \long\def\de##1{}%
    \def\fr{\iM@run@as@text{&\\}}%
   \fi
   \def\param##1{%
     \setbox0=\hbox{\iMtt{##1}}%
     \ifdim\wd0>0.33\textwidth\relax\global\@M@wideparamtrue\fi
     \ifhtml\HCode{<span class="mupin">}\fi
     \iMtt{##1}
     \ifhtml\HCode{</span>}\fi
     &}%
   \vskip-\topsep
   \@nameuse{MParameters@hook@\M@Helppage@Type}%
   \global\@M@wideparamfalse
   \list{}{}\item\relax
   \expandafter\ifx\csname M@@Parameter@wide@\iM@func@nonesc\endcsname\relax
     \@ReturnAfterElseFi
     \expanded{\tabularx{\linewidth}{%
         @{}l
         \ifhtml\else @{~~---~~}\fi
         >{\noexpand\raggedright}X
         @{}p{0cm}@{}}}%
   \else
     \@ReturnAfterFi
     \expanded{\tabularx{\linewidth}{%
         @{}>{\noexpand\raggedright}p{0.25\noexpand\linewidth}
         \ifhtml\else @{~~---~~}\fi
         >{\noexpand\raggedright}X
         @{}p{0cm}@{}}}%
   \fi
   }
{\endtabularx\par\endlist\vskip-3\iM@presectskip\vskip0pt\relax
  \if@M@wideparam
    \write\@auxout{\string\global\string\@namedef{M@@Parameter@wide@\iM@func@nonesc}{true}}%
  \fi}

\newenvironment{MOptions}{%
  \@nameuse{MOptions@prehook@\M@Helppage@Type}%
  \ifcase\value{iMlang}%
    \Msection{Options:}%
%    \def\eng{\iM@run@as@text{&\\}}%
    \long\def\eng##1{##1&\\}%
    \long\def\de##1{}%
    \long\def\fr##1{}%
   \or
    \Msection{Optionen:}%
    \long\def\eng##1{}%
    \def\de{\iM@run@as@text{&\\}}%
    \long\def\fr##1{}%
   \or
    \Msection{Options:}%%
    \long\def\eng##1{}%
    \long\def\de##1{}%
    \def\fr{\iM@run@as@text{&\\}}%
   \fi
   \def\option##1{\iMtt{##1}&}
   \vskip-\topsep
   \@nameuse{MOptions@hook@\M@Helppage@Type}%
   \list{}{}\item\relax
   \expanded{\tabularx{\linewidth}{%
       @{}l
       \ifhtml\else @{~~---~~}\fi
       >{\noexpand\raggedright}X
       @{}p{0cm}@{}}}%
   }
{\endtabularx\par\endlist\vskip-3\iM@presectskip\vskip0pt}

\newenvironment{iM@AxCatSuper}
{%
  \ifcase\value{iMlang}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{}%
    \def\IF{if}%
    \def\THEN{then}%
    \def\ELSE{else}%
    \def\HAS{has}%
    \def\ISA{is a}%
    \def\AND{and}%
    \def\OR{or}%
  \or%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\eng##1{\ignorespaces}%
    \long\def\fr##1{}%
    \def\IF{falls}%
    \def\THEN{dann}%
    \def\ELSE{sonst}%
    \def\HAS{hat}%
    \def\ISA{ist ein}%
    \def\AND{und}%
    \def\OR{oder}%
  \or%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{}%
    \def\IF{si}%
    \def\THEN{alors}%
    \def\ELSE{sinon}%
    \def\HAS{a}%
    \def\ISA{est un}%
    \def\AND{et}%
    \def\OR{ou}%
  \fi%
  \def\cond{\bgroup\iM@sanitize\iM@cond}%
  \let\@Mup=\Mup%
  \def\iM@cond##1##2{\egroup%
    \let\Mup=\@Mup%
    \par\noindent\textbf{##1}%
    \par\vskip-\parskip\noindent%
    \bgroup\advance\leftskip2em\relax%
    \def\Mup{\par\@Mup}%
    \parsep0pt\relax\parskip0pt\relax%
    ##2\par\egroup}%
  \vskip-\topskip%
  \list{}{}\item%
  \raggedright%
}%
{\endlist\par}

\newenvironment{MAxioms}
{%
  \ifcase\value{iMlang}%
   \Msection{Axioms}%
  \or
   \Msection{Axiome:}%
  \or
   \Msection{Axiomes:}%
  \fi
  \iM@AxCatSuper%
}{\endiM@AxCatSuper}

\newenvironment{MCategories}
{%
  \ifcase\value{iMlang}%
   \Msection{Categories:}%
  \or%
   \Msection{Kategorien:}%
  \or%
   \Msection{Cat�gories:}%
  \fi%
  \iM@AxCatSuper%
}{\endiM@AxCatSuper}

\newenvironment{MSuperDomain*}
{%
  \ifcase\value{iMlang}%
   \Msection{Super-Domain:}%    % !!!!!!!!!! Check the uppercase
  \or%
   \Msection{Super-Domain:}%
  \or%
   \Msection{Super-Domaine:}%
  \fi%
  \iM@AxCatSuper%
}{\endiM@AxCatSuper}

\newenvironment{MDomEntries}
  {\ifcase\value{iMlang}
    \iM@sect@line{Entries:}%
    \long\def\eng{\par}%
    \long\def\de##1{}%
    \long\def\fr##1{}%
   \or
    \iM@sect@line{Eintr�ge:}
    \long\def\eng##1{}%
    \def\de{\par}%
    \long\def\fr##1{}%
   \or
    \iM@sect@line{Entr�es:}%%
    \long\def\eng##1{}%
    \long\def\de##1{}%
    \def\fr{\par}%
   \fi
   \newcommand{\MDomEntry}{\bgroup\iM@sanitize\@MDomEntry}
   \newcommand{\@MDomEntry}[1]{\egroup\item[\Mex{##1}]}
   \vskip-\topsep
%   \begin{description}
   \list{}{%
     \leftmargin.15\linewidth\relax
     \labelwidth.13\linewidth\relax
     \itemindent\z@
     \def\makelabel##1{%
       \leavevmode
%       \hskip-.15\linewidth
       \setbox0\hbox{##1\space\space}%
       \ifdim\wd0<.13\linewidth
         \hbox to .13\linewidth{\box0\hfill}%
       \else
         \box0\relax
       \fi
       }}
   }
{%\end{description}
\par\endlist\par}

\newenvironment{MDomBasEntries}
  {\ifcase\value{iMlang}
    \iM@sect@line{Basic Entries:}%
    \long\def\eng{\par}%
    \long\def\de##1{}%
    \long\def\fr##1{}%
   \or
    \iM@sect@line{Interface-Eintr�ge:}
    \long\def\eng##1{}%
    \def\de{\par}%
    \long\def\fr##1{}%
   \or
    \iM@sect@line{Entr�es de base:}%%
    \long\def\eng##1{}%
    \long\def\de##1{}%
    \def\fr{\par}%
   \fi
   \newcommand{\MDomEntry}{\bgroup\iM@sanitize\@MDomEntry}
   \newcommand{\@MDomEntry}[1]{\egroup\item[\Mex{##1}]}
   \vskip-\topsep
   \begin{description}
   }
{\end{description}\par\endlist\par}

\newenvironment{MReturnValue}
  {\ifcase\value{iMlang}
    \iM@sect@nobreak{Return Value:}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{R\"uckgabewert:}
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Valeur de retour:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
   \fi
   \renewcommand*{\labelitemi}{\smallcube}%
   }
{\par}

\newenvironment{MTypeConstr}
{\ifcase\value{iMlang}%
    \Msection{Construction:}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
    \def\see{see \ignorespaces}%
   \or
    \Msection{Erzeugen:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
    \def\see{vgl.\ \ignorespaces}%
   \or
    \Msection{Construction:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
    \def\see{voir aussi.\ \ignorespaces}%%
   \fi
   }
{\par}

\newenvironment{MSideEffects}
  {\ifcase\value{iMlang}
    \iM@sect@nobreak{Side Effects:}%
    \def\eng{}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Seiteneffekte:}
    \long\def\eng##1{\ignorespaces}%
    \def\de{}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Effets de bord:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{}%
   \fi
   }
{\par}

\newenvironment{MFurtherDoc}
  {\ifcase\value{iMlang}
    \iM@sect@nobreak{Further Documentation:}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Weitere Dokumentation:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Pour aller plus loin:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
   \fi
   }
{\par}

\newenvironment{MDetails}{%
  \@nameuse{MDetails@prehook@\M@Helppage@Type}%
  \begingroup
  \ifcase\value{iMlang}
    \@ifundefined{r@\iM@docname @\iM@filename @M@exa}{}{%
      \Msection{See \Mhref[\iM@docname @\iM@filename @M@exa]{Examples}}\par\medskip}%
    \iM@sect@line{Details:}%
    \def\eng{\item\iM@run@as@text{\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
    \def\Mkernel{\bgroup\iM@sanitize\@Mkernel}%
    \def\@Mkernel{}%
    \renewcommand\@Mkernel[1][\Mthis]{\egroup\item\Mex{##1}\ is a function of the system kernel.}%
   \or
    \@ifundefined{r@\iM@docname @\iM@filename @M@exa}{}{%
      \Msection{Zu den \Mhref[\iM@docname @\iM@filename @M@exa]{Beispielen}}\par\medskip}%
    \iM@sect@line{Details:}   %%% Check this !!!!!
    \long\def\eng##1{}%\ignorespaces}%
    \def\de{\item\iM@run@as@text{\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
    \def\Mkernel{\bgroup\iM@sanitize\@Mkernel}%
    \def\@Mkernel{}%
    \renewcommand\@Mkernel[1][\Mthis]{\egroup\item\Mex{##1}\ ist eine Funktion des Systemkerns.}%
   \or
    \@ifundefined{r@\iM@docname @\iM@filename @M@exa}{}{%
      \Msection{Voir les \Mhref[\iM@docname @\iM@filename @M@exa]{Exemples}}\par\medskip}%%
    \iM@sect@line{D�tails:}%%
    \long\def\eng##1{}%\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\item\iM@run@as@text{\ignorespaces}}%
    \def\Mkernel{\bgroup\iM@sanitize\@Mkernel}%
    \def\@Mkernel{}%
    \renewcommand\@Mkernel[1][\Mthis]{\egroup\item\Mex{##1}\ est une
fonction du noyau.}%%
   \fi
   \vskip-\topsep%\vskip-\parskip
   \begin{M@cubelist}{}\relax
%   \list{$\bullet$}{}\relax
   }
{%
  \@nameuse{MDetails@endhook@\M@Helppage@Type}%
  \end{M@cubelist}\par
  \endgroup
  \@nameuse{MDetails@posthook@\M@Helppage@Type}%
}

\newenvironment{MOperations}
  {\par\bigskip%
   \ifcase\value{iMlang}%
    \iM@sect@nobreak{Important Operations:}%
    \def\eng{\item\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Wichtige Operationen:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\item\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Op�rations importantes:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\item\iM@run@as@text{\par\ignorespaces}}%
   \fi
   \vskip-\topsep%
   \begin{M@cubelist}{}\relax
   }
{\end{M@cubelist}\vskip-\parskip\null\par}

\newenvironment{MEval}
  {\ifcase\value{iMlang}%
    \iM@sect@nobreak{Result of Evaluation:}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
    \def\self{Evaluating an object of the domain type \Mthis\ returns the object itself.\par}%
   \or
    \iM@sect@nobreak{Ergebnis einer Evaluierung:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
    \def\self{Ein Objekt vom Typ \Mthis\ evaluiert zu sich selbst.\par}%
   \or
    \iM@sect@nobreak{R�sultat de l'�valuation:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
    \def\self{�valuer un objet du domain \Mthis\ renvoie l'objet lui-m�me.\par}%%
   \fi
   }
{\null\par}

\newenvironment{MFuncCall}
  {\ifcase\value{iMlang}%
    \iM@sect@nobreak{Function Call:}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Aufruf als Funktion:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Appel de fonction:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
   \fi
   }
{\null\par}

\newenvironment{MEnvSens}
  {\ifcase\value{iMlang}%
    \iM@sect@nobreak{Sensitivity to Environment Variables:}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Abh\"angigkeit von Umgebungsvariablen:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Sensibilit� aux variables d'environnement:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
   \fi
   }
{\null\par}

\newenvironment{MOperands}
  {\ifcase\value{iMlang}%
    \iM@sect@nobreak{Operands:}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Operanden:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Op�randes:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
   \fi
   }
{\null\par}


\newenvironment{MOutput}
  {\ifcase\value{iMlang}%
    \iM@sect@nobreak{Output:}%
    \def\eng{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Ausgabe:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\iM@run@as@text{\par\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{R�sultat:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\iM@run@as@text{\par\ignorespaces}}%
   \fi
   }
{\null\par}


\newenvironment{MOptionDetails}[1]
  {\ifcase\value{iMlang}%
    \iM@sect@line{Option \textless{}\Mex{#1}\textgreater{}:}%
    \def\eng{\item\iM@run@as@text{\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@line{Option \textless{}\Mex{#1}\textgreater{}:}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{\item\iM@run@as@text{\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@line{Option \textless{}\Mex{#1}\textgreater{}:}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\item\iM@run@as@text{\ignorespaces}}%
   \fi
   \vskip-\topsep%\vskip-\parskip
   \begin{M@cubelist}{}\relax
   }
{\end{M@cubelist}\vskip-\parskip\null\par}

\newcommand*{\iM@methodsection}[1]
{%
  \ifhytex\newpage\Msection{#1}%
  \else\iM@sect@line{#1}%
  \fi
  \bigskip%
}

\newenvironment*{iM@MethodsForHelppage}[1]{%
  \edef\temp@a{#1}%
  \ifx\temp@a\iM@func%
   \@tempswafalse%
   \ifcase\value{iMlang}%
     \iM@sect@line{All methods:}%
   \or%
     \iM@sect@line{Alle Methoden:}%
   \or
     \iM@sect@line{Toutes les m�thodes:}%
   \fi%
   \LTleft\leftmargin%
   \LTpre=\smallskipamount
   \LTpost=\smallskipamount
%   \advance\LTpre by -2\baselineskip
   \advance\LTpre by -\parsep
   % Squeeze all glue from \LTpre
   \@tempdima=\LTpre\relax
   \LTpre=\@tempdima\relax
   % Ugly hack to make longtable *not* have a pagebreak
   \leavevmode
   \begin{longtable}{@{}ll@{}}%
  \else%
   \@tempswatrue%
   \@ReturnAfterFi{\comment}%
  \fi%
}{\if@tempswa\endcomment\else\end{longtable}\pagebreak[2]\fi}%

\newcommand*{\iM@readmethods}{%
  \ifiM@meth@read\else
  \iM@meth@readtrue%
  {%
    \makeatletter%
    \iM@sanitize%
    \@makeother{\%}%
    \IfFileExists{\jobname.met}%
     {\input{\jobname.met}}%
     {Missing file \jobname.met}}%
   \fi}
% \MBasMethods nur fuer Cat::*!
\newcommand*{\MBasMethods}{%
  \iM@readmethods%
  \ifcase\value{iMlang}%
    \iM@methodsection{Basic Methods}%
  \or%
    \iM@methodsection{Interface-Methoden}%
  \or%
    \iM@methodsection{M�thodes de base}%
  \fi}

\newcommand*{\MMathMethods}{%
  \iM@readmethods%
  \ifcase\value{iMlang}%
   \iM@methodsection{Mathematical Methods}%
  \or
   \iM@methodsection{Mathematische Methoden}%
  \or
   \iM@methodsection{M�thodes Math�matiques}%
  \fi}

\newcommand*{\MAccessMethods}{%
  \iM@readmethods%
  \ifcase\value{iMlang}%
   \iM@methodsection{Access Methods}%
  \or
   \iM@methodsection{Zugriffsmethoden}%
  \or
   \iM@methodsection{M�thodes d'acc�s}%
  \fi}

\newcommand*{\MConvMethods}{%
  \iM@readmethods%
  \ifcase\value{iMlang}%
   \iM@methodsection{Conversion Methods}%
  \or
   \iM@methodsection{Konvertierungsmethoden}%
  \or
   \iM@methodsection{M�thodes de conversion}%
  \fi}

\newcommand*{\MTechMethods}{%
  \iM@readmethods%
  \ifcase\value{iMlang}%
   \iM@methodsection{Technical Methods}%
  \or
   \iM@methodsection{Technische Methoden}%
  \or
   \iM@methodsection{M�thodes Techniques}%
  \fi}

\let\M@Impl@State\@empty
\let\M@Doc@State\@empty
\let\M@Test@State\@empty
\define@key{MMethodDetails}{ImplState}{\def\M@Impl@State{#1}}
\define@key{MMethodDetails}{DocState}{\def\M@Doc@State{#1}}
\define@key{MMethodDetails}{TestState}{\def\M@Test@State{#1}}

\newcommand*{\M@rlspace}{% space, but a line break here causes ragged-left text
  \penalty-1\hskip.33em plus-0.001filll minus .11em\vadjust{}%
  \nobreak\hskip0pt plus 0.001filll\relax}%

\newcommand*{\M@typename@implementation}{%
  \ifcase\value{iMlang}%
    implementation%
  \or
    Implementation%
  \or
    TODO:\M@rlspace Insert\M@rlspace French\M@rlspace translation!%
  \fi}
\newcommand*{\M@typename@documentation}{%
  \ifcase\value{iMlang}%
    documentation%
  \or
    Dokumentation%
  \or
    TODO:\M@rlspace Insert\M@rlspace French\M@rlspace translation!%
  \fi}
\newcommand*{\M@typename@test}{%
  \ifcase\value{iMlang}%
    tests%
  \or
    Tests%
  \or
    TODO:\M@rlspace Insert\M@rlspace French\M@rlspace translation!%
  \fi}


\newcommand*{\M@statename@missing}{%
  \ifcase\value{iMlang}%
    missing\M@rlspace completely!%
  \or
    fehlt\M@rlspace vollst�ndig!%
  \or
    TODO:\M@rlspace Insert\M@rlspace French\M@rlspace translation!%
  \fi}
\newcommand*{\M@statename@design}{%
  \ifcase\value{iMlang}%
    initial\M@rlspace design%
  \or
    Design-Phase%
  \or
    TODO:\M@rlspace Insert\M@rlspace French\M@rlspace translation!%
  \fi}
\newcommand*{\M@statename@alpha}{%
  \ifcase\value{iMlang}%
    alpha\M@rlspace version%
  \or
    Alpha-Version%
  \or
    TODO:\M@rlspace Insert\M@rlspace French\M@rlspace translation!%
  \fi}
\newcommand*{\M@statename@beta}{%
  \ifcase\value{iMlang}%
    beta\M@rlspace version%
  \or
    Beta-Version%
  \or
    TODO:\M@rlspace Insert\M@rlspace French\M@rlspace translation!%
  \fi}
% Do not define \M@statename@release, so it does not
% generate any note.


\newenvironment{MMethodDetails}{%
  \bgroup\iM@sanitize\iM@MethodDetails}%
{\if@tempswb\end{M@cubelist}\fi\endlist%\vskip-\parskip
\par}

\def\iM@MethodDetails#1{\@ifnextchar[%]
  {\iM@@MethodDetails{#1}}{\iM@@MethodDetails{#1}[]}}

\def\iM@@MethodDetails#1[#2]{\egroup%
  \setkeys{MMethodDetails}{#2}%
  \def\Mtype##1{\textit{##1}}%
  \edef\temp@a{\iM@func@nonesc::#1}%
  \expandafter\iM@globallabel\expandafter{\temp@a}%
  \long\def\eng##1{\ignorespaces}%
  \long\def\de##1{\ignorespaces}%
  \long\def\fr##1{\ignorespaces}%
  \def\infoEng##1{}%
  \def\infoDe##1{}%
  \def\infoFr##1{}%
  \let\temp@b\relax
  \expandafter\ifx\csname M@statename@\M@Impl@State\endcsname\relax
  \else\edef\temp@b{\M@typename@implementation:\M@rlspace\csname M@statename@\M@Impl@State\endcsname}\fi
  \expandafter\ifx\csname M@statename@\M@Doc@State\endcsname\relax
  \else
    \ifx\temp@b\relax
      \edef\temp@b{\M@typename@documentation:\M@rlspace\csname M@statename@\M@Doc@State\endcsname}%
    \else
      \edef\temp@b{\temp@b,\M@rlspace\M@typename@documentation:\M@rlspace\csname M@statename@\M@Doc@State\endcsname}%
    \fi
  \fi
  \ifx\temp@b\relax\else\edef\temp@b{\noexpand\hfill\M@rlspace\noexpand\begingroup\noexpand\small(\temp@b)\noexpand\endgroup\relax}\fi
  \ifcase\value{iMlang}
    \def\infoEng##1{\Msection{Method \Mex{#1}: ##1\temp@b}%
      \def\overloads{}%
      \renewcommand*{\overloads}[1][#1]%
      {\eng{This method overloads \Mup{####1}.}}%
      \list{}{\itemsep0pt\relax}}%
    \def\eng{\iM@maybestartlist\item\relax\iM@run@as@text{\ignorespaces}}%
  \or
    \def\infoDe##1{\Msection{Methode \Mex{#1}: ##1\temp@b}%
      \def\overloads{}%
      \renewcommand*{\overloads}[1][#1]%
      {\de{Diese Methode �berl�dt \Mup{####1}.}}%
      \list{}{\itemsep0pt\relax}}%
    \def\de{\iM@maybestartlist\item\relax\iM@run@as@text{\ignorespaces}}%
  \or
    \def\infoFr##1{\Msection{M�thode \Mex{#1}: ##1\temp@b}%%
      \def\overloads{}%
      \renewcommand*{\overloads}[1][#1]%
      {\fr{Cette m�thode surcharge \Mup{####1}.}}%%
      \list{}{\itemsep0pt\relax}}%
    \def\fr{\iM@maybestartlist\item\relax\iM@run@as@text{\ignorespaces}}%
  \fi
  \newcommand*{\call}[2][#1]{%
    \if@tempswb\end{M@cubelist}\fi%
    \@tempswbfalse%
  \item\relax
                                %\par\noindent
    \Mex{##1(##2)}}%
  \def\iM@maybestartlist{%
    \if@tempswb\else%
    \begin{M@cubelist}{}%
    \@tempswbtrue\fi}%
  \vskip-\topsep%\vskip-\parskip
  \@tempswbfalse%
}

\newcommand{\MMethodInherited}{\bgroup\iM@sanitize\iM@MethodInherited}%
\newcommand*{\iM@MethodInherited}[2]{\egroup%
%  \Mwrite{met}{\string\iM@useMethod{#2}{#1}}%
}%

\newcommand*{\Mjumptoexamples}{\PackageWarning{Mhelp}{%
    \string\Mjumptoexamples\space is obsolete!}}

% xxx Abstand davor zu gro�
\newenvironment{MExample}[1]
{% Vor dem ersten Beispiel eine Linie:
  \@ifundefined{iM@func}{}{
      \ifcase\value{iM@example}%
        \ifhypermode
          \pagebreak\label{M@exa}%
        \else
        \par\ifhtml\HCode{<hr>}\label{M@exa}\else\hrule\fi%
      \fi
    \fi}%
  \refstepcounter{iM@example}%
  \ifcase\value{iMlang}%
    \iM@sect@nobreak{Example \arabic{iM@example}.}%
\special{html: foo }
    \def\eng{%\bgroup\itshape
      \iM@run@as@text{%\egroup
        \ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Beispiel \arabic{iM@example}.}%
    \long\def\eng##1{\ignorespaces}%
    \def\de{%\bgroup\itshape
      \iM@run@as@text{%\egroup
        \ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
   \or
    \iM@sect@nobreak{Exemple \arabic{iM@example}.}%%
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{%\bgroup\itshape
      \iM@run@as@text{%\egroup
        \ignorespaces}}%
   \fi
   \label{#1}%
   }
{\null\par}

\newenvironment{MBackground}
  {\ifcase\value{iMlang}
    \Msection{Background:}%
    \def\eng{\item\iM@run@as@text{\ignorespaces}}%
    \long\def\de##1{\ignorespaces}%
    \long\def\fr##1{\ignorespaces}%
    \def\Mkernel{\bgroup\iM@sanitize\@Mkernel}%
    \def\@Mkernel{}%
    \renewcommand\@Mkernel[1][\Mthis]{\egroup\item\Mex{##1}\ is a function of the system kernel.}%
   \or
    \Msection{Hintergr�nde:}
    \long\def\eng##1{\ignorespaces}%
    \def\de{\item\iM@run@as@text{\ignorespaces}}%
    \long\def\fr##1{\ignorespaces}%
    \def\Mkernel{\bgroup\iM@sanitize\@Mkernel}%
    \def\@Mkernel{}%
    \renewcommand\@Mkernel[1][\Mthis]{\egroup\item\Mex{##1}\ ist eine Funktion des Systemkerns.}%
   \or
    \Msection{Contexte math�matique:}%% !!!Beuargl!!!!
    \long\def\eng##1{\ignorespaces}%
    \long\def\de##1{\ignorespaces}%
    \def\fr{\item\iM@run@as@text{\ignorespaces}}%
    \def\Mkernel{\bgroup\iM@sanitize\@Mkernel}%
    \def\@Mkernel{}%
    \renewcommand\@Mkernel[1][\Mthis]{\egroup\item\Mex{##1}\ est une
    fonction du noyau.}%%
   \fi
   \begin{M@cubelist}{}%
   }
{\end{M@cubelist}\par}

\newenvironment{MChanges}
{%
  \edef\M@temp@b{\if!\Mprefix!\else\Mprefix::\fi%
    \iM@func}%
  \def\eng{}\def\de{}%
  \renewcommand{\eng}[2][]{\ignorespaces}%
  \renewcommand{\de}[2][]{\ignorespaces}%
  \renewcommand{\fr}[2][]{\ignorespaces}%
  \let\renamed\@gobble%
  \renewcommand{\renamed}[2][]{\ignorespaces}%
  \let\none\relax%
  \def\new{}%
  \renewcommand{\new}[1][]{}%
  \def\version##1{%
    \renewcommand{\eng}[2][]{\ignorespaces}%
    \renewcommand{\de}[2][]{\ignorespaces}%
    \renewcommand{\fr}[2][]{\ignorespaces}%
    \renewcommand{\renamed}[2][]{\ignorespaces}%
    \renewcommand{\new}[1][]{}%
    \def\temp@a{3.0}% xxx This should not be hardcoded!
    \def\temp@b{##1}%
    \ifx\temp@a\temp@b%
     \ifcase\value{iMlang}%
      \Msection{Changes since 2.5:}%
      \def\none{\item No changes.%
        \Mwrite{changes}{\string\iM@nochange{\if!\Mprefix!\else\Mprefix::\fi\iM@func}}}%
      \def\temp@a{Dom}%
      \ifx\temp@a\Mprefix
      \renewcommand*{\new}[1][\M@temp@b]{%
          \item \Mex{####1} is a new domain.%
          \Mwrite{changes}{\string\iM@newfunc{####1}}}%
      \else
      \renewcommand*{\new}[1][\M@temp@b]{%
          \item \Mex{####1} is a new function.%
          \Mwrite{changes}{\string\iM@newfunc{####1}}}%
      \fi
      \renewcommand*{\renamed}[2][\M@temp@b]{%
        \item \Mex{####1} used to be \Mex{####2}.%
        \M@clearunderlines{####1}%
        \let\temp@b=\iMescaped%
        \M@clearunderlines{####2}%
        \edef\next{\noexpand\Mwrite{changes}{\string\iM@renamed{\temp@b}{\iMescaped}}}%
        \next%
        }%
      \renewcommand{\eng}[1][]{\Mwrite{changes}{\string\iM@change{\M@temp@b}{####1}}\item\iM@run@as@text{\ignorespaces}}%
     \or%
      \Msection{�nderungen seit 2.5:}%
      \def\none{\item Keine �nderungen.%
        \Mwrite{changes}{\string\iM@nochange{\M@temp@b}}}%
      \def\temp@a{Dom}%
      \ifx\temp@a\Mprefix
      \renewcommand*{\new}[1][\M@temp@b]{%
        \item \Mex{####1} ist ein neues Domain.%
        \Mwrite{changes}{\string\iM@newfunc{####1}}}%
      \else
      \renewcommand*{\new}[1][\M@temp@b]{%
        \item \Mex{####1} ist eine neue Funktion.%
        \Mwrite{changes}{\string\iM@newfunc{####1}}}%
      \fi
      \renewcommand*{\renamed}[2][\M@temp@b]{%
        \item \Mex{####1} hie� fr�her \Mex{####2}.%
        \Mwrite{changes}{\string\iM@renamed{####1}{####2}}}%
      \renewcommand{\de}[1][]{\item\iM@run@as@text{\ignorespaces}}%
     \or
      \Msection{Changements depuis 2.5:}%
      \def\none{\item Pas de changements.%
        \Mwrite{changes}{\string\iM@nochange{\if!\Mprefix!\else\Mprefix::\fi\iM@func}}}%
      \def\temp@a{Dom}%
      \ifx\temp@a\Mprefix
      \renewcommand*{\new}[1][\M@temp@b]{%
          \item \Mex{####1} est un nouveau domaine.%                           %%
          \Mwrite{changes}{\string\iM@newfunc{####1}}}%
      \else
      \renewcommand*{\new}[1][\M@temp@b]{%
          \item \Mex{####1} est une nouvelle fonction.%                         %%
          \Mwrite{changes}{\string\iM@newfunc{####1}}}%
      \fi
      \renewcommand*{\renamed}[2][\M@temp@b]{%
        \item \Mex{####1} s'appelait \Mex{####2}.%
        \M@clearunderlines{####1}%
        \let\temp@b=\iMescaped%
        \M@clearunderlines{####2}%
        \edef\next{\noexpand\Mwrite{changes}{\string\iM@renamed{\temp@b}{\iMescaped}}}%
        \next%
        }%
      \renewcommand{\fr}[1][]{\Mwrite{changes}{\string\iM@change{\M@temp@b}{####1}}\item\iM@run@as@text{\ignorespaces}}%
     \fi%
     \begin{M@cubelist}{}%
    \fi%
    }%
}{\def\x{M@cubelist}\ifx\x\@currenvir\end{M@cubelist}\fi\par}

\AtBeginDocument{\Mwrite{met}{\string\begin{iM@MethodsForHelppage}{NO SUCH FN}}}
\AtEndDocument{\Mwrite{met}{\string\end{iM@MethodsForHelppage}}}
% Die neuen Helppages
\define@key{Mhelppage}{ImplState}{\def\M@Impl@State{#1}}
\define@key{Mhelppage}{DocState}{\def\M@Doc@State{#1}}
\define@key{Mhelppage}{TestState}{\def\M@Test@State{#1}}
\let\M@Helppage@Type\@empty
\define@key{Mhelppage}{Type}{\def\M@Helppage@Type{#1}}

\newenvironment{Mhelppage}{\M@helppagetrue\bgroup\iM@sanitize\M@helppage}{%
  \par
  \ifhypermode
    \penalty-10037%
  \fi
  \M@helppagefalse\relax
  \ifhtml
    \EndHPage{}%
  \fi}

\newcommand*{\M@helppage}[2][]{\egroup\M@@helppage{#1}{#2}}
\newcommand*{\M@@helppage}[3]{\@ifnextchar[{\M@@@helppage{#1}{#2}{#3}}%]
{\M@@@helppage{#1}{#2}{#3}[]}}

\bgroup%
\lccode`\/=`\%\relax
\lccode`M=`M\relax
\lowercase{\def\x{\egroup%
\def\M@@@helppage##1##2##3[##4]{%
  \def\M@Doc@State{distrib}%
  \def\M@Impl@State{distrib}%
  \def\M@Test@State{distrib}%
  \def\M@Helppage@Type{function}%
  \setkeys{Mhelppage}{##4}%
  \stepcounter{iMhelppage}%
  \@nameuse{Mhelppage@prehook@\M@Helppage@Type}%
  \ifhtml
    \HPage{}%
    \clearpage% to force a new link target
  \fi
  \iM@meth@readfalse%
  \iM@layout%
  \par%
  \iMfileopen%  % Files fuer Ausgabe oeffnen
%  \hyperpagebreak% % Seitenumbruch unter HyTeX
  \ifhypermode\pagestyle{helppage}\thispagestyle{helppagefirst}\fi%
  \def\label####1{%
    \Mnode{\iM@docname @\iM@filename @####1}%
    \globallabel{\iM@docname @\iM@filename @####1}%
  }%
  \M@sethelppagelabel%
  \M@sethelppagebuttons%
  \bgroup
    \ifcase\value{iMlang}%
      \def\eng####1{####1}\def\de####1{}\def\fr####1{}%
    \or%
      \def\eng####1{}\def\de####1{####1}\def\fr####1{}%
    \or%
      \def\eng####1{}\def\de####1{}\def\fr####1{####1}%
    \fi
    \def\_{\noexpand\_}%
    \edef\%{/}%
    \edef\x{\noexpand\egroup%
      \noexpand\def\noexpand\temp@a{##2}%
      \noexpand\def\noexpand\temp@b{##1}}%
  \x%
  \Mwrite{met}{\string\end{iM@MethodsForHelppage}}
  \Mwrite{met}{\string\begin{iM@MethodsForHelppage}{\temp@a}}
  \ifiMreallylarge\vspace*{-1.5cm}\fi%
  \ifascii \newpage \fi%
  \iMescapeChar{_}{\noexpand\_}{\temp@a}%
  \edef\iM@func{\iMescaped}%
  \def\iM@author{##3}%
  \def\a####1{\iMescapeChar{,}{..}{####1}}%
  \ifx\temp@b\@empty
    \expandafter\a\expandafter{\temp@a}%
    \let\iMhzwei\temp@a% F�r \Msysfun und \Menvvar. xxx
  \else
    \expandafter\a\expandafter{\temp@b}%
    \let\iMhzwei\temp@b% F�r \Msysfun und \Menvvar. xxx
  \fi
  \let\iMnod\iMescaped%
  \let\iM@func@nonesc\temp@a%
  \iM@globallabel{\iMnod}%
  \iM@globallabel{\iM@func@nonesc}%
  \let\temp@c\temp@a
  \expandafter\iM@foreach\expandafter{\temp@c}{,}{\M@alias@withpacknode}{\ignorespaces}%
%    \let\temp@c\temp@a
  \expandafter\iM@foreach\expandafter{\temp@c}{,}{\iM@globallabel}{\ignorespaces}%
%    \expandafter\iM@foreach\expandafter{\temp@c}{,}{\e}{\ignorespaces}%
%%  \fi
    \if!##1!\else
      \if!\Mprefix!%
        \if!\Mpackname!%
          \iMwritehelp{\iMhzwei}{\iMnod}%
        \else%
          \iMwritehelp{\iMhzwei}{\Mpackname\Mfilelabel\iMnod}%
        \fi
        \markright{\noexpand\iMtt{\M@clip@to@linelength{\iMhzwei}}}%
      \else%
        \iMwritehelp{\Mprefix::\iMhzwei}{\iMpacknode\Mfilelabel\iMnod}%
        \iM@globallabel{\Mprefix::\iMnod}%
        \def\temp@b{}%
        \def\a####1{\edef\temp@b{%
            \expandafter\ifx\expandafter\\\temp@b\\%
            \else\temp@b, \fi\Mprefix::####1}}%
        \expandafter\iM@foreach%
          \expandafter{\iMhzwei}{,}{\a}{\ignorespaces}%
        \markright{\noexpand\iMtt{\M@clip@to@linelength{\temp@b}}}%
    %    \Malias{\iMnod}%
      \fi%
    \fi
  \def\Mthis{}%
  \if!\Mprefix!%
    \def\a####1{\if!\Mthis!\def\Mthis{\iMtt{####1}}%
      \else\expandafter\def\expandafter%
      \Mthis\expandafter{\Mthis, \iMtt{####1}}\fi}%
  \else
    \def\a####1{\if!\Mthis!\def\Mthis{\iMtt{\Mprefix::####1}}%
      \else\expandafter\def\expandafter%
      \Mthis\expandafter{\Mthis, \iMtt{\Mprefix::####1}}\fi}%
  \fi
  \expandafter\iM@foreach\expandafter{\iM@func}{,}{\a}{\ignorespaces}%
  \ifhypermode%
   \ifiMreallylarge%
    \bgroup
    \let\iMtt\relax
    \edef\x{%
      \noexpand\egroup
      \noexpand\def\noexpand\iM@helppage@ueberschrift{\Mthis}%
    }%
    \x
   \fi%
  \fi%
  \bgroup
  \let\iMtt\relax
  \edef\x{%
    \noexpand\egroup
    \noexpand\markright{\noexpand\M@clip@to@linelength{\Mthis}}%
  }%
  \x
 %  \edef\Mthis{\noexpand\iMtt{\if!\Mprefix!\else\Mprefix::\fi\iM@func}}%
 % Wenn \Maddtoc benutzt wurde, noch den Eintrag ins Inhaltsverzeichnis
 % vornehmen. Wichtig z.B. f"ur das Handbuch
  \ifiaddtoc\ifx\iMhzwei\iMleer\else%
    \M@addcont{toc}{subsection}{{\iMout{\temp@a}}}%
    \iM@protected@Mwrite{mtoc}{\string\tocentry{\string\Mhref[\iMidx@entry]{{\iMout{\temp@a}}}}{helppage}{\thepage}}%
  \fi\fi
  \iMescapeChar{!}{$!}{##1}% Schreibt \iMescaped%$%
  \let\temp@a\iMescaped%
  \expandafter\MIndex\expandafter{\temp@a}\relax%  % Index-Eintrag erzeugen.
  \if!\Mprefix!\else
   \iM@tok=\expandafter\expandafter\expandafter{\expandafter\Mprefix%
      \expandafter:\expandafter:\temp@a}%
    \expandafter\MIndex\expandafter{\the\iM@tok}\relax%
  \fi%
  \Mnewcontext%
  \@nameuse{Mhelppage@starthook@\M@Helppage@Type}%
}}}
\x


\newenvironment{Mpackage}[3][] % Umgebung fuer die Beschreibung von
    % MuPAD-Paketen, falls im
    % Objektbezeichner
    % Sonderzeichen vorkommen.
 {%
  \par
\packagetrue  % Merken, das wir uns
    % in einem Paket befinden.
 \def\iMread{#1} % Zum Merken von leeren
    % optionalen Argumenten.
 \ifx\iMread\iMleer%
  \gdef\iMpacknode{#2}%
 \else%
  \gdef\iMpacknode{#1}%
 \fi%
 \iM@globallabel{\iMpacknode}% % Label und HyTeX-Knoten setzen
 {\large {\ttfamily #2} -- \bfseries #3}% % Ausgabe der Ueberschrift
%bij% \MIdx{#2}  % Index-Eintrag erzeugen.
 \iMescapeChar{!}{$!}{#2}% Schreibt \iMescaped%$%
 \expandafter\MIndex\expandafter{\iMescaped}%  % Index-Eintrag erzeugen.
 \def\Mthis{\iMtt{#2}}%
 \def\Mname{\iMtt{#2}}%
 \def\Mpackname{#2}%
 \setcounter{first}{1}%
 \setcounter{iMpack}{1}~\\%
 \par%
}
 {\par}

\newenvironment{Menglish} % Umgebung fuer englische Beschreibungen
 {}{}   % Dummydefinition

\newenvironment{Mgerman} % Umgebung fuer deutsche Beschreibungen
 {}{}   % Dummydefinition

%------------------------------------------------------------------------

%----- Neuer Verbatimstyle fuer die Beispielausgaben --------------------


%% ----------------------------------------------------------------------
%% ----------  Mvin und Mvout -------------------------------------------
%% ----------------------------------------------------------------------

% \lstdefinestyle{Mmanual}{%
%   numbers=none,
%   basicstyle={\upshape},
%   commentstyle={\textsf}
% %  commentstyle={\upshape}
% }
% 
% \lstdefinelanguage{MuPAD}{%
% %%
% %  keywordstyle=[1]{\bf},
% %
%   morekeywords={end, next, break, if, then, elif, else, end_if, case,
%     end_case, otherwise, for, from, to, step, downto, in, end_for,
%     while, end_while, repeat, until, end_repeat, or, and, not, xor,
%     div, mod, union, minus, intersect, subset, proc, begin, end_proc,
%     domain, end_domain, category, end_category, axiom, end_axiom,
%     quit, delete, frame},
% %%
% %  keywordstyle=[2]{\sf},
% %
%   morekeywords=[2]{NIL, FAIL, TRUE, FALSE, UNKNOWN, I, RD_INF,
%     RD_NINF, RD_NAN, name, local, option, save, inherits, of, do},
% %
%   otherkeywords={\%if, ?, !, :=, <, >, =, <=, <>, >=, ==>, <=>, ::,
%     .., ..., ->, @, @@, \$},
% %
%   sensitive=true,
%   comment=[l]{//},
%   morecomment=[n]{/*}{*/},
%   string=[b]",
%   morestring=[d]{`}{`},
%   extendedchars=true,
%   columns=fullflexible,
% }

% xxx Ein Teil hiervon in Mhyper.sty?

\newcommand*{\Mnonewcontext}{\@Mnonewcontexttrue}
\newcommand*{\Mnewcontext}{%
  \if@Mnonewcontext
    \@Mnonewcontextfalse
  \else
    \Mwrite{tst}{<<<R>>>}%
  \fi}
\newcommand*{\MvinMvin}{%
  \vskip-\lastskip%
  \vskip-\prevdepth%
  {\tt\@tempskipa=-\iM@Mvinpostskip\relax
    \advance\@tempskipa by -\iM@Mvinpreskip\relax
    \advance\@tempskipa by 0.3\baselineskip\relax
    \vskip\@tempskipa}%
  \vskip0pt\relax%
  \@nobreaktrue}

\def\iM@Mvinpostskip{0.0em}
\def\iM@Mvinpreskip{0.0em}
\def\iM@Mvoutpostskip{0.0em}
\def\iM@Mvoutpreskip{0.0em}
\def\iM@postskip{0pt}
\def\iM@preskip{0pt}
\ifhtml
\def\iM@Mvindefaultprompt{>> }
\else
\def\iM@Mvindefaultprompt{\normalfont\texttt{>\/>}}
\fi
\def\iM@Mvinprompt{\iM@Mvindefaultprompt}
\def\iM@Mvin@plottimes{}
\let\iM@Mvincontprompt\relax
\let\iM@Mvinnotebook\relax
\newskip\MvinMvouttopsep
\MvinMvouttopsep=0pt\relax
\def\MvinMvout@color{}
\newif\if@Mvin@color
\@ifundefined{color}{%
  \let\Mvin@color\relax
  \let\Mvout@color\relax
}{%
  \def\Mvin@color{\color[rgb]{0.8,0.0,0.0}}%
  \def\Mvout@color{\color[rgb]{0.0,0.0,0.8}}%
}

\def\Mdefaultprompt#1{\def\iM@Mvindefaultprompt{#1}}
\let\iM@Mvin@inputfile\relax

\define@key{Mvin}{test}[true]{\def\temp@a{#1}%
        \def\temp@b{true}%
        \ifx\temp@a\temp@b\iM@Mvintesttrue\else\iM@Mvintestfalse\fi}
\define@key{Mvin}{color}[true]{\def\temp@a{#1}%
        \def\temp@b{true}%
        \ifx\temp@a\temp@b\@Mvin@colortrue\else\@Mvin@colorfalse\fi}
\define@key{Mvin}{click}[true]{\def\temp@a{#1}%
        \def\temp@b{true}%
        \ifx\temp@a\temp@b\iM@Mvinclicktrue\else\iM@Mvinclickfalse\fi}
\define@key{Mvin}{hide}[true]{\def\temp@a{#1}%
        \def\temp@b{true}%
        \ifx\temp@a\temp@b\iM@Mvinhidetrue\else\iM@Mvinhidefalse\fi}
\define@key{Mvin}{collect}[true]{\csname iM@Mvincollect#1\endcsname}
\define@key{Mvin}{notest}[true]{\PackageWarning{Mhelp}%
        {Please use 'test=false' instead of 'notest' for Mvin and Mvout}%
        \iM@Mvintestfalse}
\define@key{Mvin}{noclick}[true]{\PackageWarning{Mhelp}%
        {Please use 'click=false' instead of 'noclick' for Mvin}%
        \iM@Mvinclickfalse}
\define@key{Mvin}{postskip}[\parskip]{\def\iM@postskip{#1}}
\define@key{Mvin}{preskip}[0pt]{\def\iM@preskip{#1}}
\define@key{Mvin}{prompt}{\def\iM@Mvinprompt{#1}}
\define@key{Mvin}{contprompt}{%
\PackageWarning{Mhelp}{'contprompt' not yet implemented. Ignoring...}%
\def\iM@Mvincontprompt{\leavevmode\llap{\texttt{#1\ }}}}
\define@key{Mvin}{firstinseries}[true]{%
  \csname iM@Mvinfirstinseries#1\endcsname}
\define@key{Mvin}{inputfile}{\def\iM@Mvin@inputfile{#1}}
\define@key{Mvin}{samepage}[true]{\csname iM@Mvinsamepage#1\endcsname}
\define@key{Mvin}{notebook}{\def\iM@Mvinnotebook{#1}}
\define@key{Mvin}{plot}[]{\iM@Mvinplottrue\def\iM@Mvin@plottimes{#1}}
\define@key{Mvin}{TeX}[true]{\csname iM@MvoutTeX#1\endcsname}

% \def\M@set@outputtype@fancy{\iM@Mvin@plainoutputfalse}
% \def\M@set@outputtype@plain{\iM@Mvin@plainoutputtrue}
% \define@key{Mvin}{outputtype}[fancy]{\csname M@set@outputtype@#1\endcsname}


\def\iM@makePromptBox{%
%  \ifhypermode%
% Das hier ist code bloat, es steht fast(!) genauso im allgemeinen
% hypertex-Teil. Leider nur fast... Daf�r k�nnen hier ein paar
% Sonderf�lle herausfallen.
    \setbox1\hbox{\iM@Mvinprompt}%
    \ifiMmark%
      \ifMbspmode%
        \setbox0\hbox{\strut\fbox{\iM@Mvinprompt}}%
      \else%
        \dp1=0pt%
        \setbox0\hbox{\strut\underline{\box1}}% 
      \fi% 
    \else% \ifiMmark
      \setbox0\hbox{\strut\iM@Mvinprompt}% 
    \fi%
%  \else% not hypermode
%    \setbox0\hbox{\strut\hbox{\iM@Mvinprompt}}%
%  \fi%
}

% xxx Hier stehen Hypertext-Sachen drin, die sollten nach Mhyper.sty
% xxx ausgelagert werden.  Schnittstelle?
\def\iM@click#1{%
  \addtocounter{iMexcounter}{1}%
  \trivlist%
\item\hspace*{\parindent}%
  \iM@makePromptBox%
%  \marginpar{\arabic{iMexcounter}}
  \llap{\if@Mvin@color\MvinMvout@color\fi
    \M@makebsplink{\box0}\ \relax}\ignorespaces
  }
\def\iM@noclick{%
  \trivlist%
\item\hspace*{\parindent}%
%  \marginpar{\arabic{iMexcounter}}
  \iM@makePromptBox%
  \llap{\if@Mvin@color\MvinMvout@color\fi
    \box0\ \relax}\ignorespaces% 
  }

\def\iM@typeout@example{%
  {%
    \shouldbe@samepage%
    \def\par{%
      \strut%
      \if@tempswa%
       \null\@@par\penalty500\relax%
      \else%
       \@tempswatrue%
       \ifhmode\@@par\penalty\interlinepenalty\fi%
      \fi
      \if@Mvin@color\MvinMvout@color\fi
    }%%
    \def\M@contprompt{\let\M@contprompt=\iM@Mvincontprompt}%
    \if@Mvin@color\MvinMvout@color\fi
    \strut\the\iM@bsp@par%
% %% fancy output
% %      \normalfont\rmfamily
%       \let\do\do@noligs
%       \verbatim@nolig@list
%       \lstset{language=MuPAD,style=Mmanual,
%         aboveskip=-.72\baselineskip}%
%       \def\x##1{\begin{lstlisting}^^J##1^^J\end{lstlisting}}%
%       \@tempdima=\linewidth
%       \advance\@tempdima by -1.1\parindent\relax
%       \parbox[t]{\@tempdima}{\noindent\expandafter\x\expandafter{\the\iM@bsplines}}%
%       \vspace{0pt}\relax
  }%
  \if@Mvin@color\everypar{\everypar{}\color{black}}\fi
  \@nobreaktrue}%
\def\iM@start{%
  \ifiM@Mvintest
    \ifiM@Mvincollect\else
      \ifiM@Mvinplot
        \Mwrite{tst}{\M@plotdelimiter}%
      \else
        \ifiM@MvoutTeX
          \Mwrite{tst}{\M@TeXdelimiter}%
        \else
          \Mwrite{tst}{\M@delimiter}%
        \fi
      \fi
    \fi
  \fi
  }%
\def\iM@line{\iM@collect@bsp@line%
  \ifiM@Mvintest%
    \Mwrite{tst}{\the\verbatim@line}%
  \fi%
  }%

\bgroup
\@makeother{&}%
\@makeother{<}%
\@makeother{>}%
\def\x{\egroup%
  \newcommand*{\M@write@html@verb}%
  {{%
      \@namedef{v:par}{}%
      \def\x{\iMescapeChar{&}{&amp;}}%
      \expandafter\x\expandafter{\the\iM@bsplines}%
      \def\x{\iMescapeChar{<}{&lt;}}%
      \expandafter\x\expandafter{\iMescaped}%
      \def\x{\iMescapeChar{>}{&gt;}}%
      \expandafter\x\expandafter{\iMescaped}%
      \def\x{\iMescapeChar{~}{ }}%
      \expandafter\x\expandafter{\iMescaped}%
                                %      \show\iMescaped
      \edef\temp@a{\iM@Mvinprompt}%
      %% indenting: hacky
%      \if!\temp@a!\else
      \def\x{\iMescapeChar{^^J}{^^J }}%
      \expandafter\x\expandafter{\iMescaped}%
      \expandafter\x\expandafter{\iMescaped}%
      \expandafter\x\expandafter{\iMescaped}%
%      \fi
      \def\x{mupin}%
      \def\a{Mvout}%
      \ifx\@currenvir\a\def\x{mupout}\fi
      \def\a{Mexout}%
      \ifx\@currenvir\a\def\x{mupout}\fi
      \HCode{<pre class="\x">^^J%
        \if!\temp@a!\space\space\space\else
        \expandafter\strip@prefix\meaning\temp@a\fi
        \expandafter\strip@prefix\meaning\iMescaped</pre>}%
    }}%
}
\x


\def\iM@finish{%
  \ifiM@Mvinhide\else%
%    \@tempskipa=-\parsep%
    \@tempskipa=\iM@preskip%
    \ifdim\prevdepth<0.3\baselineskip%
      \ifdim\prevdepth>0pt%
        \advance\@tempskipa by -\prevdepth%
      \fi%
      \advance\@tempskipa by 0.3\baselineskip%
    \fi%
    \vskip\@tempskipa%
    \nointerlineskip%
    \ifhtml
      \M@write@html@verb
    \else
    \ifiM@Mvinsamepage%
      \vbox%
    \fi%
    {% Box zusammenstellen, um die Breite zu kennen.
      \iM@makePromptBox%
      \setbox\@tempboxa\hbox{\box0\ \relax}%
      \parindent\wd\@tempboxa\relax%
      \ifiM@Mvinclick%
        \iM@click{\the\iM@bsplines}%
      \else%
        \iM@noclick{}%
      \fi%
      \iM@typeout@example%
      }%
    \penalty\@endparpenalty%
    \fi% \ifhtml
  \fi%
  }%

\def\iM@startMvinMvout#1{%
  \let\iM@Mvin@inputfile\relax
  \iM@Mvintesttrue
  \iM@Mvinsamepagefalse
  \iM@Mvinhidefalse
  \iM@Mvincollectfalse
  \iM@Mvinfirstinseriesfalse
  \iM@Mvinplotfalse
  \parskip0pt\relax%
  \partopsep0pt\relax%
  \global\iM@bsplines={}%
  \global\iM@bsp@par={\null}%
  \advance\topsep\MvinMvouttopsep\relax
%%%%%%%%%%%%%
% Weise die entsprechenden Parameter zu:
  \setkeys{Mvin}{#1}%
  \addto@hook\every@verbatim{\iM@start}%
  \let\verbatim@processline\iM@line%
  \let\verbatim@finish\iM@finish%
%%%%%%%%%%%%%
% Die Show beginnt:
%% \verbatim ist in verbatim.sty 1.5m kaputtge�ndert.
%  \let\M@verbatim\verbatim
  \def\M@verbatim{%
    \@verbatim%
    \catcode`\^^A=14\relax % comment
%    \catcode`\^^A=9\relax % ignore ^^A
    \frenchspacing\@vobeyspaces\verbatim@start%
  }%
  \let\endverbatim=\endtrivlist
  \ifhtml\SaveEverypar\fi
  \ifiM@Mvinhide\def\M@verbatim{%
    \@bsphack
    \the\every@verbatim
    \def\par{%
      \if@tempswa
        \leavevmode\null\@@par\penalty\interlinepenalty
      \else
        \@tempswatrue
        \ifhmode\@@par\penalty\interlinepenalty\fi
      \fi}%
    \@tempswafalse
    \let\do\@makeother\dospecials
    \catcode`\^^M\active
    \catcode`\^^A=14\relax % comment
%    \catcode`\^^A=9\relax % ignore ^^A
%    \frenchspacing\@vobeyspaces
    \verbatim@start}\fi
  \ifiM@MvoutTeX\ifiM@Mvout
    \let\M@verbatim\relax
    \@ifundefined{addmargin}{}{\addmargin{3em}}
    \if@Mvin@color\MvinMvout@color\fi
    \(\displaystyle
  \fi\fi%
  \ifx\iM@Mvin@inputfile\relax
  \else\def\M@verbatim{\verbatiminput{\iM@Mvin@inputfile}\comment}%
  \fi
  \M@verbatim
}

\def\iM@finishMvinMvout{%
  \ifhtml\RecallEverypar\fi
  \let\M@endverbatim\endverbatim
  \ifiM@Mvinhide\let\M@endverbatim\endcomment\fi
  \ifiM@MvoutTeX\ifiM@Mvout
    \)\par\bigskip\csname endaddmargin\endcsname
    \let\M@endverbatim\relax
  \fi\fi
  \ifx\iM@Mvin@inputfile\relax
  \else\let\M@endverbatim\endcomment\fi
%
  \M@endverbatim
  \relax%\leavevmode\@@par\noindent%
  \@nobreakfalse%
  \ifiM@Mvinfirstinseries\MvinMvin\fi%
}%

\newenvironment{Mvin}[1]%
{%
  \stepcounter{iM@inputs}%
  \def\M@delimiter{<<<I>>>\the\inputlineno/\iM@filename}%
  \def\M@plotdelimiter{<<<P>>>\the\inputlineno/\iM@file@dir\iM@filename/\iM@Mvin@plottimes/\arabic{iM@inputs}}%
  \def\M@TeXdelimiter{<<<TI>>>\the\inputlineno/\iM@filename}%
% Defaultwerte:
  \ifhypermode%
    \iM@Mvinclicktrue%
  \else%
    \iM@Mvinclickfalse%
  \fi%
  \let\MvinMvout@color\Mvin@color
  \let\iM@postskip\iM@Mvinpostskip%
  \let\iM@preskip\iM@Mvinpreskip%
  \let\iM@Mvinnotebook\relax
  \iM@MvoutTeXfalse
  \iM@Mvoutfalse
%  \M@set@outputtype@fancy
  \iM@startMvinMvout{#1}}%
{\iM@finishMvinMvout%
  \ifiM@Mvinplot
    \edef\n{PICTURES/\jobname/generated/\iM@file@dir\iM@filename_img\arabic{iM@inputs}}%
%\expandafter\M@clearunderlines\expandafter{\n}%
%\centerline{attempting to input gfx file \iMescaped}%
    \@tempswatrue
    \def\x##1{%
      \if@tempswa
        \expandafter\IfFileExists\expandafter{\n.##1}{%
          \ifhtml
            \HCode{<img src="\n.##1" alt="[image]">}% no scaling
%            \includegraphics{\n.##1}%
          \else
            \expandafter\IfFileExists\expandafter{\n.eps}{%
%            \vskip-1em\relax
              \Mgraphic{\n}%
            }{\expandafter\M@clearunderlines\expandafter{\n}%
              TODO: EPS file has not been generated! \texttt{\iMescaped.##1}}%
          \fi
          \endgraf%
          \@tempswafalse
        }{}%
      \fi
    }%
    \expandafter\IfFileExists\expandafter{\n.animated}{%
      \penalty\@M
      \edef\x{%
        \endgroup% end the verbatim mode started above
        \begingroup% to have balanced groups
        \def\noexpand\n{\n}%
        \def\noexpand\@currenvir{\@currenvir}%
      }%
      \x
      {%
        \lineskip=1em\relax
        \vskip-\lineskip
        \vskip-\topsep
        \vskip0pt\relax
        \shouldbe@samepage
        \list{}{\leftmargin=\parindent}\item\relax
        \noindent\expandafter\input\expandafter{\n.animated}\endgraf%
        \endlist
      }%
    }{%
      \@tempswbfalse
      \ifhtml\@tempswbtrue\fi
      \ifhypermode\@tempswbtrue\fi
      \if@tempswb
        \x{png}\x{jpeg}\x{jpg}\x{gif}\x{avi}%
      \else
        \ifpdf
          \x{pdf}\x{png}\x{jpeg}\x{jpg}\x{avi}%
        \else
          \x{eps}\x{ps}%
        \fi
      \fi
      \if@tempswa
        \expandafter\M@clearunderlines\expandafter{\n}%
        \hbox{Image \iMescaped\ not found!}%
      \fi
    }%
  \fi
}

\newenvironment{Mvout}[1]%
{%
  \def\M@delimiter{<<<O>>>}%
  \let\M@plotdelimiter\M@delimiter
  \def\M@TeXdelimiter{<<<TO>>>}%
  \iM@Mvinclickfalse
  \iM@MvoutTeXfalse
  \iM@Mvouttrue
  \let\MvinMvout@color\Mvout@color
  \let\iM@postskip\iM@Mvoutpostskip
  \let\iM@preskip\iM@Mvoutpreskip
%  \M@set@outputtype@plain
  \def\iM@Mvinprompt{}%
  \let\iM@Mvinnotebook\relax
  \@nameuse{Mvin@start@hook}%
  \iM@startMvinMvout{#1}}%
{\iM@finishMvinMvout}

% Kurzformen f�r "normale" Anwender
% Achtung: \begin{Mvin}{notest} geht schief, weil Mvin intern
% den verbatim-Mechanismus von verbatim.sty verwendet, der nach
% dem \end-Befehl zu \@currenvir, also der mit dem letzten \begin
% begonnenen Umgebung, sucht.
\newenvironment{Mexin}{\Mvin{test=true}}{\endMvin}
\newenvironment{Mexout}{\Mvout{test=true}}{\endMvout}


\providecommand{\@openbib@code}{\relax}

%
% Verschiedene vordefinierte Seitenabschlu�striche
%%\def\Mnobottomline{\def\Mbottomline{\null\leavevmode\vskip2cm%
%%    \centerline{\vrule width 0.6\textwidth height0pt depth0pt\relax}}}%
%%\def\Mstandardbottomline{\def\Mbottomline{\null\leavevmode\vskip2cm%
%%    \centerline{\vrule width 0.6\textwidth height1pt depth 0pt\relax}}}%
%%\def\Mthinbottomline{\def\Mbottomline{\null\leavevmode\vskip2cm%
%%    \centerline{\vrule width 0.6\textwidth height0.2pt depth 0pt\relax}}}%
\def\Mnobottomline{\typeout{>>Mhelp Warning:
    \string\Mnobottomline\space ignored}}
\def\Mstandardbottomline{\typeout{>>Mhelp Warning:
    \string\Mstandardbottomline\space ignored}}
\def\Mthinbottomline{\typeout{>>Mhelp Warning:
    \string\Mthinbottomline\space ignored}}

% Umgebung Mhtml: Wird von LaTeX ignoriert.
% Dient dazu, so etwas wie
% \begin{Mhtml}
%  <img src="http://www.sciface.com/foo/bild.jpeg">
%  Siehe auch <a href="http://www.sciface.com/foo/bar.html">hier</a>
% \end{Mhtml}
% schreiben zu koennen. Nach dem \end{Mhtml} mu� ein Zeilenende kommen,
% der Inhalt der Umgebung wird 1:1 ins HTML-File geschrieben.
\let\Mhtml=\comment
\let\endMhtml=\endcomment

% Analog: \Mhtmlverb
\let\Mhtmlverb=\@gobble

% Das Inverse dazu:  die Mnohtml-Umgebung wird vom Konverter
% ignoriert, LaTeX setzt sie aber so, als ob \begin{Mnohtml}
% und \end{Mnohtml} nicht vorhanden w�ren.
\def\Mnohtml{}
\def\endMnohtml{}

% Analog als Kommando:
\long\def\Mnothtml#1{#1}%

% Und noch etwas auf allgemeinen Wunsch: die todo-Umgebung wird ignoriert.
% xxx noch in mh2html einbauen!
\let\todo=\comment
\let\endtodo=\endcomment

% Einbinden der Bilder:
% Hiermit kann ein Pfad zu den Bildern angelegt werden,
% und zwar \Mgfxpath{png}{ps}. Hier koennen auch mehrere Verzeichnisse
% angegeben werden, wie in \graphicspath, also z.B.
% \Mgfxpath{{beispiele/pngs/}{output/pngs/}{output/jpeg/}}%
%  {{beispiele/ps/}{beispiele/eps/}%
%  {output/ps/}{output/eps/}}
%
% Wenn Die Bilder alle einem Verzeichnis stehen (BBox), kann auch direkt
% \graphicspath verwendet werden -- macht dieser Befehl �berhaupt Sinn?

\newcommand{\Mgfxpath}[2]{\ifhypermode%
                \graphicspath{#1}%
        \else%
                \graphicspath{#2}%
        \fi}

% Defaultargumente fuer Bilder:
%\def\Mgfxdefault{width=0.8\textwidth}
%\def\Mgfxdefault{clip}
\let\Mgfxdefault\relax

% for OLE links
\newcommand*{\M@olebox}[2]{%
  \setbox\z@\hbox{{#2}}%
  {%
    \@tempcnta=\wd0\relax
    \@tempcntb=\ht0\relax
    \special{olelink:\the\@tempcnta\space\the\@tempcntb:#1}%
  }%
  \box\z@
}

\define@key{Gin}{oletarget}{%
  \Gin@esetsize
  \@tempswatrue
  \edef\@tempa{\toks@{\noexpand\M@olebox{#1}{\the\toks@}}}%
  \@tempa}

\newcommand*{\M@filmstrip@heavy}[1]{{%
    \lineskip\z@
    \baselineskip\z@
    \fboxrule1pt\fboxsep\z@
    \setbox0\hbox{{#1}}%
    \dp0=\z@
    % set the box to follow such that \wd0 is
    % a multiple of \wd1
    \@tempdima=1.9\wd0%
    \@tempdimb=15mm%
    \divide\@tempdima by\@tempdimb%
    \@tempdimb=\wd0%
    \divide\@tempdimb by\@tempdima%
    \setbox1\hbox to \@tempdimb{%
      \leaders\vrule height 2mm\hfill\relax
      \hskip 2mm\relax
      \leaders\vrule height 2mm\hfill\relax
    }%
    \@tempdima=1mm%
    \advance\@tempdima by -\fboxrule\relax
    \setbox0\vbox{%
      \hrule height\@tempdima width \wd0\relax
      \hbox{\leaders\copy1\hskip\wd0}%
      \hrule height1mm width \wd0\relax
      \copy0
      \hrule height1mm width \wd0\relax
      \hbox{\leaders\copy1\hskip\wd0}%
      \hrule height\@tempdima width \wd0\relax
    }%
    \dp0=\z@
    \vbox{\hbox{\fbox{\box0}}\medskip}%
  }}

\newcommand*{\M@filmstrip@light}[1]{{%
    \lineskip\z@
    \baselineskip\z@
    \fboxrule1pt\fboxsep\z@
    \setbox0\hbox{\fbox{#1}}%
%    \dp0=\z@
    % set the box to follow such that \wd0 is
    % a multiple of \wd1
    \@tempdima=1.9\wd0%
    \@tempdimb=15mm%
    \divide\@tempdima by\@tempdimb%
    \@tempdimb=\wd0%
    \divide\@tempdimb by\@tempdima%
    \setbox1\hbox to \@tempdimb{%
      \hfill
      \vrule
      \vbox to 2mm{\hrule width 2mm\vfill\hrule width 2mm}%
      \vrule
      \hfill
    }%
    \@tempdima=1pt%
    \advance\@tempdima by -\fboxrule\relax
    \vbox{%
      \hrule height 1pt width \wd0\relax
      \vskip .7mm
      \hbox{\leaders\copy1\hskip\wd0}%
      \vskip .7mm
      \hrule height\@tempdima width \wd0\relax
      \copy0
      \hrule height\@tempdima width \wd0\relax
      \vskip .7mm
      \hbox{\leaders\copy1\hskip\wd0}%
      \vskip .7mm
      \hrule height 1pt width \wd0\relax
      \medskip
    }%
  }}

\newcommand*{\M@filmstrip@ignore}[1]{#1}

\ifhtml
 \let\M@filmstrip\M@filmstrip@ignore
\else
 \let\M@filmstrip\M@filmstrip@light
\fi

\define@key{Gin}{filmstrip}[]{%
  \Gin@esetsize
  \@tempswatrue
  \edef\@tempa{\toks@{\noexpand\M@filmstrip{\the\toks@}}}%
  \@tempa}

% Scale all images to 75%, for the online docs:
\def\Gin@viewport@code{%
  \ifhypermode
  \setcounter{iM@tempa}{3*\Gin@ury/4}%
  \edef\Gin@ury{\arabic{iM@tempa}}%
  \setcounter{iM@tempa}{3*\Gin@lly/4}%
  \edef\Gin@lly{\arabic{iM@tempa}}%
  \setcounter{iM@tempa}{3*\Gin@urx/4}%
  \edef\Gin@urx{\arabic{iM@tempa}}%
  \setcounter{iM@tempa}{3*\Gin@llx/4}%
  \edef\Gin@llx{\arabic{iM@tempa}}%
  \fi
  }%

\def\M@alttext{image}%
\define@key{Gin}{alt}[image]{%
  \def\M@alttext{#1}%
}

% Und hiermit kann ein Bild eingesetzt werden. Es werden alle Optionen
% von \includegraphics unterst�tzt.

\newcommand{\Mgraphic}{%
  \ifhtml
    \@tempswbtrue
    \def\Ginclude@html##1{%
      \if@tempswb
        \HCode{<img src=\hyper@quote##1\hyper@quote\space
          width=\number\Gin@req@width\space
          height=\number\Gin@req@height\space
          alt=\hyper@quote\M@alttext\hyper@quote>}%
      \else% size not set
        \HCode{<img src=\hyper@quote##1\hyper@quote\space
          alt=\hyper@quote\M@alttext\hyper@quote>}%
      \fi
    }%
    \DeclareGraphicsExtensions{.png,.jpeg,.jpg,.gif}%
    \DeclareGraphicsRule{*}{html}{.eps}{}%
    \def\Gin@nosize##1{%
      \PackageWarning{Mhelp}{can't find size of image, I
        hope you leave enough space yourself}%
      \@tempswbfalse
    }%
  \else
  \ifhypermode%
%%                \bgroup
    \@tempswbtrue
    \def\Ginclude@hyp##1{%
% Some mangling of the dimensions to the format hypage wants:
      \if@tempswb
        \setbox0\hbox{}%
        \ht0=\Gin@req@height%
        \wd0=\Gin@req@width%
        \setbox1\hbox{\box0}%
        \special{html:<img src=\hyper@quote##1\hyper@quote\space
          width=\hyper@quote\number\wd1\hyper@quote\space
          height=\hyper@quote\number\ht1\hyper@quote>}%
      \else
        \special{html:<img src=\hyper@quote##1\hyper@quote>}%
      \fi
    }%
    \DeclareGraphicsExtensions{.png,.jpeg,.jpg,.gif}%
    \DeclareGraphicsRule{*}{hyp}{.eps}{}%
%                \Gread@false%
    \def\Gin@nosize##1{%
      \PackageWarning{Mhelp}{can't find size of image, I
        hope you leave enough space yourself}%
      \@tempswbfalse
    }%
    \else%
      \ifpdf
        \DeclareGraphicsExtensions{.pdf,.png,.jpeg,.jpg}% pdflatex
      \else
        \DeclareGraphicsExtensions{.eps,.ps}% Not pdflatex
      \fi
    \fi%
    \fi
%       \setkeys{Gin}{\Mgfxdefault}%
    \ifx\Mgfxdefault\relax\else%
      \def\temp@a##1{\setkeys{Gin}{##1}}%
      \expandafter\temp@a\expandafter{\Mgfxdefault}%
    \fi%
    \includegraphics%
}

% bei fehlenden eps-Bildern koennen wir zwar nicht viel tun,
% aber es soll auch keine Fehlermeldung kommen:
\let\M@orig@Gread@eps\Gread@eps
\def\Gread@eps#1{%
  \IfFileExists{#1}{\M@orig@Gread@eps{#1}}{%
    \edef\temp@a{#1}%
    \hbox{File \expandafter\strip@prefix\meaning\temp@a\ not found!}%
    \PackageWarning{Mhelp}%
    {File \expandafter\strip@prefix\meaning\temp@a\space not found!}%
    \gdef\@gtempa{0 0 72 72 }%
  }%
}

\newcommand*{\MOverloading}[1]{%
  \ifcase\value{iMlang}%
   \iM@sect@nobreak{\Mhref[stdlib,glossary]{Overloadable by:}}%
  \or%
   \iM@sect@nobreak{\Mhref[stdlib,glossary]{�berladbar durch:}}%
  \fi%
  \iMtt{#1}%
}

% \MRelatedFunctions benutzt praktisch denselben Mechanismus wie \index,
% um Sonderzeichen (derzeit $ und _) im Argument zuzulassen.
\newcommand*{\MRelatedFunctions}{%
  \@nameuse{MRelatedFunctions@prehook@\M@Helppage@Type}%
  \ifcase\value{iMlang}%
   \iM@sect@nobreak{Related Functions:}%
  \or%
   \iM@sect@nobreak{Verwandte Funktionen:}%
  \fi%
  \begingroup\iM@sanitize%
  \catcode`\ =9%
  \iM@RelatedFunctions%
}

\newcommand*{\iM@RelatedFunctions}[1]{%
  \hangafter=1\relax
  \hangindent=1em\relax
  \raggedright\iM@foreach{#1}{,}{\Mup}{, }%
  \par\endgroup% Die Gruppe wurde in \MRelatedFunctions ge�ffnet
  }

\newcommand*{\MSuperDomain}{%
  \ifcase\value{iMlang}%
   \iM@sect@line@nobreak{Super-Domain:}%
  \or%
   \iM@sect@line@nobreak{Super-Domain:}%
  \fi%
  \begingroup\iM@sanitize%
  \catcode`\ =9%
  \iM@RelatedFunctions%
}

\newcommand*{\MRelatedDomains}{%
  \@nameuse{MRelatedDomains@prehook@\M@Helppage@Type}%
  \ifcase\value{iMlang}%
   \iM@sect@nobreak{Related Domains:}%
  \or%
   \iM@sect@nobreak{Verwandte Domains:}%
  \fi%
  \begingroup\iM@sanitize%
  \catcode`\ =9%
  \iM@RelatedFunctions%
}

\newcommand*{\MRelatedAttributes}{%
  \@nameuse{MRelatedAttributes@prehook@\M@Helppage@Type}%
  \ifcase\value{iMlang}%
   \iM@sect@nobreak{Related Attributes:}%
  \or%
   \iM@sect@nobreak{Verwandte Attribute:}%
  \fi%
  \begingroup\iM@sanitize%
  \catcode`\ =9%
  \iM@RelatedAttributes%
}

\newcommand*{\iM@RelatedAttributes}[1]{%
  \hangafter=1\relax
  \hangindent=1em\relax
  \raggedright\iM@foreach{#1}{,}{\Mup[\Mpackname,]}{, }%
  \par\endgroup% Die Gruppe wurde in \MRelatedAttributes ge�ffnet
  }


\newcommand*{\iM@ignspaces}[1]{\ignorespaces #1}
\newcommand*{\MKeywords}[1]{{%
%    \ifcase\value{iMlang}%
%     \iM@sect@nobreak{Keywords:}%
%    \or%
%     \iM@sect@nobreak{Schl�sselworte:}%
%    \fi%
%    \raggedright\null\iM@foreach{#1}{,}{\iM@ignspaces}{, }\par%
    }}

\newcommand*{\MOptionName}[1]{%
  \ifhtml\HCode{<span class="mupin">}\fi
  \texttt{\textit{{#1}}}\/%
  \ifhtml\HCode{</span>}\fi
}
\newcommand*{\MDeclareOption}[2]{%
  \newcommand*{#1}{\MOptionName{#2}}%
  \Mwrite{opts}{{#2}{\Mpackname}{\Mprefix}{\iM@func}}%
  }
\newcommand*{\M@uses@option}[1]{%
  \Mwrite{opts}{{#1}{\Mpackname}{\Mprefix}{\iM@func}}%
}

%%% %% TODO: This doesn't work yet
%%% %%
%%% \bgroup% to write { and }
%%% \lccode`\.=`\{\relax \lccode`\I=`\I\relax \lccode`\R=`\R\relax
%%% \lccode`\@=`\}\relax \lccode`\J=`\J\relax \lccode`\S=`\S\relax
%%% \lccode`\A=`\A\relax \lccode`\K=`\K\relax \lccode`\T=`\T\relax
%%% \lccode`\B=`\B\relax \lccode`\L=`\L\relax \lccode`\U=`\U\relax
%%% \lccode`\C=`\C\relax \lccode`\M=`\M\relax \lccode`\V=`\V\relax
%%% \lccode`\D=`\D\relax \lccode`\N=`\N\relax \lccode`\W=`\W\relax
%%% \lccode`\E=`\E\relax \lccode`\O=`\O\relax \lccode`\X=`\X\relax
%%% \lccode`\F=`\F\relax \lccode`\P=`\P\relax \lccode`\Y=`\Y\relax
%%% \lccode`\G=`\G\relax \lccode`\Q=`\Q\relax \lccode`\Z=`\Z\relax
%%% \lccode`\H=`\H\relax
%%% \obeyspaces
%%% \lowercase{%
%%%   \egroup
%%%   \def\a{}%
%%%   \ifx\Mpackname\a% stdlib, special code:
%%%   \AtEndDocument{\begingroup%
%%%     \Mnewcontext%
%%%     \Mwrite{tst}{<<<I>>>0/consistencyCheck}%
%%%     \Mwrite{tst}{prog::init(All):}%
%%%     \Mwrite{tst}{compl := (map(anames(DOM_PROC) union anames(DOM_FUNC_ENV)}%
%%%     \Mwrite{tst}{     union anames(DOM_IDENT) union}%
%%%     \Mwrite{tst}{     select(anames(DOM_DOMAIN), x->(eval(x))::interface=.@),}%
%%%     \Mwrite{tst}{     expr2text) union Pref::allComplete()) minus Pref::noComplete():}%
%%%     \Mwrite{tst}{documented := . }%
%%%     \def\do#1{\Mwrite{tst}{"#1", }}%
%%%     \the\M@allpages%
%%%     \Mwrite{tst}{null() @:}%
%%%     \Mwrite{tst}{<<<I>>>1/consistencyCheck}%
%%%     \Mwrite{tst}{"documented, but not in the completion" = documented minus compl}%
%%%     \Mwrite{tst}{<<<O>>>}%
%%%     \Mwrite{tst}{          "documented, but not in the completion" = .@}%
%%%     \Mwrite{tst}{<<<I>>>2/consistencyCheck}%
%%%     \Mwrite{tst}{"undocumented, but in the completion" = compl minus documented}%
%%%     \Mwrite{tst}{<<<O>>>}%
%%%     \Mwrite{tst}{           "undocumented, but in the completion" = .@}%
%%%     \Mnewcontext%
%%%     \endgroup}%
%%%   \else% not stdlib, generic code:
%%%   \AtEndDocument{\begingroup%
%%%     \Mnewcontext%
%%%     \Mwrite{tst}{<<<I>>>0/consistencyCheck}%
%%%     \Mwrite{tst}{prog::init(\Mpackname):}%
%%%     \Mwrite{tst}{documented := . }%
%%%     \def\do#1{\Mwrite{tst}{#1, }}%
%%%     \the\M@allpages%
%%%     \Mwrite{tst}{null() @:}%
%%%     \Mwrite{tst}{interf := map(\Mpackname::interface, x->"\Mpackname::".x):}%
%%%     \Mwrite{tst}{<<<I>>>1/consistencyCheck}%
%%%     \Mwrite{tst}{"documented, but not in the interface" = documented minus interf}%
%%%     \Mwrite{tst}{<<<O>>>}%
%%%     \Mwrite{tst}{          "documented, but not in the interface" = .@}%
%%%     \Mwrite{tst}{<<<I>>>2/consistencyCheck}%
%%%     \Mwrite{tst}{"undocumented, but in the interface" = interf minus documented}%
%%%     \Mwrite{tst}{<<<O>>>}%
%%%     \Mwrite{tst}{           "undocumented, but in the interface" = .@}%
%%%     \Mnewcontext%
%%%     \endgroup}%
%%%   \fi% end of distinction stdlib/others
%%% }%

\newcommand*{\M@adddocumented@fn}[1]{{%
  \def\a##1{\global\iM@appendtok\M@allpages+=\noexpand\do{##1}\iM@appendtok}%
  \iM@foreach{#1}{,}{\a}{\ignorespaces}%
}}

\newcommand*{\Mhelppage@starthook@function}{%
%  \expandafter\M@adddocumented@fn\expandafter{\iM@func}%
}

\newcommand*{\Malias@hook@function}[2]{%
  \M@adddocumented@fn{#2}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% graphic documentation specific macros

\newcommand*{\Mhelppage@starthook@graphobj}{%
  \Mhelppage@starthook@function
}

\newcommand*{\Malias@hook@graphobj}{%
  \Malias@hook@function%
}

\newcommand*{\MParameters@prehook@graphobj}{%
  \ifcase\value{iMlang}%
    \def\MEquivSlot##1{%
      \@tempcnta=0
      \def\x####1{\advance\@tempcnta by 1\relax}%
      \iM@foreach{##1}{,}{\x}{}%
      \def\x####1{\Mhref[\Mpackname,####1]{\MOptionName{####1}}}
      \ifcase\@tempcnta
       % 0
      \or
       % 1
       Equivalent to the attribute \x{##1}. 
      \else
       % > 1
       Equivalent to the attributes
       \iM@foreach{##1}{,}{\x}{, \ignorespaces}.
      \fi
    }%
  \or
    \def\MEquivSlot##1{%
      \@tempcnta=0
      \def\x####1{\advance\@tempcnta by 1\relax}%
      \iM@foreach{##1}{,}{\x}{}%
      \def\x####1{\Mhref[\Mpackname,####1]{\MOptionName{####1}}}
      \ifcase\@tempcnta
       % 0
      \or
       % 1
       Entspricht dem Attribut \x{##1}.
      \else
       % > 1
       Entsprechen den Attributen
       \iM@foreach{##1}{,}{\x}{, \ignorespaces}.
      \fi
    }%
  \or
    \def\MEquivSlot##1{\error{French translation missing!}}%
  \fi
}

\newcommand*{\Mhelppage@prehook@attribute}{%
  \def\Mprefix{}%
}

\newcommand*{\Mhelppage@starthook@attribute}{%
  \edef\Mthis{\noexpand\iMtt{\iM@func}}%
  \expanded{\markright{\noexpand\iMtt{\noexpand\M@clip@to@linelength{\iM@func}}}}%
%% remember which attributes are on one page and run their extra commands
  {%
    \edef\a##1{\noexpand\write\noexpand\@auxout{%
        \string\global\string\@namedef{M@attribute@colpage@##1}{\iM@func}}%
      \noexpand\write\noexpand\@auxout{%
        \string\global\string\@namedef{M@attribute@part@##1}{\M@cur@part}}%
      {\def\noexpand\iM@func{##1}\noexpand\@nameuse{M@attrib@commands@on@helppage@##1}}}%
    \expandafter\iM@foreach\expandafter{\iM@func}{,}{\a}{\ignorespaces}\relax
  }%
}

\newcommand*{\MInfo@hook@attribute}[2]{%
  \protected@write\@auxout%
  {\let\Mex\relax\let\Mup\relax}%
  {\string\M@declare@attrib@short{#1}{#2}}%
}

\newcommand*{\M@declare@attrib@short}[2]{%
  \global\@namedef{M@attrib@short@#1}{#2}%
  {\def\Mex##1{##1}\def\Mup##1{##1}%
    \edef\x{\noexpand\Mwrite{plotcfg}{#1:#2}}\x}%
}

\newcommand*{\M@declare@attrib@meta}[8]{{%
  \global\@namedef{M@attrib@typeof@#1}{#2}%
  \global\@namedef{M@attrib@accepting@#1}{#3}%
  \global\@namedef{M@attrib@default@#1}{#4}%
  \global\@namedef{M@attrib@usedBy@#1}{#5}%
  \global\@namedef{M@attrib@object@defaults@#1}{#6}%
  \def\M@default##1##2{%
    \def\x####1{\global\@namedef{M@attrib@default@####1@#1}{##2}}%
    \iM@foreach{##1}{,}{\x}{\ignorespaces}%
  }%
  #6\relax
  \global\@namedef{M@attrib@hints@for@#1}{#7}%
%  \@ifundefined{#1}{}{\error{Attrib #1 known to TeX!}}%
  \global\@namedef{M@attrib@commands@on@helppage@#1}{#8}%
}}

\newcommand*{\M@declare@attribs@for@object}[3]{%
  \global\@namedef{M@object@attribs@#1}{#2}%
  \global\@namedef{M@object@hints@#1}{#3}%
}

\newcommand*{\M@attrib@findsameacceptable}[1]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\do##1##2{\expandafter\ifx\csname M@attrib@accepting@#1\endcsname##2\relax%
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1, \Mex{#1}}{##2}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
      \def\x##1{\iM@appendtok\@temptokena+=\noexpand\do{\Mex{#1}}{##1}\iM@appendtok}%
      \expandafter\x\csname M@attrib@accepting@#1\endcsname%
      \@ifundefined{M@attrib@accepting@#1}{\global\@namedef{M@attrib@accepting@#1}{TODO!}}{}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}

\newcommand*{\M@attrib@writeaccepting}{{%
    \def\temp@c{}%
    \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}%
      {\M@attrib@findsameacceptable}{\ignorespaces}%
    \@tempcnta=0\relax
    \def\do##1##2{\advance\@tempcnta by 1\relax}%
    \temp@c
    \ifnum\@tempcnta>1
      \ifcase\value{iMlang}%
        \Msection{Acceptable values:}%
      \or
        \iM@sect@nobreak{Zul�ssige Werte:}%
      \or
        \error{french translation missing}%
      \fi
      \def\do##1##2{\llap{\smallcube\ }##1&##2&\\}%
      \unskip\noindent
      \begin{tabularx}{\linewidth}{@{\hskip1em}>{\raggedright}X>{\raggedright}X@{}p{0cm}@{}}%
        \temp@c
      \end{tabularx}
    \else
      \def\do##1##2{%
        \ifcase\value{iMlang}%
        \iM@sect@nobreak{Acceptable values:}%
        \or
        \iM@sect@nobreak{Zul�ssige Werte:}%
        \or
        \error{french translation missing}%
        \fi
        \noindent ##2
      }%
      \raggedright
      \temp@c
      \par
    \fi
  }}


\newcommand*{\M@attrib@findsametype}[1]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\do##1##2{\expandafter\ifx\csname M@attrib@typeof@#1\endcsname##2\relax%
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1, \Mex{#1}}{##2}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
      \def\x##1{\iM@appendtok\@temptokena+=\noexpand\do{\Mex{#1}}{##1}\iM@appendtok}%
      \expandafter\x\csname M@attrib@typeof@#1\endcsname%
      \@ifundefined{M@attrib@typeof@#1}{\global\@namedef{M@attrib@typeof@#1}{TODO!}}{}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}

\newcommand*{\M@attrib@writetype}{{%
    \def\temp@c{}%
    \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}%
       {\M@attrib@findsametype}{\ignorespaces}%
    \def\do##1##2{\advance\@tempcnta by 1\relax}%
    \@tempcnta=0\relax
    \temp@c
    \ifnum\@tempcnta>1
      \ifcase\value{iMlang}%
        \Msection{Attribute types:}%
      \or
        \Msection{Typen der Attribute:}%
      \or
        \error{french translation missing}%
      \fi
      \def\do##1##2{\llap{\smallcube\ }##1&##2&\\}%
      \unskip\noindent
      \begin{tabularx}{\linewidth}{@{\hskip1em}>{\raggedright}X>{\raggedright}X@{}p{0cm}@{}}%
        \temp@c
      \end{tabularx}
    \else
      \def\do##1##2{%
        \ifcase\value{iMlang}%
        \iM@sect@nobreak{Attribute type:}%
        \or
        \iM@sect@nobreak{Typ:}%
        \or
        \error{french translation missing}%
        \fi
        \noindent ##2
      }%
      \raggedright
      \temp@c
      \par
    \fi
}}

\newcommand*{\M@attrib@findsamedefault}[1]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\do##1##2{\expandafter\ifx\csname M@attrib@default@#1\endcsname##2\relax%
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1, \Mex{#1}}{##2}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
      \def\x##1{\iM@appendtok\@temptokena+=\noexpand\do{\Mex{#1}}{##1}\iM@appendtok}%
      \expandafter\x\csname M@attrib@default@#1\endcsname%
      \@ifundefined{M@attrib@default@#1}{\global\@namedef{M@attrib@default@#1}{TODO!}}{}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}

\newcommand*{\M@attrib@writedefault}{{%
    \def\temp@c{}%
    \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}%
       {\M@attrib@findsamedefault}{\ignorespaces}%
    \@tempcnta=0\relax
    \def\do##1##2{\advance\@tempcnta by 1\relax}%
    \temp@c
    \ifnum\@tempcnta>0
      \ifnum\@tempcnta>1
        \ifcase\value{iMlang}%
          \Msection{Default values:}%
        \or
          \Msection{Voreinstellungen:}%
        \or
          \error{french translation missing}%
        \fi
        \def\do##1##2{
          \if!##2!\else
            \llap{\smallcube\ }##1 & ##2 &\\
          \fi
        }%
        \unskip\noindent
        \begin{tabularx}{\linewidth}{@{\hskip1em}>{\raggedright}X>{\raggedright}X@{}p{0cm}@{}}%
          \temp@c
        \end{tabularx}
      \else
        \def\do##1##2{
          \if!##2!\else
            \ifcase\value{iMlang}%
              \iM@sect@nobreak{Default value:}%
            \or
              \iM@sect@nobreak{Voreinstellung:}%
            \or
              \error{french translation missing}%
            \fi
            \noindent ##2
          \fi
        }%
        \raggedright
        \temp@c
        \par
      \fi
    \fi
}}

\newcommand*{\MIntro@posthook@attribute}{%
  % MInfo has been written
  \M@attrib@writeaccepting
%  \M@attrib@writedefault % moved to the list of object types
  \M@attrib@writetype
}

\newcommand*{\M@attrib@findsameprimitives}[1]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\do##1##2{\expandafter\ifx\csname M@attrib@object@defaults@#1\endcsname##2\relax%
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1, \Mex{#1}}{##2}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
      \def\x##1{\iM@appendtok\@temptokena+=\noexpand\do{\Mex{#1}}{##1}\iM@appendtok}%
      \expandafter\x\csname M@attrib@object@defaults@#1\endcsname%
      \@ifundefined{M@attrib@object@defaults@#1}{\global\@namedef{M@attrib@object@defaults@#1}{TODO!}}{}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}

\newcommand*{\M@attrib@group@hint}[3]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\a{{#1}{#3}}% {object type}{value}
    \def\do##1##2##3{%
      \def\b{{##1}{##3}}%
      \ifx\a\b\relax
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2,#2}{##3}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}{##3}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{#1}{#2}{#3}}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}

\newcommand*{\M@attrib@group@hint@ii}[3]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\a{{#2}{#3}}% {attribute(s)}{value}
    \def\do##1##2##3{%
      \def\b{{##2}{##3}}%
      \ifx\a\b\relax
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1, #1}{##2}{##3}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}{##3}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{#1}{#2}{#3}}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}

% finally, group by attribute
\newcommand*{\M@attrib@group@hint@iii}[3]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\a{#2}% {attribute(s)}
    \def\do##1##2{%
      \def\b{##2}%
      \ifx\a\b\relax
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1\do{#1}{#3}}{##2}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{\do{#1}{#3}}{#2}}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}


\newcommand*{\M@attrib@insert@hint}[3]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\a{#1}% object
    \def\do##1##2{%
      \def\b{##2}%
      \ifx\a\b\relax
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1\M@attrib@group@hint{#1}{#2}{#3}}{##2}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{\M@attrib@group@hint{#1}{#2}{#3}}{#1}}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}

\newcommand*{\M@declare@objgroup}[2]{%
  \global\@namedef{M@@group@#2}{\csname M@object@group@#1\endcsname}%
  \global\@namedef{M@objs@in@group@#1}{#2}%
  \global\@namedef{M@print@obj@group@#1}{}% redefined when the group is used
  \edef\x{\noexpand\g@addto@macro%
    \expandafter\noexpand\csname M@object@group@#1\endcsname{%
      \global\noexpand\@namedef{M@print@obj@group@#1}{%
        \noexpand\Msection{%
          \ifcase\value{iMlang}``\or"`\else\error\fi
          \csname M@object@group@#1\endcsname%
          \ifcase\value{iMlang}''\or"'\else\error\fi
        }
        \noexpand\M@print@obj@group{#1}
      }%
    }%
  }%
  \x
}

\newcommand*{\M@print@obj@group}[1]{%
  \def\x##1{\Mup{plot::##1}}%
  \expandafter\expandafter\expandafter\iM@foreach
  \expandafter\expandafter\expandafter{%
    \csname M@objs@in@group@#1\endcsname}{,}{\x}{, \ignorespaces}%
}

\newcommand*{\MDetails@prehook@attribute}{{%
    \def\M@default##1##2{%
      \def\a####1{\Mup{plot::####1}}%
      \@ifundefined{M@@group@##1}{%
        \iM@foreach{##1}{,}{\a}{, \ignorespaces}%
      }{\Mhref[plot,objectGroupsListed]{\@nameuse{M@@group@##1}}}%
      &
      \if!##2!\else
        \hspace*{1.5em}%
        \edef\x{%
          \ifcase\value{iMlang}%
            Default:
          \or
            Voreinstellung:
          \or
            \error{french translation missing}%
          \fi
        }%
        \setbox0=\hbox{\x ##2}%
        \ifdim\wd0>0.5\linewidth\relax
          % test if ##2 starts with a [, looking into \Mex{[...]}
          \bgroup
            \def\Mex####1{####1}%
            \let\Mup\relax% \Mup{[...]} won't work anyway
            \let\MOptionName\relax% just for the \edef
            \edef\y{\egroup
              \noexpand\setbox0=\noexpand\hbox{% to avoid output
                \noexpand\@ifnextchar[%]
                {\global\noexpand\@tempswatrue}%
                {\global\noexpand\@tempswafalse}%
                ##2}}
          \y
          \parbox[t]{0.5\linewidth}{%
              \if@tempswa
                \setbox0\hbox{\Mex{[}}%]
                  \@hangfrom{\x\hskip\wd0\null}\hskip-\wd0%
              \else
                \@hangfrom{\x}%
              \fi
              ##2\strut}%
        \else
          \box0
        \fi
      \fi&\\
    }%

    \def\temp@c{}%
    \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}{\M@attrib@findsameprimitives}{\ignorespaces}%
    \def\do##1##2{
      \if!##2!\else
      \ifcase\value{iMlang}%
        \Msection{Object Types reacting to ##1:}%
      \or
        \Msection{Objekttypen, die auf ##1\ reagieren:}%
      \or
        \error{french translation missing}%
      \fi
      \vskip-\bigskipamount
      \noindent
      \begin{tabularx}{\linewidth}{@{\smallcube~}>{\raggedright}Xr@{}p{0cm}@{}}%
        ##2
      \end{tabularx}
      \fi
    }%
    \raggedright
    \temp@c
    \par

    \def\temp@c{}%
    \def\do##1{%
      \def\M@hint####1####2{%
          \def\d########1{\M@attrib@insert@hint{########1}{##1}{####1}}%
          \iM@foreach{####2}{,}{\d}{}%
        }%
      \csname M@attrib@hints@for@##1\endcsname}%
    \def\a##1{\iMescapeChar{ }{}{##1}}%
    \@for\x:=\iM@func@nonesc\do{%
      \expandafter\a\expandafter{\x}%
      \expandafter\do\expandafter{\iMescaped}}%
    \let\x\temp@c
    \def\temp@c{}%
    \def\do##1##2{##1}%
    \x
    \let\x\temp@c
    \def\temp@c{}%
    \let\do\M@attrib@group@hint@ii
    \x
    \let\x\temp@c
    \def\temp@c{}%
    \let\do\M@attrib@group@hint@iii
    \x
    \def\do##1##2{{%
        \@tempcnta=0
        \def\do####1####2{\def\h{####2}\advance\@tempcnta by 1\relax}%
        ##1
        \ifnum\@tempcnta=1\relax
          \if!\h!%
            \Msection{%
              \ifcase\value{iMlang}%
                Object Types setting hints for \Mex{##2}:
              \or
                Objekttypen, die Hints f�r \Mex{##2} setzen:
              \or
                \error{French translation missing!}
              \fi
            }%
          \else
            \Msection{%
              \ifcase\value{iMlang}%
                Object Types setting hint \Mex{##2\,=\,\h}:
              \or
                Objekttypen, die Hint \Mex{##2\,=\,\h} setzen:
              \or
                \error{French translation missing!}
              \fi
            }%
          \fi
          \vskip-1.5\bigskipamount
          \vskip\z@
          \list{}\item
          \def\do####1####2{####1}%
          \null{}##1
          \endlist
        \else
          \Msection{%
            \ifcase\value{iMlang}%
              Object Types setting hints for \Mex{##2}:
            \or
              Objekttypen, die Hints f�r \Mex{##2} setzen:
            \or
              \error{French translation missing!}
            \fi
          }%
          \def\do####1####2{\llap{\smallcube\ }####1 & 
            \ifcase\value{iMlang}%
              Value:
            \or
              Wert:
            \or
              \error{French translation missing!}
            \fi
            ####2 & \\}%
          \vskip-\bigskipamount
          \noindent
          \begin{tabularx}{\linewidth}{@{\hskip1em}>{\raggedright}X>{\raggedright}r@{}p{0cm}@{}}%       
            ##1
          \end{tabularx}
        \fi
        }}%
  \temp@c
}}

\newcommand*{\M@@add@attrib}[4]{%
  \bgroup
    \@tempswatrue
    \def\a{#1}%
    \def\c##1{\def\b{##1}\ifx\a\b\@tempswafalse\fi}%
    \iM@foreach{#2}{,}{\c}{\ignorespaces}%
    \if@tempswa
      \def\x{\egroup
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{#2, #1}{#3}{#4}}%
      }%
    \else
      \def\x{\egroup
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{#2}{#3}{#4}}}%
    \fi
  \x
}

\newcommand*{\M@graphobj@findcommonattribs}[1]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\do##1##2##3{\expandafter\ifx\csname M@attribute@colpage@#1\endcsname##2\relax%
        \@tempswafalse
        \M@@add@attrib{#1}{##1}{##2}{##3}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}{##3}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
      \@ifundefined{M@attribute@colpage@#1}{\global\@namedef{M@attribute@colpage@#1}{#1}}{}%
      \def\x##1{\iM@appendtok\@temptokena+=\noexpand\do{#1}{##1}{#1}\iM@appendtok}%
      \expandafter\x\csname M@attribute@colpage@#1\endcsname%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}

\newcommand*{\M@graphobj@groupattribs@bysection}[3]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\do##1##2{\expandafter\ifx\csname M@attribute@part@#3\endcsname##2\relax%
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1\do{#1}{#2}{#3}}{##2}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}}%
      \fi
    }%
    \temp@a
    \if@tempswa% need to insert new type
      \@ifundefined{M@attribute@part@#3}{\global\@namedef{M@attribute@part@#3}{#3}}{}%
      \def\x##1{\iM@appendtok\@temptokena+=\noexpand\do{\do{#1}{#2}{#3}}{##1}\iM@appendtok}%
      \expandafter\x\csname M@attribute@part@#3\endcsname%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@a\expandafter{\the\@temptokena}%
    }%
    \x
}

\newcommand*{\M@@optionlinks@findsamedefault}[2]{%
  \bgroup
    \expandafter\let\expandafter\b\csname M@attrib@default@#2@#1\endcsname
    \ifx\b\relax\def\x{\egroup\@tempswafalse}\else
     \if!\b!\def\x{\egroup\@tempswafalse}\else
      \@tempswatrue
      \@temptokena{}%
      \def\do##1##2{\expandafter\ifx\csname M@attrib@default@#2@#1\endcsname##2\relax%
          \@tempswafalse
          \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
            \do{##1, \Mex{#2}}{##2}}%
        \else
          \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
            \do{##1}{##2}}%
        \fi
      }%
      \temp@c
      \if@tempswa% need to insert new type
        \def\x##1{\iM@appendtok\@temptokena+=\noexpand\do{\Mex{#2}}{##1}\iM@appendtok}%
        \expandafter\x\csname M@attrib@default@#2@#1\endcsname%
      \fi
      \expandafter\def\expandafter\x\expandafter{%
        \expandafter\egroup
        \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
      }%
    \fi\fi
    \x
}

\newcommand*{\M@@optionlinks@print@default}[1]{%
  {% find common defaults
    \def\temp@c{}%
    \@tempswatrue%
    \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}%
     {\M@@optionlinks@findsamedefault{#1}}{\ignorespaces}%
    % count
    \@tempcnta=0
    \def\do##1##2{\advance\@tempcnta by 1\relax}%
    \temp@c
    \ifnum\@tempcnta>0
      \ifnum\@tempcnta>1\relax\@tempswafalse\fi
      \if@tempswa
        \def\do##1##2{\Mex{\,=\,}##2}%
        \temp@c
      \else
        \@tempswafalse
        \def\do##1##2{\if@tempswa, \fi##1: ##2\@tempswatrue}%
        \space(\temp@c)%
      \fi
    \fi
  }%
}

\newcommand*{\M@@optionlinks}[2]{{%
    \def\print##1{\Mhref[##1]{\MOptionName{##1}}%
      \M@@optionlinks@print@default{##1}%
    }%
    \@tempswbfalse
    \def\printIf##1{{% print ##1 iff it is in the list #1
        \def\a{##1}%
        \def\b####1{%
            \def\c{####1}%
            \ifx\a\c%
             \if@tempswb, \fi
             \print{####1}%
             \aftergroup\@tempswbtrue
            \fi
          }%
        \iM@foreach{#1}{,}{\b}{\ignorespaces}%
      }}%
  \iM@foreach{#2}{,}{\printIf}{\ignorespaces}%
}}

\newcommand*{\M@graphobj@writeattribs}{{%
    \def\temp@c{}%
    \def\do##1{\M@graphobj@findcommonattribs{##1}}%
    \def\a##1{\csname M@object@attribs@plot::##1\endcsname}%
    \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}%
       {\a}{\ignorespaces}%

    \if!\temp@c!% no attributes?
    \else
      \ifhypermode\pagebreak\fi\label{M@attribs}%
      %% commata in \iM@func@nonesc?
      \@tempcnta=0
      \def\a##1{\advance\@tempcnta by 1\relax}%
      \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}{\a}{\ignorespaces}%
      \ifnum\@tempcnta>1
        \ifcase\value{iMlang}%
          \ifhypermode
            \expandafter\Msection
          \else
            \expandafter\iM@sect@line
          \fi{\raggedright\Mthis\ react to these attributes:}%
        \or
          \ifhypermode
            \expandafter\Msection
          \else
            \expandafter\iM@sect@line
          \fi{\raggedright\Mthis\ reagieren auf diese Attribute:}%
        \or
          \error{french translation is missing}%
        \fi
      \else
        \ifcase\value{iMlang}%
          \ifhypermode
            \expandafter\Msection
          \else
            \expandafter\iM@sect@line
          \fi{\Mthis\ reacts to these attributes:}%
        \or
          \ifhypermode
            \expandafter\Msection
          \else
            \expandafter\iM@sect@line
          \fi{\Mthis\ reagiert auf diese Attribute:}%
        \or
          \error{french translation is missing}%
        \fi
      \fi

      %% Group attributes
      \let\do\M@graphobj@groupattribs@bysection
      \temp@c

%\show\temp@a
%\show\M@attribute@part@To
%\show\M@attribute@colpage@From

      \def\do##1{{% this iterates over all sections
          \edef\a{##1}%
          \def\do####1####2{{% iteration over the grouped attributes
              \edef\b{####2}%
              \ifx\a\b% this is the section we currently seek
%                \Msection{##1}
                \setbox0\hbox{\smallcube\ }%
                \vskip-\medskipamount
                \hbox{%\noindent
                  %\null\hskip-\wd0
                  \bfseries ##1}%
                \def\do########1########2########3{% inner loop over entries
                  % {\MOptionName{a}, \MOptionName{b}}{\M@attribute@colpage@a}{a}
                  \ifhtml\HCode{<tr><td valign="top">}\else\llap{\smallcube\ }\fi%
                  \noexpand\M@@optionlinks{########1}{########2}
                  \ifhtml\HCode{<td valign="top">}\else&\fi 
                  \noexpand\csname M@attrib@short@########3\noexpand\endcsname 
                  \ifhtml\HCode{</tr>}\else&\noexpand\\\fi
                }%
                \edef\x{%
                  \ifhtml
                    \noexpand\HCode{<table border="0" style="table-layout:fixed"><colgroup><col width="30\%" /><col width="60\%" /></colgroup>}
                    ####1
                    \noexpand\HCode{</table>}                  
                  \else
                  \noexpand\begin{tabularx}{\noexpand\linewidth}%
                    {@{}>{\linewidth0.5\linewidth\noexpand\raggedright}X%
                      >{\linewidth1.5\linewidth\noexpand\raggedright}X@{}p{0cm}@{}}%
                    ####1\relax
                    \noexpand\end{tabularx}
                  \fi
                }%
                \x
              \fi
            }}%
          \temp@a
        }}%
  
      \list{}{}\item\relax
      \bigskip
      \csname M@all@parts\endcsname
      \par
      \endlist
      \vskip-\iM@presectskip\vskip0pt%
    \fi
  }}

\newcommand*{\M@graphobj@findcommonhints}[2]{%
  \bgroup
    \@tempswatrue
    \@temptokena{}%
    \def\do##1##2{%
      \def\a{#2}%
      \def\b{##2}%
      \ifx\a\b
        \@tempswafalse
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1, #1}{##2}}%
      \else
        \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
          \do{##1}{##2}}%
      \fi
    }%
    \temp@c
    \if@tempswa% need to insert new type
      \expandafter\@temptokena\expandafter=\expandafter{\the\@temptokena%
        \do{#1}{#2}}%
    \fi
    \expandafter\def\expandafter\x\expandafter{%
      \expandafter\egroup
      \expandafter\def\expandafter\temp@c\expandafter{\the\@temptokena}%
    }%
    \x
}


\newcommand*{\M@graphobj@writehints}{{%
    \def\temp@c{}%
    \def\M@object@hint##1##2{%
      \expandafter\M@graphobj@findcommonhints\expandafter{\b}%
         {\if!##2!%
            \Mhref[plot,##1]{\MOptionName{##1}}%
          \else
            \Mex{\Mhref[plot,##1]{\MOptionName{##1}}\,=\,##2}%
          \fi}}%
    \def\a##1{\def\b{##1}\csname M@object@hints@plot::##1\endcsname}%
    \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}%
       {\a}{\ignorespaces}%

    \if!\temp@c!% no hints
    \else% hints
      \vskip-3\bigskipamount\relax
%%% TODO: Hints f�r einzelne Attribute!
      %% commata in \iM@func@nonesc?
      \@tempcnta=0
      \def\a##1{\advance\@tempcnta by 1\relax}%
      \expandafter\iM@foreach\expandafter{\iM@func@nonesc}{,}{\a}{\ignorespaces}%
      \ifnum\@tempcnta>1
        \ifcase\value{iMlang}%
          \iM@sect@nobreak{\Mthis\ set the following \Mhref[plot,SectionHints]{hints}:}%
        \or
          \iM@sect@nobreak{\Mthis\ setzen diese \Mhref[plot,SectionHints]{\glqq{}Hints\grqq{}}:}%
        \or
          \error{french translation is missing}%
        \fi
      \else
        \ifcase\value{iMlang}%
          \iM@sect@nobreak{\Mthis\ sets the following \Mhref[plot,SectionHints]{hints}:}%
        \or
          \iM@sect@nobreak{\Mthis\ setzt diese \Mhref[plot,SectionHints]{\glqq{}Hints\grqq{}}:}%
        \or
          \error{french translation is missing}%
        \fi
      \fi
  
      \def\do##1##2{%
        \if@tempswa, \fi
        \@tempswatrue
        ##2%
        \def\a{##1}%
        \ifx\a\iM@func@nonesc\else
         \space(\iM@foreach{##1}{,}{\Mex}{, \ignorespaces})\fi
      }%
      \@tempswafalse
      \temp@c
      \raggedright\par\bigskip
    \fi
  }}


\newcommand*{\MDetails@posthook@graphobj}{%
  \M@graphobj@writeattribs
  \M@graphobj@writehints
}

\newcommand*{\MDomElConst@hook@graphobj}{%
  \renewcommand*{\iM@call}{\@ifstar\iM@@call@star\iM@@call}%
  \newcommand*{\iM@@call}[2][\Mthis]{\egroup%
  \item
    \parbox[t]{\linewidth}{{\@hangfrom{\Mex{##1(%)
          }}\Mex{##2 \if@M@anim\Mopt{, a = amin .. amax} \fi
          \@ifundefined{r@\iM@docname @\iM@filename @M@attribs}{}%
          {\Mopt{\Mseq{, attr}}}%(
          )}\@@par\ignorespaces}}}%
  \newcommand*{\iM@@call@star}[2][\Mthis]{\egroup%
  \item
    \parbox[t]{\linewidth}{{\@hangfrom{\Mex{##1(%)
          }}\Mex{##2 \Mopt{\Mseq{, attr}}%(
          )}\@@par\ignorespaces}}}%
  \global\@M@animtrue
  \newcommand*{\notanimated}{\global\@M@animfalse}
}

\newcommand*{\MCalls@hook@graphobj}{%
  \PackageWarning{Mhelp}{MCalls env used for a graphobj page!  Please
  use MDomElConst instead!}%
  \let\MCall\call
  \MDomElConst@hook@graphobj
}

\newcommand*{\MParameters@hook@graphobj}{%
  \let\M@orig@endtabularx\TX@endtabularx
  \def\TX@endtabularx{%
    \toks@\expandafter{\the\toks@%
      \if@M@anim
      \Mex{a} &
      \ifcase\value{iMlang}%
        the animation parameter:
       an \Mhref[DOM_IDENT]{identifier} or
       an \Mhref[stdlib,_index]{indexed identifier}.
       \MEquivSlot{ParameterName}
      \or
        der Animationsparameter:
       ein \Mhref[DOM_IDENT]{Bezeichner} oder
       ein \Mhref[stdlib,_index]{indizierter Bezeichner}.
       \MEquivSlot{ParameterName}
      \or
        \error{French translation missing!}
      \fi
      &\\
      \Mex{amin .. amax} &
      \ifcase\value{iMlang}
        the  animation range:
        \Mex{amin}, \Mex{amax} must be numerical real values.
        \MEquivSlot{ParameterRange}
      \or
        der Animationsbereich:
        \Mex{amin}, \Mex{amax} m\"ussen reelle numerische Werte sein.
        \MEquivSlot{ParameterRange}
      \or
        \error{French translation missing!}
      \fi
      &\\
      \fi% end of \if@M@anim
      \@ifundefined{r@\iM@docname @\iM@filename @M@attribs}{}{%
        \Mseq{attr} &
        \ifcase\value{iMlang}%
          plot options, i.e., equations
          \Mex{\MOptionName{Attribute} = value}, where
          \MOptionName{Attribute} is one of the attributes 
          \Mhref[\iM@docname @\iM@filename @M@attribs]{listed below}
          or a \Mhref[plot,SectionHints]{hint.} See
          \Mhref[plot,SectionAttributes]{section~\ref{SectionAttributes}} for
          details.
        \or
          Optionen, also Gleichungen \Mex{\MOptionName{Attribut} =
            Wert}, wobei \MOptionName{Attribut} eines der
          \Mhref[\iM@docname @\iM@filename @M@attribs]{unten
            angegebenen} oder ein
          \Mhref[plot,SectionHints]{\glqq{}Hint\grqq{}} ist.
          \Mhref[plot,SectionAttributes]{Abschnitt~\Mhref{SectionAttributes}}
          erl�utert die Einzelheiten.
        \or
          French translation missing!
        \fi
        &\\
      }%
    }%
    \M@orig@endtabularx
  }%
}

\newcommand*{\@MsetInfoString@graphobj}[2]{%
  \ifcase\value{iMlang}
    \@@MsetInfoString{#1}{graphical primitive for #2}%
  \or
    \@@MsetInfoString{#1}{graphisches Primitiv f�r #2}%
  \or
    {\error{French translation missing!} }%
  \fi
}

\newcommand*{\@MsetInfoString@attribute}[2]{%
  \@@MsetInfoString{#1}{#2}%
  \protected@write\@auxout%
  {\let\Mex\relax\let\Mup\relax}%
  {\string\M@declare@attrib@short{#1}{#2}}%
}

\g@addto@macro\dospecials{\do\�\do\�}%

\newcommand*{\Msetscalefactor}[1]{%
  \def\temp@a{\special{documentscalefactor: #1}}%
  \iM@appendtok\M@startof@page+=\temp@a\iM@appendtok
}

\@onlypreamble{\Msetscalefactor}

% for long headlines, we want them shortened somewhere
%
\DeclareRobustCommand*\M@clip@to@linelength[1]{{%
    \iM@tok{\ignorespaces}%
    \def\@for@each@word##1 ##2\@end{%
      \setbox0=\hbox{\the\iM@tok\space##1}%
      \ifdim\wd0<0.9\linewidth
        \expandafter\iM@tok\expandafter{\the\iM@tok\space##1}%
        \@ReturnAfterElseFi{\if!##2!\else\@ReturnAfterFi\@for@each@word##2\@end\fi}%
      \else
        \expandafter\iM@tok\expandafter{\the\iM@tok\space\textellipsis}%
      \fi
    }%
    \@for@each@word#1 \@end
    \the\iM@tok
}}

\endinput

%%
%% End of file `Mhelp.sty'.
