Debian Codegraph @

texmf-dist/tex/latex/koma-script/tocbasic.sty

raw
1 %%
2 %% This is file `tocbasic.sty',
3 %% generated with the docstrip utility, extended by scrdocstrip.
4 %%
5 %% The original source files were:
6 %%
7 %% tocbasic.dtx (with options: `package,identify')
8 %% tocbasic.dtx (with options: `package,prepare')
9 %% tocbasic.dtx (with options: `package,option')
10 %% tocbasic.dtx (with options: `package,execoption')
11 %% tocbasic.dtx (with options: `package,preparebody')
12 %% tocbasic.dtx (with options: `package,body,deprecated')
13 %% scrkernel-tocstyle.dtx (with options: `package,body')
14 %% scrkernel-tocstyle.dtx (with options: `package,style,gobble')
15 %% scrkernel-tocstyle.dtx (with options: `package,style,dottedtocline')
16 %% scrkernel-tocstyle.dtx (with options: `package,style,undottedtocline')
17 %% scrkernel-tocstyle.dtx (with options: `package,style,largetocline')
18 %% scrkernel-tocstyle.dtx (with options: `package,style,tocline')
19 %% scrkernel-tocstyle.dtx (with options: `package,style,toctext')
20 %% scrkernel-tocstyle.dtx (with options: `package,style,default')
21 %% tocbasic.dtx (with options: `package,exit')
22 %% scrlogo.dtx (with options: `logo')
23 %%
24 %% Copyright (c) 2008-2026 Markus Kohm [komascript at gmx info]
25 %%
26 %% This file was generated from file(s) of the KOMA-Script bundle.
27 %% ---------------------------------------------------------------
28 %%
29 %% It may be distributed under the conditions of the
30 %% LaTeX Project Public License in the version distributed together
31 %% with KOMA-Script, see file `lppl.txt' or `lppl-de.txt'.
32 %%
33 %% This file may only be distributed together with a copy of the
34 %% KOMA-Script bundle. You may however distribute the
35 %% KOMA-Script bundle without all such generated files. See also
36 %% `lppl.txt' or `lppl-de.txt' for additional information.
37 %%
38 %% The list of files belonging to KOMA-Script distribution is given in
39 %% the file `MANIFEST.md'. See also `lppl.txt' or `lppl-de.txt' for
40 %% additional information.
41 %%
42 %% If this file is a beta version, you may not be allowed to distribute
43 %% it. Look at the comments below to see if this is the case.
44 %%
45 %% English and German manuals are part of KOMA-Script bundle.
46 %% ----------------------------------------------------------
47 %%
48 %% See `README'.
49 %%
50 %% The KOMA-Script bundle (but maybe not this file) was based upon the
51 %% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
52 %% standard classes created by The LaTeX3 Project 1994-1996. You can
53 %% find a complete unmodified copy of LaTeX2e at
54 %% <http://mirror.ctan.org/tex-archive/macros/latex/base/>.
55 %%
56 %%% From File: $Id: tocbasic.dtx 4251 2025-12-31 10:31:49Z kohm $
57 %%% (run: identify)
58 \NeedsTeXFormat{LaTeX2e}[2022/06/01]
59 \ProvidesPackage{tocbasic}[%
60 2026/02/02 v3.49.2 KOMA-Script
61 package
62 (handling toc-files)%
63 ]
64 %%% From File: $Id: tocbasic.dtx 4251 2025-12-31 10:31:49Z kohm $
65 %%% (run: prepare)
66 \newif\if@tocbasic@old@latex@found
67 \ifnum 0=\ifcsname IfFormatAtLeastTF\endcsname
68 \IfFormatAtLeastTF{2022-06-01}{1}{0}
69 \else
70 0
71 \fi\relax
72 \PackageWarningNoLine{tocbasic}{%
73 LaTeX kernel too old!\MessageBreak
74 For full functionality the package needs at least\MessageBreak
75 LaTeX 2022-06-01.\MessageBreak
76 You are using an older LaTeX version.\MessageBreak
77 So the functionality will be limited.\MessageBreak
78 Note that this also can result in error messages,\MessageBreak
79 that would not raise with an up-to-date LaTeX%
80 }
81 \@tocbasic@old@latex@foundtrue
82 \fi
83 \RequirePackage{scrbase}
84 \scr@ifundefinedorrelax{NewDocumentCommand}{%
85 \RequirePackage{xparse}[2018-04-12]%
86 }{}
87 \IfClassLoadedTF{beamer}{%
88 \PackageWarningNoLine{tocbasic}{%
89 beamer class detected,\MessageBreak
90 loading package tocbasic aborted%
91 }%
92 \DeclareOption*{}
93 \ProcessOptions
94 \endinput
95 }{}
96 %%% From File: $Id: tocbasic.dtx 4251 2025-12-31 10:31:49Z kohm $
97 %%% (run: option)
98 \if@tocbasic@old@latex@found\else
99 \ExplSyntaxOn
100
101 \bool_new:N \g__tocbasic_patch_all_bool
102 \bool_new:N \g__tocbasic_patch_starttoc_bool
103 \bool_new:N \g__tocbasic_patch_chapter_bool
104 \bool_new:c { g__tocbasic_patch_chapter*_bool }
105 \bool_new:N \g__tocbasic_patch_listoffigures_bool
106 \bool_new:N \g__tocbasic_patch_listoftables_bool
107
108 \bool_new:N \g__tocbasic_patch_caption_bool
109 \keys_define:nn { tocbasic }
110 {
111 enablepatch .code = \__tocbasic_endisable_patch:nn {#1} \c_true_bool,
112 enablepatch .usage = preamble,
113 enablepatch .value_required:n = true,
114 disablepatch .code = \__tocbasic_endisable_patch:nn {#1} \c_false_bool,
115 disablepatch .usage = preamble,
116 disablepatch .value_required:n = true,
117 }
118
119 \msg_new:nnnn { tocbasic } { unknown-patch }
120 {
121 \text_uppercase:n #1bling~of~unknown~patch~#2~ignored.
122 }
123 {
124 You've~tried~to~#1able~patch~#2,~
125 but~this~is~not~a~known~patch.~
126 Because~of~this~your~attempt~is~ignored.~
127 See~the~KOMA-Script~user~manual~for~more~information~about~known~patches.
128 }
129
130 \cs_new:Nn \__tocbasic_endisable_patch:nn
131 {
132 \clist_map_inline:nn { #1 }
133 {
134 \cs_if_exist:cTF { g__tocbasic_patch_##1_bool }
135 {
136 \bool_set_eq:cN { g__tocbasic_patch_##1_bool } #2
137 }
138 {
139 \exp_args:Nnnx \msg_warning:nnnn { tocbasic } { unknown-patch }
140 { \bool_if:NTF #2 { en } { dis } } { ##1 }
141 }
142 }
143 }
144
145 \ExplSyntaxOff
146 \fi
147 \if@tocbasic@old@latex@found\else
148 \ExplSyntaxOn
149 \bool_new:N \g__tocbasic__caption_above_bool
150 \cs_new:Nn \tocbasic_define_caption_keys:n
151 {
152 \keys_if_exist:nnF { tocbasic } { #1captionabove }
153 {
154 \keys_define:nn { tocbasic }
155 {
156 #1captionabove .choice:,
157 #1captionabove / true .code:n =
158 { \__tocbasic_set_caption_position_top_bottom:nn { #1 } { t } },
159 #1captionabove / false .code:n =
160 { \__tocbasic_set_caption_position_top_bottom:nn { #1 } { b } },
161 #1captionabove / unknown .code:n =
162 { \msg_error:nne { keys } { boolean-values-only } \l_keys_path_str },
163 #1captionabove .usage:n = general,
164 #1captionabove .default:n = true,
165 #1captionbelow .choice:,
166 #1captionbelow / true .code:n =
167 { \__tocbasic_set_caption_position_top_bottom:nn { #1 } { b } },
168 #1captionbelow / false .code:n =
169 { \__tocbasic_set_caption_position_top_bottom:nn { #1 } { t } },
170 #1captionbelow / unknown .code:n =
171 { \msg_error:nne { keys } { boolean-values-only } \l_keys_path_str },
172 #1captionbelow .usage:n = general,
173 #1captionbelow .default:n = true,
174 #1captionposition .choice:,
175 #1captionposition / top .code:n =
176 { \__tocbasic_set_caption_position_top_bottom:nn { #1 } { t } },
177 #1captionposition / bottom .code:n =
178 { \__tocbasic_set_caption_position_top_bottom:nn { #1 } { b } },
179 #1captionposition .usage:n = general,
180 #1captionposition .value_required:n = true,
181 }
182 \str_if_empty:nF { #1 }
183 {
184 \keys_define:nn { tocbasic }
185 {
186 #1captionposition / default .code:n =
187 { \__tocbasic_set_caption_position_top_bottom:nn { #1 } { default } },
188 #1captionposition .initial:n = default
189 }
190 }
191 \cs_if_exist:NTF \captionsetup
192 {
193 \bool_if_exist:cTF { g__tocbasic_ #1 _caption_above_bool }
194 {
195 \exp_last_unbraced:Ne \captionsetup
196 {
197 \str_if_empty:nF {#1} {[#1]}
198 {
199 #1position=
200 { \bool_if:cTF { g__tocbasic_ #1 _caption_above_bool } tb }
201 }
202 }
203 }
204 {
205 \tl_if_exist:cT { caption@opt@#1 }
206 {
207 \tl_if_empty:cF { caption@opt@#1 }
208 { \clearcaptionsetup[position]{#1} }
209 }
210 }
211 }
212 {
213 \tl_if_eq:VnT \everypar { \@nodocument }
214 {
215 \str_if_in:nnTF { ,table,figure,, } { ,#1, }
216 {
217 \exp_args:Ne \PassOptionsToPackage
218 {
219 #1position=
220 \bool_if_exist:cTF { g__tocbasic_ #1 _caption_above_bool }
221 { \bool_if:cTF { g__tocbasic_ #1 _caption_above_bool } tb }
222 { default }
223 }
224 { caption }
225 }
226 {
227 \hook_gput_code:nnn { package / caption / after } { tocbasic }
228 {
229 \bool_if_exist:cT { g__tocbasic_ #1 _caption_above_bool }
230 {
231 \exp_last_unbraced:Ne \captionsetup
232 {
233 \str_if_empty:nF {#1} {[#1]}
234 { position=\bool_if:cTF { g__tocbasic_ #1 _caption_above_bool } tb }
235 }
236 }
237 }
238 }
239 }
240 }
241 }
242 }
243 \cs_new:Nn \__tocbasic_set_caption_position_top_bottom:nn
244 {
245 \str_if_eq:nnTF { #2 } { default }
246 {
247 \bool_if_exist:cT { g__tocbasic_ #1 _caption_above_bool }
248 { \cs_undefine:c { g__tocbasic_ #1 _caption_above_bool } }
249 \cs_if_exist:NTF \clearcaptionsetup
250 {
251 \tl_if_exist:cT { caption@opt@#1 }
252 {
253 \tl_if_empty:cF { caption@opt@#1 }
254 { \clearcaptionsetup[position]{ #1 } }
255 }
256 }
257 {
258 \tl_if_eq:VnT \everypar { \@nodocument }
259 {
260 \str_if_in:nnT { ,table,figure,, } { ,#1, }
261 {
262 \PassOptionsToPackage { #1position=#2 } { caption }
263 }
264 }
265 }
266 }
267 {
268 \bool_if_exist:cF { g__tocbasic_ #1 _caption_above_bool }
269 { \bool_new:c { g__tocbasic_ #1 _caption_above_bool } }
270 \str_if_eq:nnTF { #2 } { t }
271 { \bool_set_true:c }
272 { \bool_set_false:c }
273 { g__tocbasic_ #1 _caption_above_bool }
274 \cs_if_exist:NTF \captionsetup
275 {
276 \exp_last_unbraced:Ne \captionsetup
277 { \str_if_empty:nF {#1} {[#1]} }
278 { position=#2 }
279 }
280 {
281 \tl_if_eq:VnT \everypar { \@nodocument }
282 {
283 \str_if_in:nnT { ,table,figure,, } { ,#1, }
284 {
285 \PassOptionsToPackage { #1position=#2 } { caption }
286 }
287 }
288 }
289 }
290 }
291 \tocbasic_define_caption_keys:n {}
292 \clist_map_inline:nn { table, figure }
293 {
294 \bool_if:nT
295 {
296 { \cs_if_exist_p:c { #1 } && \cs_if_exist_p:c { end#1 } }
297 ||
298 { \cs_if_exist_p:c { #1- } && \cs_if_exist_p:c { end#1- } }
299 }
300 {
301 \tocbasic_define_caption_keys:n { #1 }
302 }
303 }
304
305 \ExplSyntaxOff
306 \fi
307 %%% From File: $Id: tocbasic.dtx 4251 2025-12-31 10:31:49Z kohm $
308 %%% (run: execoption)
309 \if@tocbasic@old@latex@found
310 \ProcessOptions\relax
311 \else
312 \ProcessKeyOptions[tocbasic]
313 \fi
314 %%% From File: $Id: tocbasic.dtx 4251 2025-12-31 10:31:49Z kohm $
315 %%% (run: preparebody)
316 %%% From File: $Id: tocbasic.dtx 4251 2025-12-31 10:31:49Z kohm $
317 %%% (run: body)
318 \if@tocbasic@old@latex@found\else
319 \ExplSyntaxOn
320 \msg_new:nnnn { tocbasic } { dangerous-patch }
321 {
322 Dangerous~#2~patch~enabled \str_if_empty:nF { #1 } { ~using~#1 } .
323 }
324 {
325 \str_if_empty:nF { #1 } { Class~#1~does~not~need~the~#2~patch.~ }
326 Using~this~patch~can~even~result~in~harm.~
327 If~you~are~not~sure~that~this~patch~is~needed,~
328 you~should~not~enable~it.~
329 Please,~see~the~KOMA-Script~user~manual~for~more~information~about~
330 the~#2~patch.
331 }
332
333 \AtBeginDocument
334 {
335
336 \bool_if:NT \g__tocbasic_patch_all_bool
337 {
338 \bool_set_true:N \g__tocbasic_patch_starttoc_bool
339 \cs_if_exist:NF \KOMAClassName
340 {
341 \bool_set_true:N \g__tocbasic_patch_chapter_bool
342 \bool_set_true:c { g__tocbasic_patch_chapter*_bool }
343 }
344 \bool_set_true:N \g__tocbasic_patch_listoffigures_bool
345 \bool_set_true:N \g__tocbasic_patch_listoftables_bool
346 \IfPackageLoadedTF{ caption } { }
347 { \bool_set_true:N \g__tocbasic_patch_caption_bool }
348 }
349
350 \bool_if:NT \g__tocbasic_patch_chapter_bool
351 {
352 \__tocbasic_chapter_patch_code:
353 }
354
355 \bool_if:NT \g__tocbasic_patch_starttoc_bool \tocbasicautomode
356
357 \bool_if:NT \g__tocbasic_patch_listoffigures_bool
358 {
359 \__tocbasic_listof_patch_code:n{figure}
360 }
361
362 \bool_if:NT \g__tocbasic_patch_listoftables_bool
363 {
364 \__tocbasic_listof_patch_code:n{table}
365 }
366
367 }
368
369 \ExplSyntaxOff
370 \fi
371 \AfterPackage*{multitoc}{%
372 \@ifpackagelater{multitoc}{2022/02/10}{}{%
373 \PackageWarningNoLine{tocbasic}{%
374 Usage of package `multitoc' is not recommended!\MessageBreak
375 Note, this package generally results in empty ToCs\MessageBreak
376 for all extension but `toc', `lof' and `lot' and\MessageBreak
377 even for these extensions if you do not use the\MessageBreak
378 corresponding multitoc options.\MessageBreak
379 It is recommended to use:\MessageBreak
380 \space\space\string\usepackage{multicol}\MessageBreak
381 \space\space\string\BeforeStartingTOC{\string\begin{multicols}{2}}%
382 \MessageBreak
383 \space\space\string\AfterStartingTOC{\string\end{multicols}}%
384 \MessageBreak
385 instead of loading package `multitoc'.\MessageBreak
386 See the KOMA-Script manual for more information\MessageBreak
387 about using \string\BeforeStartingTOC\space and
388 \string\AfterStartingTOC\MessageBreak
389 and the multicol manual for more information\MessageBreak
390 about the `multicols' environment%
391 }%
392 }%
393 }
394 \newcommand*{\tb@listoftocs}{}
395 \providecommand*{\ifattoclist}{%
396 \PackageWarning{tocbasic}{Usage of deprecated command
397 `\string\ifattoclist'.\MessageBreak
398 The command has been renamed because of a\MessageBreak
399 recommendation of The LaTeX Project Team.\MessageBreak
400 Please replace `\string\ifattoclist' by `\string\Ifattoclist'%
401 }%
402 \Ifattoclist
403 }
404 \newcommand{\Ifattoclist}[1]{%
405 \begingroup
406 \def\do##1##2{%
407 \edef\reserved@a{##1}%
408 \ifx\reserved@a\reserved@b\@tempswatrue\fi
409 }%
410 \edef\reserved@b{#1}\@tempswafalse\tb@listoftocs
411 \if@tempswa\aftergroup\@firstoftwo\else\aftergroup\@secondoftwo\fi
412 \endgroup
413 }
414 \newcommand*{\tb@optowner}[1]{%
415 \IfValueTF{#1}{%
416 #1%
417 }{%
418 \ifx\@currname\@empty\else
419 \@currname.\@currext%
420 \fi
421 }%
422 }
423 \NewDocumentCommand\addtotoclist{om}{%
424 \edef\reserved@b{\tb@optowner{#1}}%
425 \Ifattoclist{#2}{%
426 \PackageError{tocbasic}{%
427 file extension `#2' cannot be used twice
428 }{%
429 File extension `#2' is already used by a toc-file, while
430 \ifx\relax#1\relax someone\else #2\fi\MessageBreak
431 tried to use it again for a toc-file.\MessageBreak
432 This may be either an incompatibility of packages, an error at a
433 package,\MessageBreak
434 or a mistake by the user.\MessageBreak
435 }%
436 }{%
437 \begingroup
438 \edef\reserved@a{%
439 \noexpand\g@addto@macro\noexpand\tb@listoftocs{%
440 \noexpand\do{#2}{\reserved@b}}}\reserved@a
441 \endgroup
442 \ifx\reserved@b\@empty\else
443 \@ifundefined{tb@\reserved@b @add@hook}{}{%
444 \edef\reserved@a{%
445 \noexpand\def\noexpand\@currext{#2}%
446 \noexpand\@nameuse{tb@\reserved@b @add@hook}%
447 \noexpand\def\noexpand\@currext{\@currext}%
448 }\reserved@a
449 }%
450 \fi
451 \edef\reserved@a{%
452 \noexpand\def\noexpand\@currext{#2}%
453 \noexpand\@nameuse{tb@@add@hook}%
454 \noexpand\def\noexpand\@currext{\@currext}%
455 }\reserved@a
456 }%
457 }
458 \newcommand*{\owneroftoc}[2][\@firstofone]{%
459 \begingroup
460 \let\reserved@a\endgroup
461 \def\do##1##2{\Ifstr{#2}{##1}{\def\reserved@a{\endgroup#1{##2}}}{}}%
462 \tb@listoftocs
463 \reserved@a
464 }
465 \newcommand*{\categoryoftoc}{\owneroftoc}
466 \NewDocumentCommand\AtAddToTocList{o}{%
467 \edef\reserved@a{\tb@optowner{#1}}%
468 \@ifundefined{tb@\reserved@a @add@hook}%
469 {\@namedef{tb@\reserved@a @add@hook}{}}%
470 {}%
471 \expandafter\g@addto@macro\csname tb@\reserved@a @add@hook\endcsname
472 }
473 \newcommand*{\tocbasic@extend@babel}[1]{%
474 \Iftocfeature{#1}{nobabel}{%
475 \PackageInfo{tocbasic}{omitting babel extension for `#1'\MessageBreak
476 because of feature `nobabel' available\MessageBreak
477 for `#1'}%
478 }{%
479 \scr@ifundefinedorrelax{bbl@set@language}{%
480 \PackageInfo{tocbasic}{omitting babel extension for `#1'\MessageBreak
481 because of missing \string\bbl@set@language}%
482 }{%
483 \scr@ifundefinedorrelax{BabelContentsFiles}{%
484 \PackageInfo{tocbasic}{setting babel extension for `#1'}%
485 \expandafter\gdef\expandafter\bbl@set@language
486 \expandafter##\expandafter1%
487 \expandafter{%
488 \bbl@set@language{##1}%
489 \addtocontents{#1}{\xstring\select@language{\languagename}}%
490 }%
491 }{%
492 \@expandtwoargs\in@{,#1,}{,\BabelContentsFiles,}%
493 \ifin@
494 \PackageInfo{tocbasic}{omitting babel extension for
495 `#1'\MessageBreak
496 because it is already in \string\BabelContentsFiles}%
497 \else
498 \PackageInfo{tocbasic}{setting babel extension for `#1'}%
499 \xdef\BabelContentsFiles{\BabelContentsFiles,#1}%
500 \fi
501 }%
502 }%
503 }%
504 }
505 \AtAddToTocList[]{\expandafter\tocbasic@extend@babel\expandafter{\@currext}}
506 \NewDocumentCommand\removefromtoclist{om}{%
507 \begingroup
508 \let\tb@oldlist\tb@listoftocs
509 \edef\reserved@b{#2}%
510 \global\let\tb@listoftocs\empty
511 \def\do##1##2{%
512 \edef\reserved@a{##1}%
513 \ifx\reserved@a\reserved@b
514 \IfValueT{#1}{%
515 \begingroup
516 \edef\@currext{##2}%
517 \edef\reserved@b{#1}%
518 \ifx\@currext\reserved@b
519 \else
520 \g@addto@macro\tb@listoftocs{\do{##1}{##2}}%
521 \fi
522 \endgroup
523 }%
524 \else
525 \g@addto@macro\tb@listoftocs{\do{##1}{##2}}%
526 \fi
527 }%
528 \tb@oldlist
529 \endgroup
530 }
531 \NewDocumentCommand\doforeachtocfile{o+m}{%
532 \IfValueTF{#1}{%
533 \def\do##1##2{%
534 \edef\reserved@a{#1}\edef\reserved@b{##2}%
535 \ifx\reserved@a\reserved@b \edef\@currext{##1}#2\fi
536 }%
537 }{%
538 \def\do##1##2{\edef\@currext{##1}#2}%
539 }%
540 \edef\reserved@a{%
541 \noexpand\tb@listoftocs
542 \noexpand\def\noexpand\@currext{\@currext}%
543 }\reserved@a
544 \let\do\noexpand
545 }
546 \NewDocumentCommand\addtoeachtocfile{o+m}{%
547 \doforeachtocfile[{#1}]{\addtocontents{\@currext}{#2}}%
548 }
549 \NewDocumentCommand\addcontentslinetoeachtocfile{omm}{%
550 \doforeachtocfile[{#1}]{\addcontentsline{\@currext}{#2}{#3}}%
551 }
552 \NewDocumentCommand\addxcontentsline{mmO{}m}{%
553 \scr@ifundefinedorrelax{add#2#1entry}{%
554 \tocbasic@addxcontentsline{#1}{#2}{#3}{#4}%
555 }{%
556 \@nameuse{add#2#1entry}{#3}{#4}%
557 }%
558 }
559 \newcommand*{\nonumberline}{}%
560 \newcommand*{\tocbasic@addxcontentsline}[4]{%
561 \IfArgIsEmpty{#3}{%
562 \addcontentsline{#1}{#2}{\protect\nonumberline#4}%
563 }{%
564 \addcontentsline{#1}{#2}{\protect\numberline{#3}#4}%
565 }%
566 }
567 \NewDocumentCommand\addxcontentslinetoeachtocfile{omom}{%
568 \doforeachtocfile[{#1}]{\addxcontentsline{\@currext}{#2}[{#3}]{#4}}
569 }
570 \if@tocbasic@old@latex@found\else
571 \ExplSyntaxOn
572 \cs_new:Npn \__tocbasic_chapter_patch_code:
573 {
574 \cs_if_exist:NTF \KOMAClassName
575 {
576 \exp_args:Nnnx \msg_warn:nnnn { tocbasic } { dangerous-patch }
577 { \KOMAClassName } { chapter }
578 }
579 {
580 \exp_args:Nnnx \msg_note:nnnn { tocbasic } { dangerous-patch }
581 { } { chapter }
582 }
583 \hook_gput_code:nnn { cmd/@makechapterhead/before } { tocbasic }
584 {
585 \doforeachtocfile[float]{
586 \addtocontents{\@currext}{\tocbasic@chapter@skip}
587 }
588 }
589 \bool_if:cT { g__tocbasic_patch_chapter*_bool }
590 {
591 \hook_gput_code:nnn { cmd/@makeschapterhead/before } { tocbasic }
592 {
593 \doforeachtocfile[float]{
594 \addtocontents{\@currext}{\tocbasic@chapter@skip}
595 }
596 }
597 }
598 \ProvideDocumentCommand \tocbasic@chapter@skip { } { \addvspace{10\p@} }
599 }
600 \ExplSyntaxOff
601 \fi
602 \newcommand*{\tocbasic@starttoc}[1]{%
603 \begingroup
604 \tocbasic@reentrant@warning
605 \def\tocbasic@reentrant@warning{%
606 \PackageWarning{tocbasic}{%
607 Loading one auxiliary file inside the setup context\MessageBreak
608 of another auxiliary file is not recommended.\MessageBreak
609 In this case settings for `\@currext' could also influence\MessageBreak
610 settings of `#1' and local states of `#1' can also\MessageBreak
611 influence local states of `\@currext'%
612 }%
613 }%
614 \edef\@currext{#1}%
615 \Iftocfeature{\@currext}{noparskipfake}{}{%
616 \ifvmode
617 \@tempskipa\lastskip
618 \vskip-\lastskip
619 \addtolength{\@tempskipa}{\parskip}%
620 \vskip\@tempskipa
621 \fi
622 }%
623 \setlength{\parskip}{\z@}%
624 \setlength{\parindent}{\z@}%
625 \setlength{\parfillskip}{\z@\@plus 1fil}%
626 \csname tocbasic@@before@hook\endcsname
627 \csname tb@#1@before@hook\endcsname
628 \@starttoc{#1}%
629 \BeforeClosingMainAux{%
630 \addtocontents{#1}{%
631 \string\providecommand\string\tocbasic@end@toc@file{}%
632 \string\tocbasic@end@toc@file
633 }%
634 }%
635 \edef\@currext{#1}%
636 \csname tb@#1@after@hook\endcsname
637 \csname tocbasic@@after@hook\endcsname
638 \endgroup
639 }
640 \newcommand*{\tocbasic@end@toc@file}{\par}
641 \newcommand*{\tocbasic@reentrant@warning}{}
642 \newcommand*{\tocbasic@@before@hook}{}
643 \newcommand*{\tocbasic@@after@hook}{}
644 \newcommand{\BeforeStartingTOC}[2][]{%
645 \ifx\relax#1\relax
646 \g@addto@macro\tocbasic@@before@hook{#2}%
647 \else
648 \@ifundefined{tb@#1@before@hook}{%
649 \expandafter\global\expandafter\let\csname tb@#1@before@hook\endcsname
650 \@empty
651 }{}%
652 \expandafter\g@addto@macro\csname tb@#1@before@hook\endcsname{#2}%
653 \fi
654 }
655 \newcommand{\AfterStartingTOC}[2][]{%
656 \ifx\relax#1\relax
657 \g@addto@macro\tocbasic@@after@hook{#2}%
658 \else
659 \@ifundefined{tb@#1@after@hook}{%
660 \expandafter\global\expandafter\let\csname tb@#1@after@hook\endcsname
661 \@empty
662 }{}%
663 \expandafter\g@addto@macro\csname tb@#1@after@hook\endcsname{#2}%
664 \fi
665 }
666 \newcommand*{\listoftoc}{%
667 \kernel@ifstar \tocbasic@starttoc\@listoftoc
668 }
669 \newcommand*{\@listoftoc}[2][]{%
670 \begingroup
671 \def\list@fname{#1}%
672 \@ifundefined{listof#2name}{%
673 \ifx\list@fname\@empty
674 \PackageWarning{tocbasic}{%
675 You should either define \expandafter\string\csname
676 listof#2name\endcsname\MessageBreak
677 or use the optional argument of \string\listoftoc\space\MessageBreak
678 to set the term to be used for the\MessageBreak
679 heading of list of #2}%
680 \def\list@fname{\listofname~#2}%
681 \fi
682 }{%
683 \expandafter\let\expandafter\list@fname\csname listof#2name\endcsname
684 }%
685 \edef\@currext{#2}%
686 \Iftocfeature{\@currext}{onecolumn}{%
687 \Iftocfeature{\@currext}{leveldown}{}{%
688 \if@twocolumn
689 \aftergroup\twocolumn\onecolumn
690 \fi
691 }%
692 }{}%
693 \Iftocfeature{\@currext}{numberline}{\def\nonumberline{\numberline{}}}{}%
694 \expandafter\tocbasic@listhead\expandafter{\list@fname}%
695 \scr@ifundefinedorrelax{microtypesetup}{}{%
696 \Iftocfeature{\@currext}{noprotrusion}{}{%
697 \microtypesetup{protrusion=false}%
698 \PackageInfo{tocbasic}{%
699 character protrusion at \@currext\space deactivated}%
700 }%
701 }%
702 \tocbasic@starttoc{#2}%
703 \endgroup
704 }
705 \if@tocbasic@old@latex@found\else
706 \ExplSyntaxOn
707 \cs_new:Nn \__tocbasic_listof_patch_code:n
708 {
709 \cs_set:cpn { listof#1s } { \exp_args:Nc \listoftoc { ext@#1 } }
710 \cs_if_exist:cF { listof \use:c { ext@#1 } name }
711 {
712 \cs_new:cpn { listof \use:c { ext@#1 } name }
713 { \use:c { list#1name } }
714 }
715 }
716 \ExplSyntaxOff
717 \fi
718 \IfPackageLoadedTF{tocbibind}{}{%
719 \AtBeginDocument{%
720 \IfPackageLoadedTF{tocbibind}{%
721 \PackageInfo{tocbasic}{usage of `tocbibind' detected}%
722 \newcommand*{\tb@tocbibindpatch}[3]{%
723 \long\def\reserved@a{\tocfile{#2}{#1} }%
724 \ifx #3\reserved@a
725 \PackageWarningNoLine{tocbasic}{%
726 `tocbibind' redefinition of `\string#3'\MessageBreak
727 detected.\MessageBreak
728 Note: Loading `tocbibind' without option `not#1'\MessageBreak
729 can break several features of `tocbasic'%
730 \scr@ifundefinedorrelax{KOMAClassName}{%
731 .\MessageBreak
732 Loading `tocbibind' before `tocbasic' would avoid\MessageBreak
733 this warning message%
734 }{}%
735 }%
736 \fi
737 }%
738 \tb@tocbibindpatch{toc}{\contentsname}{\tableofcontents}%
739 \tb@tocbibindpatch{lof}{\listfigurename}{\listoffigures}%
740 \tb@tocbibindpatch{lot}{\listtablename}{\listoftables}%
741 }{}%
742 }%
743 }
744 \newcommand*{\listofname}{List of}
745 \NewDocumentCommand\listofeachtoc{o}{%
746 \doforeachtocfile[{#1}]{\listoftoc{\@currext}}%
747 }
748 \providecommand*{\ext@toc}{toc}
749 \newcommand*{\tocbasic@listhead}[1]{%
750 \@ifundefined{tocbasic@listhead@\@currext}{%
751 \scr@ifundefinedorrelax{chapter}{%
752 \expandafter\def\csname tocbasic@listhead@\@currext\endcsname##1{%
753 \Iftocfeature{\@currext}{leveldown}{%
754 \Iftocfeature{\@currext}{numbered}{%
755 \subsection[##1]{##1}%
756 }{%
757 \subsection*{##1}%
758 \ifvmode\@tempcnta\lastpenalty\@tempskipa\lastskip\unskip\fi
759 \begingroup
760 \Iftocfeature{\@currext}{totoc}{%
761 \expandafter\addxcontentsline\expandafter{\ext@toc}%
762 {subsection}{##1}%
763 }{}%
764 \c@secnumdepth=-\maxdimen
765 \subsectionmark{##1}%
766 \endgroup
767 \ifvmode\penalty\@tempcnta\vskip\@tempskipa\fi
768 }%
769 }{%
770 \Iftocfeature{\@currext}{numbered}{%
771 \section[##1]{##1}%
772 }{%
773 \section*{##1}%
774 \ifvmode\@tempcnta\lastpenalty\@tempskipa\lastskip\unskip\fi
775 \begingroup
776 \Iftocfeature{\@currext}{totoc}{%
777 \expandafter\addxcontentsline\expandafter{\ext@toc}%
778 {section}{##1}%
779 }{}%
780 \@ifundefined{@mkdouble}{%
781 \@mkboth{\MakeMarkcase{##1}}{\MakeMarkcase{##1}}%
782 }{%
783 \@mkdouble{\MakeMarkcase{##1}}%
784 }%
785 \endgroup
786 \ifvmode\penalty\@tempcnta\vskip\@tempskipa\fi
787 }%
788 }%
789 }%
790 }{%
791 \expandafter\def\csname tocbasic@listhead@\@currext\endcsname##1{%
792 \Iftocfeature{\@currext}{leveldown}{%
793 \Iftocfeature{\@currext}{numbered}{%
794 \section{##1}%
795 }{%
796 \Iftocfeature{\@currext}{totoc}{%
797 \@ifundefined{addsec}{%
798 \section*{##1}%
799 \ifvmode\@tempcnta\lastpenalty\@tempskipa\lastskip\unskip\fi
800 \begingroup
801 \@ifundefined{@mkright}{%
802 \IfActiveMkBoth{\markright{\MakeMarkcase{##1}}}{}%
803 }{%
804 \@mkright{\MakeMarkcase{##1}}%
805 }%
806 \expandafter\addxcontentsline\expandafter{\ext@toc}%
807 {section}{##1}%
808 \endgroup
809 \ifvmode\penalty\@tempcnta\vskip\@tempskipa\fi
810 }{%
811 \addsec{##1}%
812 }%
813 }{%
814 \section*{##1}%
815 \ifvmode\@tempcnta\lastpenalty\@tempskipa\lastskip\unskip\fi
816 \begingroup
817 \@ifundefined{addsecmark}{%
818 \c@secnumdepth=-\maxdimen
819 \sectionmark{##1}%
820 }{%
821 \addsecmark{##1}%
822 }%
823 \endgroup
824 \ifvmode\penalty\@tempcnta\vskip\@tempskipa\fi
825 }%
826 }%
827 }{%
828 \Iftocfeature{\@currext}{numbered}{%
829 \chapter[##1]{##1}%
830 }{%
831 \chapter*{##1}%
832 \ifvmode\@tempcnta\lastpenalty\@tempskipa\lastskip\unskip\fi
833 \begingroup
834 \@ifundefined{@mkdouble}{%
835 \@mkboth{\MakeMarkcase{##1}}{\MakeMarkcase{##1}}%
836 }{%
837 \@mkdouble{\MakeMarkcase{##1}}%
838 }%
839 \Iftocfeature{\@currext}{totoc}{%
840 \expandafter\addxcontentsline\expandafter{\ext@toc}%
841 {chapter}{##1}%
842 }{}%
843 \endgroup
844 \ifvmode\penalty\@tempcnta\vskip\@tempskipa\fi
845 }%
846 }%
847 }%
848 }%
849 }{}%
850 \csname tb@@beforehead@hook\endcsname
851 \csname tb@\@currext @beforehead@hook\endcsname
852 \csname tocbasic@listhead@\@currext\endcsname{#1}%
853 \csname tb@\@currext @afterhead@hook\endcsname
854 \csname tb@@afterhead@hook\endcsname
855 }
856 \newcommand{\BeforeTOCHead}[2][]{%
857 \@ifundefined{tb@#1@beforehead@hook}{%
858 \expandafter\global\expandafter\let\csname tb@#1@beforehead@hook\endcsname
859 \@empty
860 }{}%
861 \expandafter\g@addto@macro\csname tb@#1@beforehead@hook\endcsname{#2}%
862 }
863 \newcommand{\AfterTOCHead}[2][]{%
864 \@ifundefined{tb@#1@afterhead@hook}{%
865 \expandafter\global\expandafter\let\csname tb@#1@afterhead@hook\endcsname
866 \@empty
867 }{}%
868 \expandafter\g@addto@macro\csname tb@#1@afterhead@hook\endcsname{#2}%
869 }
870 \newcommand*{\deftocheading}[1]{%
871 \@namedef{tocbasic@listhead@#1}##1}
872 \newcommand*{\setuptoc}[2]{%
873 \@for\@tempa:=#2\do{%
874 \scr@trim@spaces\@tempa
875 \@namedef{tocbasic@#1@feature@\@tempa}{}%
876 }%
877 }
878 \newcommand*{\unsettoc}[2]{%
879 \@for\@tempa:=#2\do{%
880 \scr@trim@spaces\@tempa
881 \expandafter\let\csname tocbasic@#1@feature@\@tempa\endcsname\relax
882 }%
883 }
884 \setuptoc{toc}{nobabel}
885 \setuptoc{lof}{nobabel}
886 \setuptoc{lot}{nobabel}
887 \providecommand*{\iftocfeature}{%
888 \PackageWarning{tocbasic}{Usage of deprecated command
889 `\string\iftocfeature'.\MessageBreak
890 The command has been renamed because of a\MessageBreak
891 recommendation of The LaTeX Project Team.\MessageBreak
892 Please replace `\string\iftocfeature' by `\string\Iftocfeature'%
893 }%
894 \Iftocfeature
895 }
896 \newcommand*{\Iftocfeature}[2]{%
897 \scr@ifundefinedorrelax{tocbasic@#1@feature@#2}{%
898 \expandafter\@secondoftwo
899 }{%
900 \expandafter\@firstoftwo
901 }%
902 }
903 \newcommand*{\tocbasicautomode}{%
904 \let\tb@saved@starttoc\@starttoc
905 \let\@starttoc\tocbasic@starttoc
906 \BeforeStartingTOC{%
907 \let\@starttoc\tb@saved@starttoc
908 \expandafter\Ifattoclist\expandafter{\@currext}{}{%
909 \addtotoclist[tocbasicautomode]{\@currext}%
910 }%
911 }%
912 }
913 \DefineFamily{KOMAarg}
914 \DefineFamilyMember[.toc]{KOMAarg}
915 \newcommand*{\DeclareNewTOC}[2][]{%
916 \newif\iftb@nt@float
917 \newif\iftb@nt@nonfloat
918 \newif\iftb@nt@forcenames
919 \def\tb@nt@floattype{\tb@nt@autofloattype}%
920 \def\tb@nt@floatpos{tbp}%
921 \def\tb@nt@ext{#2}%
922 \edef\tb@nt@type{#2}%
923 \let\tb@nt@types\relax
924 \def\tb@nt@owner{float}%
925 \def\tb@nt@name{\expandafter\protect\expandafter\MakeUppercase\tb@nt@type}%
926 \let\tb@nt@listname\relax
927 \let\tb@nt@counterwithin\@empty
928 \let\tb@nt@atbegin\@empty
929 \let\tb@nt@atend\@empty
930 \def\tb@nt@tocentrystyle{default}%
931 \def\tb@nt@tocstyle@options{level=1}%
932 \IfArgIsEmpty{#1}{%
933 \begingroup
934 \let\scr@dte@current\tb@nt@type
935 \@ExecuteTOCEntryStyleInitCode{\tb@nt@tocentrystyle}{\tb@nt@type}%
936 \def\do@endgroup{\endgroup}%
937 \def\do##1{%
938 \Ifstr{##1}{numwidth}{%
939 \l@addto@macro\do@endgroup{%
940 \l@addto@macro{\tb@nt@tocstyle@options}{,numwidth=1.5em}%
941 }%
942 }{%
943 \Ifstr{##1}{indent}{%
944 \l@addto@macro\do@endgroup{%
945 \l@addto@macro{\tb@nt@tocstyle@options}{,indent=1em}%
946 }%
947 }{}%
948 }%
949 \kernel@ifnextchar[%]
950 {\@dodefault}%
951 {}%
952 }%
953 \def\@dodefault[##1]{}%
954 \scr@dte@doopts
955 \do@endgroup
956 }{%
957 \let\tb@nt@extra@relax@opts\@empty
958 \DefineFamilyKey[.toc]{KOMAarg}{type}{%
959 \tb@ifvalueisnotempty{##1}{\edef\tb@nt@type{##1}}%
960 }%
961 \DefineFamilyKey[.toc]{KOMAarg}{tocentrystyle}[default]{%
962 \IfArgIsEmpty{##1}{%
963 \edef\tb@nt@tocentrystyle{##1}%
964 \FamilyKeyStateProcessed
965 }{%
966 \scr@ifundefinedorrelax{scr@dte@def@l@##1}{%
967 \FamilyKeyStateUnknownValue
968 }{%
969 \edef\tb@nt@tocentrystyle{##1}%
970 \FamilyKeyStateProcessed
971 }%
972 }%
973 }%
974 \DefineFamilyKey[.toc]{KOMAarg}{extension}{%
975 \tb@ifvalueisnotempty{##1}{\edef\tb@nt@ext{##1}}%
976 }%
977 \DefineFamilyKey[.toc]{KOMAarg}{owner}{%
978 \tb@ifvalueisnotempty{##1}{\edef\tb@nt@owner{##1}}%
979 }%
980 \DefineFamilyKey[.toc]{KOMAarg}{category}{%
981 \tb@ifvalueisnotempty{##1}{\edef\tb@nt@owner{##1}}%
982 }%
983 \DefineFamilyKey[.toc]{KOMAarg}{@else@}{\FamilyKeyStateProcessed}%
984 \FamilyExecuteOptions[.toc]{KOMAarg}{#1}%
985 \RelaxFamilyKey[.toc]{KOMAarg}{@else@}%
986 }%
987 \expandafter\newcommand\csname ext@\tb@nt@type\endcsname{}%
988 \expandafter\let\csname ext@\tb@nt@type\endcsname\tb@nt@ext
989 \addtotoclist[\tb@nt@owner]{\csname ext@\tb@nt@type\endcsname}%
990 \IfArgIsEmpty{#1}{}{%
991 \DefineFamilyKey[.toc]{KOMAarg}{type}{\FamilyKeyStateProcessed}%
992 \DefineFamilyKey[.toc]{KOMAarg}{tocentrystyle}{\FamilyKeyStateProcessed}%
993 \DefineFamilyKey[.toc]{KOMAarg}{extension}{\FamilyKeyStateProcessed}%
994 \DefineFamilyKey[.toc]{KOMAarg}{category}{\FamilyKeyStateProcessed}%
995 \Ifstr{\tb@nt@tocentrystyle}{}{}{%
996 \begingroup
997 \let\scr@dte@current\tb@nt@type
998 \@ExecuteTOCEntryStyleInitCode{\tb@nt@tocentrystyle}{\tb@nt@type}%
999 \def\do@endgroup{\endgroup}%
1000 \def\do##1{%
1001 \l@addto@macro\do@endgroup{%
1002 \l@addto@macro\tb@nt@extra@relax@opts{%
1003 \RelaxFamilyKey[.toc]{KOMAarg}{toc##1}%
1004 \RelaxFamilyKey[.toc]{KOMAarg}{tocentry##1}%
1005 \RelaxFamilyKey[.toc]{KOMAarg}{tocentry##1:}%
1006 }%
1007 }%
1008 \kernel@ifnextchar[%]
1009 {\@dodefault{##1}}%
1010 {\@donodefault{##1}}%
1011 }%
1012 \def\@donodefault##1{%
1013 \l@addto@macro\do@endgroup{%
1014 \DefineFamilyKey[.toc]{KOMAarg}{toc##1}{%
1015 \PackageWarning{tocbasic}{you should use `tocentry##1'
1016 instead\MessageBreak
1017 of `toc##1'}%
1018 \l@addto@macro{\tb@nt@tocstyle@options}{,##1={####1}}%
1019 \FamilyKeyStateProcessed
1020 }%
1021 \DefineFamilyKey[.toc]{KOMAarg}{tocentry##1}{%
1022 \l@addto@macro{\tb@nt@tocstyle@options}{,##1={####1}}%
1023 \FamilyKeyStateProcessed
1024 }%
1025 \DefineFamilyKey[.toc]{KOMAarg}{tocentry##1:}{%
1026 \l@addto@macro{\tb@nt@tocstyle@options}{,##1:={####1}}%
1027 }%
1028 }%
1029 }%
1030 \def\@dodefault##1[##2]{%
1031 \l@addto@macro\do@endgroup{%
1032 \DefineFamilyKey[.toc]{KOMAarg}{toc##1}[##2]{%
1033 \PackageWarning{tocbasic}{you should use `tocentry##1'
1034 instead\MessageBreak
1035 of `toc##1'}%
1036 \l@addto@macro{\tb@nt@tocstyle@options}{,##1={####1}}%
1037 \FamilyKeyStateProcessed
1038 }%
1039 \DefineFamilyKey[.toc]{KOMAarg}{tocentry##1}[##2]{%
1040 \l@addto@macro{\tb@nt@tocstyle@options}{,##1={####1}}%
1041 \FamilyKeyStateProcessed
1042 }%
1043 \DefineFamilyKey[.toc]{KOMAarg}{tocentry##1:}{%
1044 \l@addto@macro{\tb@nt@tocstyle@options}{,##1:={####1}}%
1045 }%
1046 }%
1047 }%
1048 \scr@dte@doopts
1049 \do@endgroup
1050 }%
1051 \FamilyStringKey[.toc]{KOMAarg}{atbegin}{\tb@nt@atbegin}%
1052 \FamilyStringKey[.toc]{KOMAarg}{atend}{\tb@nt@atend}%
1053 \DefineFamilyKey[.toc]{KOMAarg}{counterwithin}{%
1054 \edef\tb@nt@counterwithin{##1}\FamilyKeyStateProcessed
1055 }%
1056 \FamilyBoolKey[.toc]{KOMAarg}{float}{tb@nt@float}%
1057 \DefineFamilyKey[.toc]{KOMAarg}{floatpos}{%
1058 \tb@ifvalueisnotempty{##1}{\edef\tb@nt@floatpos{##1}}%
1059 }%
1060 \DefineFamilyKey[.toc]{KOMAarg}{floattype}{%
1061 \FamilySetCounterMacro{KOMAarg}{floattype}{\reserved@d}{##1}%
1062 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1063 \ifnum 0=
1064 \ifnum\reserved@d<1 0 \else\ifnum\reserved@d>31 0 \else 1 \fi\fi
1065 \FamilyKeyStateUnknownValue
1066 \else
1067 \let\tb@nt@floattype\reserved@d
1068 \fi
1069 \fi
1070 }%
1071 \FamilyBoolKey[.toc]{KOMAarg}{forcenames}{tb@nt@forcenames}%
1072 \DefineFamilyKey[.toc]{KOMAarg}{hang}{%
1073 \scr@ifundefinedorrelax{[email protected]@tocnumwidth}{%
1074 \PackageWarning{tocbasic}{%
1075 deprecated option `hang'.\MessageBreak
1076 Option will be ignored, because toc entry style\MessageBreak
1077 `\tb@nt@tocentrystyle' does not provide option `numwidth'%
1078 }%
1079 }{%
1080 \PackageWarning{tocbasic}{%
1081 deprecated option `hang'.\MessageBreak
1082 You should replace option `hang' by option\MessageBreak
1083 `tocentrynumwidth'%
1084 }%
1085 \l@addto@macro\tb@nt@tocstyle@options{,numwidth={##1}}%
1086 }%
1087 \FamilyKeyStateProcessed
1088 }%
1089 \scr@ifundefinedorrelax{[email protected]@tocnumwidth}{}{%
1090 \l@addto@macro\tb@nt@tocstyle@options{,numwidth=1.5em}%
1091 }%
1092 \DefineFamilyKey[.toc]{KOMAarg}{indent}{%
1093 \scr@ifundefinedorrelax{[email protected]@tocindent}{%
1094 \PackageWarning{tocbasic}{%
1095 deprecated option `indent'.\MessageBreak
1096 Option will be ignored, because toc entry style\MessageBreak
1097 `\tb@nt@tocentrystyle' does not provide option `indent'%
1098 }%
1099 }{%
1100 \PackageWarning{tocbasic}{%
1101 deprecated option `indent'.\MessageBreak
1102 You should replace option `indent' by option\MessageBreak
1103 `tocentryindent'%
1104 }%
1105 \l@addto@macro\tb@nt@tocstyle@options{,indent={##1}}%
1106 }%
1107 \FamilyKeyStateProcessed
1108 }%
1109 \scr@ifundefinedorrelax{[email protected]@tocindent}{}{%
1110 \l@addto@macro\tb@nt@tocstyle@options{,indent=1em}%
1111 }%
1112 \DefineFamilyKey[.toc]{KOMAarg}{level}{%
1113 \PackageWarning{tocbasic}{%
1114 deprecated option `level'.\MessageBreak
1115 You should replace option `level' by option\MessageBreak
1116 `tocentrylevel'%
1117 }%
1118 \l@addto@macro\tb@nt@tocstyle@options{,level={##1}}%
1119 \FamilyKeyStateProcessed
1120 }%
1121 \DefineFamilyKey[.toc]{KOMAarg}{listname}{%
1122 \tb@ifvalueisnotempty{##1}{\def\tb@nt@listname{##1}}%
1123 }%
1124 \DefineFamilyKey[.toc]{KOMAarg}{name}{%
1125 \tb@ifvalueisnotempty{##1}{\edef\tb@nt@name{##1}}%
1126 }%
1127 \FamilyBoolKey[.toc]{KOMAarg}{nonfloat}{tb@nt@nonfloat}%
1128 \DefineFamilyKey[.toc]{KOMAarg}{types}{%
1129 \tb@ifvalueisnotempty{##1}{\edef\tb@nt@types{##1}}%
1130 }%
1131 \DefineFamilyKey[.toc]{KOMAarg}{setup}{%
1132 \setuptoc\tb@nt@ext{##1}%
1133 }%
1134 \DefineFamilyKey[.toc]{KOMAarg}{unset}{%
1135 \unsettoc\tb@nt@ext{##1}%
1136 }%
1137 \FamilyExecuteOptions[.toc]{KOMAarg}{#1}%
1138 \RelaxFamilyKey[.toc]{KOMAarg}{unset}%
1139 \RelaxFamilyKey[.toc]{KOMAarg}{setup}%
1140 \RelaxFamilyKey[.toc]{KOMAarg}{types}%
1141 \RelaxFamilyKey[.toc]{KOMAarg}{nonfloat}%
1142 \RelaxFamilyKey[.toc]{KOMAarg}{name}%
1143 \RelaxFamilyKey[.toc]{KOMAarg}{listname}%
1144 \RelaxFamilyKey[.toc]{KOMAarg}{level}%
1145 \RelaxFamilyKey[.toc]{KOMAarg}{indent}%
1146 \RelaxFamilyKey[.toc]{KOMAarg}{hang}%
1147 \RelaxFamilyKey[.toc]{KOMAarg}{forcenames}%
1148 \RelaxFamilyKey[.toc]{KOMAarg}{floatpos}%
1149 \RelaxFamilyKey[.toc]{KOMAarg}{float}%
1150 \RelaxFamilyKey[.toc]{KOMAarg}{counterwithin}%
1151 \RelaxFamilyKey[.toc]{KOMAarg}{atend}%
1152 \RelaxFamilyKey[.toc]{KOMAarg}{atbegin}%
1153 \tb@nt@extra@relax@opts
1154 \RelaxFamilyKey[.toc]{KOMAarg}{category}%
1155 \RelaxFamilyKey[.toc]{KOMAarg}{owner}%
1156 \RelaxFamilyKey[.toc]{KOMAarg}{extension}%
1157 \RelaxFamilyKey[.toc]{KOMAarg}{tocentrystyle}%
1158 \RelaxFamilyKey[.toc]{KOMAarg}{type}%
1159 }%
1160 \expandafter\let\csname tb@nt@type@\tb@nt@ext\endcsname\tb@nt@type
1161 \scr@ifundefinedorrelax{tb@nt@types}{%
1162 \edef\tb@nt@types{\tb@nt@type s}%
1163 }{}%
1164 \scr@ifundefinedorrelax{tb@nt@listname}{%
1165 \protected@edef\tb@nt@listname{List of \protect\MakeUppercase\tb@nt@types}%
1166 }{}%
1167 \@ifundefined{\tb@nt@type name}{%
1168 \expandafter\protected@edef\csname \tb@nt@type name\endcsname{\tb@nt@name}%
1169 }{%
1170 \iftb@nt@forcenames
1171 \expandafter\protected@edef\csname \tb@nt@type name\endcsname
1172 {\tb@nt@name}%
1173 \fi
1174 }%
1175 \@ifundefined{list\tb@nt@type name}{%
1176 \expandafter\let\csname list\tb@nt@type name\endcsname\tb@nt@listname
1177 }{%
1178 \iftb@nt@forcenames
1179 \expandafter\let\csname list\tb@nt@type name\endcsname\tb@nt@listname
1180 \fi
1181 }%
1182 \expandafter\newcommand\csname listof\tb@nt@ext name\expandafter\endcsname
1183 \expandafter{\csname list\tb@nt@type name\endcsname}%
1184 \begingroup\edef\@tempa{\endgroup
1185 \noexpand\newcommand*\csname listof\tb@nt@types\endcsname{%
1186 \noexpand\listoftoc{%
1187 \expandafter\noexpand\csname ext@\tb@nt@type\endcsname}%
1188 }%
1189 }\@tempa
1190 \Ifstr{\tb@nt@tocentrystyle}{}{%
1191 \@ifundefined{l@\tb@nt@type}{%
1192 \PackageWarning{tocbasic}{%
1193 \expandafter\string\csname l@\tb@nt@type\endcsname\space
1194 undefined!\MessageBreak
1195 I hope you know, what you are doing, but\MessageBreak
1196 maybe it would be better to use proper\MessageBreak
1197 `tocentrystyle' settings%
1198 }%
1199 }{}%
1200 }{%
1201 \edef\reserved@a{%
1202 \noexpand\DeclareTOCStyleEntry[%
1203 {\unexpanded\expandafter{\tb@nt@tocstyle@options}}%
1204 ]{\tb@nt@tocentrystyle}{\tb@nt@type}%
1205 }%
1206 \reserved@a
1207 }%
1208 \@ifundefined{listof\tb@nt@ext entryname}{%
1209 \expandafter\let\csname listof\tb@nt@ext entryname\endcsname\tb@nt@name
1210 }{}%
1211 \begingroup\edef\@tempa{\endgroup
1212 \noexpand\newcommand*\csname setup\tb@nt@types\endcsname{%
1213 \noexpand\setuptoc{\tb@nt@ext}%
1214 }%
1215 }\@tempa
1216 \@tempswafalse
1217 \iftb@nt@float
1218 \expandafter\newcommand\expandafter*\csname fps@\tb@nt@type\expandafter
1219 \endcsname\expandafter{\tb@nt@floatpos}%
1220 \expandafter\newcommand\expandafter*\csname ftype@\tb@nt@type\expandafter
1221 \endcsname\expandafter{\tb@nt@floattype}%
1222 \begingroup
1223 \edef\@tempa{%
1224 \noexpand\endgroup
1225 \noexpand\newenvironment{\tb@nt@type}{%
1226 \noexpand\kernel@ifnextchar[%]
1227 {\noexpand\tb@atbegin@after\noexpand\@float{\tb@nt@type}}%
1228 {\noexpand\edef\noexpand\reserved@a{%
1229 \noexpand\noexpand\noexpand\tb@atbegin@after
1230 \noexpand\noexpand\noexpand\@float{\tb@nt@type}%
1231 [\noexpand\csname fps@\tb@nt@type\noexpand\endcsname]}%
1232 \noexpand\reserved@a}%
1233 }{%
1234 \noexpand\csname \tb@nt@type @atend\noexpand\endcsname
1235 \noexpand\end@float
1236 }%
1237 \noexpand\newenvironment{\tb@nt@type*}{%
1238 \noexpand\kernel@ifnextchar[%]
1239 {\noexpand\tb@atbegin@after\noexpand\@dblfloat{\tb@nt@type}}%
1240 {\noexpand\edef\noexpand\reserved@a{%
1241 \noexpand\noexpand\noexpand\tb@atbegin@after
1242 \noexpand\noexpand\noexpand\@dblfloat{\tb@nt@type}%
1243 [\noexpand\csname fps@\tb@nt@type\noexpand\endcsname]}%
1244 \noexpand\reserved@a}%
1245 }{%
1246 \noexpand\csname \tb@nt@type @atend\noexpand\endcsname
1247 \noexpand\end@dblfloat
1248 }%
1249 \if@tocbasic@old@latex@found\else
1250 \expandafter\noexpand\csname tocbasic_define_caption_keys:n\endcsname
1251 {\tb@nt@type}%
1252 \fi
1253 }%
1254 \@tempa
1255 \@tempswatrue
1256 \fi
1257 \iftb@nt@nonfloat
1258 \begingroup
1259 \edef\@tempa{%
1260 \noexpand\endgroup
1261 \noexpand\newenvironment{\tb@nt@type-}{%
1262 \noexpand\trivlist\noexpand\item\noexpand\relax
1263 \noexpand\minipage{\noexpand\linewidth}%
1264 \noexpand\def\noexpand\@captype{\tb@nt@type}%
1265 \noexpand\csname \tb@nt@type @atbegin\noexpand\endcsname
1266 }{%
1267 \noexpand\csname \tb@nt@type @atend\noexpand\endcsname
1268 \noexpand\endminipage\noexpand\endtrivlist
1269 }%
1270 \if@tocbasic@old@latex@found\else
1271 \expandafter\noexpand\csname tocbasic_define_caption_keys:n\endcsname
1272 {\tb@nt@type}%
1273 \fi
1274 }%
1275 \@tempa
1276 \@tempswatrue
1277 \fi
1278 \if@tempswa
1279 \@ifundefined{c@\tb@nt@type}{%
1280 \newcounter{\tb@nt@type}%
1281 }{%
1282 \PackageWarning{tocbasic}{using already defined counter `\tb@nt@type'}%
1283 }%
1284 \ifx\tb@nt@counterwithin\@empty\else
1285 \@addtoreset{\tb@nt@type}{\tb@nt@counterwithin}%
1286 \begingroup
1287 \def\reserved@c{section}%
1288 \@ifundefined{chapter}{}{%
1289 \@ifundefined{c@chapter}{}{%
1290 \@ifundefined{l@chapter}{}{%
1291 \def\reserved@c{chapter}}}}%
1292 \expandafter\Ifstr\expandafter{\reserved@c}{\tb@nt@counterwithin}{%
1293 \edef\@tempa{%
1294 \noexpand\endgroup
1295 \noexpand\renewcommand*\expandafter\noexpand
1296 \csname the\tb@nt@type\endcsname{%
1297 \unexpanded{%
1298 \expandafter\ifx\csname if@mainmatter\expandafter\endcsname
1299 \csname iffalse\endcsname\else
1300 }%
1301 \noexpand\ifnum
1302 \expandafter\noexpand\csname c@\tb@nt@counterwithin\endcsname
1303 >\noexpand\z@
1304 \expandafter\noexpand\csname the\tb@nt@counterwithin\endcsname
1305 .%
1306 \noexpand\fi
1307 \noexpand\fi
1308 \noexpand\arabic{\tb@nt@type}%
1309 }%
1310 }%
1311 }{%
1312 \edef\@tempa{%
1313 \noexpand\endgroup
1314 \noexpand\renewcommand*\expandafter\noexpand
1315 \csname the\tb@nt@type\endcsname{%
1316 \expandafter\noexpand\csname the\tb@nt@counterwithin\endcsname
1317 .%
1318 \noexpand\arabic{\tb@nt@type}%
1319 }%
1320 }%
1321 }%
1322 \@tempa
1323 \fi
1324 \begingroup
1325 \edef\@tempa{%
1326 \noexpand\endgroup
1327 \noexpand\newcommand*\expandafter\noexpand
1328 \csname \tb@nt@type format\endcsname{%
1329 \expandafter\noexpand\csname \tb@nt@type name\endcsname
1330 \noexpand\nobreakspace
1331 \expandafter\noexpand\csname the\tb@nt@type\endcsname
1332 \ifx\tb@nt@counterwithin\@empty\else
1333 \noexpand\csname autodot\endcsname
1334 \fi
1335 }%
1336 \noexpand\newcommand*\expandafter\noexpand
1337 \csname fnum@\tb@nt@type\endcsname{%
1338 \expandafter\noexpand\csname \tb@nt@type format\endcsname
1339 }%
1340 }%
1341 \@tempa
1342 \expandafter\newcommand\expandafter*\csname \tb@nt@type @atbegin\expandafter
1343 \endcsname\expandafter{\tb@nt@atbegin}%
1344 \expandafter\newcommand\expandafter*\csname \tb@nt@type @atend\expandafter
1345 \endcsname\expandafter{\tb@nt@atend}%
1346 \fi
1347 }
1348 \newcommand*{\tb@atbegin@after}[3]{}
1349 \def\tb@atbegin@after#1#2[#3]{%
1350 #1{#2}[#3]%
1351 \csname #2@atbegin\endcsname
1352 }
1353 \newcommand*{\tb@ifvalueisnotempty}[1]{%
1354 \Ifstr{#1}{}{%
1355 \FamilyKeyStateUnknownValue
1356 \expandafter\@gobble
1357 }{%
1358 \FamilyKeyStateProcessed
1359 \expandafter\@firstofone
1360 }%
1361 }
1362 \newcommand*{\tb@nt@autofloattype}{16}
1363 \if@tocbasic@old@latex@found\else
1364 \ExplSyntaxOn
1365 \hook_gput_code:nnn { begindocument } { tocbasic }
1366 {
1367 \DeclareCommandCopy { \__tocbasic_saved_caption:w } { \caption }
1368 \bool_if:NT \g__tocbasic_patch_caption_bool
1369 {
1370 \__tocbasic_caption_patch_code:
1371 }
1372 }
1373
1374 \hook_gset_rule:nnnn { begindocument } { tocbasic } { after } { caption }
1375 \hook_gset_rule:nnnn { begindocument } { tocbasic } { after } { caption3 }
1376
1377 \cs_new:Npn \__tocbasic_caption_patch_code:
1378 {
1379 \DeclareCommandCopy { \caption } { \__tocbasic_caption:w }
1380 \DeclareCommandCopy { \captionof } { \__tocbasic_caption_of:w }
1381 }
1382 \msg_new:nnnn { tocbasic } { caption-code-by-class-deactivated }
1383 {
1384 Loading~of~class-dependent~code~for~package~caption3\\
1385 prevented~\msg_line_context:.
1386 }
1387 {
1388 The~caption3~package~attempts~to~detect~classes~known~to~it~
1389 using~a~number~of~heuristics~and,~if~necessary,~
1390 reload~class-dependent~code.~
1391 Unfortunately,~the~code~from~caption-koma.sto,~for~example,~
1392 is~no~longer~compatible~with~the~KOMA-Script~package~tocbasic~
1393 since~KOMA-Script~3.46.~
1394 Therefore,~the~tocbasic~package~attempts~to~prevent~this~file~
1395 from~being~loaded~by~pretending~to~caption3~that~a~standard~class~
1396 is~being~used.~
1397 Since~the~caption3~package,~as~part~of~the~caption~collection,~
1398 is~no~longer~maintained,~and~since~the~KOMA-Script~author~himself~
1399 is~trying~to~maintain~the~compatibility~of~the~caption~package~
1400 with~KOMA-Script,~this~is~currently~the~best~known~method~
1401 to~prevent~unnecessary~warnings~from~caption~or~caption3.
1402 }
1403 \cs_if_exist:NT \KOMAClassName
1404 {
1405 \hook_gput_code:nnn { package / caption3 / before } { tocbasic }
1406 {
1407 \cs_set:Npn \caption@documentclass { standard }
1408 \msg_info:nn { tocbasic } { caption-code-by-class-deactivated }
1409 }
1410 }
1411 \prg_new_conditional:Nnn \tocbasic_if_caption_above:n { p, T, F, TF }
1412 {
1413 \bool_if:nTF
1414 {
1415 \cs_if_exist_use:cF { g__tocbasic_ #1 _caption_above_bool }
1416 {
1417 \g__tocbasic__caption_above_bool
1418 }
1419 }
1420 {
1421 \prg_return_true:
1422 }
1423 {
1424 \prg_return_false:
1425 }
1426 }
1427 \prg_new_conditional:Npnn \tocbasic_if_caption_above: { p, T, F, TF }
1428 {
1429 \bool_if:nTF
1430 {
1431 \cs_if_exist_use:cF { g__tocbasic_ \@captype _caption_above_bool }
1432 {
1433 \g__tocbasic__caption_above_bool
1434 }
1435 }
1436 {
1437 \prg_return_true:
1438 }
1439 {
1440 \prg_return_false:
1441 }
1442 }
1443 \cs_new:Nn \__tocbasic_caption_setup:
1444 {
1445 \tocbasic_if_caption_above:TF
1446 {
1447 \cs_if_exist:NTF \captionsetup
1448 { \captionsetup { position=top } }
1449 { \__tocbasic_swap_skip: }
1450 }
1451 {
1452 \cs_if_exist:NT \captionsetup
1453 { \captionsetup { position=bottom } }
1454 }
1455 }
1456 \cs_new:Nn \__tocbasic_captionof_setup:n
1457 {
1458 \exp_args:Nne \hook_gput_next_code:nn { tocbasic / caption / after }
1459 {
1460 \cs_if_exist:NTF \@captype
1461 { \exp_not:N \tl_set:Nn \exp_not:N \@captype { \@captype } }
1462 { \exp_not:n { \cs_set_eq:NN \@captype \tex_undefined:D } }
1463 }
1464 \tocbasic_if_caption_above:nTF { #1 }
1465 {
1466 \cs_if_exist:NTF \captionsetup
1467 { \captionsetup { type=#1, position=top } }
1468 {
1469 \tl_set:Ne \@captype { #1 }
1470 \__tocbasic_swap_skip:
1471 }
1472 }
1473 {
1474 \cs_if_exist:NTF \captionsetup
1475 { \captionsetup { type=#1, position=bottom } }
1476 { \tl_set:Ne \@captype { #1 } }
1477 }
1478 }
1479 \cs_new:Nn \__tocbasic_captionof_setup:nn
1480 {
1481 \exp_args:Nne \hook_gput_next_code:nn { tocbasic / caption / after }
1482 {
1483 \cs_if_exist:NTF \@captype
1484 { \exp_not:N \tl_set:Nn \exp_not:N \@captype { \@captype } }
1485 { \exp_not:n { \cs_set_eq:NN \@captype \tex_undefined:D } }
1486 }
1487 \str_if_eq:eeTF { #2 } { top }
1488 {
1489 \cs_if_exist:NTF \captionsetup
1490 { \captionsetup { type=#1, position=top } }
1491 {
1492 \tl_set:Ne \@captype { #1 }
1493 \__tocbasic_swap_skip:
1494 }
1495 }
1496 {
1497 \cs_if_exist:NTF \captionsetup
1498 { \captionsetup { type=#1, position=#2 } }
1499 { \tl_set:Ne \@captype { #1 } }
1500 }
1501 }
1502 \NewDocumentCommand \__tocbasic_caption:w { s o +m }
1503 {
1504 \__tocbasic_caption_setup:
1505 \exp_last_unbraced:Ne \__tocbasic_saved_caption:w
1506 { \IfBooleanT{#1}* \IfValueT{#2} { \exp_not:n {[{#2}]} } }
1507 {#3}
1508 \hook_use:n { tocbasic / caption / after }
1509 }
1510 \NewDocumentCommand \captionabove { s O{#3} +m }
1511 {
1512 \cs_if_exist:NTF \captionsetup
1513 { \captionsetup { position=top } }
1514 { \__tocbasic_swap_skip: }
1515 \exp_last_unbraced:Ne \__tocbasic_saved_caption:w { \IfBooleanT{#1}* }
1516 [{#2}] {#3}
1517 \hook_use:n { tocbasic / caption / after }
1518 }
1519
1520 \NewDocumentCommand \captionbelow { s O{#3} +m }
1521 {
1522 \cs_if_exist:NT \captionsetup
1523 { \captionsetup { position=bottom } }
1524 \exp_last_unbraced:Ne \__tocbasic_saved_caption:w { \IfBooleanT{#1}* }
1525 [{#2}] {#3}
1526 \hook_use:n { tocbasic / caption / after }
1527 }
1528 \NewDocumentCommand \__tocbasic_caption_of:w { s m o +m }
1529 {
1530 \__tocbasic_captionof_setup:n { #2 }
1531 \exp_last_unbraced:Ne \__tocbasic_saved_caption:w
1532 { \IfBooleanT{#1}* \IfValueT{#3} { \exp_not:n {[{#3}]} } }
1533 {#4}
1534 \hook_use:n { tocbasic / caption / after }
1535 }
1536
1537 \cs_if_exist:NF { \captionof }
1538 { \DeclareCommandCopy { \captionof } { \__tocbasic_caption_of:w } }
1539 \cs_if_exist:NTF \socket_new:nn
1540 { \socket_new:nn { tocbasic / swapskip / after } { 0 } }
1541 { \hook_new:n { tocbasic / swapskip / after } }
1542 \hook_new:n { tocbasic / caption / after }
1543 \cs_new:Nn \__tocbasic_swap_skip:
1544 {
1545 \skip_set_eq:NN \l_tmpa_skip \abovecaptionskip
1546 \skip_set_eq:NN \abovecaptionskip \belowcaptionskip
1547 \skip_set_eq:NN \belowcaptionskip \l_tmpa_skip
1548 \hook_gput_next_code:nn { tocbasic / caption / after } {
1549 \skip_set_eq:NN \l_tmpa_skip \abovecaptionskip
1550 \skip_set_eq:NN \abovecaptionskip \belowcaptionskip
1551 \skip_set_eq:NN \belowcaptionskip \l_tmpa_skip
1552 }
1553 \cs_if_exist_use:NF \socket_use:n \hook_use:n
1554 { tocbasic / swapskip / after }
1555 }
1556 \NewDocumentCommand \captionaboveof { s m O{#4} +m }
1557 {
1558 \__tocbasic_captionof_setup:nn { #2 } { top }
1559 \exp_last_unbraced:Ne \__tocbasic_saved_caption:w { \IfBooleanT{#1}* }
1560 [{#3}] {#4}
1561 \hook_use:n { tocbasic / caption / after }
1562 }
1563
1564 \NewDocumentCommand \captionbelowof { s m O{#4} +m }
1565 {
1566 \__tocbasic_captionof_setup:nn { #2 } { bottom }
1567 \exp_last_unbraced:Ne \__tocbasic_saved_caption:w { \IfBooleanT{#1}* }
1568 [{#3}] {#4}
1569 \hook_use:n { tocbasic / caption / after }
1570 }
1571 \ExplSyntaxOff
1572 \fi
1573 %%% From File: $Id: scrkernel-tocstyle.dtx 4228 2025-10-08 14:10:51Z kohm $
1574 %%% (run: body)
1575 \newcommand*{\scr@numberline}[1]{%
1576 \numberline@box{%
1577 \numberline@prefix
1578 \Ifstr{#1}{}{#1}{%
1579 \numberline@numberformat{#1}%
1580 }%
1581 \numberline@postfix
1582 }%
1583 }
1584 \newcommand*{\usetocbasicnumberline}[1][%
1585 \PackageInfo{tocbasic}{Using my definition of `\string\numberline'}%
1586 ]{%
1587 \@tempswatrue
1588 \begingroup
1589 \def\scr@numberline##1{\global\@tempswafalse}%
1590 \@tempdima\maxdimen
1591 \sbox\@tempboxa{\numberline{0}}%
1592 \endgroup
1593 \if@tempswa #1\renewcommand*{\numberline}[1]{\scr@numberline{##1}}\fi
1594 }
1595 \newcommand*{\numberline@prefix}{}
1596 \newcommand*{\numberline@postfix}{\hfil}
1597 \newcommand*{\numberline@numberformat}[1]{%
1598 \Ifstr{#1}{}{}{\numberline@numberprefix#1\numberline@numberpostfix}%
1599 }
1600 \newcommand*{\numberline@numberprefix}{}
1601 \newcommand*{\numberline@numberpostfix}{}
1602 \newcommand*{\numberline@box}[1]{\hb@xt@\@tempdima{#1}}
1603 \DefineFamily{KOMAarg}
1604 \DefineFamilyMember[.dte]{KOMAarg}
1605 \NewDocumentCommand{\@DefineTOCEntryOption}{mmom}{%
1606 \edef\scr@dte@doopts{%
1607 \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2}%
1608 }%
1609 \IfValueTF{#3}{%
1610 \l@addto@macro\scr@dte@doopts{[#3]}%
1611 \DefineFamilyKey[.dte]{KOMAarg}{#2}[{#3}]{#4}%
1612 }{%
1613 \DefineFamilyKey[.dte]{KOMAarg}{#2}{#4}%
1614 }%
1615 }
1616 \newcommand*{\@RelaxTOCEntryOptions}{%
1617 \begingroup
1618 \def\do@endgroup{\endgroup}%
1619 \DeclareDocumentCommand\do{m+o}{%
1620 \l@addto@macro\do@endgroup{%
1621 \RelaxFamilyKey[.dte]{KOMAarg}{##1}%
1622 }%
1623 }%
1624 \scr@dte@doopts
1625 \do@endgroup
1626 }
1627 \NewDocumentCommand{\@DefineTOCEntryListOption}{mmommm}{%
1628 \@TOCEntryStyleNeedsCommandByOption{#1}{#4}{#5}{#2}{#6}%
1629 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1630 \expandafter\protected@edef\csname #4\scr@dte@current#5\endcsname{##1}%
1631 \FamilyKeyStateProcessed
1632 }%
1633 \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
1634 \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
1635 \expandafter\let
1636 \csname #4\scr@dte@current#5\expandafter\endcsname
1637 \csname #4##1#5\endcsname
1638 \FamilyKeyStateProcessed
1639 }%
1640 }%
1641 \DefineFamilyKey[.dte]{KOMAarg}{#2+}{%
1642 \expandafter\protected@edef\csname #4\scr@dte@current#5\endcsname{%
1643 \csname #4\scr@dte@current#5\endcsname,##1}%
1644 \FamilyKeyStateProcessed
1645 }%
1646 \edef\scr@dte@doopts{%
1647 \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}\noexpand\do{#2+}%
1648 }%
1649 }
1650 \NewDocumentCommand{\@DefineTOCEntryLengthOption}{mmommm}{%
1651 \@TOCEntryStyleNeedsCommandByOption{#1}{#4}{#5}{#2}{#6}%
1652 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1653 \@DefineTOCEntryLengthOptionMacro{#2}{#4}{#5}{##1}%
1654 }%
1655 \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
1656 \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
1657 \expandafter\let
1658 \csname #4\scr@dte@current#5\expandafter\endcsname
1659 \csname #4##1#5\endcsname
1660 \FamilyKeyStateProcessed
1661 }%
1662 }%
1663 \DefineFamilyKey[.dte]{KOMAarg}{#2+}{%
1664 \@DefineTOCEntryAddLengthOptionMacro{#2+}{#4}{#5}{##1}%
1665 }%
1666 \edef\scr@dte@doopts{%
1667 \unexpanded\expandafter{\scr@dte@doopts}%
1668 \noexpand\do{#2:}\noexpand\do{#2+}%
1669 }%
1670 }
1671 \newcommand*{\@DefineTOCEntryLengthOptionMacro}[4]{%
1672 \protected@edef\reserved@a{%
1673 \noexpand\FamilySetLength{KOMAarg}{#1}{\noexpand\@tempskipa}{#4}%
1674 }\reserved@a
1675 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1676 \ifscr@dte@expandtopt
1677 \expandafter\edef\csname #2\scr@dte@current#3\endcsname{%
1678 \the\@tempskipa}%
1679 \else
1680 \expandafter\protected@edef\csname #2\scr@dte@current#3\endcsname{#4}%
1681 \fi
1682 \fi
1683 }
1684 \newcommand*{\@DefineTOCEntryAddLengthOptionMacro}[4]{%
1685 \@ifundefined{#2\scr@dte@current#3}{%
1686 \FamilyKeyStateUnknownValue
1687 }{%
1688 \protected@edef\reserved@a{%
1689 \noexpand\FamilySetLength{KOMAarg}{#1}{\noexpand\@tempskipa}{#4}%
1690 }\reserved@a
1691 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1692 \ifscr@dte@expandtopt
1693 \expandafter\edef\csname #2\scr@dte@current#3\endcsname{%
1694 \the\glueexpr\@tempskipa
1695 +\csname #2\scr@dte@current#3\endcsname\relax}%
1696 \else
1697 \expandafter\protected@edef\csname #2\scr@dte@current#3\endcsname{%
1698 \the\glueexpr #4%
1699 +\csname #2\scr@dte@current#3\endcsname\relax}%
1700 \fi
1701 \fi
1702 }%
1703 }
1704 \NewDocumentCommand{\@DefineTOCEntryNumberOption}{mmommm}{%
1705 \@TOCEntryStyleNeedsCommandByOption{#1}{#4}{#5}{#2}{#6}%
1706 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1707 \@DefineTOCEntryNumberOptionMacro{#2}{#4}{#5}{##1}%
1708 }%
1709 \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
1710 \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
1711 \expandafter\let
1712 \csname #4\scr@dte@current#5\expandafter\endcsname
1713 \csname #4##1#5\endcsname
1714 \FamilyKeyStateProcessed
1715 }%
1716 }%
1717 \DefineFamilyKey[.dte]{KOMAarg}{#2+}{%
1718 \@DefineTOCEntryAddNumberOptionMacro{#2+}{#4}{#5}{##1}%
1719 }%
1720 \edef\scr@dte@doopts{%
1721 \unexpanded\expandafter{\scr@dte@doopts}%
1722 \noexpand\do{#2:}\noexpand\do{#2+}%
1723 }%
1724 }
1725 \newcommand*{\@DefineTOCEntryNumberOptionMacro}[4]{%
1726 \protected@edef\reserved@a{%
1727 \noexpand\FamilySetCounterMacro{KOMAarg}{#1}{%
1728 \expandafter\noexpand\csname #2\scr@dte@current#3\endcsname
1729 }{#4}%
1730 }\reserved@a
1731 }
1732 \newcommand*{\@DefineTOCEntryAddNumberOptionMacro}[4]{%
1733 \@ifundefined{#2\scr@dte@current#3}{%
1734 \FamilyKeyStateUnknownValue
1735 }{%
1736 \FamilySetCounterMacro{KOMAarg}{#1}{%
1737 \reserved@a
1738 }{#4}%
1739 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1740 \expandafter\edef\csname #2\scr@dte@current#3\endcsname{%
1741 \the\numexpr \reserved@a+\csname #2\scr@dte@current#3\endcsname\relax
1742 }%
1743 \fi
1744 }%
1745 }
1746 \NewDocumentCommand{\@DefineTOCEntryBooleanOption}{mmO{true}mmm}{%
1747 \@TOCEntryStyleNeedsCommandByOption{#1}{if#4}{#5}{#2}{#6}%
1748 \@TOCEntryStyleNeedsCommandByOption{#1}{#4}{#5true}{#2}{#6}%
1749 \@TOCEntryStyleNeedsCommandByOption{#1}{#4}{#5false}{#2}{#6}%
1750 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1751 \@DefineTOCEntryBoolOptionMacro{#2}{#4}{#5}{##1}%
1752 }%
1753 \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
1754 \scr@ifundefinedorrelax{if#4##1#5}{\FamilyKeyStateUnknownValue}{%
1755 \expandafter\let
1756 \csname if#4\scr@dte@current#5\expandafter\endcsname
1757 \csname if#4##1#5\endcsname
1758 \FamilyKeyStateProcessed
1759 }%
1760 }%
1761 \edef\scr@dte@doopts{%
1762 \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
1763 }%
1764 }
1765 \newcommand*{\@DefineTOCEntryBoolOptionMacro}[4]{%
1766 \@ifundefined{if#2\scr@dte@current#3}{%
1767 \expandafter\newif\csname if#2\scr@dte@current#3\endcsname
1768 }{}%
1769 \FamilySetBool{KOMAarg}{#1}{#2\scr@dte@current#3}{#4}%
1770 }
1771 \NewDocumentCommand{\@DefineTOCEntryIfOption}{mmO{true}mmm}{%
1772 \@TOCEntryStyleNeedsCommandByOption{#1}{If#4}{#5}{#2}{#6}%
1773 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1774 \@DefineTOCEntryIfOptionMacro{#2}{#4}{#5}{##1}%
1775 }%
1776 \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
1777 \scr@ifundefinedorrelax{If#4##1#5}{\FamilyKeyStateUnknownValue}{%
1778 \expandafter\let
1779 \csname If#4\scr@dte@current#5\expandafter\endcsname
1780 \csname If#4##1#5\endcsname
1781 \FamilyKeyStateProcessed
1782 }%
1783 }%
1784 \edef\scr@dte@doopts{%
1785 \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
1786 }%
1787 }
1788 \newcommand*{\@DefineTOCEntryIfOptionMacro}[4]{%
1789 \FamilySetBool{KOMAarg}{#1}{@tempswa}{#4}%
1790 \ifx\FamilyKeyState\FamilyKeyStateProcessed
1791 \if@tempswa
1792 \expandafter\let\csname If#2\scr@dte@current#3\endcsname\@firstoftwo
1793 \else
1794 \expandafter\let\csname If#2\scr@dte@current#3\endcsname\@secondoftwo
1795 \fi
1796 \fi
1797 }
1798 \NewDocumentCommand{\@DefineTOCEntryCommandOption}{mmommO{0}m}{%
1799 \@TOCEntryStyleNeedsCommandByOption{#1}{#4}{#5}{#2}{#7}%
1800 \ifcase #6
1801 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1802 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1}%
1803 }%
1804 \or
1805 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1806 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}}%
1807 }%
1808 \or
1809 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1810 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}}%
1811 }%
1812 \or
1813 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1814 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}{###3}}%
1815 }%
1816 \or
1817 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1818 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}{###3}{###4}}%
1819 }%
1820 \or
1821 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1822 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}{###3}{###4}{####5}}%
1823 }%
1824 \or
1825 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1826 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}{###3}{###4}{####5}{####6}}%
1827 }%
1828 \or
1829 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1830 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}{###3}{###4}{####5}{####6}{####7}}%
1831 }%
1832 \or
1833 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1834 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}{###3}{###4}{####5}{####6}{####7}}%
1835 }%
1836 \or
1837 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1838 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}{###3}{###4}{####5}{####6}{####7}{####8}}%
1839 }%
1840 \or
1841 \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
1842 \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}{###3}{###4}{####5}{####6}{####7}{####8}{####9}}%
1843 }%
1844 \else
1845 \PackageError{tocbasic}{maximum argument supported}{%
1846 \string\DefineTOCEntryCommandOption\space currently supports only
1847 commands with\MessageBreak
1848 at most one argument not #5}%
1849 \expandafter\@gobbletwo
1850 \fi
1851 \@firstofone{%
1852 \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
1853 \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
1854 \expandafter\let
1855 \csname #4\scr@dte@current#5\expandafter\endcsname
1856 \csname #4##1#5\endcsname
1857 \FamilyKeyStateProcessed
1858 }%
1859 }%
1860 \edef\scr@dte@doopts{%
1861 \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
1862 }%
1863 }%
1864 }
1865 \newcommand*{\@DefineTOCEntryCommandOptionMacro}[3]{%
1866 \@testopt{\@DefineTOCEntryCommandOptionMacro@{#1}{#2}{#3}}0%
1867 }
1868 \newcommand*{\@DefineTOCEntryCommandOptionMacro@}{}
1869 \long\def\@DefineTOCEntryCommandOptionMacro@#1#2#3[#4]#5{%
1870 \let\l@ngrel@x\long
1871 \expandafter\@yargdef\csname #2\scr@dte@current#3\endcsname\@ne{#4}{#5}%
1872 \FamilyKeyStateProcessed
1873 }
1874 \newcommand{\@AddToDeclareTOCEntryStylePreCheckNeeds}[1]{%
1875 \expandafter\providecommand\csname scr@dte@precheck\endcsname[1]{}%
1876 \expandafter\l@addto@macro@a\csname scr@dte@precheck\endcsname
1877 }
1878 \newcommand{\@PreToDeclareTOCEntryStylePreCheckNeeds}[1]{%
1879 \expandafter\providecommand\csname scr@dte@precheck\endcsname[1]{}%
1880 \expandafter\l@preto@macro@a\csname scr@dte@precheck\endcsname
1881 }
1882 \newcommand*{\@TOCEntryStyleNeedsCommandByOption}[5]{%
1883 \expandafter\providecommand\expandafter*\csname scr@dte@#1@needs\endcsname{}%
1884 \expandafter\l@addto@macro\csname scr@dte@#1@needs\endcsname{%
1885 \do{#2}{#3}{#4}{#5}%
1886 }%
1887 }
1888 \NewDocumentCommand\TOCEntryStyleInitCode{sm}{%
1889 \IfBooleanT{#1}{\expandafter\let\csname scr@dte@#2@init\endcsname\relax}%
1890 \scr@ifundefinedorrelax{scr@dte@#2@init}{%
1891 \expandafter\newcommand\expandafter*%
1892 \csname scr@dte@#2@init\endcsname[1]%
1893 }{%
1894 \expandafter\l@addto@macro@a\csname scr@dte@#2@init\endcsname
1895 }%
1896 }
1897 \newcommand{\TOCEntryStyleStartInitCode}[1]{%
1898 \scr@ifundefinedorrelax{scr@dte@#1@init}{%
1899 \expandafter\providecommand\expandafter*%
1900 \csname scr@dte@#1@init\endcsname[1]%
1901 }{%
1902 \expandafter\l@preto@macro@a\csname scr@dte@#1@init\endcsname
1903 }%
1904 }
1905 \newcommand*{\@ExecuteTOCEntryStyleInitCode}[2]{%
1906 \let\scr@dte@doopts\@empty
1907 \expandafter\let\csname scr@dte@#1@needs\endcsname\relax
1908 \scr@ifundefinedorrelax{scr@dte@#1@init}{}{%
1909 \def\DefineTOCEntryBooleanOption{\@DefineTOCEntryBooleanOption{#1}}%
1910 \def\DefineTOCEntryCommandOption{\@DefineTOCEntryCommandOption{#1}}%
1911 \def\DefineTOCEntryIfOption{\@DefineTOCEntryIfOption{#1}}%
1912 \def\DefineTOCEntryLengthOption{\@DefineTOCEntryLengthOption{#1}}%
1913 \def\DefineTOCEntryListOption{\@DefineTOCEntryListOption{#1}}%
1914 \def\DefineTOCEntryNumberOption{\@DefineTOCEntryNumberOption{#1}}%
1915 \def\DefineTOCEntryOption{\@DefineTOCEntryOption{#1}}%
1916 \def\AddToDeclareTOCEntryStylePreCheckNeeds{%
1917 \@AddToDeclareTOCEntryStylePreCheckNeeds{#1}}%
1918 \def\PreToDeclareTOCEntryStylePreCheckNeeds{%
1919 \@PreToDeclareTOCEntryStylePreCheckNeeds{#1}}%
1920 \def\TOCEntryStyleNeedsCommandByOption{%
1921 \@TOCEntryStyleNeedsCommandByOption{#1}}%
1922 \@nameuse{scr@dte@#1@init}{#2}%
1923 \let\TOCEntryStyleNeedsCommandByOption\relax
1924 \let\PreToDeclareTOCEntryStylePreCheckNeeds\relax
1925 \let\AddToDeclareTOCEntryStylePreCheckNeeds\relax
1926 \let\DefineTOCEntryOption\relax
1927 \let\DefineTOCEntryNumberOption\relax
1928 \let\DefineTOCEntryListOption\relax
1929 \let\DefineTOCEntryLengthOption\relax
1930 \let\DefineTOCEntryIfOption\relax
1931 \let\DefineTOCEntryCommandOption\relax
1932 \let\DefineTOCEntryBooleanOption\relax
1933 }%
1934 }
1935 \NewDocumentCommand{\DeclareTOCStyleEntry}{+omm}{%
1936 \scr@ifundefinedorrelax{scr@dte@def@l@#2}{%
1937 \IfFileExists{tocbasic-tocstyle-#2.def}{%
1938 \edef\reserved@a{%
1939 \unexpanded{%
1940 \makeatletter
1941 \input{tocbasic-tocstyle-#2.def}%
1942 \catcode`\@=}\the\catcode`\@\relax
1943 }\reserved@a
1944 }{}%
1945 }{}%
1946 \scr@ifundefinedorrelax{scr@dte@def@l@#2}{%
1947 \PackageError{tocbasic}{toc entry style `#2' undefined}{%
1948 Somebody told me to define toc entry `#3' with style `#2',\MessageBreak
1949 but I do not know style `#2'.\MessageBreak
1950 You should first define the style then define the entry.\MessageBreak
1951 If you'll continue, I'll ignore the command. This could result
1952 in\MessageBreak
1953 further error messages.%
1954 }%
1955 }{%
1956 \let\scr@dte@precheck\@gobble
1957 \def\scr@dte@current{#3}%
1958 \@ExecuteTOCEntryStyleInitCode{#2}{#3}%
1959 \IfValueT{#1}{%
1960 \FamilyBoolKey[.dte]{KOMAarg}{expandtopt}{scr@dte@expandtopt}%
1961 \scr@dte@expandtoptfalse
1962 \FamilyExecuteOptions[.dte]{KOMAarg}{#1}%
1963 \RelaxFamilyKey[.dte]{KOMAarg}{expandtopt}%
1964 }%
1965 \@RelaxTOCEntryOptions
1966 \let\scr@dte@doopts\relax
1967 \let\scr@dte@current\relax
1968 \scr@ifundefinedorrelax{#3tocdepth}{%
1969 \expandafter\let\csname #3tocdepth\expandafter\endcsname
1970 \csname #3numdepth\endcsname
1971 }{}%
1972 \scr@dte@precheck{#3}%
1973 \let\scr@dte@precheck\relax
1974 \begingroup
1975 \aftergroup\@tempswatrue
1976 \def\do##1##2##3##4{%
1977 \scr@ifundefinedorrelax{##1#3##2}{%
1978 \PackageError{tocbasic}{toc style `#2' needs ##4\MessageBreak
1979 of `#3'}{%
1980 Usually the ##4 is defined using option `##3'.\MessageBreak
1981 In some cases it may be set defining command
1982 `\expandafter\string\csname ##1#3##2\endcsname'.\MessageBreak
1983 If you'll continue, I'll ignore the command. This could result
1984 in\MessageBreak
1985 further error messages.%
1986 }%
1987 \aftergroup\@tempswafalse
1988 }{}%
1989 }%
1990 \do{}{tocdepth}{level}{toc style level}%
1991 \@nameuse{scr@dte@#2@needs}%
1992 \endgroup
1993 \if@tempswa
1994 \@nameuse{scr@dte@def@l@#2}{#3}%
1995 \expandafter\edef\csname scr@dte@#3@style\endcsname{#2}%
1996 \expandafter\edef\csname scr@tso@#3@style\endcsname{#2}%
1997 \expandafter\let\csname toclevel@#3\expandafter\endcsname
1998 \csname #3tocdepth\endcsname
1999 \if@atdocument\else
2000 \scr@ifundefinedorrelax{AfterPackage}{%
2001 \AtBeginDocument
2002 }{%
2003 \AfterPackage*{hyperref}%
2004 }%
2005 {%
2006 \expandafter\let\csname toclevel@#3\expandafter\endcsname
2007 \csname #3tocdepth\endcsname
2008 }%
2009 \fi
2010 \fi
2011 }%
2012 }
2013 \NewDocumentCommand{\DeclareTOCStyleEntries}{+omm}{%
2014 \edef\reserved@a{#3}%
2015 \@for \reserved@a:=\reserved@a \do {%
2016 \scr@trim@spaces\reserved@a
2017 \ifx\reserved@a\@empty\else
2018 \IfValueTF{#1}{%
2019 \edef\reserved@a{%
2020 \unexpanded{\DeclareTOCStyleEntry[{#1}]{#2}}{\reserved@a}}%
2021 }{%
2022 \edef\reserved@a{%
2023 \unexpanded{\DeclareTOCStyleEntry{#2}}{\reserved@a}}%
2024 }%
2025 \reserved@a
2026 \fi
2027 }%
2028 }
2029 \NewDocumentCommand{\DeclareTOCEntryStyle}{m+O{}+m}{%
2030 \@namedef{scr@dte@def@l@#1}##1{%
2031 \@namedef{l@##1}####1####2{%
2032 \TOC@EntryStartHook{##1}%
2033 #3%
2034 \TOC@EntryEndHook{##1}%
2035 }%
2036 }%
2037 \TOCEntryStyleInitCode*{#1}{%
2038 \DefineTOCEntryNumberOption{level}{}{tocdepth}{toc entry level}%
2039 #2%
2040 }%
2041 }
2042 \newcommand*{\TOC@EntryStartHook}[1]{}
2043 \newcommand*{\TOC@EntryEndHook}[1]{}
2044 \newcommand*{\CloneTOCEntryStyle}[2]{%
2045 \expandafter\let\csname scr@dte@def@l@#2\expandafter\endcsname
2046 \csname scr@dte@def@l@#1\endcsname
2047 \expandafter\let\csname scr@dte@#2@init\expandafter\endcsname
2048 \csname scr@dte@#1@init\endcsname
2049 }
2050 \providecommand*\@pnumwidth{1.55em}
2051 \providecommand*\@tocrmarg {2.55em}
2052 \providecommand*\@dotsep {4.5}
2053 %%% From File: $Id: scrkernel-tocstyle.dtx 4228 2025-10-08 14:10:51Z kohm $
2054 %%% (run: style,gobble)
2055 \DeclareTOCEntryStyle{gobble}{}%
2056 %%% From File: $Id: scrkernel-tocstyle.dtx 4228 2025-10-08 14:10:51Z kohm $
2057 %%% (run: style,dottedtocline)
2058 \DeclareTOCEntryStyle{dottedtocline}[{%
2059 \DefineTOCEntryLengthOption{indent}%
2060 {scr@tso@}{@indent}{entry indent}%
2061 \DefineTOCEntryLengthOption{numwidth}%
2062 {scr@tso@}{@numwidth}{entry number width}%
2063 \@ifundefined{#1tocdepth}{%
2064 \Ifstr{#1}{part}{\@namedef{#1tocdepth}{-1}}{%
2065 \Ifstr{#1}{chapter}{\@namedef{#1tocdepth}{0}}{%
2066 \Ifstr{#1}{section}{\@namedef{#1tocdepth}{1}}{%
2067 \Ifstr{#1}{subsection}{\@namedef{#1tocdepth}{2}}{%
2068 \Ifstr{#1}{subsubsection}{\@namedef{#1tocdepth}{3}}{%
2069 \Ifstr{#1}{paragraph}{\@namedef{#1tocdepth}{4}}{%
2070 \Ifstr{#1}{subparagraph}{\@namedef{#1tocdepth}{5}}{%
2071 \Ifstr{#1}{figure}{\@namedef{#1tocdepth}{1}}{%
2072 \Ifstr{#1}{table}{\@namedef{#1tocdepth}{1}}{%
2073 \Ifstr{#1}{lstlisting}{\@namedef{#1tocdepth}{1}}{%
2074 \expandafter\let\csname #1tocdepth\expandafter\endcsname
2075 \csname #1numdepth\endcsname
2076 }%
2077 }%
2078 }%
2079 }%
2080 }%
2081 }%
2082 }%
2083 }%
2084 }%
2085 }%
2086 }{}%
2087 \@ifundefined{#1tocdepth}{%
2088 \expandafter\let\csname #1tocdepth\expandafter\endcsname
2089 \csname toclevel@#1\endcsname
2090 }{}%
2091 \@ifundefined{scr@tso@#1@indent}{%
2092 \@ifundefined{scr@#1@tocindent}{%
2093 \Ifstr{#1}{figure}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2094 \Ifstr{#1}{table}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2095 \Ifstr{#1}{lstlisting}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2096 \Ifstr{#1}{part}{\@namedef{scr@tso@#1@indent}{0em}}{%
2097 \Ifstr{#1}{chapter}{\@namedef{scr@tso@#1@indent}{0em}}{%
2098 \scr@ifundefinedorrelax{l@chapter}{%
2099 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{0pt}}{%
2100 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2101 \Ifstr{#1}{subsubsection}{%
2102 \@namedef{scr@tso@#1@indent}{3.8em}%
2103 }{%
2104 \Ifstr{#1}{paragraph}{%
2105 \@namedef{scr@tso@#1@indent}{7em}%
2106 }{%
2107 \Ifstr{#1}{subparagraph}{%
2108 \@namedef{scr@tso@#1@indent}{10em}%
2109 }{%
2110 }%
2111 }%
2112 }%
2113 }%
2114 }%
2115 }{%
2116 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2117 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{3.8em}}{%
2118 \Ifstr{#1}{subsubsection}{%
2119 \@namedef{scr@tso@#1@indent}{7.0em}%
2120 }{%
2121 \Ifstr{#1}{paragraph}{%
2122 \@namedef{scr@tso@#1@indent}{10em}%
2123 }{%
2124 \Ifstr{#1}{subparagraph}{%
2125 \@namedef{scr@tso@#1@indent}{12em}%
2126 }{%
2127 }%
2128 }%
2129 }%
2130 }%
2131 }%
2132 }%
2133 }%
2134 }%
2135 }%
2136 }%
2137 }%
2138 }{%
2139 \@namedef{scr@tso@#1@indent}{\@nameuse{scr@#1@tocindent}}%
2140 }%
2141 }{}%
2142 \@ifundefined{scr@tso@#1@numwidth}{%
2143 \@ifundefined{scr@#1@tocnumwidth}{%
2144 \Ifstr{#1}{figure}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2145 \Ifstr{#1}{table}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2146 \Ifstr{#1}{lstlisting}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2147 \Ifstr{#1}{chapter}{\@namedef{scr@tso@#1@numwidth}{1.5em}}{%
2148 \scr@ifundefinedorrelax{chapter}{%
2149 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@numwidth}{1.5em}}{%
2150 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2151 \Ifstr{#1}{subsubsection}{%
2152 \@namedef{scr@tso@#1@numwidth}{3.2em}%
2153 }{%
2154 \Ifstr{#1}{paragraph}{%
2155 \@namedef{scr@tso@#1@numwidth}{4.1em}%
2156 }{%
2157 \Ifstr{#1}{subparagraph}{%
2158 \@namedef{scr@tso@#1@numwidth}{5m}%
2159 }{%
2160 }%
2161 }%
2162 }%
2163 }%
2164 }%
2165 }{%
2166 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2167 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@numwidth}{3.2em}}{%
2168 \Ifstr{#1}{subsubsection}{%
2169 \@namedef{scr@tso@#1@numwidth}{3.1em}%
2170 }{%
2171 \Ifstr{#1}{paragraph}{%
2172 \@namedef{scr@tso@#1@numwidth}{5em}%
2173 }{%
2174 \Ifstr{#1}{subparagraph}{%
2175 \@namedef{scr@tso@#1@numwidth}{6em}%
2176 }{%
2177 }%
2178 }%
2179 }%
2180 }%
2181 }%
2182 }%
2183 }%
2184 }%
2185 }%
2186 }%
2187 }{%
2188 \@namedef{scr@tso@#1@numwidth}{\@nameuse{scr@#1@tocnumwidth}}%
2189 }%
2190 }{}%
2191 }]{%
2192 \Iftocfeature{\@currext}{noindent}{%
2193 \@dottedtocline{\@nameuse{#1tocdepth}}{\z@}%
2194 {\@nameuse{scr@tso@#1@numwidth}}{##1}{##2}%
2195 }{%
2196 \@dottedtocline{\@nameuse{#1tocdepth}}{\@nameuse{scr@tso@#1@indent}}%
2197 {\@nameuse{scr@tso@#1@numwidth}}{##1}{##2}%
2198 }%
2199 }
2200 %%% From File: $Id: scrkernel-tocstyle.dtx 4228 2025-10-08 14:10:51Z kohm $
2201 %%% (run: style,undottedtocline)
2202 \DeclareTOCEntryStyle{undottedtocline}[{%
2203 \DefineTOCEntryLengthOption{indent}%
2204 {scr@tso@}{@indent}{entry indent}%
2205 \DefineTOCEntryLengthOption{numwidth}%
2206 {scr@tso@}{@numwidth}{entry number width}%
2207 \@ifundefined{#1tocdepth}{%
2208 \Ifstr{#1}{part}{\@namedef{#1tocdepth}{-1}}{%
2209 \Ifstr{#1}{chapter}{\@namedef{#1tocdepth}{0}}{%
2210 \Ifstr{#1}{section}{\@namedef{#1tocdepth}{1}}{%
2211 \Ifstr{#1}{subsection}{\@namedef{#1tocdepth}{2}}{%
2212 \Ifstr{#1}{subsubsection}{\@namedef{#1tocdepth}{3}}{%
2213 \Ifstr{#1}{paragraph}{\@namedef{#1tocdepth}{4}}{%
2214 \Ifstr{#1}{subparagraph}{\@namedef{#1tocdepth}{5}}{%
2215 \Ifstr{#1}{figure}{\@namedef{#1tocdepth}{1}}{%
2216 \Ifstr{#1}{table}{\@namedef{#1tocdepth}{1}}{%
2217 \Ifstr{#1}{lstlisting}{\@namedef{#1tocdepth}{1}}{%
2218 \expandafter\let\csname #1tocdepth\expandafter\endcsname
2219 \csname #1numdepth\endcsname
2220 }%
2221 }%
2222 }%
2223 }%
2224 }%
2225 }%
2226 }%
2227 }%
2228 }%
2229 }%
2230 }{}%
2231 \@ifundefined{#1tocdepth}{%
2232 \expandafter\let\csname #1tocdepth\expandafter\endcsname
2233 \csname toclevel@#1\endcsname
2234 }{}%
2235 \@ifundefined{scr@tso@#1@indent}{%
2236 \@ifundefined{scr@#1@tocindent}{%
2237 \Ifstr{#1}{figure}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2238 \Ifstr{#1}{table}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2239 \Ifstr{#1}{lstlisting}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2240 \Ifstr{#1}{part}{\@namedef{scr@tso@#1@indent}{0em}}{%
2241 \Ifstr{#1}{chapter}{\@namedef{scr@tso@#1@indent}{0em}}{%
2242 \scr@ifundefinedorrelax{l@chapter}{%
2243 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{0pt}}{%
2244 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2245 \Ifstr{#1}{subsubsection}{%
2246 \@namedef{scr@tso@#1@indent}{3.8em}%
2247 }{%
2248 \Ifstr{#1}{paragraph}{%
2249 \@namedef{scr@tso@#1@indent}{7em}%
2250 }{%
2251 \Ifstr{#1}{subparagraph}{%
2252 \@namedef{scr@tso@#1@indent}{10em}%
2253 }{%
2254 }%
2255 }%
2256 }%
2257 }%
2258 }%
2259 }{%
2260 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2261 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{3.8em}}{%
2262 \Ifstr{#1}{subsubsection}{%
2263 \@namedef{scr@tso@#1@indent}{7.0em}%
2264 }{%
2265 \Ifstr{#1}{paragraph}{%
2266 \@namedef{scr@tso@#1@indent}{10em}%
2267 }{%
2268 \Ifstr{#1}{subparagraph}{%
2269 \@namedef{scr@tso@#1@indent}{12em}%
2270 }{%
2271 }%
2272 }%
2273 }%
2274 }%
2275 }%
2276 }%
2277 }%
2278 }%
2279 }%
2280 }%
2281 }%
2282 }{%
2283 \@namedef{scr@tso@#1@indent}{\@nameuse{scr@#1@tocindent}}%
2284 }%
2285 }{}%
2286 \@ifundefined{scr@tso@#1@numwidth}{%
2287 \@ifundefined{scr@#1@tocnumwidth}{%
2288 \Ifstr{#1}{figure}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2289 \Ifstr{#1}{table}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2290 \Ifstr{#1}{lstlisting}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2291 \Ifstr{#1}{chapter}{\@namedef{scr@tso@#1@numwidth}{1.5em}}{%
2292 \scr@ifundefinedorrelax{chapter}{%
2293 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@numwidth}{1.5em}}{%
2294 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2295 \Ifstr{#1}{subsubsection}{%
2296 \@namedef{scr@tso@#1@numwidth}{3.2em}%
2297 }{%
2298 \Ifstr{#1}{paragraph}{%
2299 \@namedef{scr@tso@#1@numwidth}{4.1em}%
2300 }{%
2301 \Ifstr{#1}{subparagraph}{%
2302 \@namedef{scr@tso@#1@numwidth}{5m}%
2303 }{%
2304 }%
2305 }%
2306 }%
2307 }%
2308 }%
2309 }{%
2310 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2311 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@numwidth}{3.2em}}{%
2312 \Ifstr{#1}{subsubsection}{%
2313 \@namedef{scr@tso@#1@numwidth}{3.1em}%
2314 }{%
2315 \Ifstr{#1}{paragraph}{%
2316 \@namedef{scr@tso@#1@numwidth}{5em}%
2317 }{%
2318 \Ifstr{#1}{subparagraph}{%
2319 \@namedef{scr@tso@#1@numwidth}{6em}%
2320 }{%
2321 }%
2322 }%
2323 }%
2324 }%
2325 }%
2326 }%
2327 }%
2328 }%
2329 }%
2330 }%
2331 }{%
2332 \@namedef{scr@tso@#1@numwidth}{\@nameuse{scr@#1@tocnumwidth}}%
2333 }%
2334 }{}%
2335 }]{%
2336 \ifnum \c@tocdepth >\numexpr \@nameuse{#1tocdepth}-\@ne\relax
2337 \ifnum \@nameuse{#1tocdepth}<\@ne
2338 \scr@ifundefinedorrelax{chapter}{%
2339 \addpenalty\@secpenalty
2340 \addvspace{1.0em \@plus\p@}%
2341 }{%
2342 \addpenalty{-\@highpenalty}%
2343 \vskip 1.0em \@plus\p@
2344 }%
2345 \else
2346 \addpenalty\@secpenalty
2347 \addvspace{1.0em \@plus\p@}%
2348 \fi
2349 \setlength\@tempdima{\@nameuse{scr@tso@#1@numwidth}}%
2350 \begingroup
2351 \parindent \z@ \rightskip \@pnumwidth
2352 \parfillskip -\@pnumwidth
2353 \leavevmode
2354 \bfseries
2355 \advance\leftskip\@tempdima
2356 \Iftocfeature{\@currext}{noindent}{%
2357 \hskip -\leftskip
2358 }{%
2359 \advance\leftskip\@nameuse{scr@tso@#1@indent}%
2360 \hskip -\dimexpr \leftskip-\@nameuse{scr@tso@#1@indent}\relax
2361 }%
2362 ##1%
2363 \nobreak
2364 \hfil \nobreak\hb@xt@\@pnumwidth{\hss ##2}%
2365 \par
2366 \penalty\@highpenalty
2367 \endgroup
2368 \fi
2369 }
2370 %%% From File: $Id: scrkernel-tocstyle.dtx 4228 2025-10-08 14:10:51Z kohm $
2371 %%% (run: style, largetocline)
2372 \DeclareTOCEntryStyle{largetocline}[{%
2373 \DefineTOCEntryLengthOption{indent}%
2374 {scr@tso@}{@indent}{entry indent}%
2375 \@ifundefined{#1tocdepth}{%
2376 \Ifstr{#1}{part}{\@namedef{#1tocdepth}{-1}}{%
2377 \Ifstr{#1}{chapter}{\@namedef{#1tocdepth}{0}}{%
2378 \Ifstr{#1}{section}{\@namedef{#1tocdepth}{1}}{%
2379 \Ifstr{#1}{subsection}{\@namedef{#1tocdepth}{2}}{%
2380 \Ifstr{#1}{subsubsection}{\@namedef{#1tocdepth}{3}}{%
2381 \Ifstr{#1}{paragraph}{\@namedef{#1tocdepth}{4}}{%
2382 \Ifstr{#1}{subparagraph}{\@namedef{#1tocdepth}{5}}{%
2383 \Ifstr{#1}{figure}{\@namedef{#1tocdepth}{1}}{%
2384 \Ifstr{#1}{table}{\@namedef{#1tocdepth}{1}}{%
2385 \Ifstr{#1}{lstlisting}{\@namedef{#1tocdepth}{1}}{%
2386 \expandafter\let\csname #1tocdepth\expandafter\endcsname
2387 \csname #1numdepth\endcsname
2388 }%
2389 }%
2390 }%
2391 }%
2392 }%
2393 }%
2394 }%
2395 }%
2396 }%
2397 }%
2398 }{}%
2399 \@ifundefined{#1tocdepth}{%
2400 \expandafter\let\csname #1tocdepth\expandafter\endcsname
2401 \csname toclevel@#1\endcsname
2402 }{}%
2403 \@ifundefined{scr@tso@#1@indent}{%
2404 \@ifundefined{scr@#1@tocindent}{%
2405 \Ifstr{#1}{figure}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2406 \Ifstr{#1}{table}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2407 \Ifstr{#1}{lstlisting}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2408 \Ifstr{#1}{part}{\@namedef{scr@tso@#1@indent}{0em}}{%
2409 \Ifstr{#1}{chapter}{\@namedef{scr@tso@#1@indent}{0em}}{%
2410 \scr@ifundefinedorrelax{l@chapter}{%
2411 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{0pt}}{%
2412 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2413 \Ifstr{#1}{subsubsection}{%
2414 \@namedef{scr@tso@#1@indent}{3.8em}%
2415 }{%
2416 \Ifstr{#1}{paragraph}{%
2417 \@namedef{scr@tso@#1@indent}{7em}%
2418 }{%
2419 \Ifstr{#1}{subparagraph}{%
2420 \@namedef{scr@tso@#1@indent}{10em}%
2421 }{%
2422 }%
2423 }%
2424 }%
2425 }%
2426 }%
2427 }{%
2428 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2429 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{3.8em}}{%
2430 \Ifstr{#1}{subsubsection}{%
2431 \@namedef{scr@tso@#1@indent}{7.0em}%
2432 }{%
2433 \Ifstr{#1}{paragraph}{%
2434 \@namedef{scr@tso@#1@indent}{10em}%
2435 }{%
2436 \Ifstr{#1}{subparagraph}{%
2437 \@namedef{scr@tso@#1@indent}{12em}%
2438 }{%
2439 }%
2440 }%
2441 }%
2442 }%
2443 }%
2444 }%
2445 }%
2446 }%
2447 }%
2448 }%
2449 }%
2450 }{%
2451 \@namedef{scr@tso@#1@indent}{\@nameuse{scr@#1@tocindent}}%
2452 }%
2453 }{}%
2454 }]{%
2455 \ifnum \c@tocdepth >\numexpr \@nameuse{#1tocdepth}-\@ne\relax
2456 \ifnum \@nameuse{#1tocdepth}<\@ne
2457 \scr@ifundefinedorrelax{chapter}{%
2458 \addpenalty\@secpenalty
2459 \addvspace{2.25em \@plus\p@}%
2460 }{%
2461 \addpenalty{-\@highpenalty}%
2462 \addvspace{2.25em \@plus\p@}%
2463 }%
2464 \else
2465 \addpenalty\@secpenalty
2466 \addvspace{2.25em \@plus\p@}%
2467 \fi
2468 \setlength\@tempdima{3em}%
2469 \begingroup
2470 \parindent \z@ \rightskip \@pnumwidth
2471 \parfillskip -\@pnumwidth
2472 \leavevmode
2473 \large
2474 \bfseries
2475 \Iftocfeature{\@currext}{noindent}{%
2476 }{%
2477 \advance\leftskip\@nameuse{scr@tso@#1@indent}%
2478 }%
2479 ##1%
2480 \hfil \nobreak\hb@xt@\@pnumwidth{\hss ##2}%
2481 \par
2482 \nobreak
2483 \ifnum 0=
2484 \scr@ifundefinedorrelax{chapter}{\if@compatibility 1\else 0\fi}{1}\relax
2485 \global\@nobreaktrue
2486 \everypar{\global\@nobreakfalse\everypar{}}%
2487 \fi
2488 \endgroup
2489 \fi
2490 }
2491 %%% From File: $Id: scrkernel-tocstyle.dtx 4228 2025-10-08 14:10:51Z kohm $
2492 %%% (run: style,tocline)
2493 \DeclareTOCEntryStyle{tocline}[{%
2494 \DefineTOCEntryCommandOption{numberprefix}%
2495 {scr@tso@}{@numberprefix}{number prefix definition}%
2496 \DefineTOCEntryCommandOption{numberpostfix}%
2497 {scr@tso@}{@numberpostfix}{number postfix definition}%
2498 \DefineTOCEntryLengthOption{beforeskip}%
2499 {scr@tso@}{@beforeskip}{vertical skip before the entry}%
2500 \DefineTOCEntryIfOption{breakafternumber}%
2501 {scr@tso@}{@breakafternumber}{line break after number flag}%
2502 \DefineTOCEntryIfOption{dynnumwidth}%
2503 {scr@tso@}{@dynnumwidth}{dynamic number width flag}%
2504 \DefineTOCEntryListOption{indentfollows}%
2505 {scr@tso@}{@indentfollows}{list of levels that define the indent}%
2506 \DefineTOCEntryIfOption{dynindent}%
2507 {scr@tso@}{@dynindent}{dynamic indent width flag}%
2508 \DefineTOCEntryCommandOption{entryformat}%
2509 {scr@tso@}{@entryformat}[1]{entry format}%
2510 \DefineTOCEntryCommandOption{entrynumberformat}%
2511 {scr@tso@}{@numberformat}[1]{entry number format}%
2512 \DefineTOCEntryCommandOption{linefill}[\TOCLineLeaderFill]%
2513 {scr@tso@}{@linefill}{filling between text and page number}%
2514 \DefineTOCEntryLengthOption{numsep}%
2515 {scr@tso@}{@numsep}{entry number separation}%
2516 \DefineTOCEntryCommandOption{onstarthigherlevel}%
2517 {scr@tso@}{@LastTOCLevelWasLower}{start higher level entry hook}%
2518 \DefineTOCEntryCommandOption{onstartlowerlevel}%
2519 {scr@tso@}{@LastTOCLevelWasHigher}{start lower level entry hook}%
2520 \DefineTOCEntryCommandOption{onstartsamelevel}%
2521 {scr@tso@}{@LastTOCLevelWasSame}{start same level entry hook}%
2522 \DefineTOCEntryCommandOption{pagenumberbox}%
2523 {scr@tso@}{@pagenumberbox}[1]{page number box}%
2524 \DefineTOCEntryCommandOption{pagenumberformat}%
2525 {scr@tso@}{@pagenumberformat}[1]{page number format}%
2526 \DefineTOCEntryLengthOption{pagenumberwidth}%
2527 {scr@tso@}{@pagenumberwidth}{width of page number box}%
2528 \DefineTOCEntryLengthOption{rightindent}%
2529 {scr@tso@}{@rightindent}{entry's text right indent}%
2530 \DefineTOCEntryOption{raggedentrytext}[true]{%
2531 \FamilySetBool{KOMAarg}{raggedentrytext}{@tempswa}{##1}%
2532 \ifx\FamilyKeyState\FamilyKeyStateProcessed
2533 \if@tempswa
2534 \expandafter\let\csname ragged\scr@dte@current entry\endcsname
2535 \raggedright
2536 \else
2537 \expandafter\let\csname ragged\scr@dte@current entry\endcsname
2538 \relax
2539 \fi
2540 \fi
2541 }%
2542 \DefineTOCEntryIfOption{raggedpagenumber}%
2543 {scr@tso@}{@raggedpage}{page number ragged flag}%
2544 \DefineTOCEntryLengthOption{indent}%
2545 {scr@tso@}{@indent}{entry indent}%
2546 \DefineTOCEntryLengthOption{numwidth}%
2547 {scr@tso@}{@numwidth}{entry number width}%
2548 \ExpandArgs{c}\providecommand{scr@tso@#1@numberprefix}{}%
2549 \ExpandArgs{c}\providecommand{scr@tso@#1@numberpostfix}{}%
2550 \scr@ifundefinedorrelax{#1tocdepth}{%
2551 \Ifstrstart{#1}{sub}{%
2552 \scr@ifundefinedorrelax{\scr@dte@nosub{#1}tocdepth}{}{%
2553 \expandafter\edef\csname #1tocdepth\endcsname{%
2554 \the\numexpr \noexpand\@nameuse{\scr@dte@nosub{#1}tocdepth}+\@ne\relax
2555 }%
2556 }%
2557 }{}%
2558 }{}%
2559 \@ifundefined{#1tocdepth}{%
2560 \Ifstr{#1}{part}{\@namedef{#1tocdepth}{-1}}{%
2561 \Ifstr{#1}{chapter}{\@namedef{#1tocdepth}{0}}{%
2562 \Ifstr{#1}{section}{\@namedef{#1tocdepth}{1}}{%
2563 \Ifstr{#1}{subsection}{\@namedef{#1tocdepth}{2}}{%
2564 \Ifstr{#1}{subsubsection}{\@namedef{#1tocdepth}{3}}{%
2565 \Ifstr{#1}{paragraph}{\@namedef{#1tocdepth}{4}}{%
2566 \Ifstr{#1}{subparagraph}{\@namedef{#1tocdepth}{5}}{%
2567 \Ifstr{#1}{figure}{\@namedef{#1tocdepth}{1}}{%
2568 \Ifstr{#1}{table}{\@namedef{#1tocdepth}{1}}{%
2569 \Ifstr{#1}{lstlisting}{\@namedef{#1tocdepth}{1}}{%
2570 \expandafter\let\csname #1tocdepth\expandafter\endcsname
2571 \csname #1numdepth\endcsname
2572 }%
2573 }%
2574 }%
2575 }%
2576 }%
2577 }%
2578 }%
2579 }%
2580 }%
2581 }%
2582 }{}%
2583 \@ifundefined{#1tocdepth}{%
2584 \expandafter\let\csname #1tocdepth\expandafter\endcsname
2585 \csname toclevel@#1\endcsname
2586 }{}%
2587 \scr@ifundefinedorrelax{scr@tso@#1@indent}{%
2588 \@ifundefined{scr@#1@tocindent}{%
2589 \Ifstrstart{#1}{sub}{%
2590 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@indent}{%
2591 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@numwidth}{}{%
2592 \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
2593 \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@numwidth}%
2594 \relax
2595 }%
2596 }%
2597 }{%
2598 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@numwidth}{%
2599 \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
2600 \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@indent}%
2601 \relax
2602 }%
2603 }{%
2604 \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
2605 \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@indent}%
2606 +\noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@numwidth}%
2607 \relax
2608 }%
2609 }%
2610 }%
2611 }{}%
2612 }{%
2613 \@namedef{scr@tso@#1@indent}{\@nameuse{scr@#1@tocindent}}%
2614 }%
2615 }{}%
2616 \scr@ifundefinedorrelax{scr@tso@#1@pagenumberwidth}{%
2617 \Ifstrstart{#1}{sub}{%
2618 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@pagenumberwidth}{%
2619 \@namedef{scr@tso@#1@pagenumberwidth}{\@pnumwidth}%
2620 }{%
2621 \expandafter\let
2622 \csname scr@tso@#1@pagenumberwidth\expandafter\endcsname
2623 \csname scr@tso@\scr@dte@nosub{#1}@pagenumberwidth\endcsname
2624 }%
2625 }{%
2626 \@namedef{scr@tso@#1@pagenumberwidth}{\@pnumwidth}%
2627 }%
2628 }{}%
2629 \scr@ifundefinedorrelax{scr@tso@#1@rightindent}{%
2630 \Ifstrstart{#1}{sub}{%
2631 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@rightindent}{%
2632 \@namedef{scr@tso@#1@rightindent}{\@tocrmarg}%
2633 }{%
2634 \expandafter\let
2635 \csname scr@tso@#1@rightindent\expandafter\endcsname
2636 \csname scr@tso@\scr@dte@nosub{#1}@rightindent\endcsname
2637 }%
2638 }{%
2639 \@namedef{scr@tso@#1@rightindent}{\@tocrmarg}%
2640 }%
2641 }{}%
2642 \@ifundefined{scr@tso@#1@indent}{%
2643 \Ifstr{#1}{figure}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2644 \Ifstr{#1}{table}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2645 \Ifstr{#1}{lstlisting}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2646 \Ifstr{#1}{part}{\@namedef{scr@tso@#1@indent}{0em}}{%
2647 \Ifstr{#1}{chapter}{\@namedef{scr@tso@#1@indent}{0em}}{%
2648 \scr@ifundefinedorrelax{l@chapter}{%
2649 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{0pt}}{%
2650 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2651 \Ifstr{#1}{subsubsection}{%
2652 \@namedef{scr@tso@#1@indent}{3.8em}%
2653 }{%
2654 \Ifstr{#1}{paragraph}{%
2655 \@namedef{scr@tso@#1@indent}{7em}%
2656 }{%
2657 \Ifstr{#1}{subparagraph}{%
2658 \@namedef{scr@tso@#1@indent}{10em}%
2659 }{%
2660 }%
2661 }%
2662 }%
2663 }%
2664 }%
2665 }{%
2666 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
2667 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{3.8em}}{%
2668 \Ifstr{#1}{subsubsection}{%
2669 \@namedef{scr@tso@#1@indent}{7.0em}%
2670 }{%
2671 \Ifstr{#1}{paragraph}{%
2672 \@namedef{scr@tso@#1@indent}{10em}%
2673 }{%
2674 \Ifstr{#1}{subparagraph}{%
2675 \@namedef{scr@tso@#1@indent}{12em}%
2676 }{%
2677 }%
2678 }%
2679 }%
2680 }%
2681 }%
2682 }%
2683 }%
2684 }%
2685 }%
2686 }%
2687 }%
2688 }{}%
2689 \scr@ifundefinedorrelax{scr@tso@#1@numwidth}{%
2690 \scr@ifundefinedorrelax{scr@#1@tocnumwidth}{%
2691 \Ifstrstart{#1}{sub}{%
2692 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@numwidth}{}{%
2693 \expandafter\edef\csname scr@tso@#1@numwidth\endcsname{%
2694 \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@numwidth}%
2695 +.9em%
2696 \relax
2697 }%
2698 }%
2699 }{}%
2700 }{%
2701 \@namedef{scr@tso@#1@numwidth}{\@nameuse{scr@#1@tocnumwidth}}%
2702 }%
2703 }{}%
2704 \@ifundefined{scr@tso@#1@numwidth}{%
2705 \Ifstr{#1}{figure}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2706 \Ifstr{#1}{table}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2707 \Ifstr{#1}{lstlisting}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2708 \Ifstr{#1}{chapter}{\@namedef{scr@tso@#1@numwidth}{1.5em}}{%
2709 \scr@ifundefinedorrelax{chapter}{%
2710 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@numwidth}{1.5em}}{%
2711 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2712 \Ifstr{#1}{subsubsection}{%
2713 \@namedef{scr@tso@#1@numwidth}{3.2em}%
2714 }{%
2715 \Ifstr{#1}{paragraph}{%
2716 \@namedef{scr@tso@#1@numwidth}{4.1em}%
2717 }{%
2718 \Ifstr{#1}{subparagraph}{%
2719 \@namedef{scr@tso@#1@numwidth}{5m}%
2720 }{%
2721 }%
2722 }%
2723 }%
2724 }%
2725 }%
2726 }{%
2727 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@numwidth}{2.3em}}{%
2728 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@numwidth}{3.2em}}{%
2729 \Ifstr{#1}{subsubsection}{%
2730 \@namedef{scr@tso@#1@numwidth}{3.1em}%
2731 }{%
2732 \Ifstr{#1}{paragraph}{%
2733 \@namedef{scr@tso@#1@numwidth}{5em}%
2734 }{%
2735 \Ifstr{#1}{subparagraph}{%
2736 \@namedef{scr@tso@#1@numwidth}{6em}%
2737 }{%
2738 }%
2739 }%
2740 }%
2741 }%
2742 }%
2743 }%
2744 }%
2745 }%
2746 }%
2747 }%
2748 }{}%
2749 \expandafter\providecommand%
2750 \csname scr@tso@#1@LastTOCLevelWasLower\endcsname{\LastTOCLevelWasLower}%
2751 \expandafter\providecommand%
2752 \csname scr@tso@#1@LastTOCLevelWasSame\endcsname{\LastTOCLevelWasSame}%
2753 \expandafter\providecommand%
2754 \csname scr@tso@#1@LastTOCLevelWasHigher\endcsname{\LastTOCLevelWasHigher}%
2755 \@ifundefined{scr@tso@#1@beforeskip}{%
2756 \Ifstr{#1}{part}{%
2757 \@namedef{scr@tso@#1@beforeskip}{\glueexpr 2.25em \@plus\p@\relax}%
2758 }{%
2759 \Ifstr{#1}{chapter}{%
2760 \@namedef{scr@tso@#1@beforeskip}{\glueexpr 1.0em \@plus\p@\relax}%
2761 }{%
2762 \Ifstr{#1}{section}{%
2763 \scr@ifundefinedorrelax{l@chapter}{%
2764 \@namedef{scr@tso@#1@beforeskip}{\glueexpr 1.0em \@plus\p@\relax}%
2765 }{}%
2766 }{}%
2767 }%
2768 }%
2769 \expandafter\providecommand\expandafter*%
2770 \csname scr@tso@#1@beforeskip\endcsname{\glueexpr \z@ plus .2\p@\relax}%
2771 }{}%
2772 \@ifundefined{scr@dte@#1@maxnumwidth}{%
2773 \expandafter\newlength\csname scr@dte@#1@maxnumwidth\endcsname
2774 \setlength{\@nameuse{scr@dte@#1@maxnumwidth}}{\z@}%
2775 }{}%
2776 \providecommand*{\scr@dte@donumwidth}{}%
2777 \g@addto@macro{\scr@dte@donumwidth}{\do{#1}}%
2778 \expandafter\providecommand\expandafter*%
2779 \csname scr@tso@#1@numsep\endcsname{.4em}%
2780 \expandafter\providecommand%
2781 \csname scr@tso@#1@numberformat\endcsname[1]{##1}%
2782 \Ifstr{#1}{part}{%
2783 \expandafter\providecommand%
2784 \csname scr@tso@#1@entryformat\endcsname[1]{\large\bfseries ##1}%
2785 }{%
2786 \Ifstr{#1}{chapter}{%
2787 \expandafter\providecommand%
2788 \csname scr@tso@#1@entryformat\endcsname[1]{\bfseries ##1}%
2789 }{%
2790 \scr@ifundefinedorrelax{l@chapter}{%
2791 \Ifstr{#1}{section}{%
2792 \expandafter\providecommand%
2793 \csname scr@tso@#1@entryformat\endcsname[1]{\bfseries ##1}%
2794 }{}%
2795 }{}%
2796 \expandafter\providecommand%
2797 \csname scr@tso@#1@entryformat\endcsname[1]{##1}%
2798 }%
2799 }%
2800 \expandafter\providecommand
2801 \csname Ifscr@tso@#1@breakafternumber\endcsname[2]{##2}%
2802 \@ifundefined{scr@tso@#1@linefill}{%
2803 \Ifstr{#1}{part}{%
2804 \@namedef{scr@tso@#1@linefill}{\hfill}%
2805 }{%
2806 \Ifstr{#1}{chapter}{%
2807 \@namedef{scr@tso@#1@linefill}{\hfill}%
2808 }{%
2809 \scr@ifundefinedorrelax{l@chapter}{%
2810 \Ifstr{#1}{section}{%
2811 \@namedef{scr@tso@#1@linefill}{\hfill}%
2812 }{}%
2813 }{}%
2814 \expandafter\providecommand%
2815 \csname scr@tso@#1@linefill\endcsname{\TOCLineLeaderFill\relax}%
2816 }%
2817 }%
2818 }{}%
2819 \expandafter\providecommand\csname Ifscr@tso@#1@raggedpage\endcsname[2]{##2}%
2820 \Ifstr{#1}{part}{%
2821 \expandafter\providecommand%
2822 \csname scr@tso@#1@pagenumberformat\endcsname[1]{\large\bfseries ##1}%
2823 }{%
2824 \Ifstr{#1}{chapter}{%
2825 \expandafter\providecommand%
2826 \csname scr@tso@#1@pagenumberformat\endcsname[1]{\bfseries ##1}%
2827 }{%
2828 \scr@ifundefinedorrelax{l@chapter}{%
2829 \Ifstr{#1}{section}{%
2830 \expandafter\providecommand%
2831 \csname scr@tso@#1@pagenumberformat\endcsname[1]{\bfseries ##1}%
2832 }{}%
2833 }{}%
2834 \expandafter\providecommand%
2835 \csname scr@tso@#1@pagenumberformat\endcsname[1]{%
2836 \normalfont\normalcolor ##1}%
2837 }%
2838 }%
2839 \expandafter\providecommand%
2840 \csname scr@tso@#1@pagenumberbox\endcsname[1]{%
2841 \hb@xt@\@nameuse{scr@dte@pagenumberwidth}{\hfil ##1}}%
2842 \expandafter\providecommand\csname
2843 Ifscr@tso@#1@dynnumwidth\endcsname[2]{##2}%
2844 \expandafter\providecommand\csname Ifscr@tso@#1@dynindent\endcsname[2]{##2}%
2845 \scr@ifundefinedorrelax{scr@tso@#1@indentfollows}{%
2846 \Ifstrstart{#1}{sub}{%
2847 \expandafter\edef\csname scr@tso@#1@indentfollows\endcsname{%
2848 \scr@dte@nosub{#1}%
2849 }%
2850 }{%
2851 \expandafter\let\csname scr@tso@#1@indentfollows\endcsname\@empty
2852 }%
2853 }{}%
2854 }]{%
2855 \scr@dte@tocline{#1}{##1}{##2}%
2856 }
2857 \AtBeginDocument{%
2858 \BeforeClosingMainAux{%
2859 \begingroup
2860 \def\do#1{%
2861 \relax
2862 \scr@ifundefinedorrelax{scr@dte@#1@maxnumwidth}{}{%
2863 \ifdim \@nameuse{scr@dte@#1@maxnumwidth}>\z@
2864 \if@filesw
2865 \protected@write\@mainaux{}{%
2866 \string\global\string\@namedef{scr@dte@#1@lastmaxnumwidth}%
2867 {\the\@nameuse{scr@dte@#1@maxnumwidth}}%
2868 }%
2869 \fi
2870 \@nameuse{scr@dte@#1@maxnumwidth}\z@
2871 \fi
2872 }%
2873 }%
2874 \@nameuse{scr@dte@donumwidth}%
2875 \endgroup
2876 }%
2877 }
2878 \newcommand*{\scr@dte@nosub}[1]{\@scr@dte@nosub #1\relax}
2879 \newcommand*{\@scr@dte@nosub}{}
2880 \def\@scr@dte@nosub sub#1\relax{#1}
2881 \newlength\scr@dte@tocline@numberwidth
2882 \newcommand*{\scr@dte@tocline}[3]{%
2883 \ifnum \@nameuse{#1tocdepth}>\c@tocdepth
2884 \else
2885 \tocbasic@DependOnPenaltyAndTOCLevel{#1}%
2886 \addvspace{\@nameuse{scr@tso@#1@beforeskip}}\relax
2887 \@nameuse{Ifscr@tso@#1@dynindent}{%
2888 \expandafter\ifx\csname scr@tso@#1@indentfollows\endcsname\@empty
2889 \PackageWarning{tocbasic}{`dynindent' for `#1' not available}%
2890 \else
2891 \edef\reserved@a{\@nameuse{scr@tso@#1@indentfollows}}%
2892 \@for \reserved@a:=\reserved@a\do {%
2893 \scr@trim@spaces\reserved@a
2894 \ifx\reserved@a\@empty\else
2895 \scr@ifundefinedorrelax{\reserved@a tocdepth}{%
2896 }{%
2897 \ifnum \@nameuse{\reserved@a tocdepth}<\@nameuse{#1tocdepth}%
2898 \@tempdima\@nameuse{scr@tso@\reserved@a @indent}\relax
2899 \@nameuse{Ifscr@tso@\reserved@a @dynnumwidth}{%
2900 \scr@ifundefinedorrelax
2901 {scr@dte@\reserved@a @lastmaxnumwidth}{%
2902 \advance\@tempdima
2903 \@nameuse{scr@tso@\reserved@a @numwidth}\relax
2904 }{%
2905 \advance\@tempdima
2906 \@nameuse{scr@dte@\reserved@a @lastmaxnumwidth}\relax
2907 }%
2908 }{%
2909 \advance\@tempdima
2910 \@nameuse{scr@tso@\reserved@a @numwidth}\relax
2911 }%
2912 \ifdim \@tempdima>\@nameuse{scr@tso@#1@indent}\relax
2913 \expandafter\edef\csname scr@tso@#1@indent\endcsname
2914 {\the\@tempdima}%
2915 \fi
2916 \fi
2917 }%
2918 \fi
2919 }%
2920 \fi
2921 }{}%
2922 {%
2923 \Iftocfeature{\@currext}{noindent}{%
2924 \leftskip \z@
2925 }{%
2926 \leftskip \@nameuse{scr@tso@#1@indent}\relax
2927 }%
2928 \rightskip \@nameuse{scr@tso@#1@rightindent}\relax
2929 \parfillskip -\rightskip
2930 \@nameuse{Ifscr@tso@#1@raggedpage}{%
2931 \addtolength{\parfillskip}{\z@ \@plus 1fil}%
2932 }{}%
2933 \Iftocfeature{\@currext}{noindent}{%
2934 \parindent \z@
2935 }{%
2936 \parindent \@nameuse{scr@tso@#1@indent}\relax
2937 }%
2938 \@afterindenttrue
2939 \interlinepenalty\@M
2940 \expandafter\ifx\csname ragged#1entry\endcsname\raggedright
2941 \addtolength\rightskip\@flushglue
2942 \else
2943 \def\reserved@a{\raggedright}%
2944 \expandafter\ifx\csname ragged#1entry\endcsname\reserved@a
2945 \addtolength\rightskip\@flushglue
2946 \else
2947 \renewcommand\reserved@a{\raggedright}%
2948 \expandafter\ifx\csname ragged#1entry\endcsname\reserved@a
2949 \addtolength\rightskip\@flushglue
2950 \fi
2951 \fi
2952 \fi
2953 \leavevmode
2954 \@tempdima \@nameuse{scr@tso@#1@numwidth}\relax
2955 \@nameuse{Ifscr@tso@#1@dynnumwidth}{%
2956 \scr@ifundefinedorrelax{scr@dte@#1@lastmaxnumwidth}{}{%
2957 \ifdim \@nameuse{scr@dte@#1@lastmaxnumwidth}>\@tempdima
2958 \@tempdima\@nameuse{scr@dte@#1@lastmaxnumwidth}\relax
2959 \fi
2960 }%
2961 }{}%
2962 \advance\leftskip \@tempdima
2963 \null\nobreak\hskip -\leftskip
2964 {%
2965 \l@preto@macro\numberline@numberprefix
2966 {\@nameuse{scr@tso@#1@numberprefix}}%
2967 \l@addto@macro\numberline@numberpostfix
2968 {\@nameuse{scr@tso@#1@numberpostfix}}%
2969 \usetocbasicnumberline
2970 \let\scr@dte@numberline@box\numberline@box
2971 \def\numberline@box##1{%
2972 \sbox\scr@dte@tocline@numbox{\@nameuse{scr@tso@#1@numberformat}{##1}}%
2973 \global\scr@dte@tocline@numberwidth
2974 \dimexpr\wd\scr@dte@tocline@numbox+\@nameuse{scr@tso@#1@numsep}\relax
2975 \relax
2976 \ifdim \scr@dte@tocline@numberwidth
2977 >\@nameuse{scr@dte@#1@maxnumwidth}\relax
2978 \global\@nameuse{scr@dte@#1@maxnumwidth}\scr@dte@tocline@numberwidth
2979 \fi
2980 \@nameuse{Ifscr@tso@#1@dynnumwidth}{}{%
2981 \ifdim \scr@dte@tocline@numberwidth
2982 >\dimexpr \@nameuse{scr@tso@#1@numwidth}%
2983 +\@nameuse{scr@tso@#1@numsep}\relax\relax
2984 \PackageWarning{tocbasic}{%
2985 number width of #1 toc entries should be
2986 increased!\MessageBreak
2987 Currently used number width =
2988 \the\wd\scr@dte@tocline@numbox,\MessageBreak
2989 Wanted number separation
2990 \space\space\space =
2991 \the\dimexpr\@nameuse{scr@tso@#1@numsep}\relax,\MessageBreak
2992 Reserved number width \space\space\space\space\space\space =
2993 \the\dimexpr\@nameuse{scr@tso@#1@numwidth}\relax%
2994 }%
2995 \fi
2996 }%
2997 \scr@dte@numberline@box{\@nameuse{scr@tso@#1@numberformat}{##1}}%
2998 \@nameuse{Ifscr@tso@#1@breakafternumber}{%
2999 {\parfillskip\@flushglue\par}\nobreak\hskip-\leftskip
3000 }{}%
3001 }%
3002 \@nameuse{scr@tso@#1@entryformat}{%
3003 #2%
3004 \nobreak
3005 {%
3006 \normalfont\normalsize\@nameuse{scr@tso@#1@linefill}%
3007 \nobreak
3008 \expandafter\let\expandafter\scr@dte@pagenumberwidth
3009 \csname scr@tso@#1@pagenumberwidth\endcsname
3010 \@nameuse{scr@tso@#1@pagenumberbox}{%
3011 \@nameuse{scr@tso@#1@pagenumberformat}{#3}%
3012 }%
3013 }%
3014 \@par
3015 }%
3016 }%
3017 }%
3018 \tocbasic@SetPenaltyByTOCLevel{#1}%
3019 \fi
3020 }
3021 \newsavebox\scr@dte@tocline@numbox
3022 \newcommand*{\tocbasic@DependOnPenaltyAndTOCLevel}[1]{%
3023 \ifnum \lastpenalty<\numexpr 20009-\@nameuse{#1tocdepth}\relax
3024 \@nameuse{scr@tso@#1@LastTOCLevelWasHigher}%
3025 \else\ifnum \lastpenalty=\numexpr 20009-\@nameuse{#1tocdepth}\relax
3026 \@nameuse{scr@tso@#1@LastTOCLevelWasSame}%
3027 \else
3028 \@nameuse{scr@tso@#1@LastTOCLevelWasLower}%
3029 \fi
3030 \fi
3031 }
3032 \newcommand*{\tocbasic@SetPenaltyByTOCLevel}[1]{%
3033 \penalty \numexpr 20009-\@nameuse{#1tocdepth}\relax
3034 }
3035 \newcommand*{\LastTOCLevelWasHigher}{\ifvmode\addpenalty{\@lowpenalty}\fi}
3036 \newcommand*{\LastTOCLevelWasSame}{\ifvmode\addpenalty{\@lowpenalty}\fi}
3037 \newcommand*{\LastTOCLevelWasLower}{}
3038 \newcommand*{\TOCLineLeaderFill}[1][.]{%
3039 \leaders\hbox{$\m@th
3040 \mkern \@dotsep mu\hbox{#1}\mkern \@dotsep
3041 mu$}\hfill
3042 }
3043 %%% From File: $Id: scrkernel-tocstyle.dtx 4228 2025-10-08 14:10:51Z kohm $
3044 %%% (run: style,toctext)
3045 \DeclareTOCEntryStyle{toctext}[{%
3046 \DefineTOCEntryLengthOption{beforeskip}%
3047 {scr@tso@}{@beforeskip}{vertical skip before the entry}%
3048 \DefineTOCEntryListOption{indentfollows}%
3049 {scr@tso@}{@indentfollows}{list of levels that define the indent}%
3050 \DefineTOCEntryIfOption{dynindent}%
3051 {scr@tso@}{@dynindent}{dynamic indent width flag}%
3052 \DefineTOCEntryCommandOption{entryformat}%
3053 {scr@tso@}{@entryformat}[1]{entry format}%
3054 \DefineTOCEntryCommandOption{entrynumberformat}%
3055 {scr@tso@}{@numberformat}[1]{entry number format}%
3056 \DefineTOCEntryCommandOption{prepagenumber}%
3057 {scr@tso@}{@prepagenumber}{separator between text and page number}%
3058 \DefineTOCEntryLengthOption{numsep}%
3059 {scr@tso@}{@numsep}{entry number separation}%
3060 \DefineTOCEntryCommandOption{onstartfirstentry}%
3061 {scr@tso@}{@onstartfirstentry}{output at start of paragraph}%
3062 \DefineTOCEntryCommandOption{onstartentry}%
3063 {scr@tso@}{@onstartentry}{output at start of all entries but the first}%
3064 \DefineTOCEntryCommandOption{onendlastentry}%
3065 {scr@tso@}{@onendlastentry}{output at end of paragraph}%
3066 \DefineTOCEntryCommandOption{afterpar}%
3067 {scr@tso@}{@afterpar}{settings after end of paragraph}%
3068 \DefineTOCEntryCommandOption{onendentry}%
3069 {scr@tso@}{@onendentry}{output at end of all entries but the last}%
3070 \DefineTOCEntryCommandOption{pagenumberformat}%
3071 {scr@tso@}{@pagenumberformat}[1]{page number format}%
3072 \DefineTOCEntryLengthOption{rightindent}%
3073 {scr@tso@}{@rightindent}{entry's text right indent}%
3074 \DefineTOCEntryIfOption{raggedright}%
3075 {scr@tso@}{@raggedright}{use raggedright for the whole paragraph}%
3076 \DefineTOCEntryLengthOption{indent}%
3077 {scr@tso@}{@indent}{entry indent}%
3078 \scr@ifundefinedorrelax{#1tocdepth}{%
3079 \Ifstrstart{#1}{sub}{%
3080 \scr@ifundefinedorrelax{\scr@dte@nosub{#1}tocdepth}{}{%
3081 \expandafter\edef\csname #1tocdepth\endcsname{%
3082 \the\numexpr \noexpand\@nameuse{\scr@dte@nosub{#1}tocdepth}+\@ne\relax
3083 }%
3084 }%
3085 }{}%
3086 }{}%
3087 \@ifundefined{#1tocdepth}{%
3088 \Ifstr{#1}{part}{\@namedef{#1tocdepth}{-1}}{%
3089 \Ifstr{#1}{chapter}{\@namedef{#1tocdepth}{0}}{%
3090 \Ifstr{#1}{section}{\@namedef{#1tocdepth}{1}}{%
3091 \Ifstr{#1}{subsection}{\@namedef{#1tocdepth}{2}}{%
3092 \Ifstr{#1}{subsubsection}{\@namedef{#1tocdepth}{3}}{%
3093 \Ifstr{#1}{paragraph}{\@namedef{#1tocdepth}{4}}{%
3094 \Ifstr{#1}{subparagraph}{\@namedef{#1tocdepth}{5}}{%
3095 \Ifstr{#1}{figure}{\@namedef{#1tocdepth}{1}}{%
3096 \Ifstr{#1}{table}{\@namedef{#1tocdepth}{1}}{%
3097 \Ifstr{#1}{lstlisting}{\@namedef{#1tocdepth}{1}}{%
3098 \expandafter\let\csname #1tocdepth\expandafter\endcsname
3099 \csname #1numdepth\endcsname
3100 }%
3101 }%
3102 }%
3103 }%
3104 }%
3105 }%
3106 }%
3107 }%
3108 }%
3109 }%
3110 }{}%
3111 \@ifundefined{#1tocdepth}{%
3112 \expandafter\let\csname #1tocdepth\expandafter\endcsname
3113 \csname toclevel@#1\endcsname
3114 }{}%
3115 \scr@ifundefinedorrelax{scr@tso@#1@indent}{%
3116 \@ifundefined{scr@#1@tocindent}{%
3117 \Ifstrstart{#1}{sub}{%
3118 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@indent}{%
3119 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@numwidth}{}{%
3120 \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
3121 \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@numwidth}%
3122 \relax
3123 }%
3124 }%
3125 }{%
3126 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@numwidth}{%
3127 \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
3128 \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@indent}%
3129 \relax
3130 }%
3131 }{%
3132 \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
3133 \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@indent}%
3134 +\noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@numwidth}%
3135 \relax
3136 }%
3137 }%
3138 }%
3139 }{}%
3140 }{%
3141 \@namedef{scr@tso@#1@indent}{\@nameuse{scr@#1@tocindent}}%
3142 }%
3143 }{}%
3144 \scr@ifundefinedorrelax{scr@tso@#1@rightindent}{%
3145 \Ifstrstart{#1}{sub}{%
3146 \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@rightindent}{%
3147 \@namedef{scr@tso@#1@rightindent}{\@tocrmarg}%
3148 }{%
3149 \expandafter\let
3150 \csname scr@tso@#1@rightindent\expandafter\endcsname
3151 \csname scr@tso@\scr@dte@nosub{#1}@rightindent\endcsname
3152 }%
3153 }{%
3154 \@namedef{scr@tso@#1@rightindent}{\@tocrmarg}%
3155 }%
3156 }{}%
3157 \@ifundefined{scr@tso@#1@indent}{%
3158 \Ifstr{#1}{figure}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
3159 \Ifstr{#1}{table}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
3160 \Ifstr{#1}{lstlisting}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
3161 \Ifstr{#1}{part}{\@namedef{scr@tso@#1@indent}{0em}}{%
3162 \Ifstr{#1}{chapter}{\@namedef{scr@tso@#1@indent}{0em}}{%
3163 \scr@ifundefinedorrelax{l@chapter}{%
3164 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{0pt}}{%
3165 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
3166 \Ifstr{#1}{subsubsection}{%
3167 \@namedef{scr@tso@#1@indent}{3.8em}%
3168 }{%
3169 \Ifstr{#1}{paragraph}{%
3170 \@namedef{scr@tso@#1@indent}{7em}%
3171 }{%
3172 \Ifstr{#1}{subparagraph}{%
3173 \@namedef{scr@tso@#1@indent}{10em}%
3174 }{%
3175 }%
3176 }%
3177 }%
3178 }%
3179 }%
3180 }{%
3181 \Ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
3182 \Ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{3.8em}}{%
3183 \Ifstr{#1}{subsubsection}{%
3184 \@namedef{scr@tso@#1@indent}{7.0em}%
3185 }{%
3186 \Ifstr{#1}{paragraph}{%
3187 \@namedef{scr@tso@#1@indent}{10em}%
3188 }{%
3189 \Ifstr{#1}{subparagraph}{%
3190 \@namedef{scr@tso@#1@indent}{12em}%
3191 }{%
3192 }%
3193 }%
3194 }%
3195 }%
3196 }%
3197 }%
3198 }%
3199 }%
3200 }%
3201 }%
3202 }%
3203 }{}%
3204 \expandafter\providecommand\expandafter*%
3205 \csname scr@tso@#1@beforeskip\endcsname{\z@}%
3206 \expandafter\providecommand\expandafter*%
3207 \csname scr@tso@#1@numsep\endcsname{.4em}%
3208 \expandafter\providecommand%
3209 \csname scr@tso@#1@onstartfirstentry\endcsname{}%
3210 \expandafter\providecommand%
3211 \csname scr@tso@#1@onstartentry\endcsname{}%
3212 \expandafter\providecommand%
3213 \csname scr@tso@#1@onendlastentry\endcsname{}%
3214 \expandafter\providecommand%
3215 \csname scr@tso@#1@onendentry\endcsname{\quad}%
3216 \expandafter\providecommand%
3217 \csname scr@tso@#1@afterpar\endcsname{}%
3218 \expandafter\providecommand%
3219 \csname scr@tso@#1@numberformat\endcsname[1]{##1}%
3220 \expandafter\providecommand%
3221 \csname scr@tso@#1@entryformat\endcsname[1]{##1}%
3222 \expandafter\providecommand\csname Ifscr@tso@#1@dynindent\endcsname[2]{##2}%
3223 \scr@ifundefinedorrelax{scr@tso@#1@indentfollows}{%
3224 \Ifstrstart{#1}{sub}{%
3225 \expandafter\edef\csname scr@tso@#1@indentfollows\endcsname{%
3226 \scr@dte@nosub{#1}%
3227 }%
3228 }{%
3229 \expandafter\let\csname scr@tso@#1@indentfollows\endcsname\@empty
3230 }%
3231 }{}%
3232 \expandafter\providecommand%
3233 \csname Ifscr@tso@#1@raggedright\endcsname[2]{##2}%
3234 \expandafter\providecommand%
3235 \csname scr@tso@#1@prepagenumber\endcsname{\nobreakspace}%
3236 \expandafter\providecommand%
3237 \csname scr@tso@#1@pagenumberformat\endcsname[1]{##1}%
3238 }]{%
3239 \scr@dte@toctext{#1}{##1}{##2}%
3240 }
3241 \newcommand*{\scr@dte@toctext}[3]{%
3242 \ifnum \@nameuse{#1tocdepth}>\c@tocdepth
3243 \else
3244 \ifhmode
3245 \scr@dte@toctext@lastend
3246 \@nameuse{scr@tso@#1@onstartentry}%
3247 \else
3248 \addvspace{\@nameuse{scr@tso@#1@beforeskip}}%
3249 \leavevmode
3250 \def\par{%
3251 \scr@dte@toctext@raggedright
3252 \scr@dte@toctext@parend
3253 \@par
3254 \scr@dte@toctext@afterpar
3255 \global\let\scr@dte@toctext@afterpar\relax
3256 \global\let\scr@dte@toctext@parend\relax
3257 \global\let\scr@dte@toctext@raggedright\relax
3258 }%
3259 \global\let\scr@dte@toctext@afterpar\@empty
3260 \Iftocfeature{\@currext}{noindent}{%
3261 \leftskip \z@
3262 }{%
3263 \@nameuse{Ifscr@tso@#1@dynindent}{%
3264 \expandafter\ifx\csname scr@tso@#1@indentfollows\endcsname\@empty
3265 \PackageWarning{tocbasic}{`dynindent' for `#1' not available}%
3266 \else
3267 \edef\reserved@a{\@nameuse{scr@tso@#1@indentfollows}}%
3268 \@for \reserved@a:=\reserved@a\do {%
3269 \scr@trim@spaces\reserved@a
3270 \ifx\reserved@a\@empty\else
3271 \scr@ifundefinedorrelax{\reserved@a tocdepth}{%
3272 }{%
3273 \ifnum \@nameuse{\reserved@a tocdepth}<\@nameuse{#1tocdepth}%
3274 \@tempdima\@nameuse{scr@tso@\reserved@a @indent}\relax
3275 \@nameuse{Ifscr@tso@\reserved@a @dynnumwidth}{%
3276 \scr@ifundefinedorrelax
3277 {scr@dte@\reserved@a @lastmaxnumwidth}{%
3278 \advance\@tempdima
3279 \@nameuse{scr@tso@\reserved@a @numwidth}\relax
3280 }{%
3281 \advance\@tempdima
3282 \@nameuse{scr@dte@\reserved@a @lastmaxnumwidth}\relax
3283 }%
3284 }{%
3285 \advance\@tempdima
3286 \@nameuse{scr@tso@\reserved@a @numwidth}\relax
3287 }%
3288 \ifdim \@tempdima>\@nameuse{scr@tso@#1@indent}\relax
3289 \expandafter\edef\csname scr@tso@#1@indent\endcsname
3290 {\the\@tempdima}%
3291 \fi
3292 \fi
3293 }%
3294 \fi
3295 }%
3296 \fi
3297 }{}%
3298 \leftskip \@nameuse{scr@tso@#1@indent}\relax
3299 }%
3300 \rightskip \@nameuse{scr@tso@#1@rightindent}\relax
3301 \parfillskip \z@ \@plus 1fill\relax
3302 \ifx\addvspace\scr@dte@xaddvspace\else
3303 \let\scr@dte@saddvspace\addvspace
3304 \def\scr@dte@xaddvspace{%
3305 \let\addvspace\scr@dte@saddvspace\par\addvspace}%
3306 \let\addvspace\scr@dte@xaddvspace
3307 \fi
3308 \ifx\addpenalty\scr@dte@xaddpenalty\else
3309 \let\scr@dte@saddpenalty\addpenalty
3310 \def\scr@dte@xaddpenalty{%
3311 \let\addpenalty\scr@dte@saddpenalty\par\addpenalty}%
3312 \fi
3313 \@nameuse{scr@tso@#1@onstartfirstentry}%
3314 \fi
3315 \@nameuse{Ifscr@tso@#1@raggedright}{%
3316 \let\\\@centercr
3317 \gdef\scr@dte@toctext@raggedright{%
3318 \@rightskip\@flushglue
3319 \addtolength\rightskip\@rightskip
3320 }%
3321 }{}%
3322 \l@addto@macro\scr@dte@toctext@afterpar{\@nameuse{scr@tso@#1@afterpar}}%
3323 \expandafter\global\expandafter\let\expandafter\scr@dte@toctext@lastend
3324 \csname scr@tso@#1@onendentry\endcsname
3325 \expandafter\global\expandafter\let\expandafter\scr@dte@toctext@parend
3326 \csname scr@tso@#1@onendlastentry\endcsname
3327 {%
3328 \usetocbasicnumberline
3329 \def\numberline@box##1{%
3330 \mbox{%
3331 \@nameuse{scr@tso@#1@numberformat}{\ignorespaces ##1\unskip}%
3332 \hskip\@nameuse{scr@tso@#1@numsep}\relax
3333 }%
3334 }%
3335 \@nameuse{scr@tso@#1@entryformat}{%
3336 \ignorespaces#2\unskip
3337 \@nameuse{scr@tso@#1@prepagenumber}%
3338 \@nameuse{scr@tso@#1@pagenumberformat}{\ignorespaces #3\unskip}%
3339 }%
3340 }%
3341 \fi
3342 }
3343 \newcommand*{\scr@dte@toctext@raggedright}{}
3344 \newcommand*{\scr@dte@toctext@parend}{}
3345 \newcommand*{\scr@dte@toctext@lastend}{}
3346 %%% From File: $Id: scrkernel-tocstyle.dtx 4228 2025-10-08 14:10:51Z kohm $
3347 %%% (run: style,dottedtocline)
3348 \CloneTOCEntryStyle{dottedtocline}{default}
3349 %%% From File: $Id: tocbasic.dtx 4251 2025-12-31 10:31:49Z kohm $
3350 %%% (run: exit)
3351 \AtBeginDocument{%
3352 \@ifundefined{MakeMarkcase}{%
3353 \scr@ifundefinedorrelax{KOMAClassName}{%
3354 \let\MakeMarkcase\MakeUppercase
3355 }{%
3356 \let\MakeMarkcase\@firstofone
3357 }%
3358 }{}%
3359 }
3360 %%% From File: $Id: scrlogo.dtx 4032 2023-04-17 09:45:11Z kohm $
3361 \RequirePackage{scrlogo}
3362 \endinput
3363 %%
3364 %% End of file `tocbasic.sty'.