%
% Dutch DOCUMENT-STYLE option -- Version 1.0 released 3 may 1989
%
% for LaTeX version 2.09
% Copyright (C) 1989 by Johannes Braams, PTT Research Neher Laboratories
%
%-
\typeout{Document Style Option `Dutch' V 1.0;  Released 3 may 1989}
%
%
% This file is implemets a dutch style option, which replaces
% all the text-generating commands in the standard LaTeX styles
% whith parametrized versions. These commands use the parameter \xxxname
% for the text. The varous \xxxname's can be defined for a set of
% languages. It is possible to switch the language within a document.
%
% It can be called via
%    \documentstyle[dutch]{anystyle}
% where anystyle can be one of article, report, book or letter
%
% It was created using the instructions in the standard document styles
% and having in mind integration with the `german' style option
% created by Huber Partl.
% During the development ideas from Nico Poppelier have been implemented.
% Also the idea's used in Piet van Oostrums NL.sty have been used.
%
%-
%    ****************************************
%    *           TEXT COMMANDS              *
%    ****************************************
%+
%    Define all the text-generating commands, they get enabled with
%    the commands \captionsenglish, \captionsdutch,
%                 \dateUSenglish, \dateenglish, \datedutch
%-
\gdef\captionsenglish{%
\def\refname{References}%
\def\abstractname{Abstract}%
\def\bibname{Bibliography}%
\def\chaptername{Chapter }% An extra space is needed here unfortunately because
\def\appendixname{Appendix }% of the extra macro evaluation via \@chapapp
\def\contentsname{Contents}%
\def\listfigurename{List of Figures}%
\def\listtablename{List of Tables}%
\def\indexname{Index}%
\def\figurename{Figure}%
\def\tablename{Table}%
\def\partname{Part}%
\def\enclname{encl}%
\def\ccname{cc}%
\def\headpagename{Page}%
\def\headtoname{To}}
%
\gdef\captionsdutch{%
\def\refname{Referenties}%
\def\abstractname{Samenvatting}%
\def\bibname{Bibliografie}%
\def\chaptername{Hoofdstuk }%
\def\appendixname{Bijlage }%
\def\contentsname{Inhoudsopgave}%
\def\listfigurename{Lijst van figuren}%
\def\listtablename{Lijst van tabellen}%
\def\indexname{Index}%
\def\figurename{Figuur}%
\def\tablename{Tabel}%
\def\partname{Deel}%
\def\enclname{Bijlage(n):}%
\def\ccname{Ter attentie van:}%
\def\headpagename{Pagina}%
\def\headtoname{Aan:}}
%+
%    Define similar commands for the date:
%-
\gdef\dateUSenglish{\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space\number\day, \number\year}}
%
\gdef\dateenglish{\def\today{\ifcase\day\or
  1st\or 2nd\or 3rd\or 4th\or 5th\or
  6th\or 7th\or 8th\or 9th\or 10th\or
  11th\or 12th\or 13th\or 14th\or 15th\or
  16th\or 17th\or 18th\or 19th\or 20th\or
  21st\or 22nd\or 23rd\or 24th\or 25th\or
  26th\or 27th\or 28th\or 29th\or 30th\or
  31st\fi~\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space \number\year}}
%
\gdef\datedutch{\def\today{\number\day~\ifcase\month\or
  januari\or februari\or maart\or april\or mei\or juni\or juli\or
  augustus\or september\or oktober\or november\or december\fi
  \space \number\year}}
%    ****************************************
%    *          STYLE COMMANDS              *
%    ****************************************
%
%+
%    First try to find out which is the main documentstyles
%    for the standard styles we know:
%        article         : \chapter and \opening is undefined
%        report and book : \chapter defined and \opening is undefined
%        letter          : \chapter undefined and \opening is defined
%        the commands for report and book are the same, so no problem there
%
%    We define a parameter to identify the style \doc@style
%    then the following if-construct gives us the needed info
%
%    IF undefined (opening) THEN
%      IF undefined (chapter) THEN
%        this is article.sty
%      ELSE
%        this is report or book.sty
%      FI
%    ELSE
%      this is letter.sty
%    FI
%-
\@ifundefined{doc@style}{\def\doc@style{0}% kludge to get ntg1.sty to work
\@ifundefined{opening}
{\@ifundefined{chapter}{\def\doc@style{1}}{\def\doc@style{2}}}
{\def\doc@style{3}} }{\relax}
%+
%    The letter documentstyle has \if@restonecol *NOT* defined
%    This resulted in a message about too many }'s
%    Soo, define it now.
%    The switch is used in the definitions of \tableofcontents,
%    \listoffigures and \listoftables
%-
\newif\if@restonecol
%+
%    Redefine all the commands that generate text in the output
%
%    Used by all
%-
% figure and table environments:
\def\fnum@figure{\figurename{} \thefigure}
%
\def\fnum@table{\tablename{} \thetable}
%+
%    Now the rest is different for each style
%-
\ifcase \doc@style\relax
\or
%+
%    The following are redefinitions for the article style, which
%    lacks the \chapter and \opening commands (thanx PvO, NP)
%-
%\typeout{redefining commands for the article document style}
%
% \tableofcontents:
\def\tableofcontents{\section*{\contentsname
  \@mkboth{\uppercase\expandafter{\contentsname}}
          {\uppercase\expandafter{\contentsname}}}
  \@starttoc{toc}}
%
% \listoffigures:
\def\listoffigures{\section*{\listfigurename\@mkboth
  {\uppercase\expandafter{\listfigurename}}
  {\uppercase\expandafter{\listfigurename}}}\@starttoc{lof}}
%
% \listoftables:
\def\listoftables{\section*{\listtablename\@mkboth
  {\uppercase\expandafter{\listtablename}}
  {\uppercase\expandafter{\listtablename}}}\@starttoc{lot}}
%
% \thebibliography:
\def\thebibliography#1{\section*{\refname\@mkboth
  {\uppercase\expandafter{\refname}}{\uppercase\expandafter{\refname}}}\list
  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumi}}
    \def\newblock{\hskip 0.11em plus 0.33em minus 0.07em}
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax}
%
%\theindex:
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@
\columnsep 35pt\twocolumn[\section*{\indexname}]
  \@mkboth{\uppercase\expandafter{\indexname}}
          {\uppercase\expandafter{\indexname}}\thispagestyle{plain}
  \parindent\z@ \parskip\z@ plus 0.3pt\relax\let\item\@idxitem}
%
% abstract environment:
\def\abstract{\if@twocolumn
\section*{\abstractname}
\else \small
\begin{center}
{\bf \abstractname\vspace{-0.5em}\vspace{0pt}}
\end{center}
\quotation
\fi}
%
% \part
\def\@part[#1]#2{\ifnum \c@secnumdepth >\m@ne    % IF secnumdepth > -1
        \refstepcounter{part}                    %  THEN step part counter
        \addcontentsline{toc}{part}{\thepart     %       add toc line
        \hspace{1em}#1}\else                     %  ELSE add unnumbered line
      \addcontentsline{toc}{part}{#1}\fi         % FI
   { \parindent 0pt \raggedright
    \ifnum \c@secnumdepth >\m@ne   % IF secnumdepth > -1
      \Large \bf \partname{} \thepart     %   THEN Print 'Part' and
      \par \nobreak                %          number in \Large boldface.
    \fi                            % FI
    \huge \bf                      % Select \huge boldface.
    #2\markboth{}{}\par }          % Print title and set heading marks null.
    \nobreak                       % TeX penalty to prevent page break.
    \vskip 3ex                     % Space between title and text.
   \@afterheading                  % Routine called after part and
    }                              %     section heading.
%
\or
%+
%    The following are redefinitions for the report and book styles
%    which have the \chapter command (thanx PvO)
%-
%\typeout{redefining commands for the report and book document styles}
%
% \tableofcontents:
\def\tableofcontents{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\contentsname\@mkboth
   {\uppercase\expandafter{\contentsname}}
   {\uppercase\expandafter{\contentsname}}}
  \@starttoc{toc}\if@restonecol\twocolumn\fi}
%
% \listoffigures:
\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\listfigurename\@mkboth
  {\uppercase\expandafter{\listfigurename}}
  {\uppercase\expandafter{\listfigurename}}}\@starttoc{lof}\if@restonecol
  \twocolumn\fi}
%
% \listoftables:
\def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
  \fi\chapter*{\listtablename\@mkboth
  {\uppercase\expandafter{\listtablename}}
  {\uppercase\expandafter{\listtablename}}}\@starttoc{lot}\if@restonecol
  \twocolumn\fi}
%
% \thebibliography:
\def\thebibliography#1{\chapter*{\bibname\@mkboth
  {\uppercase\expandafter{\bibname}}{\uppercase\expandafter{\bibname}}}\list
  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumi}}
    \def\newblock{\hskip 0.11em plus 0.33em minus 0.07em}
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax}
%
%\theindex:
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@
\columnsep 35pt\twocolumn[\@makeschapterhead{\indexname}]
  \@mkboth{\uppercase\expandafter{\indexname}}
          {\uppercase\expandafter{\indexname}}\thispagestyle{plain}\parindent\z@
  \parskip\z@ plus 0.3pt\relax\let\item\@idxitem}
%
% abstract environment:
\def\abstract{\titlepage
\null\vfil
\begin{center}
{\bf \abstractname}
\end{center}}
%
% \chapter
\def\@chapapp{\chaptername}
%
% \appendix
\def\appendix{\par
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \def\@chapapp{\appendixname}
  \def\thechapter{\Alph{chapter}}}
%
% \part
\def\@part[#1]#2{\ifnum \c@secnumdepth >-2\relax  % IF secnumdepth > -2
        \refstepcounter{part}                     %   THEN step part counter
        \addcontentsline{toc}{part}{\thepart      %        add toc line
        \hspace{1em}#1}\else                      %   ELSE add unnumbered line
        \addcontentsline{toc}{part}{#1}\fi        % FI
   \markboth{}{}
   {\centering                       % %% added 19 Jan 88
    \ifnum \c@secnumdepth >-2\relax  % IF secnumdepth > -2
      \huge\bf \partname{} \thepart         %   THEN Print 'Part' and number
    \par                             %         in \huge bold.
    \vskip 20pt \fi                  %        Add space before title.
    \Huge \bf                        % FI
    #1\par}\@endpart}                % Print Title in \Huge bold.
%
\or
%+
%    The letter style has the \opening command defined,
%    so the following should work only for letters
%-
%\typeout{redefining commands for the letter document style}
%
% \cc
\def\cc#1{\par\noindent
\parbox[t]{\textwidth}{\@hangfrom{\rm  \ccname : }\ignorespaces #1\strut}\par}
%
%\encl
\def\encl#1{\par\noindent
\parbox[t]{\textwidth}{\@hangfrom{\rm  \enclname : }\ignorespaces #1\strut}\par}
%
% the headings
\def\ps@headings{\def\@oddhead{\sl \headtoname{} \ignorespaces\toname \hfil
  \@date \hfil \headpagename{} \thepage}\def\@oddfoot{}}
%
\fi
%    ****************************************
%    *         LANGUAGE SWITCHES            *
%    ****************************************
%
% \setlanguage{n}    to switch to the language specified by n, which
%                    should be one of the following command names:
%                    \austrian \french \english \german \USenglish;
%                    \dutch
%                    - this changes the date format, captions and (if
%                    ``multilingual TeX''is installed) hyphenation.
% \originalTeX       to restore everything to the original settings
%                    of TeX and LaTeX (well, almost everything).
%% \germanTeX         to re-activate the german settings.
% \englishTeX        to activate the english settings.
% \dutchTeX          to re-activate the dutch settings.
%
% \language         a count that is set by \setlanguage and can be used
%                   by document style declarations like
%                      \ifnum\language=\english .textengl.\else
%                      \ifnum\language=\german  .textgerm.\fi\fi
%                   and/or by M.Ferguson's ``Multilingual T^eX''.
%
\newcount\language % if not yet declared by Ferguson's ``Multilingual T^eX''
\newcount\USenglish  \global\USenglish=0
\newcount\german     \global\german=1
\newcount\austrian   \global\austrian=2
\newcount\french     \global\french=3
\newcount\english    \global\english=4
\newcount\dutch      \global\dutch=5
\gdef\setlanguage#1{\language #1\relax
  \expandafter\ifcase #1\relax
  \dateUSenglish  \captionsenglish   \or
  \dategerman     \captionsgerman    \or
  \dateaustrian   \captionsgerman    \or
  \datefrench     \captionsfrench    \or
  \dateenglish    \captionsenglish   \or
  \datedutch      \captionsdutch     \fi}
%
% \gdef\originalTeX{\mdqoff \umlauthigh \let\3\original@three
%   \setlanguage{\USenglish}}
% \gdef\germanTeX{\mdqon \umlautlow \let\3\ss
%   \setlanguage{\german}}
\gdef\originalTeX{\setlanguage{\USenglish}}
\gdef\englishTeX{\setlanguage{\english}}
\gdef\dutchTeX{\setlanguage{\dutch}}
%    ****************************************
%    *           INITIALIZATION             *
%    ****************************************
%
\dutchTeX
