summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ltxdockit/ltxdockit.def
blob: d4ba31f4e466c81f737c5e021a74d86f65c65e9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% $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