% $Id: ltxdockit.def,v 1.2a 2010/02/12 20:20:16 lehman stable $

\ProvidesFile{ltxdockit.def}
[\ltd@rcsid $Id: ltxdockit.def,v 1.2a 2010/02/12 20:20:16 lehman stable $
 ltxdockit pre-configuration (DFSG-free)]

\RequirePackage{etoolbox}

\PassOptionsToClass{11pt,a4paper,DIV9,listof=totoc,listof=flat}{scrartcl}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
\ProcessOptions*
\LoadClass{scrartcl}

% patches

\newcommand*{\AtBeginToc}{\g@addto@macro\@begintochook}
\newcommand*{\AtEndToc}{\g@addto@macro\@endtochook}
\newcommand*{\@begintochook}{}
\newcommand*{\@endtochook}{}
\@onlypreamble\AtBeginToc
\@onlypreamble\AtEndToc
\newcommand*{\AtBeginLot}{\g@addto@macro\@beginlothook}
\newcommand*{\AtEndLot}{\g@addto@macro\@endlothook}
\newcommand*{\@beginlothook}{}
\newcommand*{\@endlothook}{}
\@onlypreamble\AtBeginLot
\@onlypreamble\AtEndLot

\pretocmd\@starttoc{\csuse{@begin#1hook}}{}{}
\apptocmd\@starttoc{\csuse{@end#1hook}}{}{}

\AtBeginToc{\multicolsep\z@\begin{multicols}{2}}
\AtEndToc{\end{multicols}}
\AtBeginLot{\multicolsep\z@\begin{multicols}{2}}
\AtEndLot{\end{multicols}}

\endinput
