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