\def\filename{ml.doc}
\let\thisfilename\filename
\def\fileversion{ml-1.92}
\def\filedate{16 sept 1994}
\def\docdate{16 sept 1994}
%% \CheckSum{2296}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
%
%\iffalse
%
% ML DOCUMENT-STYLE option for LaTeX version 2.09
% Copyright (C) 1993 by Hans Stoks, Malden, The Netherlands
%
% Please report errors to: J.W.H.M. Stoks
%                          [email protected]
%\fi
%
%    \changes{ml~1.3}{20 febr 93}{Corrected some bugs}
%    \changes{ml~1.9}{15 june 93}{Except for ml.sty renamed the sty files to
%                                     be input to .tex}
%
% \DoNotIndex{\!,\',\,,\.,,\:,\;,\?,\/,\^,\`,\@M}
% \DoNotIndex{\@,\@ne,\@m,\@afterheading,\@date,\@endpart}
% \DoNotIndex{\@hangfrom,\@idxitem,\@makeschapterhead,\@mkboth}
% \DoNotIndex{\@oddfoot,\@oddhead,\@restonecolfalse,\@restonecoltrue}
% \DoNotIndex{\@starttoc,\@unused}
% \DoNotIndex{\accent,\active}
% \DoNotIndex{\addcontentsline,\advance,\Alph,\arabic}
% \DoNotIndex{\baselineskip,\begin,\begingroup,\bf,\box,\c@secnumdepth}
% \DoNotIndex{\catcode,\centering,\char,\chardef,\clubpenalty}
% \DoNotIndex{\columnsep,\columnseprule,\crcr,\csname}
% \DoNotIndex{\day,\def,\dimen,\discretionary,\divide,\dp,\do,\docdate}
% \DoNotIndex{\edef,\else,\empty,\end,\endgroup,\endcsname,\endinput}
% \DoNotIndex{\errhelp,\errmessage,\expandafter,\fi,\filedate}
% \DoNotIndex{\fileversion,\fmtname,\fnum@figure,\fnum@table,\fontdimen}
% \DoNotIndex{\gdef,\global}
% \DoNotIndex{\hbox,\hidewidth,\hfil,\hskip,\hspace,\ht,\Huge,\huge,\ialign}
% \DoNotIndex{\if@twocolumn,\ifcase,\ifcat,\ifhmode,\ifmmode,\ifnum}
% \DoNotIndex{\ifx,\immediate,\ignorespaces,\input,\item,\kern,\labelsep,\Large}
% \DoNotIndex{\large,\labelwidth,\lccode,\leftmargin,\leavevmode,\let}
% \DoNotIndex{\lineskip,\list,\ll,\long,\lower,\m@ne}
% \DoNotIndex{\mathchar,\mathaccent,\markboth,\month,\multiply}
% \DoNotIndex{\newblock,\newbox,\newcount,\newdimen,\newwrite}
%^^A\newif is defined \outer
% \DoNotIndex{\nobreak,\noexpand,\noindent,\null,\number}
% \DoNotIndex{\onecolumn,\or}
% \DoNotIndex{\p@,\parbox,\parindent,\parskip,\penalty,\protect,\ps@headings}
%^^A\par is defined \outer
% \DoNotIndex{\quotation,\raggedright,\raise,\refstepcounter,\relax,\rm,\setbox}
% \DoNotIndex{\section,\setcounter,\settowidth,\scriptscriptstyle}
% \DoNotIndex{\sfcode,\sl,\sloppy,\small,\space,\strut}
% \DoNotIndex{\textwidth,\thechapter,\thefigure,\thepage,\spacefactor,\string}
% \DoNotIndex{\the,\thepart,\thetable,\thispagestyle,\titlepage,\tracingmacros}
% \DoNotIndex{\tw@,\twocolumn,\typeout,\uppercase,\usecounter,\vbox,\vfil}
% \DoNotIndex{\vskip,\vspace,\vss,\widowpenalty,\write,\xdef,\year,\z@,\z@skip}
%
%
% \title {ML, a multilingual style-option system for use
%         with \LaTeX's standard document styles\thanks{
%         I took this mainly from J.~Braam's babel.doc, since
%         I wanted my ml to be compatible with his babel.}}
%
% \author{Hans Stoks}
% \address{Kroonsingel 36\\
%          6581 BM Malden\\
%          The Netherlands}
% {\catcode`\"12
% \netaddress{[email protected]}
% }
% \date{Printed \today}
%
% \maketitle
%
% \section{History}
%    For a long time I have been struggling to make documents
%    using different languages in the same document.
%    When M.~Ferguson came up with his ml.tex and H.~Partl with his german.sty
%    I started working at a styleoption which was mainly based on Partl's
%    example.
%
%    The first problem I faced (on my 8088 processor) was to input so many
%    hyphenation patterns.  I discovered that with only two pattern files,
%    say one for american and one for continental hyphenation,
%    I was able to hyphenate most modern languages correctly.  I took
%    the original hyphen.tex (ahyphen.tex) for american and the {\sc celex}
%    patterns for continental hyphenation.  However, I had to modify
%    especially the {\sc celex} patterns to have them function also with german
%    and french (for that reason I renamed the latter to euhyphen).
%
%    Another thing I usually hate very much is to have to decide before
%    beginning my document how many and which different languages I am going
%    to use.  So I made the call for the different languages automatic:
%    I just say \verb=\dutch=, or \verb=\Dutch=, or \verb=\dutchTeX=, to
%    switch to dutch (in fact these commands all input the file nl.sty).
%    Then {\sf babel} came and for a long time I continued with my ml.sty
%    (since it suited me well).  However, I knew one day I just had to look at
%    this style especially since it seems to me to be accepted widely.
%
%    This new version of ml.sty is a modification to make it compatible
%    with {\sf babel.} I designed it so that my old documents (and those of
%    some beta testers whom I gave my style) do not have to be changed;
%    i.e. the only style option requested is ml.  I renamed the different
%    style files to be input to .tex and modified them somewhat
%    with ideas from the different style files coming with {\sf babel.} However,
%    basically I wanted to keep my files since they do much more translating
%    than J.~Braam's files.
%
% \section{The user interface}
%
%    The user interface of this system of style options is quite simple.
%    It consists of only two commands. These commands can be used to
%    select another language or to find out what the current language is.
%
%    \DescribeMacro\selectlanguage
%    When a user wants to switch from one language to another he
%    can do so using the macro \verb=\selectlanguage=. This macro
%    takes the language, defined previously by a language-specific option,
%    as its argument. It calls several macros that should be
%    defined in the language-specific files to activate the special
%    definitions for the language chosen. For compatibility with
%    the original {\tt german.tex} (as much as possible)
%    the synonym
%    \verb=\setlanguage= is available, if it isn't already defined.
%    And for compatibility with my older ml.sty the commands \verb=\dutch=,
%    \verb=\Dutch=, or \verb=\dutchTeX=, \verb=\german=, \verb=\German=, or
%    \verb=\germanTeX=, \verb=\french=, \verb=\French=, or \verb=\frenchTeX=,
%    \verb=\english=, \verb=\English=, or \verb=\originalTeX=
%    \verb=\russian=, \verb=\Russian=, or \verb=\cyrTeX=, and
%    \verb=\greekTeX= still function in the same way they did.
%
%    \DescribeMacro\iflanguage
%    If more than one language is used it might be necessary to know
%    which language is active at a specific time. This can be checked
%    by a call to \verb=\iflanguage=. This macro takes three arguments.
%    The first argument is the name of a language,
%    the second and third arguments are the actions
%    to take if the result of the test is {\tt true} or {\tt false}
%    respectively.
%
%\StopEventually{%
% \clearpage
% \let\filename\thisfilename
% \clearpage
% \def\filename{index}
%  \PrintIndex
% \clearpage
% \def\filename{changes}
%  \PrintChanges
% \makesignature
% }
%
% \section{The implementation}
%
% The first thing to do is to write the current version of this
%    file\footnote{The file described in this section is called
%    {\tt \filename},
%    has version number~\fileversion,
%    was last revised on~\filedate,
%    while the documentation was last revised on~\docdate.}.
%    \begin{macrocode}
\wlog{Style option `ml' version \fileversion\space <\filedate>}
\wlog{English documentation dated <\docdate>}
%    \end{macrocode}
%
%    We want to be compatible with the {\sf babel} system, so we first
%    input babel.sty.
%    \begin{macrocode}
\ifx\undefined\mdqon\relax\else\endinput\fi
\@ifundefined{iflanguage}{\input babel.sty\relax}{\relax}
\ifx\undefined\babel@core@loaded\input babel.com\fi
%    \end{macrocode}
%
%\let\filename\thisfilename
%
% \subsection{Correcting and adding some LaTeX commands}
%
%    Every now and then I find in my reader list a message concerning some
%    correction on some LaTeX command.  I use to collect them and keep them
%    here in my ml style since I am using this style as my default anyway.
%
%    \begin{macrocode}
\let\firstcolmark\relax
\def\@outputdblcol{\if@firstcolumn
\xdef\firstcolmark{\firstmark}
\global\@firstcolumnfalse
   \global\setbox\@leftcolumn\box\@outputbox
 \else \global\@firstcolumntrue
   \setbox\@outputbox\vbox{\hbox to\textwidth{\hbox to\columnwidth
     {\box\@leftcolumn \hss}\hfil \vrule width\columnseprule\hfil
      \hbox to\columnwidth{\box\@outputbox \hss}}}\@combinedblfloats
      \@outputpage \begingroup \@dblfloatplacement \@startdblcolumn
      \@whilesw\if@fcolmade \fi{\@outputpage\@startdblcolumn}\endgroup
   \fi}
\def\ps@right
{\let\@mkboth\markboth
\def\@oddfoot{}\def\@evenfoot{}\def\@evenhead{\rm \thepage\hfil \sl
\leftmark}\def\@oddhead{\hbox{}\sl \rightmark \hfil
\hbox to 0pt{\kern30pt \rm\thepage\hss}
}\def\sectionmark##1{\markright {\uppercase{\ifnum \c@secnumdepth >\z@
\thesection\hskip 1em\relax \fi ##1}}}}
%    \end{macrocode}
%
%    Correction on \verb=\tt_=:
%
%    \begin{macrocode}
\let\typewriter\tt
\gdef\tt{\typewriter\def\_{\char95}}
%    \end{macrocode}
%
% \subsubsection{Some useful definitions}
%
%    I have done quite some nice things with H.~Partl's macros containing
%    the double quote, not only while using german.  So I already define
%    \verb=\mdqon= and \verb=\mdqoff= right here
%
%    \begin{macrocode}
\def\mdqon{\catcode`\"\active}
\def\mdqoff{\catcode`\"12}
%    \end{macrocode}
%
%    Now I would like to be able to switch to a lower trema in different
%    languages\ldots
%
%    \begin{macrocode}
\gdef\allowhyphens{\penalty\@M \hskip\z@skip}
\newcount\U@C\newbox\U@B\newdimen\U@D
\gdef\umlauthigh{\def\"{\protect{\accent127 ##1}}}
\gdef\umlautlow{\def\"{\protect\newumlaut}}
\gdef\newumlaut#1{\leavevmode\allowhyphens
    \vbox{\baselineskip\z@skip \lineskip.25ex
    \ialign{##\crcr\hidewidth
    \setbox\U@B\hbox{#1}\U@D .01\p@\U@C\U@D
    \U@D\ht\U@B\advance\U@D -1ex\divide\U@D \U@C
    \U@C\U@D\U@D\the\fontdimen1\the\font
    \multiply\U@D \U@C\divide\U@D 100\kern\U@D
    \vbox to .20ex
    {\hbox{\char127}\vss}\hidewidth\crcr#1\crcr}}\allowhyphens}
\gdef\@UMLAUT{\"}
\gdef\@MATHUMLAUT{\mathaccent"707F }
\gdef\@SS{\mathchar"7019 }
\gdef\dq{"}
\gdef\highumlaut#1{\leavevmode\allowhyphens%
    \accent127 #1\allowhyphens}%
%    \end{macrocode}
%
%    I add the quotes to the definitions of dospecials and sanitize:
%
%    \begin{macrocode}
\begingroup
\def\do{\noexpand\do\noexpand}%
\xdef\dospecials{\dospecials\do\"}%
\expandafter\ifx\csname @sanitize\endcsname\relax \else
 \def\@makeother{\noexpand\@makeother\noexpand}%
 \xdef\@sanitize{\@sanitize\@makeother\"}%
\fi
\endgroup
%    \end{macrocode}
%
%    and can now use the double quotes for fancy effects (I need a
%    dieresis for use in a discretionary command and, for efficiency,
%    I define a short macro for the most frequent characters used after
%    the double quotes).
%
%    \begin{macrocode}
{\mdqon
\gdef"{\protect\active@dq}
\gdef\dieresis{\"}
\gdef\active@dq#1{%
    \ifx #1s\ifmmode\@SS\else\ss\fi{}%
\else\ifx #1a\ifmmode\@MATHUMLAUT a\else\@UMLAUT a\fi
\else\ifx #1o\ifmmode\@MATHUMLAUT o\else\@UMLAUT o\fi
\else\ifx #1u\ifmmode\@MATHUMLAUT u\else\@UMLAUT u\fi
\else\ifx #1A\ifmmode\@MATHUMLAUT A\else\@UMLAUT A\fi
\else\ifx #1O\ifmmode\@MATHUMLAUT O\else\@UMLAUT O\fi
\else\ifx #1U\ifmmode\@MATHUMLAUT U\else\@UMLAUT U\fi
\else\ifx #1`\leftquotes{}%
\else\ifx #1'\rightquotes{}%
\else\other@active@dq{#1}%
\fi\fi\fi\fi\fi\fi\fi\fi\fi }
% now a separate command for the less frequent ones:
\gdef\other@active@dq#1{%
    \ifx #1e\ifmmode\@MATHUMLAUT e\else\highumlaut e\fi
\else\ifx #1i\ifmmode\discretionary{-}{#1}{\@MATHUMLAUT i}
           \else\discretionary{-}{#1}{\dieresis\i}\fi
\else\ifx #1j\ifmmode\discretionary{-}{#1}{\@MATHUMLAUT j}
           \else\discretionary{-}{#1}{\dieresis\j}\fi
\else\ifx #1E\ifmmode\@MATHUMLAUT E\else\highumlaut E\fi
\else\ifx #1I\ifmmode\@MATHUMLAUT I\else\highumlaut I\fi
\else\ifx #1SSS%
\else\ifx #1-\allowhyphens\-\allowhyphens
\else\ifx #1"\hskip\z@skip\allowhyphens
\else\ifx #1|\discretionary{-}{}{\kern.03em}%
\else\ifx #1c\allowhyphens\discretionary{k-}{}{c}\allowhyphens
\else\ifx #1f\allowhyphens\discretionary{ff-}{}{f}\allowhyphens
\else\ifx #1k\allowhyphens\discretionary{k-}{}{}\allowhyphens %% Maasai
\else\ifx #1l\allowhyphens\discretionary{ll-}{}{l}\allowhyphens
\else\ifx #1m\allowhyphens\discretionary{mm-}{}{m}\allowhyphens
\else\ifx #1n\allowhyphens\discretionary{nn-}{}{n}\allowhyphens
\else\ifx #1p\allowhyphens\discretionary{pp-}{}{p}\allowhyphens
\else\ifx #1t\allowhyphens\discretionary{tt-}{}{t}\allowhyphens
\else\ifx #1C\allowhyphens\discretionary{K-}{}{C}\allowhyphens
\else\ifx #1F\allowhyphens\discretionary{FF-}{}{F}\allowhyphens
\else\ifx #1K\allowhyphens\discretionary{K-}{}{}\allowhyphens %% Maasai
\else\ifx #1L\allowhyphens\discretionary{LL-}{}{L}\allowhyphens
\else\ifx #1M\allowhyphens\discretionary{MM-}{}{M}\allowhyphens
\else\ifx #1N\allowhyphens\discretionary{NN-}{}{N}\allowhyphens
\else\ifx #1P\allowhyphens\discretionary{PP-}{}{Pp}\allowhyphens
\else\ifx #1T\allowhyphens\discretionary{TT-}{}{T}\allowhyphens
\else\ifx #1y\allowhyphens i\kern-0.06\p@ j\allowhyphens%
\else\ifx #1Y\allowhyphens I\kern-0.05\p@ J\allowhyphens%
\else\ifx #1<\flqq{}%
\else\ifx #1>\frqq{}%
\else        \dq #1%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\fi\fi\fi\fi\fi\fi\fi\fi }
\gdef\at{{\char '100}}
\gdef\boi{{\tt\char '134}}
\gdef\circonflexe{{\char '136}}
\gdef\tild{{\char '176}}
\gdef\degre{{\char '27}}
\gdef\french@circumflex#1{{\accent'136\if#1i\i\else#1\fi}}
\gdef\french@dieresis#1{{\accent'177\if#1i\i\else#1\fi}}
\gdef\up#1{\raise 1ex\hbox{\small#1}}
\gdef\No{\kern-.25em\lower.2ex\hbox{\degre}}
\gdef\ieme{$^{\rm e }$\kern+.17em}
\gdef\FrenchEnumerate#1{$#1^{\rm o}$\kern+.29em}
\gdef\FrenchPopularEnumerate#1{#1\No\kern-.25em)\kern+.3em}
\gdef\primo{\FrenchEnumerate1}
\gdef\secundo{\FrenchEnumerate2}
\gdef\tertio{\FrenchEnumerate3}
\gdef\quatro{\FrenchEnumerate4}
\gdef\fprimo){\FrenchPopularEnumerate1}
\gdef\fsecundo){\FrenchPopularEnumerate2}
\gdef\ftertio){\FrenchPopularEnumerate3}
\gdef\fquatro){\FrenchPopularEnumerate4}
\gdef\flqq{\protect\@flqq}
\gdef\@flqq{\ifhmode \edef\@SF{\spacefactor\the\spacefactor}\else
    \let\@SF\empty \fi
    \ifmmode \ll \else \leavevmode
    \raise .2ex \hbox{$\scriptscriptstyle \ll $}\fi \@SF\relax}
\gdef\frqq{\protect\@frqq}
\gdef\@frqq{\ifhmode \edef\@SF{\spacefactor\the\spacefactor}\else
    \let\@SF\empty \fi
    \ifmmode \gg \else \leavevmode
    \raise .2ex \hbox{$\scriptscriptstyle \gg $}\fi \@SF\relax}
\gdef\flq{\protect\@flq}
\gdef\@flq{\ifhmode \edef\@SF{\spacefactor\the\spacefactor}\else
    \let\@SF\empty \fi
    \ifmmode < \else \leavevmode
    \raise .2ex \hbox{$\scriptscriptstyle < $}\fi \@SF\relax}
\gdef\frq{\protect\@frq}
\gdef\@frq{\ifhmode \edef\@SF{\spacefactor\the\spacefactor}\else
    \let\@SF\empty \fi
    \ifmmode > \else \leavevmode
    \raise .2ex \hbox{$\scriptscriptstyle > $}\fi \@SF\relax}
}
\gdef\ouvreguillemet{\leavevmode\hbox{\ly(\kern-0.13em(}\nobreak}
\gdef\fermeguillemet{\nobreak\leavevmode\hbox{\ly)\kern-0.13em)}}
%    \end{macrocode}
%
%    This is where I end having made quotes active (mdqon).  Now
%    I would like to add some more useful definitions to make the
%    input of my files a little bit more convenient.
%
%    To avoid having to make lots of italic corrections:
%
%    \begin{macrocode}
\gdef\bold#1{{\bf#1\/}}
\gdef\emph#1{{\em#1\/}}
\gdef\ital#1{{\it#1\/}}
\gdef\slant#1{{\sl#1\/}}
%    \end{macrocode}
%
%    To prevent overfull hboxes with words containing ():
%
%    \begin{macrocode}
\let\stopmath\)
\gdef\specialhyphen{%
\ifmmode\stopmath\else\allowhyphens\discretionary{-)}{}{-)}\allowhyphens\fi}
\def\){\protect\specialhyphen}
%    \end{macrocode}
%
%    For an underline in italic:
%
%    \begin{macrocode}
\gdef\B#1{\kern-.0667em\b{\kern.1788em#1}}
%    \end{macrocode}
%
%    Some of the definitions I collected:
%
%    \begin{macrocode}
\gdef\rref#1{\ref{#1}\begingroup
 \def\x{#1}\edef\x{\expandafter\GetMeaning\meaning\x\MeaningEnd}%
 \ref{\x}\marginpar{\verb^ \x ^}\endgroup}
\gdef\llabel#1{\label{#1}\begingroup
 \def\x{#1}\edef\x{\expandafter\GetMeaning\meaning\x\MeaningEnd}%
 \ref{\x}\marginpar{\verb^ \x ^}\endgroup}
\gdef\trademark{\raise 1ex\hbox{\ooalign{\hfil\raise.07ex\hbox{\sevenrm
  R}\hfil\crcr\mathhexbox20D}}}
%    \end{macrocode}
%
%    For chemical formulas:
%
%    \begin{macrocode}
\gdef\ch#1{$\textfont1=\the\font#1$}
%    \end{macrocode}
%
%    Finally there are some macros which I would like to incorporate but
%    witch I leave out for the moment since they are not quite worked out yet.
%
%    So I have been thinking of a definition for big initials or photos:
%
%    \begin{verbatim}
% \def\photo#1#2{\hangindent#1\noindent\hangafter-#2}
% \def\initial#1#2#3
%   {\hangindent#1\noindent\hangafter-#2\smash{\lower#2\baselineskip\hbox
%   to0pt{#3\hfill}}}
%    \end{verbatim}
%
%    Eventually I want to have something for generating grammar paradigms:
%
%    \begin{verbatim}
% {\def\adjpar#1#2#3{ \begin{tabular}{rllll}
%     &      & Masc. & Fem. & Neut. \\
% Sg. & Nom. & #1    & #2   & #3    \\
% \adjpari }
% \def\adjpari#1#2#3{ & Gen. & #1 & #2 & #3 \\ \adjparii}
% \def\adjparii#1#2#3{ & Dat. & #1 & #2 & #3 \\ \adjpariii}
% \def\adjpariii#1#2#3{ & Acc. & #1 & #2 & #3 \\ \adjpariv}
% \def\adjpariv#1#2#3{ Pl. & Nom. & #1 & #2 & #3 \\ \adjparv}
% \def\adjparv#1#2#3{ & Gen. & #1 & #2 & #3 \\ \adjparvi}
% \def\adjparvi#1#2#3{ & Dat. & #1 & #2 & #3 \\ \adjparvii}
% \def\adjparvii#1#2#3{ & Acc. & #1 & #2 & #3 \end{tabular}}}
%    \end{verbatim}
%
%\section{The actual ml style code}
%
% \subsection{My extra multilingual macros}
%
%    Maybe David van Leeuwen's (DAVID@HLERUL59) `getallen' are useful:
%
%    \begin{macrocode}
\newcount\ii\newcount\jj\newif\ifhyphen
\gdef\numb{\hyphenfalse\afterassignment\nul\ii=}
\gdef\num#1 #2 {\divide\jj by #1 \ifnum\jj>1 {\ii=\jj\getall}\fi
  #2\multiply\jj by #1 \advance\ii by -\jj\getall}
\gdef\qm{\ifhyphen\-\else\global\hyphentrue\fi}
\gdef\s#1 {\showhyphens{\numb#1}}
\newcount\n\newcount\m
\n=0
\m=1
%    \end{macrocode}
%
%    Some (school) books have exercises\ldots
%
%    \begin{macrocode}
\def\lesson{\def\chaptername{\lessonname}\chapter}
\def\exercise{\section*{\centering{\exercisename{}\thesection}}}
\def\singleexercise{\section*{\centering{\exercisename{}\thechapter}}}
\gdef\beginexercise{\@ifnextchar[\beginsingleexercise\begin@xercise}
  \gdef\begin@xercise{
     \refstepcounter{section}\exercise{}
        \begin{itemize}\begin{enumerate}}
  \gdef\beginsingleexercise[]{
     \refstepcounter{section}\singleexercise{}
        \begin{itemize}\begin{enumerate}}
\gdef\endexercise{\end{enumerate}\end{itemize}}
%    \end{macrocode}
%
%    And some books happen to have been published in different editions:
%
%    \begin{macrocode}
\gdef\higherthenthird#1{\bgroup%
  \def\arabicedition{\arabicedname}%
  \def\croatianedition{\croatianedname}%
  \def\czechedition{\czechedname}%
  \def\danishedition{\danishedname}%
  \def\dutchedition{\dutchedname}%
  \def\englishedition{\englishedname}%
  \def\esperantoedition{\esperantoedname}%
  \def\finnishedition{\finnishedname}%
  \def\frenchedition{\frenchedname}%
  \def\germanedition{\germanedname}%
  \def\greekedition{\greekedname}%
  \def\hebrewedition{\hebrewedname}%
  \def\hindiedition{\hindiedname}%
  \def\italianedition{\italianedname}%
  \def\maasaiedition{\maasaiedname}%
  \def\magyaredition{\magyaredname}%
  \def\norskedition{\norskedname}%
  \def\polishedition{\polishedname}%
  \def\portugesedition{\portugesedname}%
  \def\romanianedition{\romanianedname}%
  \def\russianedition{\russianedname}%
  \def\sloveneedition{\sloveneedname}%
  \def\spanishedition{\spanishedname}%
  \def\swahiliedition{\swahiliedname}%
  \def\swedishedition{\swedishedname}%
  \def\tamiledition{\tamiledname}%
  \def\turkishedition{\turkishedname}\if#12%
  {2\higher}\else\if#13%
  {3\higher}\else\if#14%
  {4\higher}\else\if#15%
  {5\higher}\else\if#16%
  {6\higher}\else\if#17%
  {7\higher}\else\if#18%
  {8\higher}\else\if#19%
  {9\higher}\else#1\fi\fi\fi\fi\fi\fi\fi\fi\egroup}
\gdef\edition#1{\@bsphack\@ifundefined{l@#1}{\@nolanerr{#1}}%
  {\language\csname l@#1\endcsname\@esphack}}%
\gdef\arabicedition{\edition{arabic}}
\gdef\croatianedition{\edition{croatian}}
\gdef\czechedition{\edition{czech}}
\gdef\danishedition{\edition{danish}}
\gdef\dutchedition{\edition{dutch}}
\gdef\englishedition{\edition{english}}
\gdef\esperantoedition{\edition{esperanto}}
\gdef\finnishedition{\edition{finnish}}
\gdef\frenchedition{\edition{french}}
\gdef\germanedition{\edition{german}}
\gdef\greekedition{\edition{greek}}
\gdef\hebrewedition{\edition{hebrew}}
\gdef\hindiedition{\edition{hindi}}
\gdef\italianedition{\edition{italian}}
\gdef\maasaiedition{\edition{maasai}}
\gdef\magyaredition{\edition{magyar}}
\gdef\norskedition{\edition{norsk}}
\gdef\polishedition{\edition{polish}}
\gdef\portugesedition{\edition{portuges}}
\gdef\romanianedition{\edition{romanian}}
\gdef\russianedition{\edition{russian}}
\gdef\sloveneedition{\edition{slovene}}
\gdef\spanishedition{\edition{spanish}}
\gdef\swahiliedition{\edition{swahili}}
\gdef\swedishedition{\edition{swedish}}
\gdef\tamiledition{\edition{tamil}}
\gdef\turkishedition{\edition{turkish}}
%    \end{macrocode}
%
%    Then a book is supposed to begin with a preamble and to end with
%    a postamble.
%
%    \begin{macrocode}
\gdef\subtitle#1{\def\@subtitle{#1}}
\gdef\soustitre#1{\begin{flushright}{\it#1}\end{flushright}}
\gdef\see#1#2{{\em\seename\ #1,} #2}
\newif\ifpagenumbering\pagenumberingtrue
\gdef\sschapter#1{\ifpagenumbering
  \bgroup\@schapter{#1}\pagenumbering{arabic}\egroup\pagenumberingfalse
     \else\@schapter{#1}\fi}
\gdef\cchapter[#1]#2{\ifpagenumbering\bgroup\@chapter[#1]{#2}
  \pagenumbering{arabic}\egroup\pagenumberingfalse
     \else\@chapter[#1]{#2}\fi}
\gdef\ch@pter{\clearpage\relax\if@twoside \ifodd\c@page\else
  \hbox{}\relax\newpage\thispagestyle{empty}
     \if@twocolumn\hbox{}\newpage\fi\fi\fi
  \thispagestyle{plain}\global\@topnum\z@\@afterindentfalse
     \secdef\cchapter\sschapter}
\gdef\maketitlepages{\def\chapter{\thispagestyle{empty}\ch@pter}
 \pagenumbering{roman}
 \begin{titlepage}\setcounter{page}{-3}
 \null
 \vfil
 \vskip2\baselineskip \begin{center}
 {\Huge\sc \@title \par}\end{center}
 \end{titlepage}\begin{titlepage}\setcounter{page}{-2}\null\vfil
 \end{titlepage}\begin{titlepage}
 \let\footnotesize\small \let\footnoterule\relax\setcounter{page}{-1}
 \null
 \vfil
 \vskip 60pt \begin{center}
 {\LARGE\sc \@title \par} \ifx\@subtitle\undefined\relax\else
 {\large \@subtitle \par}\fi \vskip 3em {\large
 \lineskip .75em
 \begin{tabular}[t]{c}\@author
 \end{tabular}\par}
 \vfil {\large \@date \par} \end{center}
 \end{titlepage}\begin{titlepage}\null\vfil\end{titlepage}
 \setcounter{footnote}{0} \let\thanks\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\maketitle\relax}
\gdef\tableofcontents{\bgroup\@restonecolfalse
  \if@twocolumn\@restonecoltrue\onecolumn
  \fi\pagenumberingfalse\chapter*{\contentsname
   \@mkboth{\uppercase{\contentsname}}{\uppercase{\contentsname}}}
  \@starttoc{toc}\if@restonecol\twocolumn\fi\egroup}
\gdef\listoffigures{\bgroup\@restonecolfalse
  \if@twocolumn\@restonecoltrue\onecolumn
  \fi\pagenumberingfalse\chapter*{\listfigurename\@mkboth
  {\uppercase{\listfigurename}}{\uppercase{\listfigurename}}}\@starttoc
  {lof}\if@restonecol
  \twocolumn\fi\egroup}
\gdef\listoftables{\bgroup\@restonecolfalse
  \if@twocolumn\@restonecoltrue\onecolumn
  \fi\pagenumberingfalse\chapter*{\listtablename\@mkboth
  {\uppercase{\listtablename}}{\uppercase{\listtablename}}}\@starttoc
  {lot}\if@restonecol
  \twocolumn\fi\egroup}
\def\preface{\bgroup\pagenumberingfalse\chapter*{\prefname}
      \addcontentsline{toc}{chapter}{\prefname}\egroup}
%    \end{macrocode}
%
%    I want to make \verb=\footnote= also function in section headings---but
%    I do not want footnotemarks to appear in the table of contents---and
%    let it report indexentries in it.
%
%    \begin{macrocode}
\long\gdef\@footnotetext#1{\insert\footins{\footnotesize
   \interlinepenalty\interfootnotelinepenalty
   \splittopskip\footnotesep
   \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
   \hsize\columnwidth \@parboxrestore
  \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
  \def\@wrindex{\wrindex}{\rule{\z@}{\footnotesep}\ignorespaces
     #1\strut}}}
\global\let\f@@tnote\footnote%
\global\let\c@ntentsline\contentsline%
\gdef\footnote{\rm\kern.05em\protect\f@@tnote}
\gdef\nofootnote#1{\relax}
\gdef\contentsline{%
  \def\f@@tnote{\nofootnote}\let\footnotemark\relax\c@ntentsline}
%    \end{macrocode}
%
%    Finally I want the bibliography and the index to appear in the toc.
%
%    \begin{macrocode}
\gdef\mlbibfilename#1{\def\bibfn{#1}}
\gdef\bibliography#1{%
  \if@filesw\immediate\write\@auxout{\string\bibdata{\bibfn,#1}}\fi
    \@input{\jobname.bbl}}
\gdef~{\penalty1000\ }
\gdef\notename#1{#1\,n.}
\gdef\index#1{\ifx\ind@x\undefined\relax\else\protect\ind@x{#1}\fi}
\global\let\enddoc\enddocument
\gdef\wrindex#1{\let\thepage\relax\xdef\@gtempa{%
     \write\@indexfile{\string\indexentry{#1|notename}{\thepage}}}
  \endgroup\@gtempa\if@nobreak \ifvmode\nobreak\fi\fi\@esphack}
\gdef\makeindex{\if@filesw \newwrite\@indexfile
 \immediate\openout\@indexfile=\jobname.idx
 \def\ind@x{\@bsphack\begingroup\ifx\no@french@active@punct\undefined\relax
    \else\no@french@active@punct\def\'{\accent 19}\fi
     \def\protect####1{\string####1\space}\@sanitize\@wrindex}
  \typeout{Writing index file \jobname.idx}\fi
  \def\theidx{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
     \columnseprule.4pt\small\columnsep 35pt
     \twocolumn[\@makeschapterhead{\indexname}]
     \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}
     \thispagestyle{plain}\parindent\z@\parskip\z@ plus .3pt\relax%
     \let\item\@idxitem\addcontentsline{toc}{chapter}{\indexname}}
  \def\theindex{\ifx\multicols\undefined
     \makeatletter\inputstyle{multicol}\makeatother
     \ifx\multicols\undefined\theidx\else
     \columnseprule=.4pt\small\chapter*{\indexname}
     \parindent\z@\parskip\z@ plus.3pt\relax\let\item\@idxitem
     \addcontentsline{toc}{chapter}{\indexname}
     \begin{multicols}{2}\fi\fi}
  \def\endtheindex{\ifx\multicols\undefined\if@restonecol\onecolumn\else
       \clearpage\fi\else\end{multicols}\fi}
  \def\enddocument{\@input{\jobname.ind}\enddoc}}
\gdef\cover{\@input{\jobname.ind}\def\enddocument{\enddoc}\pagestyle{empty}}
%    \end{macrocode}
%
% \section{Parallel Columns}
%
%    I think a feature generating parallel columns, viz. one column of text
%    to the left and one column of (translated) text to the right, is essential
%    to a multilingual system.  I have been working on this for a long time and
%    up till now I am not quite content with the result.  The following code I
%    took basically from some macro I found in my reader list.  I adapted it
%    somewhat and the result is not bad.  However, a big problem is generating
%    footnotes.  The numbers of the footnotes do not correspond with the
%    footnotes on the same page.  Actually it seems footnotes appear on the
%    page {\em before\/} they appear in the text.  Anyway, for the time being
%    I shall have to do with this code.  For the future, however, I am thinking
%    of a more complex mechanism.  Maybe I shall have to make two runs: First
%    to collect the text of one column, in order to know where exactly it skips
%    to the next page and then with this knowledge inserting the next column.
%
%    \begin{macrocode}
\newinsert\mcpfootins
\long\def\mcpfootnote#1{\footnotemark\addtocounter{footnote}{-1}
   \global\setbox\mcpfootins \vbox{\unvcopy\mcpfootins\footnotesize%
   \interlinepenalty\interfootnotelinepenalty\floatingpenalty=20000
   \splittopskip\footnotesep%\splitmaxdepth \dp\strutbox%
   \hsize\columnwidth\pagebreak[3]
   \parindent 1em\noindent\hbox to 1.8em{\hss\footnotemark}
   {\rule{0pt}{\footnotesep}\ignorespaces #1\strut}}}
\gdef\multicolpar#1{\def\f@@tnote{\mcpfootnote}\let\footins\mcpfootins
  \addvspace\topsep\pretolerance1001\tolerance9999
  \finalhyphendemerits3000000\hbadness5000\vbadness10001
  \advance\baselineskip0pt\multicolumnparallelparagraphs{#1}{2em}}
\gdef\endmulticolpar{\xpar\egroup\egroup\leavevmode}
\newcount\columnsleft   \newcount\totalcolumns   \newdimen\separation
\gdef\multicolumnparallelparagraphs#1#2{\totalcolumns#1\separation#2
  \let\xpar\par\vskip\parskip\columnsleft\totalcolumns\relax
  \hbox to\hsize\bgroup\let\par\nextmulticolumnparallelparagraph
  % Set hsize = (old hsize - (#1 - 1)*#2 ) / #1
  \dimen0\separation\advance\hsize-\columnsleft\dimen0
  \advance\hsize\dimen0\divide\hsize\columnsleft\relax
  \leavevmode\vtop\bgroup\parindent0pt}
\gdef\nextmulticolumnparallelparagraph{\strut\egroup\advance\columnsleft-1
  \ifnum\columnsleft>0\hfil\leavevmode\vtop\bgroup\parindent0pt
  \else\strut\egroup\xpar\vskip\parskip\xpar
  \multicolumnparallelparagraphs\totalcolumns\separation
  \fi}
%    \end{macrocode}
%
%    Now we get the language selecting mechanism.  I define a newcount
%    \verb=\l@nguage= in order to avoid conflicts with several dialects
%    using the same language count.  Consequently I redefine
%    \verb=\p@selectlanguage= so that it contains also this newcount, and
%    \verb=\iflanguage= so that it also knows about different dialects.
%
%    But first I have to take into account special languages, those that
%    use different alphabets.
%
%    \begin{macrocode}
\newcount\l@nguage
\newif\ifgreek
\newif\ifrussian
\begingroup
\catcode`\;=\active \catcode`\:=\active
\catcode`\!=\active \catcode`\?=\active
\gdef\french@active@punct{%
   \catcode`\;=\active\catcode`\:=\active%
   \catcode`\!=\active\catcode`\?=\active\relax}
\gdef\no@french@active@punct{%
   \catcode`\;=12\catcode`\:=12%
   \catcode`\!=12\catcode`\?=12\relax}
\endgroup
\begingroup
\catcode`\;=\active \catcode`\:=\active
\catcode`\!=\active \catcode`\?=\active
\gdef\extrasfrench{%
   \let\original@dospecials\dospecials%
   \let\original@sanitize\@sanitize%
   \let\original@ref\ref%
   \let\original@pageref\pageref%
   \let\original@cite\cite%
   \let\original@label\label%
   \let\original@newlabel\newlabel%
   \let\original@bibcite\bibcite%
   \let\original@@bibitem\@bibitem%
   \let\original@@lbitem\@lbitem%
   \let\original@@testdef\@testdef%
   \let\original@sc=;\let\original@co=:%
   \let\original@em=!\let\original@qm=?%
   \let\original@dieresis\"%
   \let\original@circumflex\^%
   \let\original@active@sc\active@sc%
   \let\original@active@co\active@co%
   \let\original@active@em\active@em%
   \let\original@active@qm\active@qm%
   \edef\original@xcode{%
           \catcode`\noexpand\:=\the\catcode`\:\relax%
           \catcode`\noexpand\;=\the\catcode`\;\relax%
           \catcode`\noexpand\!=\the\catcode`\!\relax%
           \catcode`\noexpand\?=\the\catcode`\?\relax}%
   \let\dospecials\french@dospecials%
   \let\@sanitize\french@sanitize%
   \def\"{\protect\french@dieresis}%
   \def\^{\protect\french@circumflex}%
   \french@active@punct%
   \def;{\protect\active@sc}%
   \def:{\protect\active@co}%
   \def!{\protect\active@em}%
   \def?{\protect\active@qm}%
   \let\active@sc\french@active@sc%
   \let\active@co\french@active@co%
   \let\active@em\french@active@em%
   \let\active@qm\french@active@qm%
   \let\ref\french@ref%
   \let\pageref\french@pageref%
   \let\cite\french@cite%
   \let\label\french@label%
   \let\newlabel\french@newlabel%
   \let\@testdef\french@@testdef%
   \let\@bibitem\french@@bibitem%
   \let\@lbitem\french@lbitem%
   \let\bibcite\french@bibcite%
       \frenchspacing\let\resetspacing\nonfrenchspacing%
}\endgroup
\begingroup\french@active@punct
\def\noextrasfrench{%
   \no@french@active@punct%
   \original@xcode;
   \let;\original@sc%
   \let:\original@co%
   \let!\original@em%
   \let?\original@qm%
   \let\active@sc\original@active@sc%
   \let\active@co\original@active@co%
   \let\active@em\original@active@em%
   \let\active@qm\original@active@qm%
   \let\"\original@dieresis%
   \let\^\original@circumflex%
   \let\dospecials\original@dospecials%
   \let\@sanitize\original@sanitize%
   \let\ref\original@ref%
   \let\pageref\original@pageref%
   \let\cite\original@cite%
   \let\label\original@label%
   \let\newlabel\original@newlabel%
   \let\@testdef\original@@testdef%
   \let\@bibitem\original@@bibitem%
   \let\@lbitem\original@lbitem%
   \let\bibcite\original@bibcite%
   \resetspacing%
}\endgroup
\def\french@active@sc{%
   \ifmmode%
     \string;%
   \else\relax%
     \ifhmode%
%       \ifdim\lastskip>\z@%
         \unskip\penalty\@M\,%
%       \fi%
     \fi%
     \string;%
   \fi}%
\def\french@active@co{\ifmmode\string:\else\relax%
   \ifhmode%\ifdim\lastskip>\z@%
   \unskip\penalty\@M\,%\fi
   \fi\string:\fi}
\def\french@active@em{\ifmmode\string!\else\relax%
   \ifhmode%\ifdim\lastskip>\z@%
   \unskip\penalty\@M\,%\fi
   \fi\string!\fi}
\def\french@active@qm{%
   \ifmmode\string?%
   \else\relax%
     \ifhmode%\ifdim\lastskip>\z@%
       \unskip\kern\fontdimen2\font%
       \kern-1.4\fontdimen3\font%
   \fi%\fi%
   \string?\fi}
\def\french@ref{\no@french@active@punct\@french@ref}
\def\@french@ref#1{\original@ref{#1}\french@active@punct}
\def\french@pageref{\no@french@active@punct\@french@pageref}
\def\@french@pageref#1{\original@pageref{#1}\french@active@punct}
\def\french@cite{\no@french@active@punct\@french@cite}
\def\@french@cite#1{\original@cite{#1}\french@active@punct}
\def\french@label{\no@french@active@punct\@french@label}
\def\@french@label#1{\original@label{#1}\french@active@punct}
\def\french@newlabel{\no@french@active@punct\@french@newlabel}
\def\@french@newlabel#1#2{\original@newlabel{#1}{#2}%
                         \french@active@punct}
\def\french@bibcite{\no@french@active@punct\@french@bibcite}
\def\@french@bibcite#1#2{\original@bibcite{#1}{#2}\french@active@punct}
\def\french@@bibitem{\no@french@active@punct\@french@@bibitem}
\def\@french@@bibitem#1{\original@@bibitem{#1}\french@active@punct}
\def\french@@lbitem{\no@french@active@punct\@french@@lbitem}
\def\@french@@lbitem#1{\original@@lbitem{#1}\french@active@punct}
\def\french@@testdef{\no@french@active@punct\@french@@testdef}
\def\@french@@testdef #1#2#3{\original@@testdef{#1}{#2}{#3}%
                            \french@active@punct}
\gdef\p@selectlanguage#1{\ifgreek\endgreek\fi\russianfalse
   \no@french@active@punct
   \@bsphack\input#1
 \expandafter\ifx\csname l@#1\endcsname\relax
   \@nolanerr{#1}
 \else
   \language=\csname l@#1\endcsname\relax
   \l@nguage=\csname l@#1\endcsname\relax
   \originalTeX\mdqon
   \edef\languagename{#1}
   \expandafter\def\expandafter\originalTeX
       \expandafter{\csname noextras#1\endcsname
                    \let\originalTeX\empty}
   \babel@beginsave
   \csname captions#1\endcsname
   \csname date#1\endcsname
   \csname extras#1\endcsname\relax
 \fi}
\gdef\iflanguage#1#2#3{\@bsphack\@ifundefined{l@#1}{#3}
   {\ifnum\l@nguage=\csname l@#1\endcsname\relax#2\else#3\fi\@esphack}}
%    \end{macrocode}
%    Because of their non roman alphabets I shall have to  put in Greek
%    and Russian here.  For the convenience of editing I also defined a
%    special ibmkbd.sty that could be input separately and since we are
%    inputting now anyway I could as well add some other useful styles.
%    However, if you do not have or want to use these styles, you can
%    skip them.
%    For that reason I define the command \verb=\inputstyle= which loads a
%    style file only if it exists.
%    \begin{macrocode}
\gdef\inputstyle#1{\openin1 #1.sty \ifeof1
  \typeout{! I can't find file `#1.sty'.}
  \else\closein1 \relax\input{#1.sty}\fi}
\inputstyle{ibmkbd}   % for an extended keyboard
\inputstyle{picins}   % to insert pictures (in columns)
\inputstyle{setspace} % to manipulate interline spacing
\inputstyle{logos}    % some frequently used logos
\inputstyle{rgreek}
\inputstyle{cmcyr}
\gdef\dutchTeX{\selectlanguage{dutch}}
\gdef\frenchTeX{\selectlanguage{french}}
\gdef\germanTeX{\selectlanguage{german}}
\gdef\greekTeX{\selectlanguage{greek}}
\gdef\cyrTeX{\selectlanguage{russian}}
\gdef\english{\selectlanguage{english}}
\gdef\English{\selectlanguage{english}}
\global\let\dutch\dutchTeX
\global\let\french\frenchTeX
\global\let\german\germanTeX
\global\let\greek\greekTeX
\global\let\russian\cyrTeX
\global\let\Dutch\dutchTeX
\global\let\French\frenchTeX
\global\let\German\germanTeX
\global\let\Greek\greekTeX
\global\let\Russian\cyrTeX
%
%    \end{macrocode}
%
%    Some people call French Francais [sic].  Now, if language French
%    is not defined, neither is Francais, we can just relax.  But if
%    French is not defined, but Francais is I would French like to be
%    Francais so I can use its hyphenation patterns.  Otherwise, if
%    Francais is not defined, but French is I would Francais like to be
%    French.
%
%    \begin{macrocode}
\ifx\undefined\l@french
 \ifx\undefined\l@francais
\else
 \global\let\l@french\l@francais
 \fi
\fi
\ifx\undefined\l@francais
 \ifx\undefined\l@french
\else
 \global\let\l@francais\l@french
 \fi
\fi
\mlbibfilename{ml}
%    \end{macrocode}
%
% \section{Some corrections on the NFSS}
%
%    Since I am using the NFSS as my default and since I think the
%    capability to use different fonts should be part of a multilingual
%    system I include some corrections on the NFSS I found while using it.
%
%    \begin{macrocode}
\global\let\mathit\mit
\expandafter\ifx\csname selectfont\endcsname\relax\else
\gdef\ly{\family{lasy}\selectfont}
\gdef\tensf{\family{cmss}\series{m}\shape{n}\size{10}{13pt}\selectfont}
\gdef\tensl{\family{cmsl}\series{m}\shape{n}\size{10}{12pt}\selectfont}
\fi
\selectlanguage{english}
%    \end{macrocode}
%
% \Finale
\endinput