summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/multitoc/multitoc.sty
blob: 4978376998a3429ab7b323829235b8f357920a41 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%%
%% This is file `multitoc.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% multitoc.dtx  (with options: `package')
%% Copyright (C) 1998–1999 Martin Schröder, 2024 Marei Peischl (peiTeX)  <marei@peitex.de>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% 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
%% Marei Peischl <marei@peitex.de>.
%% 
%% This work consists of the files multitoc.dtx and multitoc.ins
%% and the derived file multitoc.sty.
%% 
%% \iffalse meta-comment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[2015-09-18]
\ProvidesPackage{multitoc}
        [2024/06/13 v2.02 MultiToc Package]
\RequirePackage{multicol}
\RequirePackage{ifthen}
\newcommand{\multicolumntoc}{2}
\newcommand{\multicolumnlot}{2}
\newcommand{\multicolumnlof}{2}
\newboolean{@multitoc@toc}
\newboolean{@multitoc@lot}
\newboolean{@multitoc@lof}
\DeclareOption{toc}{\setboolean{@multitoc@toc}{true}}
\DeclareOption{lot}{\setboolean{@multitoc@lot}{true}}
\DeclareOption{lof}{\setboolean{@multitoc@lof}{true}}
\ProcessOptions\relax
\let\@multitoc@starttoc\@starttoc
\ExplSyntaxOn
\renewcommand*{\@starttoc}[1]{%
\clist_if_in:nnTF {toc,lof,lot} {#1} {
\ifthenelse{\boolean{@multitoc@#1}}{
\begin{multicols}{\use:c{multicolumn#1}}%
\@multitoc@starttoc{#1}%
\end{multicols}
}{
\@multitoc@starttoc{#1}
}
}{
\@multitoc@starttoc{#1}
}
}
\ExplSyntaxOff
\newcommand*{\protected@write@immediate}[3]{%
      \begingroup
       \let\thepage\relax
       #2%
       \let\protect\string
       \edef\reserved@a{\immediate\write#1{#3}}%
       \reserved@a
      \endgroup
      \if@nobreak\ifvmode\nobreak\fi\fi
   }
\newcommand*{\immediateaddtocontents}[2]{%
  \protected@write@immediate\@auxout
      {\let\label\@gobble \let\index\@gobble \let\glossary\@gobble}%
      {\string\@writefile{#1}{#2}}}
\endinput
%%
%% End of file `multitoc.sty'.