% $Id: ltxdockit.def,v 1.2d 2011/03/25 20:33:14 lehman stable $

\ProvidesFile{ltxdockit.def}
[\ltd@rcsid $Id: ltxdockit.def,v 1.2d 2011/03/25 20:33:14 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}
\@onlypreamble\AtBeginToc
\@onlypreamble\AtEndToc
\newcommand*{\@begintochook}{}
\newcommand*{\@endtochook}{}

\newcommand*{\AtBeginLot}{\g@addto@macro\@beginlothook}
\newcommand*{\AtEndLot}{\g@addto@macro\@endlothook}
\@onlypreamble\AtBeginLot
\@onlypreamble\AtEndLot
\newcommand*{\@beginlothook}{}
\newcommand*{\@endlothook}{}

\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
