From ed8702df3768e21a3ef87a2eec9ca8341aad9b7a Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 13 Oct 2019 21:40:52 +0000
Subject: koma-script (13oct19)

git-svn-id: svn://tug.org/texlive/trunk@52369 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/koma-script/tocbasic.sty  | 555 +++++++++++++++++++--
 1 file changed, 527 insertions(+), 28 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/koma-script/tocbasic.sty')

diff --git a/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty b/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty
index 44e2cccd305..a081d5e3f6c 100644
--- a/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty
+++ b/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty
@@ -16,11 +16,12 @@
 %% scrkernel-tocstyle.dtx  (with options: `package,style,undottedtocline')
 %% scrkernel-tocstyle.dtx  (with options: `package,style,largetocline')
 %% scrkernel-tocstyle.dtx  (with options: `package,style,tocline')
+%% scrkernel-tocstyle.dtx  (with options: `package,style,toctext')
 %% scrkernel-tocstyle.dtx  (with options: `package,style,default')
 %% tocbasic.dtx  (with options: `package,exit')
 %% scrlogo.dtx  (with options: `logo')
 %% 
-%% Copyright (c) 2008-2017 Markus Kohm [komascript at gmx info]
+%% Copyright (c) 2008-2019 Markus Kohm [komascript at gmx info]
 %% 
 %% This file was generated from file(s) of the KOMA-Script bundle.
 %% ---------------------------------------------------------------
@@ -48,28 +49,28 @@
 %% 
 %% The KOMA-Script bundle (but maybe not this file) was based upon the
 %% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
-%% standard classes created by The LaTeX3 Project 1994-1996.  You may
+%% standard classes created by The LaTeX3 Project 1994-1996.  You can
 %% find a complete unmodified copy of LaTeX2e at
 %% <http://mirror.ctan.org/tex-archive/macros/latex/base/>.
 %% 
-%%% From File: $Id: tocbasic.dtx 3050 2018-12-30 14:36:55Z kohm $
+%%% From File: $Id: tocbasic.dtx 3256 2019-10-10 07:06:49Z kohm $
 %%%            (run: identify)
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 \ProvidesPackage{tocbasic}[%
-  2019/02/01 v3.26b KOMA-Script
+  2019/10/12 v3.27 KOMA-Script
   package
   (handling toc-files)%
 ]
-%%% From File: $Id: tocbasic.dtx 3050 2018-12-30 14:36:55Z kohm $
+%%% From File: $Id: tocbasic.dtx 3256 2019-10-10 07:06:49Z kohm $
 %%%            (run: prepare)
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: prepare)
-%%% From File: $Id: tocbasic.dtx 3050 2018-12-30 14:36:55Z kohm $
+%%% From File: $Id: tocbasic.dtx 3256 2019-10-10 07:06:49Z kohm $
 %%%            (run: option)
 \ProcessOptions\relax
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: option)
-%%% From File: $Id: tocbasic.dtx 3050 2018-12-30 14:36:55Z kohm $
+%%% From File: $Id: tocbasic.dtx 3256 2019-10-10 07:06:49Z kohm $
 %%%            (run: body)
 \RequirePackage{scrbase}
 \AfterPackage*{multitoc}{%
@@ -159,6 +160,7 @@
     \tb@listoftocs
   \reserved@a
 }
+\newcommand*{\categoryoftoc}{\owneroftoc}
 \newcommand*{\AtAddToTocList}{%
   \kernel@ifnextchar [%]
     \@@AtAddToTocList\@AtAddToTocList
@@ -353,6 +355,10 @@
     \setlength{\parfillskip}{\z@\@plus 1fil}%
     \csname tocbasic@@before@hook\endcsname
     \csname tb@#1@before@hook\endcsname
+    \let\tocbasic@saved@input\@input
+    \def\@input##1{%
+      \let\@input\tocbasic@saved@input\@input{##1}\par
+    }%
     \@starttoc{#1}%
     \csname tb@#1@after@hook\endcsname
     \csname tocbasic@@after@hook\endcsname
@@ -681,6 +687,9 @@
     \DefineFamilyKey[.toc]{KOMAarg}{owner}{%
       \tb@ifvalueisnotempty{##1}{\edef\tb@nt@owner{##1}}%
     }%
+    \DefineFamilyKey[.toc]{KOMAarg}{category}{%
+      \tb@ifvalueisnotempty{##1}{\edef\tb@nt@owner{##1}}%
+    }%
     \DefineFamilyKey[.toc]{KOMAarg}{@else@}{\FamilyKeyStateProcessed}%
     \FamilyExecuteOptions[.toc]{KOMAarg}{#1}%
     \RelaxFamilyKey[.toc]{KOMAarg}{@else@}%
@@ -692,7 +701,7 @@
     \DefineFamilyKey[.toc]{KOMAarg}{type}{\FamilyKeyStateProcessed}%
     \DefineFamilyKey[.toc]{KOMAarg}{tocentrystyle}{\FamilyKeyStateProcessed}%
     \DefineFamilyKey[.toc]{KOMAarg}{extension}{\FamilyKeyStateProcessed}%
-    \DefineFamilyKey[.toc]{KOMAarg}{owner}{\FamilyKeyStateProcessed}%
+    \DefineFamilyKey[.toc]{KOMAarg}{category}{\FamilyKeyStateProcessed}%
     \ifstr{\tb@nt@tocentrystyle}{}{}{%
       \begingroup
         \let\scr@dte@current\tb@nt@type
@@ -703,6 +712,7 @@
             \l@addto@macro\tb@nt@extra@relax@opts{%
               \RelaxFamilyKey[.toc]{KOMAarg}{toc##1}%
               \RelaxFamilyKey[.toc]{KOMAarg}{tocentry##1}%
+              \RelaxFamilyKey[.toc]{KOMAarg}{tocentry##1:}%
             }%
           }%
           \kernel@ifnextchar[%]
@@ -722,6 +732,9 @@
               \l@addto@macro{\tb@nt@tocstyle@options}{,##1={####1}}%
               \FamilyKeyStateProcessed
             }%
+            \DefineFamilyKey[.toc]{KOMAarg}{tocentry##1:}{%
+              \l@addto@macro{\tb@nt@tocstyle@options}{,##1:={####1}}%
+            }%
           }%
         }%
         \def\@dodefault##1[##2]{%
@@ -737,6 +750,9 @@
               \l@addto@macro{\tb@nt@tocstyle@options}{,##1={####1}}%
               \FamilyKeyStateProcessed
             }%
+            \DefineFamilyKey[.toc]{KOMAarg}{tocentry##1:}{%
+              \l@addto@macro{\tb@nt@tocstyle@options}{,##1:={####1}}%
+            }%
           }%
         }%
         \scr@dte@doopts
@@ -845,6 +861,7 @@
     \RelaxFamilyKey[.toc]{KOMAarg}{atend}%
     \RelaxFamilyKey[.toc]{KOMAarg}{atbegin}%
     \tb@nt@extra@relax@opts
+    \RelaxFamilyKey[.toc]{KOMAarg}{category}%
     \RelaxFamilyKey[.toc]{KOMAarg}{owner}%
     \RelaxFamilyKey[.toc]{KOMAarg}{extension}%
     \RelaxFamilyKey[.toc]{KOMAarg}{tocentrystyle}%
@@ -1016,7 +1033,7 @@
   }%
 }
 \newcommand*{\tb@nt@autofloattype}{16}
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: body)
 \newcommand*{\scr@numberline}[1]{%
   \numberline@box{%
@@ -1068,7 +1085,9 @@
   \begingroup
     \def\do@endgroup{\endgroup}%
     \def\do##1{%
-      \l@addto@macro\do@endgroup{\RelaxFamilyKey[.dte]{KOMAarg}{##1}}%
+      \l@addto@macro\do@endgroup{%
+        \RelaxFamilyKey[.dte]{KOMAarg}{##1}%
+      }%
       \scr@dte@gobbleopt
     }%
     \scr@dte@doopts
@@ -1085,6 +1104,21 @@
   \@DefineTOCEntryOption{#1}{#2}{%
     \@DefineTOCEntryLengthOptionMacro{#2}{#3}{#4}{##1}%
   }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+    \scr@ifundefinedorrelax{#3##1#4}{\FamilyKeyStateUnknownValue}{%
+      \expandafter\let
+      \csname #3\scr@dte@current#4\expandafter\endcsname
+      \csname #3##1#4\endcsname
+      \FamilyKeyStateProcessed
+    }%
+  }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2+}{%
+    \@DefineTOCEntryAddLengthOptionMacro{#2+}{#3}{#4}{##1}%
+  }%
+  \edef\scr@dte@doopts{%
+    \unexpanded\expandafter{\scr@dte@doopts}%
+    \noexpand\do{#2:}\noexpand\do{#2+}%
+  }%
 }
 \newcommand*{\@DefineTOCEntryLengthOptionWithDefault}{}
 \def\@DefineTOCEntryLengthOptionWithDefault#1#2[#3]#4#5#6{%
@@ -1092,6 +1126,21 @@
   \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
     \@DefineTOCEntryLengthOptionMacro{#2}{#4}{#5}{##1}%
   }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+    \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
+      \expandafter\let
+      \csname #4\scr@dte@current#5\expandafter\endcsname
+      \csname #4##1#5\endcsname
+      \FamilyKeyStateProcessed
+    }%
+  }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2+}{%
+    \@DefineTOCEntryAddLengthOptionMacro{#2+}{#4}{#5}{##1}%
+  }%
+  \edef\scr@dte@doopts{%
+    \unexpanded\expandafter{\scr@dte@doopts}%
+    \noexpand\do{#2:}\noexpand\do{#2+}%
+  }%
 }
 \newcommand*{\@DefineTOCEntryLengthOptionMacro}[4]{%
   \protected@edef\reserved@a{%
@@ -1106,6 +1155,26 @@
     \fi
   \fi
 }
+\newcommand*{\@DefineTOCEntryAddLengthOptionMacro}[4]{%
+  \@ifundefined{#2\scr@dte@current#3}{%
+    \FamilyKeyStateUnknownValue
+  }{%
+    \protected@edef\reserved@a{%
+      \noexpand\FamilySetLength{KOMAarg}{#1}{\noexpand\@tempskipa}{#4}%
+    }\reserved@a
+    \ifx\FamilyKeyState\FamilyKeyStateProcessed
+      \ifscr@dte@expandtopt
+        \expandafter\edef\csname #2\scr@dte@current#3\endcsname{%
+          \the\glueexpr\@tempskipa
+          +\csname #2\scr@dte@current#3\endcsname\relax}%
+      \else
+        \expandafter\protected@edef\csname #2\scr@dte@current#3\endcsname{%
+          \the\glueexpr #4%
+            +\csname #2\scr@dte@current#3\endcsname\relax}%
+      \fi
+    \fi
+  }%
+}
 \newcommand*{\@DefineTOCEntryNumberOption}[2]{%
   \kernel@ifnextchar [%]
     {\@DefineTOCEntryNumberOptionWithDefault{#1}{#2}}
@@ -1116,6 +1185,21 @@
   \@DefineTOCEntryOption{#1}{#2}{%
     \@DefineTOCEntryNumberOptionMacro{#2}{#3}{#4}{##1}%
   }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+    \scr@ifundefinedorrelax{#3##1#4}{\FamilyKeyStateUnknownValue}{%
+      \expandafter\let
+      \csname #3\scr@dte@current#4\expandafter\endcsname
+      \csname #3##1#4\endcsname
+      \FamilyKeyStateProcessed
+    }%
+  }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2+}{%
+    \@DefineTOCEntryAddNumberOptionMacro{#2+}{#3}{#4}{##1}%
+  }%
+  \edef\scr@dte@doopts{%
+    \unexpanded\expandafter{\scr@dte@doopts}%
+    \noexpand\do{#2:}\noexpand\do{#2+}%
+  }%
 }
 \newcommand*{\@DefineTOCEntryNumberOptionWithDefault}{}
 \def\@DefineTOCEntryNumberOptionWithDefault#1#2[#3]#4#5#6{%
@@ -1123,6 +1207,21 @@
   \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
     \@DefineTOCEntryNumberOptionMacro{#2}{#4}{#5}{##1}%
   }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+    \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
+      \expandafter\let
+      \csname #4\scr@dte@current#5\expandafter\endcsname
+      \csname #4##1#5\endcsname
+      \FamilyKeyStateProcessed
+    }%
+  }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2+}{%
+    \@DefineTOCEntryAddNumberOptionMacro{#2+}{#4}{#5}{##1}%
+  }%
+  \edef\scr@dte@doopts{%
+    \unexpanded\expandafter{\scr@dte@doopts}%
+    \noexpand\do{#2:}\noexpand\do{#2+}%
+  }%
 }
 \newcommand*{\@DefineTOCEntryNumberOptionMacro}[4]{%
   \protected@edef\reserved@a{%
@@ -1131,6 +1230,20 @@
     }{#4}%
   }\reserved@a
 }
+\newcommand*{\@DefineTOCEntryAddNumberOptionMacro}[4]{%
+  \@ifundefined{#2\scr@dte@current#3}{%
+    \FamilyKeyStateUnknownValue
+  }{%
+    \FamilySetCounterMacro{KOMAarg}{#1}{%
+      \reserved@a
+    }{#4}%
+    \ifx\FamilyKeyState\FamilyKeyStateProcessed
+      \expandafter\edef\csname #2\scr@dte@current#3\endcsname{%
+        \the\numexpr \reserved@a+\csname #2\scr@dte@current#3\endcsname\relax
+      }%
+    \fi
+  }%
+}
 \newcommand*{\@DefineTOCEntryBooleanOption}[2]{%
   \kernel@ifnextchar [%]
     {\@DefineTOCEntryBoolOptionWithDefault{#1}{#2}}
@@ -1143,6 +1256,17 @@
   \@DefineTOCEntryOption{#1}{#2}[true]{%
     \@DefineTOCEntryBoolOptionMacro{#2}{#3}{#4}{##1}%
   }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+    \scr@ifundefinedorrelax{if#3##1#4}{\FamilyKeyStateUnknownValue}{%
+      \expandafter\let
+      \csname if#3\scr@dte@current#4\expandafter\endcsname
+      \csname if#3##1#4\endcsname
+      \FamilyKeyStateProcessed
+    }%
+  }%
+  \edef\scr@dte@doopts{%
+    \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+  }%
 }
 \newcommand*{\@DefineTOCEntryBoolOptionWithDefault}{}
 \def\@DefineTOCEntryBoolOptionWithDefault#1#2[#3]#4#5#6{%
@@ -1152,6 +1276,17 @@
   \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
     \@DefineTOCEntryBoolOptionMacro{#2}{#4}{#5}{##1}%
   }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+    \scr@ifundefinedorrelax{if#4##1#5}{\FamilyKeyStateUnknownValue}{%
+      \expandafter\let
+      \csname if#4\scr@dte@current#5\expandafter\endcsname
+      \csname if#4##1#5\endcsname
+      \FamilyKeyStateProcessed
+    }%
+  }%
+  \edef\scr@dte@doopts{%
+    \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+  }%
 }
 \newcommand*{\@DefineTOCEntryBoolOptionMacro}[4]{%
   \@ifundefined{if#2\scr@dte@current#3}{%
@@ -1169,6 +1304,17 @@
   \@DefineTOCEntryOption{#1}{#2}[true]{%
     \@DefineTOCEntryIfOptionMacro{#2}{#3}{#4}{##1}%
   }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+    \scr@ifundefinedorrelax{If#3##1#4}{\FamilyKeyStateUnknownValue}{%
+      \expandafter\let
+      \csname If#3\scr@dte@current#4\expandafter\endcsname
+      \csname If#3##1#4\endcsname
+      \FamilyKeyStateProcessed
+    }%
+  }%
+  \edef\scr@dte@doopts{%
+    \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+  }%
 }
 \newcommand*{\@DefineTOCEntryIfOptionWithDefault}{}
 \def\@DefineTOCEntryIfOptionWithDefault#1#2[#3]#4#5#6{%
@@ -1176,6 +1322,17 @@
   \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
     \@DefineTOCEntryIfOptionMacro{#2}{#4}{#5}{##1}%
   }%
+  \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+    \scr@ifundefinedorrelax{If#4##1#5}{\FamilyKeyStateUnknownValue}{%
+      \expandafter\let
+      \csname If#4\scr@dte@current#5\expandafter\endcsname
+      \csname If#4##1#5\endcsname
+      \FamilyKeyStateProcessed
+    }%
+  }%
+  \edef\scr@dte@doopts{%
+    \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+  }%
 }
 \newcommand*{\@DefineTOCEntryIfOptionMacro}[4]{%
   \FamilySetBool{KOMAarg}{#1}{@tempswa}{#4}%
@@ -1202,10 +1359,32 @@
     \@DefineTOCEntryOption{#1}{#2}{%
       \@DefineTOCEntryCommandOptionMacro{#2}{#3}{#4}[#5]{##1}%
     }%
+    \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+      \scr@ifundefinedorrelax{#3##1#4}{\FamilyKeyStateUnknownValue}{%
+        \expandafter\let
+        \csname #3\scr@dte@current#4\expandafter\endcsname
+        \csname #3##1#4\endcsname
+        \FamilyKeyStateProcessed
+      }%
+    }%
+    \edef\scr@dte@doopts{%
+      \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+    }%
   \or
     \@DefineTOCEntryOption{#1}{#2}{%
       \@DefineTOCEntryCommandOptionMacro{#2}{#3}{#4}[#5]{##1{####1}}%
     }%
+    \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+      \scr@ifundefinedorrelax{#3##1#4}{\FamilyKeyStateUnknownValue}{%
+        \expandafter\let
+        \csname #3\scr@dte@current#4\expandafter\endcsname
+        \csname #3##1#4\endcsname
+        \FamilyKeyStateProcessed
+      }%
+    }%
+    \edef\scr@dte@doopts{%
+      \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+    }%
   \else
     \PackageError{tocbasic%
     }{only one argument supported}{%
@@ -1224,14 +1403,47 @@
     \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
       \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1}%
     }%
+    \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+      \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
+        \expandafter\let
+        \csname #4\scr@dte@current#5\expandafter\endcsname
+        \csname #4##1#5\endcsname
+        \FamilyKeyStateProcessed
+      }%
+    }%
+    \edef\scr@dte@doopts{%
+      \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+    }%
   \or
     \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
       \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}}%
     }%
+    \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+      \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
+        \expandafter\let
+        \csname #4\scr@dte@current#5\expandafter\endcsname
+        \csname #4##1#5\endcsname
+        \FamilyKeyStateProcessed
+      }%
+    }%
+    \edef\scr@dte@doopts{%
+      \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+    }%
   \or
     \@DefineTOCEntryOption{#1}{#2}[{#3}]{%
       \@DefineTOCEntryCommandOptionMacro{#2}{#4}{#5}[#6]{##1{####1}{####2}}%
     }%
+    \DefineFamilyKey[.dte]{KOMAarg}{#2:}{%
+      \scr@ifundefinedorrelax{#4##1#5}{\FamilyKeyStateUnknownValue}{%
+        \expandafter\let
+        \csname #4\scr@dte@current#5\expandafter\endcsname
+        \csname #4##1#5\endcsname
+        \FamilyKeyStateProcessed
+      }%
+    }%
+    \edef\scr@dte@doopts{%
+      \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}%
+    }%
   \else
     \PackageError{tocbasic%
     }{only one argument supported}{%
@@ -1281,6 +1493,7 @@
 }
 \newcommand*{\@ExecuteTOCEntryStyleInitCode}[2]{%
   \let\scr@dte@doopts\@empty
+  \expandafter\let\csname scr@dte@#1@needs\endcsname\relax
   \scr@ifundefinedorrelax{scr@dte@#1@init}{}{%
     \def\DefineTOCEntryBooleanOption{\@DefineTOCEntryBooleanOption{#1}}%
     \def\DefineTOCEntryCommandOption{\@DefineTOCEntryCommandOption{#1}}%
@@ -1358,6 +1571,7 @@
     \if@tempswa
       \@nameuse{scr@dte@def@l@#2}{#3}%
       \expandafter\edef\csname scr@dte@#3@style\endcsname{#2}%
+      \expandafter\edef\csname scr@tso@#3@style\endcsname{#2}%
       \expandafter\let\csname toclevel@#3\expandafter\endcsname
       \csname #3tocdepth\endcsname
       \if@atdocument\else
@@ -1417,10 +1631,13 @@
   \expandafter\let\csname scr@dte@#2@init\expandafter\endcsname
   \csname scr@dte@#1@init\endcsname
 }
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+\providecommand*\@pnumwidth{1.55em}
+\providecommand*\@tocrmarg {2.55em}
+\providecommand*\@dotsep   {4.5}
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: style,gobble)
 \DeclareTOCEntryStyle{gobble}{}%
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: style,dottedtocline)
 \DeclareTOCEntryStyle{dottedtocline}[{%
   \DefineTOCEntryLengthOption{indent}%
@@ -1546,10 +1763,15 @@
     }%
   }{}%
 }]{%
-  \@dottedtocline{\@nameuse{#1tocdepth}}{\@nameuse{scr@tso@#1@indent}}%
-                 {\@nameuse{scr@tso@#1@numwidth}}{##1}{##2}%
+  \iftocfeature{\@currext}{noindent}{%
+    \@dottedtocline{\@nameuse{#1tocdepth}}{\z@}%
+                   {\@nameuse{scr@tso@#1@numwidth}}{##1}{##2}%
+  }{%
+    \@dottedtocline{\@nameuse{#1tocdepth}}{\@nameuse{scr@tso@#1@indent}}%
+                   {\@nameuse{scr@tso@#1@numwidth}}{##1}{##2}%
+  }%
 }
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: style,undottedtocline)
 \DeclareTOCEntryStyle{undottedtocline}[{%
   \DefineTOCEntryLengthOption{indent}%
@@ -1695,8 +1917,12 @@
       \leavevmode
       \bfseries
       \advance\leftskip\@tempdima
-      \advance\leftskip\@nameuse{scr@tso@#1@indent}%
-      \hskip -\dimexpr \leftskip-\@nameuse{scr@tso@#1@indent}\relax
+      \iftocfeature{\@currext}{noindent}{%
+        \hskip -\leftskip
+      }{%
+        \advance\leftskip\@nameuse{scr@tso@#1@indent}%
+        \hskip -\dimexpr \leftskip-\@nameuse{scr@tso@#1@indent}\relax
+      }%
       ##1%
       \nobreak
       \hfil \nobreak\hb@xt@\@pnumwidth{\hss ##2}%
@@ -1705,7 +1931,7 @@
     \endgroup
   \fi
 }
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: style, largetocline)
 \DeclareTOCEntryStyle{largetocline}[{%
   \DefineTOCEntryLengthOption{indent}%
@@ -1802,7 +2028,10 @@
       \leavevmode
       \large
       \bfseries
-      \advance\leftskip\@nameuse{scr@tso@#1@indent}%
+      \iftocfeature{\@currext}{noindent}{%
+      }{%
+        \advance\leftskip\@nameuse{scr@tso@#1@indent}%
+      }%
       ##1%
       \hfil \nobreak\hb@xt@\@pnumwidth{\hss ##2}%
       \par
@@ -1815,7 +2044,7 @@
     \endgroup
   \fi
 }
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: style,tocline)
 \DeclareTOCEntryStyle{tocline}[{%
   \DefineTOCEntryLengthOption{beforeskip}%
@@ -1842,6 +2071,10 @@
     {scr@tso@}{@pagenumberbox}[1]{page number box}%
   \DefineTOCEntryCommandOption{pagenumberformat}%
     {scr@tso@}{@pagenumberformat}[1]{page number format}%
+  \DefineTOCEntryLengthOption{pagenumberwidth}%
+    {scr@tso@}{@pagenumberwidth}{width of page number box}%
+  \DefineTOCEntryLengthOption{rightindent}%
+    {scr@tso@}{@rightindent}{entry's text right indent}%
   \DefineTOCEntryOption{raggedentrytext}[true]{%
     \FamilySetBool{KOMAarg}{raggedentrytext}{@tempswa}{##1}%
     \ifx\FamilyKeyState\FamilyKeyStateProcessed
@@ -1920,6 +2153,32 @@
       \@namedef{scr@tso@#1@indent}{\@nameuse{scr@#1@tocindent}}%
     }%
   }{}%
+  \scr@ifundefinedorrelax{scr@tso@#1@pagenumberwidth}{%
+    \ifstrstart{#1}{sub}{%
+      \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@pagenumberwidth}{%
+        \@namedef{scr@tso@#1@pagenumberwidth}{\@pnumwidth}%
+      }{%
+        \expandafter\let
+        \csname scr@tso@#1@pagenumberwidth\expandafter\endcsname
+        \csname scr@tso@\scr@dte@nosub{#1}@pagenumberwidth\endcsname
+      }%
+    }{%
+      \@namedef{scr@tso@#1@pagenumberwidth}{\@pnumwidth}%
+    }%
+  }{}%
+  \scr@ifundefinedorrelax{scr@tso@#1@rightindent}{%
+    \ifstrstart{#1}{sub}{%
+      \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@rightindent}{%
+        \@namedef{scr@tso@#1@rightindent}{\@tocrmarg}%
+      }{%
+        \expandafter\let
+        \csname scr@tso@#1@rightindent\expandafter\endcsname
+        \csname scr@tso@\scr@dte@nosub{#1}@rightindent\endcsname
+      }%
+    }{%
+      \@namedef{scr@tso@#1@rightindent}{\@tocrmarg}%
+    }%
+  }{}%
   \@ifundefined{scr@tso@#1@indent}{%
       \ifstr{#1}{figure}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
         \ifstr{#1}{table}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
@@ -2115,7 +2374,7 @@
   }%
   \expandafter\providecommand%
   \csname scr@tso@#1@pagenumberbox\endcsname[1]{%
-    \hb@xt@\@pnumwidth{\hfil ##1}}%
+    \hb@xt@\@nameuse{scr@dte@pagenumberwidth}{\hfil ##1}}%
   \expandafter\providecommand\csname Ifscr@tso@#1@dynnumwidth\endcsname[2]{##2}%
 }]{%
   \scr@dte@tocline{#1}{##1}{##2}%
@@ -2151,13 +2410,21 @@
     \tocbasic@DependOnPenaltyAndTOCLevel{#1}%
     \addvspace{\@nameuse{scr@tso@#1@beforeskip}}\relax
     {%
-      \leftskip \@nameuse{scr@tso@#1@indent}\relax
-      \rightskip \@tocrmarg
+      \iftocfeature{\@currext}{noindent}{%
+        \leftskip \z@
+      }{%
+        \leftskip \@nameuse{scr@tso@#1@indent}\relax
+      }%
+      \rightskip \@nameuse{scr@tso@#1@rightindent}\relax
       \parfillskip -\rightskip
       \@nameuse{Ifscr@tso@#1@raggedpage}{%
         \addtolength{\parfillskip}{\z@ \@plus 1fil}%
       }{}%
-      \parindent \@nameuse{scr@tso@#1@indent}\relax
+      \iftocfeature{\@currext}{noindent}{%
+        \parindent \z@
+      }{%
+        \parindent \@nameuse{scr@tso@#1@indent}\relax
+      }%
       \@afterindenttrue
       \interlinepenalty\@M
       \expandafter\ifx\csname ragged#1entry\endcsname\raggedright
@@ -2225,6 +2492,8 @@
           {%
             \normalfont\normalsize\@nameuse{scr@tso@#1@linefill}%
             \nobreak
+            \expandafter\let\expandafter\scr@dte@pagenumberwidth
+            \csname scr@tso@#1@pagenumberwidth\endcsname
             \@nameuse{scr@tso@#1@pagenumberbox}{%
               \@nameuse{scr@tso@#1@pagenumberformat}{#3}%
             }%
@@ -2258,10 +2527,240 @@
     \mkern \@dotsep mu\hbox{#1}\mkern \@dotsep
     mu$}\hfill
 }
-%%% From File: $Id: scrkernel-tocstyle.dtx 3011 2018-08-29 07:35:17Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
+%%%            (run: style,toctext)
+\DeclareTOCEntryStyle{toctext}[{%
+  \DefineTOCEntryCommandOption{entryformat}%
+    {scr@tso@}{@entryformat}[1]{entry format}%
+  \DefineTOCEntryCommandOption{entrynumberformat}%
+    {scr@tso@}{@numberformat}[1]{entry number format}%
+  \DefineTOCEntryCommandOption{prepagenumber}%
+    {scr@tso@}{@prepagenumber}{separator between text and page number}%
+  \DefineTOCEntryLengthOption{numsep}%
+    {scr@tso@}{@numsep}{entry number separation}%
+  \DefineTOCEntryCommandOption{onstartfirstentry}%
+    {scr@tso@}{@onstartfirstentry}{output at start of paragraph}%
+  \DefineTOCEntryCommandOption{onstartentry}%
+    {scr@tso@}{@onstartentry}{output at start of all entries but the first}%
+  \DefineTOCEntryCommandOption{onendlastentry}%
+    {scr@tso@}{@onendlastentry}{output at end of paragraph}%
+  \DefineTOCEntryCommandOption{afterpar}%
+    {scr@tso@}{@afterpar}{settings after end of paragraph}%
+  \DefineTOCEntryCommandOption{onendentry}%
+    {scr@tso@}{@onendentry}{output at end of all entries but the last}%
+  \DefineTOCEntryCommandOption{pagenumberformat}%
+    {scr@tso@}{@pagenumberformat}[1]{page number format}%
+  \DefineTOCEntryLengthOption{rightindent}%
+    {scr@tso@}{@rightindent}{entry's text right indent}%
+  \DefineTOCEntryIfOption{raggedright}%
+    {scr@tso@}{@raggedright}{use raggedright for the whole paragraph}%
+  \DefineTOCEntryLengthOption{indent}%
+    {scr@tso@}{@indent}{entry indent}%
+  \scr@ifundefinedorrelax{#1tocdepth}{%
+    \ifstrstart{#1}{sub}{%
+      \scr@ifundefinedorrelax{\scr@dte@nosub{#1}tocdepth}{}{%
+        \expandafter\edef\csname #1tocdepth\endcsname{%
+          \the\numexpr \noexpand\@nameuse{\scr@dte@nosub{#1}tocdepth}+\@ne\relax
+        }%
+      }%
+    }{}%
+  }{}%
+  \@ifundefined{#1tocdepth}{%
+    \ifstr{#1}{part}{\@namedef{#1tocdepth}{-1}}{%
+      \ifstr{#1}{chapter}{\@namedef{#1tocdepth}{0}}{%
+        \ifstr{#1}{section}{\@namedef{#1tocdepth}{1}}{%
+          \ifstr{#1}{subsection}{\@namedef{#1tocdepth}{2}}{%
+            \ifstr{#1}{subsubsection}{\@namedef{#1tocdepth}{3}}{%
+              \ifstr{#1}{paragraph}{\@namedef{#1tocdepth}{4}}{%
+                \ifstr{#1}{subparagraph}{\@namedef{#1tocdepth}{5}}{%
+                  \ifstr{#1}{figure}{\@namedef{#1tocdepth}{1}}{%
+                    \ifstr{#1}{table}{\@namedef{#1tocdepth}{1}}{%
+                      \expandafter\let\csname #1tocdepth\expandafter\endcsname
+                      \csname #1numdepth\endcsname
+                    }%
+                  }%
+                }%
+              }%
+            }%
+          }%
+        }%
+      }%
+    }%
+  }{}%
+  \scr@ifundefinedorrelax{scr@tso@#1@indent}{%
+    \@ifundefined{scr@#1@tocindent}{%
+      \ifstrstart{#1}{sub}{%
+        \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@indent}{%
+          \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@numwidth}{}{%
+            \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
+              \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@numwidth}%
+              \relax
+            }%
+          }%
+        }{%
+          \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@numwidth}{%
+            \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
+              \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@indent}%
+              \relax
+            }%
+          }{%
+            \expandafter\edef\csname scr@tso@#1@indent\endcsname{%
+              \glueexpr \noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@indent}%
+                       +\noexpand\@nameuse{scr@tso@\scr@dte@nosub{#1}@numwidth}%
+              \relax
+            }%
+          }%
+        }%
+      }{}%
+    }{%
+      \@namedef{scr@tso@#1@indent}{\@nameuse{scr@#1@tocindent}}%
+    }%
+  }{}%
+  \scr@ifundefinedorrelax{scr@tso@#1@rightindent}{%
+    \ifstrstart{#1}{sub}{%
+      \scr@ifundefinedorrelax{scr@tso@\scr@dte@nosub{#1}@rightindent}{%
+        \@namedef{scr@tso@#1@rightindent}{\@tocrmarg}%
+      }{%
+        \expandafter\let
+        \csname scr@tso@#1@rightindent\expandafter\endcsname
+        \csname scr@tso@\scr@dte@nosub{#1}@rightindent\endcsname
+      }%
+    }{%
+      \@namedef{scr@tso@#1@rightindent}{\@tocrmarg}%
+    }%
+  }{}%
+  \@ifundefined{scr@tso@#1@indent}{%
+      \ifstr{#1}{figure}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
+        \ifstr{#1}{table}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
+          \ifstr{#1}{part}{\@namedef{scr@tso@#1@indent}{0em}}{%
+            \ifstr{#1}{chapter}{\@namedef{scr@tso@#1@indent}{0em}}{%
+              \scr@ifundefinedorrelax{l@chapter}{%
+                \ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{0pt}}{%
+                  \ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
+                    \ifstr{#1}{subsubsection}{%
+                      \@namedef{scr@tso@#1@indent}{3.8em}%
+                    }{%
+                      \ifstr{#1}{paragraph}{%
+                        \@namedef{scr@tso@#1@indent}{7em}%
+                      }{%
+                        \ifstr{#1}{subparagraph}{%
+                          \@namedef{scr@tso@#1@indent}{10em}%
+                        }{%
+                        }%
+                      }%
+                    }%
+                  }%
+                }%
+              }{%
+                \ifstr{#1}{section}{\@namedef{scr@tso@#1@indent}{1.5em}}{%
+                  \ifstr{#1}{subsection}{\@namedef{scr@tso@#1@indent}{3.8em}}{%
+                    \ifstr{#1}{subsubsection}{%
+                      \@namedef{scr@tso@#1@indent}{7.0em}%
+                    }{%
+                      \ifstr{#1}{paragraph}{%
+                        \@namedef{scr@tso@#1@indent}{10em}%
+                      }{%
+                        \ifstr{#1}{subparagraph}{%
+                          \@namedef{scr@tso@#1@indent}{12em}%
+                        }{%
+                        }%
+                      }%
+                    }%
+                  }%
+                }%
+              }%
+            }%
+          }%
+        }%
+      }%
+  }{}%
+  \expandafter\providecommand\expandafter*%
+  \csname scr@tso@#1@numsep\endcsname{.4em}%
+  \expandafter\providecommand%
+  \csname scr@tso@#1@onstartfirstentry\endcsname{}%
+  \expandafter\providecommand%
+  \csname scr@tso@#1@onstartentry\endcsname{}%
+  \expandafter\providecommand%
+  \csname scr@tso@#1@onendlastentry\endcsname{}%
+  \expandafter\providecommand%
+  \csname scr@tso@#1@onendentry\endcsname{\quad}%
+  \expandafter\providecommand%
+  \csname scr@tso@#1@afterpar\endcsname{}%
+  \expandafter\providecommand%
+  \csname scr@tso@#1@numberformat\endcsname[1]{##1}%
+      \expandafter\providecommand%
+      \csname scr@tso@#1@entryformat\endcsname[1]{##1}%
+  \expandafter\providecommand%
+  \csname Ifscr@tso@#1@raggedright\endcsname[2]{##2}%
+  \expandafter\providecommand%
+  \csname scr@tso@#1@prepagenumber\endcsname{\nobreakspace}%
+}]{%
+  \scr@dte@toctext{#1}{##1}{##2}%
+}
+\newcommand*{\scr@dte@toctext}[3]{%
+  \ifnum \@nameuse{#1tocdepth}>\c@tocdepth
+  \else
+    \ifhmode
+      \scr@dte@toctext@lastend
+      \@nameuse{scr@tso@#1@onstartentry}%
+    \else
+      \leavevmode
+      \def\par{%
+        \scr@dte@toctext@raggedright
+        \scr@dte@toctext@parend
+        \@par
+        \scr@dte@toctext@afterpar
+        \global\let\scr@dte@toctext@afterpar\relax
+        \global\let\scr@dte@toctext@parend\relax
+        \global\let\scr@dte@toctext@raggedright\relax
+      }%
+      \global\let\scr@dte@toctext@afterpar\@empty
+      \iftocfeature{\@currext}{noindent}{%
+        \leftskip \z@
+      }{%
+        \leftskip \@nameuse{scr@tso@#1@indent}\relax
+      }%
+      \rightskip \@nameuse{scr@tso@#1@rightindent}\relax
+      \parfillskip \z@ \@plus 1fill\relax
+      \edef\@noitemerr{\unexpanded{\par\def\@noitemerr}%
+        {\unexpanded\expandafter{\@noitemerr}}}%
+      \@nameuse{scr@tso@#1@onstartfirstentry}%
+    \fi
+    \@nameuse{Ifscr@tso@#1@raggedright}{%
+      \let\\\@centercr
+      \gdef\scr@dte@toctext@raggedright{%
+        \@rightskip\@flushglue
+        \addtolength\rightskip\@rightskip
+      }%
+    }{}%
+    \l@addto@macro\scr@dte@toctext@afterpar{\@nameuse{scr@tso@#1@afterpar}}%
+    \expandafter\global\expandafter\let\expandafter\scr@dte@toctext@lastend
+    \csname scr@tso@#1@onendentry\endcsname
+    \expandafter\global\expandafter\let\expandafter\scr@dte@toctext@parend
+    \csname scr@tso@#1@onendlastentry\endcsname
+    {%
+      \usetocbasicnumberline
+      \def\numberline@box##1{%
+        \mbox{%
+          \@nameuse{scr@tso@#1@numberformat}{\ignorespaces ##1\unskip}%
+          \hskip\@nameuse{scr@tso@#1@numsep}\relax
+        }%
+      }%
+      \@nameuse{scr@tso@#1@entryformat}{%
+        \ignorespaces#2\unskip
+        \@nameuse{scr@tso@#1@prepagenumber}%
+        \@nameuse{scr@tso@#1@pagenumberformat}{\ignorespaces #3\unskip}%
+      }%
+    }%
+  \fi
+}
+\newcommand*{\scr@dte@toctext@raggedright}{}
+\newcommand*{\scr@dte@toctext@parend}{}
+\newcommand*{\scr@dte@toctext@lastend}{}
+%%% From File: $Id: scrkernel-tocstyle.dtx 3262 2019-10-10 08:25:29Z kohm $
 %%%            (run: style,dottedtocline)
 \CloneTOCEntryStyle{dottedtocline}{default}
-%%% From File: $Id: tocbasic.dtx 3050 2018-12-30 14:36:55Z kohm $
+%%% From File: $Id: tocbasic.dtx 3256 2019-10-10 07:06:49Z kohm $
 %%%            (run: exit)
 \AtBeginDocument{%
   \@ifundefined{MakeMarkcase}{%
-- 
cgit v1.2.3

