Debian Codegraph @

texmf-dist/source/latex/koma-script/scrkernel-listsof.dtx

raw
1 % \iffalse meta-comment
2 % ======================================================================
3 % scrkernel-listsof.dtx
4 % Copyright (c) Markus Kohm, 2002-2025
5 %
6 % This file is part of the LaTeX2e KOMA-Script bundle.
7 %
8 % This work may be distributed and/or modified under the conditions of
9 % the LaTeX Project Public License, version 1.3c of the license.
10 % The latest version of this license is in
11 % http://www.latex-project.org/lppl.txt
12 % and version 1.3c or later is part of all distributions of LaTeX
13 % version 2005/12/01 or later and of this work.
14 %
15 % This work has the LPPL maintenance status "author-maintained".
16 %
17 % The Current Maintainer and author of this work is Markus Kohm.
18 %
19 % This work consists of all files listed in MANIFEST.md.
20 % ======================================================================
21 %%% From File: $Id: scrkernel-listsof.dtx 4193 2025-08-12 14:24:39Z kohm $
22 %<prepare>%%% (run: prepare)
23 %<option>%%% (run: option)
24 %<body>%%% (run: body)
25 %<*dtx>
26 \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
27 \begingroup
28 \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
29 \filedate$Date: 2025-08-12 16:24:39 +0200 (Di, 12. Aug 2025) $
30 \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
31 \filerevision$Revision: 4193 $
32 \edef\reserved@a{%
33 \noexpand\endgroup
34 \noexpand\ProvidesFile{scrkernel-listsof.dtx}%
35 [\filedate\space\filerevision\space
36 KOMA-Script source
37 (lists of)]%
38 }%
39 \reserved@a
40 \documentclass[USenglish]{koma-script-source-doc}
41 \usepackage{babel}
42 \usepackage{hvlogos}
43 \setcounter{StandardModuleDepth}{2}
44 \begin{document}
45 \DocInput{scrkernel-listsof.dtx}
46 \end{document}
47 %</dtx>
48 % \fi
49 %
50 % \changes{v2.95}{2002/06/28}{first version after splitting \file{scrclass.dtx}}
51 % \changes{v3.36}{2022/02/28}{switch over from \cls*{scrdoc} to
52 % \cls*{koma-script-source-doc}}
53 % \changes{v3.36}{2022/02/28}{whole implementation documentation in English}
54 % \changes{v3.40}{2023/04/17}{guide names changed}
55 %
56 % \GetFileInfo{scrkernel-listsof.dtx}
57 % \title{Table of Contents, List of Figures, and List of Tables Within
58 % \href{https://komascript.de}{\KOMAScript} Classes}
59 % \author{\href{mailto:[email protected]}{Markus Kohm}}
60 % \date{Revision \fileversion{} of \filedate}
61 % \maketitle
62 % \begin{abstract}
63 % \LaTeX{} classes provides a number of directories like the table of
64 % contents, list of figures, and list of
65 % tables. \file{scrkernel-listsof.dtx} provides parts of the implementation
66 % of them. But note: Since the \KOMAScript{} classes use \pkg*{tocbasic} for
67 % all these tables and lists, most of the code has been moved to
68 % \file{tocbasic.dtx} and \file{scrkernel-tocstyle.dtx}.
69 % \end{abstract}
70 % \tableofcontents
71 %
72 % \section{User Manual}
73 %
74 % You can find the user documentation the commands implemented here in the
75 % \KOMAScript{} manual, either the German \file{scrguide-de.pdf} or the
76 % English \file{scrguide-en.pdf}.
77 %
78 % \MaybeStop{\PrintIndex}
79 %
80 % \section{Implementation of the table of contents and similar lists in the
81 % \KOMAScript{} classes}
82 %
83 % Only \cls*{scrartcl}, \cls*{scrbook} and \cls{scrreprt} provide floats and
84 % headings. So only these need to provide tables and lists of such
85 % elements. Especially the letter class \cls*{scrlttr2} does not need any of
86 % this code.
87 %
88 % \begin{macrocode}
89 %<*!letter>
90 % \end{macrocode}
91 %
92 % \subsection{Code used by all of the tables and lists of content}
93 %
94 % \begin{macro}{\numberline@numberpostfix}
95 % \changes{v3.20}{2016/03/15}{used to add \cs{autodot}}
96 % We extend this macro of \pkg*{tocbasic} to add the \cs{autodot} to the
97 % numbers.
98 % \begin{description}
99 % \item[ToDo:] Replace this by any kind of \emph{addto hook command}, maybe
100 % even by a generic \LaTeX{} hook.
101 % \end{description}
102 % \begin{macrocode}
103 %<*body>
104 \g@addto@macro{\numberline@numberpostfix}{\autodot}
105 %</body>
106 % \end{macrocode}
107 % \end{macro}%^^A \numberline@numberpostfix
108 %
109 % \begin{command}{\numberline}
110 % \changes{v3.20}{2016/03/15}{using definition of \pkg*{tocbasic}}
111 % Just activate the usage of the \pkg*{tocbasic} definition of
112 % \cs{numberline}.
113 % \begin{macrocode}
114 %<*body>
115 \usetocbasicnumberline[%
116 \ClassInfo{\KOMAClassName}{Redefining `\string\numberline'}%
117 ]
118 %</body>
119 % \end{macrocode}
120 % \end{command}%^^A \numberline
121 %
122 % \changes{v3.06}{2010/06/02}{activating \pkg*{tocbasic} feature
123 % \texttt{chapteratlist}}
124 % For classes with chapters we use the \pkg*{tocbasic} feature
125 % \texttt{chapteratlist} for all directories of category/owner
126 % \texttt{float}. This is done not only for already existing directories but
127 % also for those, that will be added later (using \pkg*{tocbasic}). Note: By
128 % default this feature is used to add a vertical distance to, e.g., the list
129 % of figures and the list of tables with each new chapter.
130 % \begin{macrocode}
131 %<*body&(book|report)>
132 \doforeachtocfile[float]{%
133 \setuptoc{\@currext}{chapteratlist}%
134 }
135 \AtAddToTocList[float]{%
136 \setuptoc{\@currext}{chapteratlist}%
137 }
138 %</body&(book|report)>
139 % \end{macrocode}
140 %
141 % \begin{macro}{\before@starttoc,\after@starttoc}
142 % \changes{v2.8q}{2001/11/14}{added}
143 % If either \texttt{tocleft} or \texttt{listsleft} is used, we need to collect
144 % additional information about the natural width of the numbers and also have
145 % to change the used width of the numbers. So we have two macros, that will be
146 % added to the \pkg*{tocbasic} hooks. \cs{before@starttoc} does some internal
147 % changes before \cs{@starttoc} to collect and use the
148 % information. \cs{after@starttoc} writes the information to the \file{aux}
149 % file after \cs{@starttoc}.
150 % \begin{macro}{\scr@dottedtocline}
151 % \changes{v2.9k}{2003/01/03}{also change the third argument}^^A
152 % \begin{macro}{\scr@numberline}
153 % \changes{v3.06}{2010/05/18}{removed}^^A
154 % \end{macro}
155 % \begin{macro}{\last@l@number}
156 % The \KOMAScript{} classes themselves use the \pkg*{tocbasic} entry style
157 % \texttt{tocline}. However other packages may use the \LaTeX{} kernel command
158 % \cs{@dottedtocline}. Currently we support these too. But to do so, we need
159 % to locally redefine \cs{@dottedtocline} to change the second and third
160 % argument. The second is the \meta{indent} and has always to be 0 (with
161 % \texttt{listsleft}). The third is the number width and has to be
162 % \cs{last@l@number}. I do not like to redefine \LaTeX{} kernel macros, so
163 % maybe the support for list entries, which use \cs{@dottedtocline}, will be
164 % removed in future. However, in this case we still would need some of the
165 % code or similar code to initialize values and features of \pkg*{tocbasic}.
166 % At loading time we only need to \emph{reserve} the macros. The real
167 % definition will be done when reading the auxiliary files of the lists or the
168 % main \file{aux} file.
169 % \begin{macrocode}
170 %<*body>
171 \newcommand*{\scr@dottedtocline}{}
172 \newcommand*{\last@l@number}{}
173 % \end{macrocode}
174 % \end{macro}^^A \last@l@number
175 % \end{macro}^^A \scr@dottedtocline
176 % \begin{macro}{\@l@number,\set@l@number}
177 % \changes{v2.8q}{2001/11/14}{added}
178 % We also need local macros to store the currently maximal number width while
179 % reading an auxiliary file. \cs{set@l@number} not only has to update
180 % \cs{@l@number} but also to set \len{@temdima} to the real maximum. It is
181 % used inside \cs{numberline@box}, which is used inside \cs{numberline}, if
182 % the \pkg*{tocbasic} definition of \cs{numberline} is used.
183 % \begin{macrocode}
184 \newcommand*{\@l@number}{}
185 \newcommand*{\set@l@number}[1]{%
186 \settowidth{\@tempdima}{#1\enskip}%
187 \ifdim\@tempdima >\@l@number
188 \xdef\@l@number{\the\@tempdima}%
189 \fi%
190 \ifdim\@tempdima >\last@l@number \else
191 \setlength{\@tempdima}{\last@l@number}%
192 \fi%
193 }
194 % \end{macrocode}
195 % \end{macro}^^A \@l@number,\set@l@number
196 % \changes{v2.95a}{2006/07/12}{empty case initialization}
197 % \changes{v3.06}{2010/05/18}{re-defining \cs{numberline} instead of
198 % \cs{numberline@box}}
199 % \changes{v3.37}{2022/06/17}{typofix}
200 % The usage of all these local macros has to be initialized in
201 % \cs{before@starttoc}.
202 % \begin{macrocode}
203 \newcommand*{\before@starttoc}[1]{%
204 \let\scr@dottedtocline=\@dottedtocline
205 \renewcommand*{\@dottedtocline}[3]{%
206 \scr@dottedtocline{##1}{\z@}{\last@l@number}}%
207 \renewcommand*{\numberline@box}[1]{%
208 \set@l@number{##1}\hb@xt@\@tempdima{##1}}%
209 \gdef\@l@number{\z@}%
210 \@ifundefined{#1@l@number}{%
211 \def\last@l@number{2em}%
212 }{%
213 \expandafter\ifx\csname #1@l@number\endcsname\@empty
214 \let\last@l@number\z@
215 \else
216 \expandafter\let\expandafter\last@l@number
217 \expandafter=\csname#1@l@number\endcsname
218 \fi
219 }%
220 % \end{macrocode}
221 % \changes{v3.20}{2015/11/26}{initialization of \pkg*{tocbasic} values}
222 % We also have to locally change the indent and number width values of the
223 % \pkg*{tocbasic} styles.
224 % \begin{macrocode}
225 \begingroup
226 \def\do@endgroup{\endgroup}%
227 \def\do##1{%
228 \scr@ifundefinedorrelax{scr@tso@##1@numwidth}{}{%
229 %<*trace>
230 \ClassInfo{\KOMAClassName}{%
231 Setting numwidth of `##1' to \last@l@number}%
232 %</trace>
233 \l@addto@macro\do@endgroup{%
234 \@namedef{scr@tso@##1@numwidth}{\last@l@number}%
235 }%
236 }%
237 \scr@ifundefinedorrelax{scr@tso@##1@indent}{}{%
238 %<*trace>
239 \ClassInfo{\KOMAClassName}{%
240 Setting indent of `##1' to \string\z@}%
241 %</trace>
242 \l@addto@macro\do@endgroup{%
243 \@namedef{scr@tso@##1@indent}{\z@}%
244 }%
245 }%
246 }%
247 \@nameuse{scr@dte@donumwidth}%
248 \do@endgroup
249 }
250 \newcommand*{\after@starttoc}[1]{%
251 \protected@write\@auxout{}{%
252 \string\gdef\expandafter\string\csname#1@l@number\endcsname{%
253 \@l@number}}%
254 }
255 % \end{macrocode}
256 % Last but not least we have to add the code to the \pkg*{tocbasic} hooks
257 % before and after \cs{@starttoc}. Note: This is also used for the table of
258 % contents, but in this case \cs{if@dynlist} will be used different.
259 % \begin{description}
260 % \item[ToDo:] A better suggestion could be to use \meta{category} dependent
261 % code here to use \cs{if@dynlist} only for \meta{category} \texttt{float}
262 % but \cs{if@tocleft} for \meta{category} \texttt{ToC}. So the support for
263 % things like \emph{table of appendix contents} could be benefit.
264 % \end{description}
265 % \begin{macrocode}
266 \g@addto@macro\tocbasic@@before@hook{%
267 \if@dynlist\expandafter\before@starttoc\expandafter{\@currext}\fi
268 }
269 \g@addto@macro\tocbasic@@after@hook{%
270 \if@dynlist\expandafter\after@starttoc\expandafter{\@currext}\fi
271 }
272 %</body>
273 % \end{macrocode}
274 % \end{macro}^^A \@dottedtocline
275 %
276 %
277 % \subsection{The table of contents}
278 %
279 % \changes{v3.27}{2019/05/11}{init code moved from \file{tocbasic.dtx}}
280 % \changes{v3.01}{2008/11/13}{auto-activation of feature \texttt{onecolumn}}
281 % Set feature \texttt{onecolumn} for every ToC file.
282 % \begin{macrocode}
283 %<*prepare&(book|report)>
284 \AtAddToTocList[\@currname.\@currext]{\setuptoc{\@currext}{onecolumn}}%
285 \AtAddToTocList[ToC]{\setuptoc{\@currext}{onecolumn}}%
286 %</prepare&(book|report)>
287 % \end{macrocode}
288 % Tell the package, what files are used:
289 % \changes{v3.27}{2019/05/11}{use category \texttt{ToC} for the table of
290 % contents}
291 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}%^^A
292 % \begin{macrocode}
293 %<*prepare>
294 \addtotoclist[ToC]{toc}
295 \Ifstr{\ext@toc}{toc}{}{%
296 \expandafter\addtotoclist
297 \expandafter[\expandafter T\expandafter o\expandafter C\expandafter ]%
298 \expandafter{\ext@toc}%
299 }
300 %</prepare>
301 % \end{macrocode}
302 %
303 % \begin{macro}{\@tocleftfalse,\@tocleftrue,\if@tocleft}
304 % \changes{v2.8q}{2001/11/14}{added}
305 % \changes{v2.98c}{2008/03/05}{earlier definition}
306 % The switch is used to store the information whether to use a flat
307 % (\cs{@toclefttrue}) or a graduated (\cs{@tocleftalse}) table of contents.
308 % \begin{macrocode}
309 %<*option>
310 \newif\if@tocleft
311 %</option>
312 % \end{macrocode}
313 % \end{macro}^^A … \if@tocleft
314 %
315 % \begin{option}{toc}
316 % \changes{v2.98c}{2008/03/04}{added}
317 % \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyState}}
318 % \changes{v3.12}{2013/08/26}{\cs{KOMA@options} replaced by
319 % \cs{KOMAExecuteOptions}}
320 % \changes{v3.12a}{2014/01/17}{\cs{KOMAExecuteOptions} replaced by
321 % \cs{KOMAoptions}}
322 % \changes{v3.18}{2015/06/15}{value \opt{\quotechar=indexnumbered} added}
323 % \changes{v3.39}{2022/11/11}{initial dot removed from member argument of
324 % option storage commands}
325 % The main features of the table of contents can be configured by this
326 % option.
327 % \begin{macrocode}
328 %<*option>
329 \KOMA@key{toc}{%
330 \KOMA@set@ncmdkey{toc}{@tempa}{%
331 % \end{macrocode}
332 % \changes{v3.28}{2019/10/21}{several alias values added}
333 % The provided values are (aliases are also available):
334 % \begin{description}
335 % \item[\opt{=noindex}:] (default) for the index neither add an entry to the
336 % table of contents nor number the heading of the index.
337 % \end{description}
338 % \begin{macrocode}
339 {noindex}{0},{noidx}{0},%
340 % \end{macrocode}
341 % \begin{description}
342 % \item[\opt{=index}:] for the index add an entry to the table of contents,
343 % but do not number the index.
344 % \end{description}
345 % \begin{macrocode}
346 {index}{1},{idx}{1},%
347 % \end{macrocode}
348 % \begin{description}
349 % \item[\opt{=indexnumbered}:] number the index and therefore also add an
350 % entry to the table of contents.
351 % \end{description}
352 % \begin{macrocode}
353 {indexnumbered}{2},{idxnumbered}{2},{numberedindex}{2},{numberedidx}{2},%
354 % \end{macrocode}
355 % \begin{description}
356 % \item[\opt{=nolistof}:] (default) for any list with category/owner
357 % \texttt{float} neither add an entry to the table of contents, nor
358 % number the heading of the list of the floats.
359 % \end{description}
360 % \begin{macrocode}
361 {nolistof}{3},{nolistsof}{3},%
362 % \end{macrocode}
363 % \begin{description}
364 % \item[\opt{=listof}:] for each list with category/owner \texttt{float} add an
365 % entry to the table of contents, but do not number the list of the floats.
366 % \end{description}
367 % \begin{macrocode}
368 {listof}{4},{listsof}{4},%
369 % \end{macrocode}
370 % \begin{description}
371 % \item[\opt{=listofnumbered}:] for each list of category/owner \texttt{float}
372 % number the list of floats and therefore add an entry to table of contents.
373 % \end{description}
374 % \begin{macrocode}
375 {listofnumbered}{5},{numberedlistof}{5},%
376 {listsofnumbered}{5},{numberedlistsof}{5},%
377 % \end{macrocode}
378 % \begin{description}
379 % \item[\opt{=nobibliography}:] (default) for the bibliography neither add an
380 % entry to the table if contents nor number the heading.
381 % \end{description}
382 % \begin{macrocode}
383 {nobibliography}{6},{nobib}{6},%
384 % \end{macrocode}
385 % \begin{description}
386 % \item[\opt{=bibliography}:] for the bibliography add an entry to the table
387 % of contents, but do not number the bibliography.
388 % \end{description}
389 % \begin{macrocode}
390 {bibliography}{7},{bib}{7},%
391 % \end{macrocode}
392 % \begin{description}
393 % \item[\opt{=bibliographynumbered}:] number the bibliography and therefore
394 % add an entry to the table of contents.
395 % \end{description}
396 % \begin{macrocode}
397 {bibliographynumbered}{8},{bibnumbered}{8},{numberedbibliography}{8},%
398 {numberedbib}{8},%
399 % \end{macrocode}
400 % \begin{description}
401 % \item[\opt{=flat}:] use the flat version of the table of contents (all
402 % numbers are at one column, all texts in another one).
403 % \end{description}
404 % \begin{macrocode}
405 {flat}{9},{left}{9},%
406 % \end{macrocode}
407 % \begin{description}
408 % \item[\opt{=graduated}:] (default) use a hierarchical indented table of
409 % contents similar to the standard classes.
410 % \end{description}
411 % \begin{macrocode}
412 {graduated}{10},{indent}{10},{indented}{10},%
413 % \end{macrocode}
414 % \changes{v3.12}{2014/09/24}{values \opt{\quotechar=numberline} and
415 % \opt{\quotechar=nonumberline} etc. added}
416 % \begin{description}
417 % \item[\opt{=numberline}:] indent entries without number like entries with
418 % number.
419 % \end{description}
420 % \begin{macrocode}
421 {indenttextentries}{11},{indentunnumbered}{11},{numberline}{11},%
422 % \end{macrocode}
423 % \begin{macrocode}
424 % \begin{description}
425 % \item[\opt{nonumberline}:] (default) do not indent the first line of an
426 % entry without number
427 % \end{description}
428 % \begin{macrocode}
429 {leftaligntextentries}{12},{leftalignunnumbered}{12},{nonumberline}{12},%
430 % \end{macrocode}
431 % \changes{v3.15}{2015/01/14}{values \opt{\quotechar=chapterentrywithdots},
432 % \opt{\quotechar=chapterentrywithoutdot} resp.
433 % \opt{\quotechar=sectionentrywithdots},
434 % \opt{\quotechar=sectionentrywithoutdot} added}
435 % \begin{description}
436 % \item[\opt{=chapterentrywithdots}:] classes with \cs{chapter} provide a dot
437 % filler also for chapter entries.
438 % \end{description}
439 % \begin{macrocode}
440 %<book|report> {chapterentrywithdots}{13},{chapterentrydotfill}{13},
441 % \end{macrocode}
442 % \begin{description}
443 % \item[\opt{=chapterentrywithoutdots}:] (default) classes with \cs{chapter} use
444 % a space filler for chapter entries.
445 % \end{description}
446 % \begin{macrocode}
447 %<book|report> {chapterentrywithoutdots}{14},{chapterentryfill}{14}%
448 % \end{macrocode}
449 % \begin{description}
450 % \item[\opt{=sectionentrywithdots}:] classes without \cs{chapter} use
451 % dot filler also for section entries.
452 % \end{description}
453 % \begin{macrocode}
454 %<article> {sectionentrywithdots}{13},{sectionentrydotfill}{13},
455 % \end{macrocode}
456 % \begin{description}
457 % \item[\opt{=sectionentrywithoutdots}:] (default) classes without
458 % \cs{chapter} use a space filler for section entries.
459 % \end{description}
460 % \begin{macrocode}
461 %<article> {sectionentrywithoutdots}{14},{sectionentryfill}{14}%
462 }{#1}%
463 \ifx\FamilyKeyState\FamilyKeyStateProcessed
464 \ifcase \@tempa\relax % noindex
465 \KOMAoptions{index=notoc}%
466 \or % index
467 \KOMAoptions{index=totoc}%
468 \or % indexnumbered
469 \KOMAoptions{index=numbered}%
470 \or % listof
471 \KOMAoptions{listof=notoc}%
472 \or % nolistof
473 \KOMAoptions{listof=totoc}%
474 \or % listofnumbered
475 \KOMAoptions{listof=numbered}%
476 \or % nobibliography
477 \KOMAoptions{bibliography=nottotoc}%
478 \or % bibliography
479 \KOMAoptions{bibliography=totoc}%
480 \or % bibliographynumbered
481 \KOMAoptions{bibliography=totocnumbered}%
482 \or % flat
483 \KOMA@kav@remove{\KOMAClassFileName}{toc}{flat}%
484 \KOMA@kav@remove{\KOMAClassFileName}{toc}{graduated}%
485 \KOMA@kav@add{\KOMAClassFileName}{toc}{flat}%
486 \@toclefttrue
487 \or % graduated
488 \KOMA@kav@remove{\KOMAClassFileName}{toc}{flat}%
489 \KOMA@kav@remove{\KOMAClassFileName}{toc}{graduated}%
490 \KOMA@kav@add{\KOMAClassFileName}{toc}{graduated}%
491 \@tocleftfalse
492 \or % indenttextentries
493 \KOMA@kav@remove{\KOMAClassFileName}{toc}{indenttextentries}%
494 \KOMA@kav@remove{\KOMAClassFileName}{toc}{leftaligntextentries}%
495 \KOMA@kav@add{\KOMAClassFileName}{toc}{indenttextentries}%
496 \expandafter\setuptoc\expandafter{\ext@toc}{numberline}%
497 \or % leftaligntextentries
498 \KOMA@kav@remove{\KOMAClassFileName}{toc}{indenttextentries}%
499 \KOMA@kav@remove{\KOMAClassFileName}{toc}{leftaligntextentries}%
500 \KOMA@kav@add{\KOMAClassFileName}{toc}{leftaligntextentries}%
501 \expandafter\unsettoc\expandafter{\ext@toc}{numberline}%
502 \or % chapterentrywithdots/sectionentrywithdots
503 %<book|report> \KOMAoptions{chapterentrydots=true}%
504 %<article> \KOMAoptions{sectionentrydots=true}%
505 \or % chapterentrywithoutdots/sectionentrywithoutdots
506 %<book|report> \KOMAoptions{chapterentrydots=false}%
507 %<article> \KOMAoptions{sectionentrydots=false}%
508 \fi
509 \fi
510 }
511 %</option>
512 % \end{macrocode}
513 % \end{option}
514 %
515 % \begin{option}{tocleft,tocindent}
516 % \changes{v2.8q}{2001/11/14}{added}
517 % \changes{v2.98c}{2008/03/05}{obsolet}
518 % \changes{v3.01a}{2008/11/20}{deprecated}
519 % \changes{v3.99}{2022/11/16}{removed from \KOMAScript~4}
520 % \begin{macrocode}
521 %<*option&!v4>
522 \KOMA@DeclareDeprecatedOption{tocleft}{toc=flat}
523 \KOMA@DeclareDeprecatedOption{tocindent}{toc=graduated}
524 %</option&!v4>
525 % \end{macrocode}
526 % \end{option}^^A tocleft,tocindent
527 %
528 % \begin{command}{\contentsname}
529 % \begin{command}{\listoftocname}
530 % \changes{v3.00}{2008/07/03}{added to be used by \pkg*{tocbasic}}
531 % \changes{v3.27}{2019/05/11}{language dependency added}
532 % The name of the table of contents.
533 % \begin{macrocode}
534 %<*body>
535 \newcommand*\contentsname{Contents}
536 \newcommand*\listoftocname{\contentsname}
537 \providecaptionname{american,australian,british,canadian,english,newzealand,%
538 UKenglish,ukenglish,USenglish,usenglish}\contentsname{Contents}%
539 %</body>
540 % \end{macrocode}
541 % \end{command}^^A \listoftocname
542 % \end{command}^^A \contentsname
543 %
544 % \begin{counter}{tocdepth}
545 % The counter is used to define, down to which level the entries are shown in
546 % the table of contents (resp. list of floats, because the same value is used
547 % there). Note: We don't use symbolic values here, because usage of symbolic
548 % values would add an additional order dependency with the corresponding
549 % \cs{DeclareSecionCommand}.
550 % \begin{macrocode}
551 %<*body>
552 %<book|report>\setcounter{tocdepth}{2}
553 %<article>\setcounter{tocdepth}{3}
554 %</body>
555 % \end{macrocode}
556 % \end{counter}^^A tocdepth
557 %
558 % \begin{macro}{\toc@heading}
559 % \changes{v2.3h}{1995/01/21}{added for \cls*{scrartcl}}
560 % \changes{v2.95}{2002/06/28}{added for \cls*{scrreprt}and \cls*{scrbook}}
561 % \changes{v3.00}{2008/07/04}{deprecated}
562 % \changes{v3.10}{2011/08/31}{using \cs{MakeMarkcase}}
563 % \changes{v3.30}{2020/02/24}{white space at end of warning removed}
564 % This has been defined before usage of \pkg*{tocbasic}. Internally it is not
565 % used any longer.
566 % \begin{macrocode}
567 %<*body>
568 \newcommand*\toc@heading{%
569 \ClassWarning{\KOMAClassName}{%
570 usage of deprecated \string\toc@heading!\MessageBreak
571 You should use the features of package `tocbasic'\MessageBreak
572 instead of \string\toc@heading.\MessageBreak
573 Definition of \string\toc@heading\space may be removed from\MessageBreak
574 KOMA-Script soon, so it should not be used%
575 }%
576 %<article> \section*{\contentsname}%
577 %<book|report> \chapter*{\contentsname}%
578 \@mkboth{\MakeMarkcase{\contentsname}}{\MakeMarkcase{\contentsname}}%
579 }
580 %</body>
581 % \end{macrocode}
582 % \end{macro}^^A \toc@heading
583 %
584 % \begin{macro}{\toc@l@number}
585 % \changes{v2.8q}{2001/11/14}{added}
586 % The number length storage used by \cs{before@starttoc} for \meta{extension}
587 % \texttt{toc}. For safety we just \emph{reserve} it.
588 % \begin{macrocode}
589 %<*body>
590 \newcommand*{\toc@l@number}{}
591 %</body>
592 % \end{macrocode}
593 % \end{macro}^^A \toc@l@number
594 %
595 % \begin{command}{\tableofcontents}
596 % \changes{v2.3h}{1995/01/21}{using \cs{toc@heading}}
597 % \changes{v2.8l}{2001/08/16}{group added an \len{parskip} set to 0}
598 % \changes{v2.8q}{2001/11/13}{\cs{@parskipfalse} and \cs{@parskip@indent}}
599 % \changes{v2.8q}{2001/11/14}{\cs{if@tocleft} changed}
600 % \changes{v2.95}{2002/06/28}{\cls*{scrartcl} also uses \cs{if@tocleft}}
601 % \changes{v2.95}{2004/11/05}{\cs{@parskipfalse} and \cs{@parskip@indent} replaced}
602 % \changes{v3.00}{2008/07/04}{re-implementation using \pkg*{tocbasic}}
603 % The table of contents. See the note above about the local change of
604 % \cs{if@dynlist}.
605 % \begin{macrocode}
606 %<*body>
607 \newcommand*{\tableofcontents}{%
608 \begingroup
609 \let\if@dynlist\if@tocleft
610 \expandafter\listoftoc\expandafter{\ext@toc}%
611 \endgroup
612 }
613 %</body>
614 % \end{macrocode}
615 % \end{command}^^A \tableofcontents
616 %
617 % \begin{command}{\addtocentrydefault}
618 % \changes{v3.08}{2010/11/01}{added}
619 % \changes{v3.12}{2013/09/24}{using new \pkg*{tocbasic} macro
620 % \cs{tocbasic@addxcontentsline}}
621 % Instead of making the entries into the table of contents directly with
622 % the \LaTeX{} low level command \cs{addcontentsline} we provide a class
623 % specific low level user command
624 % \begin{quote}
625 % \cs{addtocentrydefault}\marg{level name}\marg{formatted number}\marg{entry text}
626 % \end{quote}
627 % that uses the \pkg*{tocbasic} package author command
628 % \cs{tocbasic@addctontentsline}. We cannot use \cs{addxcontentsline} because
629 % this will run \cs{add\meta{level name}\meta{toc}entry} if available and
630 % \cs{addtocentrydefault} is used by the entry commands
631 % \cs{addchaptertocentry}, \cs{addsectiontocentry}. So \cs{addtoentrydefault}
632 % is a helper for the callbacks from \cs{addxcontentsline} and needs to use
633 % the package author interface instead of the user interface. For not numbered
634 % entries the \meta{formatted number} should be empty (not only expand to no
635 % output). Note: Entries with empty \meta{entry text} will be omitted.
636 % \begin{macrocode}
637 %<*body>
638 \newcommand{\addtocentrydefault}[3]{%
639 \expandafter\tocbasic@addxcontentsline\expandafter{\ext@toc}{#1}{#2}{#3}%
640 }
641 %</body>
642 % \end{macrocode}
643 % \end{command}
644 %
645 %
646 % \subsection{The lists of floats (or similar environments)}
647 %
648 % The list of tables, list of figures and similar lists of environments with
649 % category/owner \texttt{float} are very similar to the table of contents. But
650 % they use a own set of options and also some commands.
651 %
652 % \changes{v3.25}{2017/10/10}{extension \texttt{lof} not added explicitely}
653 % \changes{v3.25}{2017/10/10}{extension \texttt{lot} not added explicitely}
654 % Note: We must not add extensions \texttt{lof} and \texttt{lot} explicitely,
655 % because these files will be prepared using \cs{DeclareNewTOC} that also
656 % registers the extension.
657 %
658 % \changes{v3.01}{2008/11/13}{auto-activation of feature \texttt{onecolumn}}
659 % Set feature \texttt{onecolumn} for every float list file.
660 % \begin{macrocode}
661 %<*prepare&(book|report)>
662 \AtAddToTocList[float]{\setuptoc{\@currext}{onecolumn}}%
663 %</prepare&(book|report)>
664 % \end{macrocode}
665 %
666 % \begin{macro}{\float@@listhead}
667 % \changes{v2.98c}{2008/03/05}{added}
668 % \changes{v3.01}{2008/11/14}{deprecated}
669 % Prints only the heading, nothing else. The heading text is the argument.
670 % \begin{macrocode}
671 %<*option>
672 \newcommand*{\float@@listhead}{%
673 %<article> \section*
674 %<report|book> \chapter*
675 }
676 %</option>
677 % \end{macrocode}
678 % \end{macro}^^A \float@@listhead
679 %
680 % \begin{macro}{\@dynlistfalse,\@dynlisttrue,\if@dynlist}
681 % \changes{v2.8q}{2001/11/14}{added}
682 % The switch to select the flat (\cs{@dynlisttrue}) or graduated
683 % (\cs{@dynlistfalse)} list type.
684 % \begin{macrocode}
685 %<*option>
686 \newif\if@dynlist
687 %</option>
688 % \end{macrocode}
689 % \end{macro}^^A … \if@dynlist
690 %
691 % \begin{option}{listof}
692 % \changes{v2.98c}{2008/03/05}{added}
693 % \changes{v3.06}{2010/06/02}{options for \pkg*{tocbasic} features do not only
694 % work for the currently defined lists but all future lists of category
695 % \texttt{float}}
696 % \changes{v3.12}{2013/03/05}{using \cs{FamilyKeyState}}
697 % \changes{v3.12}{2013/06/26}{\cs{KOMA@options} replaced by
698 % \cs{KOMAExecuteOptions}}
699 % \changes{v3.12a}{2014/01/17}{\cs{KOMAExecuteOptions} replaced by
700 % \cs{KOMAoptions}}
701 % \changes{v3.39}{2022/11/11}{initial dot removed from member argument of
702 % option storage commands}
703 % The main features of the lists of floats can be configured by this option.
704 % \begin{macrocode}
705 %<*option>
706 \KOMA@key{listof}{%
707 \KOMA@set@ncmdkey{listof}{@tempa}{%
708 % \end{macrocode}
709 % The provided values are (aliases are also available):
710 % \begin{description}
711 % \item[\opt{=notoc}:] (default) neither number the lists of floats nor add
712 % entries to them into the table of contents.
713 % \end{description}
714 % \begin{macrocode}
715 {notoc}{0},{nottotoc}{0},{plainheading}{0},%
716 % \end{macrocode}
717 % \begin{description}
718 % \item[\opt{=totoc}:] do not number the lists of floats but nevertheless add
719 % an entry for each of them to the table of contents.
720 % \end{description}
721 % \begin{macrocode}
722 {totoc}{1},{toc}{1},{notnumbered}{1},%
723 % \end{macrocode}
724 % \begin{description}
725 % \item[\opt{=numbered}:] number the lists of floats and therefore also add an
726 % for each of them to the table of contents.
727 % \end{description}
728 % \begin{macrocode}
729 {numbered}{2},{totocnumbered}{2},{tocnumbered}{2},{numberedtotoc}{2},%
730 {numberedtoc}{2},%
731 % \end{macrocode}
732 % \begin{description}
733 % \item[\opt{=flat}:] use the flat version of the lists of floats (all
734 % numbers are at one column, all texts in another one). Usually this only
735 % removes the indent and calculates the needed width of the numbers. But,
736 % e.g., if chapters are added, it does work over all levels.
737 % \end{description}
738 % \begin{macrocode}
739 {flat}{3},{left}{3},%
740 % \item[\opt{=graduated}:] (default) use hierarchical indented lists of
741 % floats similar to the standard classes.
742 % \end{description}
743 % \begin{macrocode}
744 {graduated}{4},{indent}{4},{indented}{4},%
745 % \end{macrocode}
746 % \begin{description}
747 % \item[\opt{=leveldown}:] Use for the lists of floats a section hierarchy one
748 % level below the standard level.
749 % \end{description}
750 % \begin{macrocode}
751 {leveldown}{5},
752 % \end{macrocode}
753 % \changes{v3.25}{2017/12/04}{value \opt{\quotechar=standardlevel} added}
754 % \begin{description}
755 % \item[\opt{=standardlevel}:] (default) Use for the lists of floats the
756 % standard hierarchy.
757 % \end{description}
758 % \begin{macrocode}
759 {standardlevel}{6},
760 % \end{macrocode}
761 % \changes{v3.06}{2010/05/18}{value \opt{\quotechar=entryprefix} added}
762 % \begin{description}
763 % \item[\opt{=entryprefix}:] Prefix the number of each entry with
764 % \cs{listof\meta{toc}entryprefix}. Note: This is more or less senseless and
765 % does not work correctly with chapter entries in the lists of floats. It is
766 % recommended to reconfigure the entries, e.g., using
767 % \cs{DeclareTOCStyleEntry} or redefining \cs{add\meta{level
768 % name}\meta{toc}entry} instead. Note: \opt{listof=entryprefix} also
769 % activates \opt{listof=flat}.
770 % \end{description}
771 % \begin{macrocode}
772 {entryprefix}{7},
773 % \end{macrocode}
774 % \changes{v3.12}{2014/09/24}{values \opt{\quotechar=numberline} and
775 % \opt{\quotechar=nonumberline} etc. added}
776 % \begin{description}
777 % \item[\opt{=numberline}:] indent entries without number like entries with
778 % number.
779 % \end{description}
780 % \begin{macrocode}
781 {indenttextentries}{8},{indentunnumbered}{8},{numberline}{8},%
782 % \end{macrocode}
783 % \begin{macrocode}
784 % \begin{description}
785 % \item[\opt{=nonumberline}:] (default) do not indent the first line of an
786 % entry without number
787 % \end{description}
788 % \begin{macrocode}
789 {leftaligntextentries}{9},{leftalignunnumbered}{9},{nonumberline}{9}%
790 % \end{macrocode}
791 % \begin{description}
792 % \item[\opt{=chapterentry}:] \cls*{scrbook} and \cls*{scrreprt} provides
793 % chapter entries into the lists of floats.
794 % \end{description}
795 % \begin{macrocode}
796 %<*book|report>
797 ,{chapterentry}{10},{withchapterentry}{10},%
798 % \end{macrocode}
799 % \begin{description}
800 % \item[\opt{=nochaptergap}:] Alternatively the lists of floats can ignore chapters.
801 % \end{description}
802 % \begin{macrocode}
803 {nochaptergap}{11},{ignorechapter}{11},%
804 % \end{macrocode}
805 % \begin{description}
806 % \item[\opt{=chaptergapsmall}:] (default) chapters can add a small
807 % vertical distance into the lists of floats.
808 % \end{description}
809 % \begin{macrocode}
810 {chaptergapsmall}{12},{smallchaptergap}{12},%
811 % \end{macrocode}
812 % \begin{description}
813 % \item[\opt{=chaptergapline}:] chapters can add an empty line to the lists of
814 % floats.
815 % \end{description}
816 % \begin{macrocode}
817 {chaptergapline}{13},{onelinechaptergap}{13}%
818 %</book|report>
819 }{#1}%
820 \ifx\FamilyKeyState\FamilyKeyStateProcessed
821 \ifcase \@tempa\relax % notoc
822 \KOMA@kav@remove{\KOMAClassFileName}{toc}{nolistof}%
823 \KOMA@kav@remove{\KOMAClassFileName}{toc}{listof}%
824 \KOMA@kav@remove{\KOMAClassFileName}{toc}{listofnumbered}%
825 \KOMA@kav@add{\KOMAClassFileName}{toc}{nolistof}%
826 \KOMA@kav@remove{\KOMAClassFileName}{listof}{notoc}%
827 \KOMA@kav@remove{\KOMAClassFileName}{listof}{totoc}%
828 \KOMA@kav@remove{\KOMAClassFileName}{listof}{numbered}%
829 \KOMA@kav@add{\KOMAClassFileName}{listof}{notoc}%
830 \renewcommand*{\float@@listhead}{%
831 %<article> \section*
832 %<report|book> \chapter*
833 }%
834 \doforeachtocfile[float]{%
835 \unsettoc{\@currext}{numbered}%
836 \unsettoc{\@currext}{totoc}%
837 }%
838 \AtAddToTocList[float]{%
839 \unsettoc{\@currext}{numbered}%
840 \unsettoc{\@currext}{totoc}%
841 }%
842 \or% totoc
843 \KOMA@kav@remove{\KOMAClassFileName}{toc}{nolistof}%
844 \KOMA@kav@remove{\KOMAClassFileName}{toc}{listof}%
845 \KOMA@kav@remove{\KOMAClassFileName}{toc}{listofnumbered}%
846 \KOMA@kav@add{\KOMAClassFileName}{toc}{listof}%
847 \KOMA@kav@remove{\KOMAClassFileName}{listof}{notoc}%
848 \KOMA@kav@remove{\KOMAClassFileName}{listof}{totoc}%
849 \KOMA@kav@remove{\KOMAClassFileName}{listof}{numbered}%
850 \KOMA@kav@add{\KOMAClassFileName}{listof}{totoc}%
851 \renewcommand*{\float@@listhead}{%
852 %<article> \addsec
853 %<report|book> \addchap
854 }%
855 \doforeachtocfile[float]{%
856 \unsettoc{\@currext}{numbered}%
857 \setuptoc{\@currext}{totoc}%
858 }%
859 \AtAddToTocList[float]{%
860 \unsettoc{\@currext}{numbered}%
861 \setuptoc{\@currext}{totoc}%
862 }%
863 \or% numbered
864 \KOMA@kav@remove{\KOMAClassFileName}{toc}{nolistof}%
865 \KOMA@kav@remove{\KOMAClassFileName}{toc}{listof}%
866 \KOMA@kav@remove{\KOMAClassFileName}{toc}{listofnumbered}%
867 \KOMA@kav@add{\KOMAClassFileName}{toc}{listofnumbered}%
868 \KOMA@kav@remove{\KOMAClassFileName}{listof}{notoc}%
869 \KOMA@kav@remove{\KOMAClassFileName}{listof}{totoc}%
870 \KOMA@kav@remove{\KOMAClassFileName}{listof}{numbered}%
871 \KOMA@kav@add{\KOMAClassFileName}{listof}{numbered}%
872 \renewcommand*{\float@@listhead}{%
873 %<article> \section
874 %<report|book> \chapter
875 }%
876 \doforeachtocfile[float]{%
877 \setuptoc{\@currext}{numbered}%
878 \setuptoc{\@currext}{totoc}%
879 }%
880 \AtAddToTocList[float]{%
881 \setuptoc{\@currext}{numbered}%
882 \setuptoc{\@currext}{totoc}%
883 }%
884 \or% flat
885 \KOMA@kav@remove{\KOMAClassFileName}{listof}{flat}%
886 \KOMA@kav@remove{\KOMAClassFileName}{listof}{graduated}%
887 \KOMA@kav@add{\KOMAClassFileName}{listof}{flat}%
888 \@dynlisttrue
889 \or% graduated
890 \KOMA@kav@remove{\KOMAClassFileName}{listof}{flat}%
891 \KOMA@kav@remove{\KOMAClassFileName}{listof}{graduated}%
892 \KOMA@kav@add{\KOMAClassFileName}{listof}{graduated}%
893 \@dynlistfalse
894 \or% leveldown
895 \KOMA@kav@remove{\KOMAClassFileName}{listof}{standardlevel}%
896 \KOMA@kav@add{\KOMAClassFileName}{listof}{leveldown}%
897 \doforeachtocfile[float]{%
898 \setuptoc{\@currext}{leveldown}%
899 }%
900 \AtAddToTocList[float]{%
901 \setuptoc{\@currext}{leveldown}%
902 }%
903 \or% standardlevel
904 \KOMA@kav@remove{\KOMAClassFileName}{listof}{leveldown}%
905 \KOMA@kav@add{\KOMAClassFileName}{listof}{standardlevel}%
906 \doforeachtocfile[float]{%
907 \unsettoc{\@currext}{leveldown}%
908 }%
909 \AtAddToTocList[float]{%
910 \unsettoc{\@currext}{leveldown}%
911 }%
912 \or% entryprefix
913 \KOMA@kav@add{\KOMAClassFileName}{listof}{entryprefix}%
914 \@dynlisttrue
915 \doforeachtocfile[float]{%
916 \BeforeStartingTOC[\@currext]{%
917 \scr@ifundefinedorrelax{listof\@currext entryname}{}{%
918 \expandafter\def\expandafter\numberline@prefix
919 \expandafter{\csname listof\@currext entryname\endcsname
920 \nobreakspace}%
921 }%
922 }%
923 }%
924 \AtAddToTocList[float]{%
925 \BeforeStartingTOC[\@currext]{%
926 \scr@ifundefinedorrelax{listof\@currext entryname}{}{%
927 \expandafter\def\expandafter\numberline@prefix
928 \expandafter{\csname listof\@currext entryname\endcsname
929 \nobreakspace}%
930 }%
931 }%
932 }%
933 \or% indenttextentries
934 \KOMA@kav@remove{\KOMAClassFileName}{listof}{indenttextentries}%
935 \KOMA@kav@remove{\KOMAClassFileName}{listof}{leftaligntextentries}%
936 \KOMA@kav@add{\KOMAClassFileName}{listof}{indenttextentries}%
937 \doforeachtocfile[float]{%
938 \setuptoc{\@currext}{numberline}%
939 }%
940 \AtAddToTocList[float]{%
941 \setuptoc{\@currext}{numberline}%
942 }
943 \or% leftaligntextentries
944 \KOMA@kav@remove{\KOMAClassFileName}{listof}{indenttextentries}%
945 \KOMA@kav@remove{\KOMAClassFileName}{listof}{leftaligntextentries}%
946 \KOMA@kav@add{\KOMAClassFileName}{listof}{leftaligntextentries}%
947 \doforeachtocfile[float]{%
948 \unsettoc{\@currext}{numberline}%
949 }%
950 \AtAddToTocList[float]{%
951 \unsettoc{\@currext}{numberline}%
952 }
953 %<*book|report>
954 \or% chapterentry
955 \KOMAoptions{chapteratlists=entry}%
956 \or% chaptergap
957 \KOMAoptions{chapteratlists=\z@}%
958 \or% chaptergapsmall
959 \KOMAoptions{chapteratlists=10\p@}%
960 \or% chaptergapline
961 \KOMAoptions{chapteratlists=\baselineskip}%
962 %</book|report>
963 \fi
964 \fi
965 }
966 \KOMA@kav@add{\KOMAClassFileName}{toc}{nolistof}
967 \KOMA@kav@add{\KOMAClassFileName}{listof}{notoc}
968 \KOMA@kav@add{\KOMAClassFileName}{listof}{graduated}
969 \KOMA@kav@add{\KOMAClassFileName}{listof}{leftaligntextentries}
970 %</option>
971 % \end{macrocode}
972 % \end{option}^^A listof
973 %
974 % \begin{option}{liststotoc}
975 % \changes{v2.3h}{1995/01/21}{added}
976 % \changes{v2.8b}{2001/06/26}{using \cs{float@headings}}
977 % \changes{v2.4a}{1996/03/13}{\cs{listtabelname} relaces by \cs{listtablename}}
978 % \changes{v2.8g}{2001/07/18}{\cs{float@headings} renamed to
979 % \cs{float@listhead}}
980 % \changes{v2.98c}{2008/03/05}{obsolet}
981 % \changes{v3.01a}{2008/11/20}{deprecated}
982 % \changes{v3.99}{2022/11/16}{removed from \KOMAScript~4}
983 % \begin{macrocode}
984 %<*option&!v4>
985 \KOMA@DeclareDeprecatedOption{liststotoc}{listof=totoc}
986 %</option&!v4>
987 % \end{macrocode}
988 % \end{option}^^A liststotoc
989 %
990 % \begin{option}{liststotocnumbered}
991 % \changes{v2.8q}{2002/04/08}{added}
992 % \changes{v2.9p}{2003/07/07}{number also in the running head}
993 % \changes{v2.98c}{2008/03/05}{obsolet}
994 % \changes{v3.01a}{2008/11/20}{deprecated}
995 % \changes{v3.99}{2022/11/16}{removed from \KOMAScript~4}
996 % \begin{macrocode}
997 %<*option&!v4>
998 \KOMA@DeclareDeprecatedOption{liststotocnumbered}{listof=numbered}
999 %</option&!v4>
1000 % \end{macrocode}
1001 % \end{option}^^A liststotocnumbered
1002 %
1003 %
1004 % \begin{option}{listsleft,listsindent}
1005 % \changes{v2.8q}{2001/11/14}{added}
1006 % \changes{v2.98c}{2008/03/05}{obsolet}
1007 % \changes{v3.01a}{2008/11/20}{deprecated}
1008 % \changes{v3.99}{2022/11/16}{removed from \KOMAScript~4}
1009 % \begin{macrocode}
1010 %<*option&!v4>
1011 \KOMA@DeclareDeprecatedOption{listsleft}{listof=flat}
1012 \KOMA@DeclareDeprecatedOption{listsindent}{listof=graduated}
1013 %</option&!v4>
1014 % \end{macrocode}
1015 % \end{option}^^A listsleft,listsindent
1016 %
1017 % \begin{option}{chapteratlists}
1018 % \changes{v2.96a}{2006/12/03}{added}
1019 % \changes{v2.98c}{2008/03/05}{not with \cls*{scrartcl}}
1020 % \changes{v3.12a}{2014/01/17}{missing \cs{FamilyKeyStateProcessed} added}
1021 % \changes{v3.17}{2015/03/12}{internal value storage}
1022 % \changes{v3.28}{2019/11/18}{\cs{ifstr} renamed to \cs{Ifstr}}
1023 % \changes{v3.39}{2022/11/11}{initial dot removed from member argument of
1024 % option storage commands}
1025 % \begin{macro}{\@chaptertolistsfalse,\@chaptertoliststrue,\if@chaptertolists}
1026 % \changes{v2.96a}{2006/12/03}{added}
1027 % \changes{v3.12}{2013/09/24}{don't add lists to lists}
1028 % \begin{macro}{\@chapterlistsgap}
1029 % \changes{v2.96a}{2006/12/03}{added}
1030 % We can do several special treatments inside the lists of floats, when a new
1031 % chapter starts.
1032 % \begin{macrocode}
1033 %<*option&(book|report)>
1034 \newcommand*{\@chapterlistsgap}{10\p@}
1035 \newif\if@chaptertolists\@chaptertolistsfalse
1036 \KOMA@key{chapteratlists}[entry]{%
1037 \FamilyKeyStateProcessed
1038 \KOMA@kav@remove{\KOMAClassFileName}{listof}{chapterentry}%
1039 \KOMA@kav@remove{\KOMAClassFileName}{listof}{chaptergap}%
1040 \KOMA@kav@remove{\KOMAClassFileName}{listof}{chaptergapsmall}%
1041 \KOMA@kav@remove{\KOMAClassFileName}{listof}{chaptergapline}%
1042 % \end{macrocode}
1043 % \begin{description}
1044 % \item[\opt{=entry}:] add the chapter heading also to the lists of
1045 % float. \cs{@chaptertolisttrue} is used and the distance \cs{@chapterlistgap}
1046 % is set to \len{z@}.
1047 % \end{description}
1048 % \begin{macrocode}
1049 \Ifstr{#1}{entry}{%
1050 \@chaptertoliststrue\renewcommand*{\@chapterlistsgap}{\z@}%
1051 \KOMA@kav@replacevalue{\KOMAClassFileName}{chapteratlists}{entry}%
1052 \KOMA@kav@add{\KOMAClassFileName}{listof}{chapterentry}%
1053 }{%
1054 % \end{macrocode}
1055 % \begin{description}
1056 % \item[\opt{=\meta{distance}}:] use a vertical \meta{distance}.
1057 % \end{description}
1058 % \begin{macrocode}
1059 \@chaptertolistsfalse\renewcommand*{\@chapterlistsgap}{#1}%
1060 \KOMA@kav@replacevalue{\KOMAClassFileName}{chapteratlists}%
1061 {\@chapterlistsgap}%
1062 \def\reserved@a{\z@}%
1063 \ifx\@chapterlistsgap\reserved@a
1064 \KOMA@kav@add{\KOMAClassFileName}{listof}{chaptergap}%
1065 \else
1066 \def\reserved@a{10\p@}%
1067 \ifx\@chapterlistsgap\reserved@a
1068 \KOMA@kav@add{\KOMAClassFileName}{listof}{chaptergapsmall}%
1069 \else
1070 \def\reserved@a{\baselineskip}%
1071 \ifx\@chapterlistsgap\reserved@a
1072 \KOMA@kav@add{\KOMAClassFileName}{listof}{chaptergapline}%
1073 \fi
1074 \fi
1075 \fi
1076 }%
1077 }
1078 \BeforeTOCHead{\@chaptertolistsfalse}
1079 \KOMA@kav@add{\KOMAClassFileName}{chapteratlists}{10\p@}%
1080 \KOMA@kav@add{\KOMAClassFileName}{listof}{chaptergapsmall}%
1081 %</option&(book|report)>
1082 % \end{macrocode}
1083 % \end{macro}^^A \@chapterlistgap
1084 % \end{macro}^^A \if@chaptertolists
1085 % \end{option}^^A chapteratlists
1086 %
1087 %
1088 % \begin{macro}{\float@listhead}
1089 % \changes{v2.8b}{2001/06/26}{added}
1090 % \changes{v2.8g}{2001/07/18}{\cs{float@headings} renamed to
1091 % \cs{float@listhead}}
1092 % \changes{v2.98c}{2008/03/05}{using \cs{float@@listhead}}
1093 % \changes{v3.00}{2008/07/04}{deprecated}
1094 % \changes{v3.10}{2011/08/31}{using\cs{MakeMarkcase}}
1095 % In 2001 I've designed an interface to allow other package authors to set the
1096 % headings of lists of floats the same way \KOMAScript{} classes do. Anselm
1097 % Lingnau accepted this interface (but did not like may macro names, so these
1098 % were changed in \KOMAScript{} 2.8g). But for \KOMAScript{} 3 I've needed a
1099 % more powerful interface. So this became deprecated. Unfortunately Anselm is
1100 % not willing to use the new \pkg*{tocbasic} for \pkg{float}. See
1101 % \pkg*{scrhack} for a solution and how \pkg{float} could benefit from using
1102 % \pkg*{tocbasic}.
1103 % \begin{macrocode}
1104 %<*body>
1105 \newcommand*{\float@listhead}[1]{%
1106 \scr@float@listhead@warning
1107 \float@@listhead{#1}%
1108 \@mkboth{\MakeMarkcase{#1}}{\MakeMarkcase{#1}}%
1109 % \end{macrocode}
1110 % \changes{v2.8q}{2001/11/14}{support for dynamic number width}
1111 % This is the best occasion to also add the code for the dynamic number width.
1112 % \begin{macrocode}
1113 \if@dynlist%
1114 \newcommand*{\scr@starttoc}{}%
1115 \let\scr@starttoc=\@starttoc
1116 \renewcommand*{\@starttoc}[1]{%
1117 \before@starttoc{##1}\scr@starttoc{##1}\after@starttoc{##1}%
1118 }%
1119 \fi
1120 }
1121 % \end{macrocode}
1122 % \begin{macro}{\scr@float@listhead@warning,\scr@float@addtolists@warning}
1123 % \changes{v3.01}{2008/11/13}{added}
1124 % \changes{v3.12}{2013/09/25}{text changed}
1125 % \changes{v3.12a}{2014/03/05}{text corrected}
1126 % \changes{v3.30}{2020/02/25}{spurious space at end of warning message
1127 % removed}
1128 % \changes{v3.43}{2024/10/24}{warning changed}
1129 % \changes{v3.45}{2025/06/04}{\cs{@ifpackageloaded} replaced by
1130 % \cs{IfPackageLoadedTF}}
1131 % Here the warning messages, that are used for using the deprecated interface.
1132 % \begin{macrocode}
1133 \newcommand*{\scr@float@listhead@warning}{%
1134 \ClassWarning{\KOMAClassName}{%
1135 Usage of \string\float@listhead\space detected!\MessageBreak
1136 This could be, because you are using\MessageBreak
1137 \IfPackageLoadedTF{floatrow}{%
1138 \IfPackageLoadedTF{floatrowbytocbasic}{%
1139 a package that does not support the KOMA-Script\MessageBreak
1140 interface of KOMA-Script package `tocbasic`.\MessageBreak
1141 }{%
1142 package `floatrow` without `floatrowbytocbasic`.\MessageBreak
1143 }%
1144 }{%
1145 \IfPackageLoadedTF{float}{%
1146 \IfPackageLoadedTF{floatbytocbasic}{%
1147 a package that does not support the KOMA-Script\MessageBreak
1148 interface of KOMA-Script package `tocbasic`.\MessageBreak
1149 }{%
1150 package `float` without `floatbytocbasic`.\MessageBreak
1151 }%
1152 }{%
1153 a package that does not support the KOMA-Script\MessageBreak
1154 interface of KOMA-Script package `tocbasic`.\MessageBreak
1155 }%
1156 }%
1157 Implementation of \string\float@listhead\space became\MessageBreak
1158 deprecated in KOMA-Script v3.01 2008/11/14 and\MessageBreak
1159 has been replaced by several more flexible\MessageBreak
1160 features of package `tocbasic`.\MessageBreak
1161 Implementation of \string\float@listhead\space will\MessageBreak
1162 be removed from KOMA-Script soon%
1163 }%
1164 }
1165 \newcommand*{\scr@float@addtolists@warning}{%
1166 \ClassWarningNoLine{\KOMAClassName}{%
1167 \string\float@addtolists\space detected!\MessageBreak
1168 Implementation of \string\float@addtolist\space became\MessageBreak
1169 deprecated in KOMA-Script v3.01 2008/11/14 and\MessageBreak
1170 has been replaced by several more flexible\MessageBreak
1171 features of package `tocbasic`.\MessageBreak
1172 Since Version 3.12 support for deprecated\MessageBreak
1173 \string\float@addtolist\space interface has been\MessageBreak
1174 restricted to only some of the KOMA-Script\MessageBreak
1175 features and been removed from others.\MessageBreak
1176 Since Version 3.43 support for deprecated\MessageBreak
1177 \string\float@addtolist\space interface has been\MessageBreak
1178 removed from all KOMA-Script classes%
1179 }%
1180 \global\let\scr@float@addtolists@warning\relax
1181 }
1182 %</body>
1183 % \end{macrocode}
1184 % \end{macro}^^A \scr@float@listhead@warning,scr@float@addtolists@warning
1185 % \end{macro}^^A \float@listhead
1186 %
1187 % \begin{command}{\listfigurename,\listtablename}
1188 % \begin{command}{\listoflofname,\listoflotname,
1189 % \listoflofentryname,\listoflotentryname}
1190 % \changes{v3.00}{2008/07/03}{neu für Paket \pkg*{tocbasic}}
1191 % \changes{v3.25}{2017/10/10}{\cs{renewcommand} statt \cs{newcommand}}%^^A
1192 % The names used by \pkg*{tocbasic}.
1193 % \begin{macrocode}
1194 %<*body>
1195 \renewcommand*\listfigurename{List of Figures}
1196 \providecaptionname{american,australian,british,canadian,english,newzealand,%
1197 UKenglish,ukenglish,USenglish,usenglish}\listfigurename{List of Figures}
1198 \renewcommand*\listoflofname{\listfigurename}
1199 \renewcommand*\listoflofentryname{\figurename}
1200 \renewcommand*\listtablename{List of Tables}
1201 \providecaptionname{american,australian,british,canadian,english,newzealand,%
1202 UKenglish,ukenglish,USenglish,usenglish}\listtablename{List of Tables}
1203 \renewcommand*\listoflotname{\listtablename}
1204 \renewcommand*\listoflotentryname{\tablename}
1205 %</body>
1206 % \end{macrocode}
1207 % \end{command}^^A \listoflofname … \listoflotentryname
1208 % \end{command}^^A \listfigurename,\listtablename
1209 %
1210 % \begin{command}{\listoffigures}
1211 % \changes{v2.3h}{1995/01/21}{using \cs{lof@heading}}
1212 % \changes{v2.4k}{1996/12/13}{\cs{lof@heading} for all classes}
1213 % \changes{v2.8l}{2001/08/16}{group added an \len{parskip} set to 0}
1214 % \changes{v2.8q}{2001/11/13}{\cs{@parskipfalse}\cs{@parskip@indent}}
1215 % \changes{v2.95}{2004/11/05}{\cs{@parskipfalse} and \cs{@parskip@indent}
1216 % replaced}
1217 % \changes{v3.00}{2008/07/04}{using \pkg*{tocbasic}}
1218 % \changes{v3.23}{2017/03/24}{using \cs{ext@figure} instead of \file{lof}}
1219 % \changes{v3.25}{2017/10/10}{implicit definition by \cs{DeclareNewTOC}}
1220 % The list of figures.
1221 % \end{command}^^A \listoffigures
1222 %
1223 % \begin{macro}{\l@figure}
1224 % \changes{v3.25}{2017/10/10}{implicit definition by \cs{DeclareNewTOC}}
1225 % Entry command for the list of figures.
1226 % \end{macro}^^A \l@figure
1227 %
1228 % \begin{command}{\listoftables}
1229 % \changes{v2.3h}{1995/01/21}{using \cs{lot@heading}}
1230 % \changes{v2.4k}{1996/12/13}{\cs{lot@heading} for all classes}
1231 % \changes{v2.8l}{2001/08/16}{group added an \len{parskip} set to 0}
1232 % \changes{v2.8q}{2001/11/13}{\cs{@parskipfalse}\cs{@parskip@indent}}
1233 % \changes{v2.95}{2004/11/05}{\cs{@parskipfalse} and \cs{@parskip@indent}
1234 % replaced}
1235 % \changes{v3.00}{2008/07/04}{using \pkg*{tocbasic}}
1236 % \changes{v3.23}{2017/03/24}{using \cs{ext@table} instead of \file{lot}}
1237 % \changes{v3.25}{2017/10/10}{implicit definition by \cs{DeclareNewTOC}}
1238 % The list of figures.
1239 % \end{command}^^A \listoftables
1240 %
1241 % \begin{macro}{\l@table}
1242 % \changes{v3.25}{2017/10/10}{implicit definition by \cs{DeclareNewTOC}}
1243 % Entry command for the list of tables.
1244 % \end{macro}^^A \l@table
1245 %
1246 % \begin{macrocode}
1247 %</!letter>
1248 % \end{macrocode}
1249 %
1250 %
1251 % \Finale
1252 % \PrintChanges
1253 %
1254 \endinput
1255 % Local Variables:
1256 % mode: doctex
1257 % ispell-local-dictionary: "en_US"
1258 % eval: (flyspell-mode 1)
1259 % TeX-master: t
1260 % TeX-engine: luatex-dev
1261 % eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx"))
1262 % End: