\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{babel.tex}%
  [2006/06/02 v1.0 Driver file for babel.drv (HO)]
%
% Copyright 2006 Heiko Oberdiek
%
% This file is part of project `latex-tds'.
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% 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.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Heiko Oberdiek.
%
% See `readme.txt' for a list of all files belonging to the
% project `latex-tds' and additional information.
%
\makeatletter

% There are a lot of unnumbered sections `References'
% among numbered sections. That looks too poor.
\PassOptionsToPackage{numbered}{hypdoc}

% The first environment `thebibliography' belongs to babel.dtx,
% but the following are part of the other language definition files.
% Thus we must move the \section to the \subsection level here.
\newif\if@FirstBib
\@FirstBibtrue
\AtBeginDocument{%
  \let\Saved@TheBibliography\thebibliography
  \let\thebibliography\New@TheBibliography
  \renewcommand*{\l@subsection}{%
    % \@dottedtocline{2}{1.5em}{2.3em}% article.cls, 10pt
    \@dottedtocline{2}{1.5em}{2.8em}%
  }%
  \renewcommand*{\l@subsubsection}{%
    % \@dottedtocline{3}{3.8em}{3.2em}% article.cls, 10pt
    \@dottedtocline{3}{4.3em}{3.7em}%
  }%
  \renewcommand*{\@pnumwidth}{2.05em}% 1.55em, article.cls, 10pt
  \addtocontents{toc}{\protect\sloppy}%
  \let\saved@multicols\multicols
  \def\multicols#1{%
    \ifnum#1=2 %
      \let\endmulticols\relax
      \expandafter\@gobble
    \else
      \expandafter\@firstofone
    \fi
    {%
      \saved@multicols{#1}%
    }%
  }%
}
\def\New@TheBibliography{%
  \if@FirstBib
    \global\@FirstBibfalse
  \else
    \def\section{\subsection}%
  \fi
  \Saved@TheBibliography
}

% Add bookmark for `Change History'
\AtBeginDocument{%
  \let\Saved@TheGlossary\theglossary
  \let\theglossary\New@TheGlossary
}
\def\New@TheGlossary{%
  \clearpage
  \pdfbookmark[1]{Change History}{gloss}%
  \Saved@TheGlossary
}

% Index not numbered
\AtBeginDocument{%
  \let\Saved@TheIndex\theindex
  \let\theindex\New@TheIndex
}
\def\New@TheIndex{%
  \csname HD@numberedfalse\endcsname
  \Saved@TheIndex
}
\makeatother

\input{babel.drv}
\endinput
