summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/koma-script/tocbasic.sty')
-rw-r--r--Master/texmf-dist/tex/latex/koma-script/tocbasic.sty161
1 files changed, 139 insertions, 22 deletions
diff --git a/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty b/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty
index 73df3ed8977..2bfaa0b9451 100644
--- a/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty
+++ b/Master/texmf-dist/tex/latex/koma-script/tocbasic.sty
@@ -53,24 +53,24 @@
%% find a complete unmodified copy of LaTeX2e at
%% <http://mirror.ctan.org/tex-archive/macros/latex/base/>.
%%
-%%% From File: $Id: tocbasic.dtx 3453 2020-02-25 07:33:30Z kohm $
+%%% From File: $Id: tocbasic.dtx 3508 2020-07-08 08:45:20Z kohm $
%%% (run: identify)
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{tocbasic}[%
- 2020/04/19 v3.30 KOMA-Script
+ 2020/07/22 v3.31 KOMA-Script
package
(handling toc-files)%
]
-%%% From File: $Id: tocbasic.dtx 3453 2020-02-25 07:33:30Z kohm $
+%%% From File: $Id: tocbasic.dtx 3508 2020-07-08 08:45:20Z kohm $
%%% (run: prepare)
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: prepare)
-%%% From File: $Id: tocbasic.dtx 3453 2020-02-25 07:33:30Z kohm $
+%%% From File: $Id: tocbasic.dtx 3508 2020-07-08 08:45:20Z kohm $
%%% (run: option)
\ProcessOptions\relax
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: option)
-%%% From File: $Id: tocbasic.dtx 3453 2020-02-25 07:33:30Z kohm $
+%%% From File: $Id: tocbasic.dtx 3508 2020-07-08 08:45:20Z kohm $
%%% (run: body)
\RequirePackage{scrbase}
\AfterPackage*{multitoc}{%
@@ -400,11 +400,11 @@
\newcommand*{\listoftoc}{%
\kernel@ifstar \tocbasic@starttoc\@listoftoc
}
-\newcommand*{\@listoftoc}[2][\list@fname]{%
+\newcommand*{\@listoftoc}[2][]{%
\begingroup
+ \def\list@fname{#1}%
\@ifundefined{listof#2name}{%
- \let\list@fname\relax
- \ifx\relax#1\relax
+ \ifx\list@fname\@empty
\PackageWarning{tocbasic}{%
You should either define \expandafter\string\csname
listof#2name\endcsname\MessageBreak
@@ -425,7 +425,7 @@
}%
}{}%
\Iftocfeature{\@currext}{numberline}{\def\nonumberline{\numberline{}}}{}%
- \tocbasic@listhead{#1}%
+ \expandafter\tocbasic@listhead\expandafter{\list@fname}%
\scr@ifundefinedorrelax{microtypesetup}{}{%
\Iftocfeature{\@currext}{noprotrusion}{}{%
\microtypesetup{protrusion=false}%
@@ -1051,7 +1051,7 @@
}%
}
\newcommand*{\tb@nt@autofloattype}{16}
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: body)
\newcommand*{\scr@numberline}[1]{%
\numberline@box{%
@@ -1112,6 +1112,58 @@
\do@endgroup
}
\newcommand{\scr@dte@gobbleopt}[1][]{}
+\newcommand*{\@DefineTOCEntryListOption}[2]{%
+ \kernel@ifnextchar [%]
+ {\@DefineTOCEntryListOptionWithDefault{#1}{#2}}
+ {\@DefineTOCEntryListOptionWithoutDefault{#1}{#2}}%
+}
+\newcommand*{\@DefineTOCEntryListOptionWithoutDefault}[5]{%
+ \@TOCEntryStyleNeedsCommandByOption{#1}{#3}{#4}{#2}{#5}%
+ \@DefineTOCEntryOption{#1}{#2}{%
+ \expandafter\protected@edef\csname #3\scr@dte@current#4\endcsname{##1}%
+ \FamilyKeyStateProcessed
+ }%
+ \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+}{%
+ \expandafter\protected@edef\csname #2\scr@dte@current#4\endcsname{%
+ \csname #2\scr@dte@current#4\endcsname,##1}%
+ \FamilyKeyStateProcessed
+ }%
+ \edef\scr@dte@doopts{%
+ \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}\noexpand\do{#2+}%
+ }%
+}
+\newcommand*{\@DefineTOCEntryListOptionWithDefault}{}
+\def\@DefineTOCEntryListOptionWithDefault#1#2[#3]#4#5#6{%
+ \@TOCEntryStyleNeedsCommandByOption{#1}{#4}{#5}{#2}{#6}%
+ \@DefineTOCEntryOption{#1}{#2}[{#3]}{%
+ \expandafter\protected@edef\csname #4\scr@dte@current#5\endcsname{##1}%
+ \FamilyKeyStateProcessed
+ }%
+ \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+}{%
+ \expandafter\protected@edef\csname #4\scr@dte@current#5\endcsname{%
+ \csname #4\scr@dte@current#5\endcsname,##1}%
+ \FamilyKeyStateProcessed
+ }%
+ \edef\scr@dte@doopts{%
+ \unexpanded\expandafter{\scr@dte@doopts}\noexpand\do{#2:}\noexpand\do{#2+}%
+ }%
+}
\newcommand*{\@DefineTOCEntryLengthOption}[2]{%
\kernel@ifnextchar [%]
{\@DefineTOCEntryLengthOptionWithDefault{#1}{#2}}
@@ -1517,6 +1569,7 @@
\def\DefineTOCEntryCommandOption{\@DefineTOCEntryCommandOption{#1}}%
\def\DefineTOCEntryIfOption{\@DefineTOCEntryIfOption{#1}}%
\def\DefineTOCEntryLengthOption{\@DefineTOCEntryLengthOption{#1}}%
+ \def\DefineTOCEntryListOption{\@DefineTOCEntryListOption{#1}}%
\def\DefineTOCEntryNumberOption{\@DefineTOCEntryNumberOption{#1}}%
\def\DefineTOCEntryOption{\@DefineTOCEntryOption{#1}}%
\def\AddToDeclareTOCEntryStylePreCheckNeeds{%
@@ -1531,6 +1584,7 @@
\let\AddToDeclareTOCEntryStylePreCheckNeeds\relax
\let\DefineTOCEntryOption\relax
\let\DefineTOCEntryNumberOption\relax
+ \let\DefineTOCEntryListOption\relax
\let\DefineTOCEntryLengthOption\relax
\let\DefineTOCEntryIfOption\relax
\let\DefineTOCEntryCommandOption\relax
@@ -1652,10 +1706,10 @@
\providecommand*\@pnumwidth{1.55em}
\providecommand*\@tocrmarg {2.55em}
\providecommand*\@dotsep {4.5}
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: style,gobble)
\DeclareTOCEntryStyle{gobble}{}%
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: style,dottedtocline)
\DeclareTOCEntryStyle{dottedtocline}[{%
\DefineTOCEntryLengthOption{indent}%
@@ -1789,7 +1843,7 @@
{\@nameuse{scr@tso@#1@numwidth}}{##1}{##2}%
}%
}
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: style,undottedtocline)
\DeclareTOCEntryStyle{undottedtocline}[{%
\DefineTOCEntryLengthOption{indent}%
@@ -1949,7 +2003,7 @@
\endgroup
\fi
}
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: style, largetocline)
\DeclareTOCEntryStyle{largetocline}[{%
\DefineTOCEntryLengthOption{indent}%
@@ -2062,7 +2116,7 @@
\endgroup
\fi
}
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: style,tocline)
\DeclareTOCEntryStyle{tocline}[{%
\DefineTOCEntryLengthOption{beforeskip}%
@@ -2071,6 +2125,10 @@
{scr@tso@}{@breakafternumber}{line break after number flag}%
\DefineTOCEntryIfOption{dynnumwidth}%
{scr@tso@}{@dynnumwidth}{dynamic number width flag}%
+ \DefineTOCEntryListOption{indentfollows}%
+ {scr@tso@}{@indentfollows}{list of levels that define the indent}%
+ \DefineTOCEntryIfOption{dynindent}%
+ {scr@tso@}{@dynindent}{dynamic indent width flag}%
\DefineTOCEntryCommandOption{entryformat}%
{scr@tso@}{@entryformat}[1]{entry format}%
\DefineTOCEntryCommandOption{entrynumberformat}%
@@ -2394,6 +2452,16 @@
\csname scr@tso@#1@pagenumberbox\endcsname[1]{%
\hb@xt@\@nameuse{scr@dte@pagenumberwidth}{\hfil ##1}}%
\expandafter\providecommand\csname Ifscr@tso@#1@dynnumwidth\endcsname[2]{##2}%
+ \expandafter\providecommand\csname Ifscr@tso@#1@dynindent\endcsname[2]{##2}%
+ \scr@ifundefinedorrelax{scr@tso@#1@indentfollows}{%
+ \Ifstrstart{#1}{sub}{%
+ \expandafter\edef\csname scr@tso@#1@indentfollows\endcsname{%
+ \scr@dte@nosub{#1}%
+ }%
+ }{%
+ \expandafter\let\csname scr@tso@#1@indentfollows\endcsname\@empty
+ }%
+ }{}%
}]{%
\scr@dte@tocline{#1}{##1}{##2}%
}
@@ -2427,6 +2495,41 @@
\else
\tocbasic@DependOnPenaltyAndTOCLevel{#1}%
\addvspace{\@nameuse{scr@tso@#1@beforeskip}}\relax
+ \@nameuse{Ifscr@tso@#1@dynindent}{%
+ \expandafter\ifx\csname scr@tso@#1@indentfollows\endcsname\@empty
+ \PackageWarning{tocbasic}{`dynindent' for `#1' not available}%
+ \else
+ \edef\reserved@a{\@nameuse{scr@tso@#1@indentfollows}}%
+ \@for \reserved@a:=\reserved@a\do {%
+ \scr@trim@spaces\reserved@a
+ \ifx\reserved@a\@empty\else
+ \scr@ifundefinedorrelax{\reserved@a tocdepth}{%
+ }{%
+ \ifnum \@nameuse{\reserved@a tocdepth}<\@nameuse{#1tocdepth}%
+ \@tempdima\@nameuse{scr@tso@\reserved@a @indent}\relax
+ \@nameuse{Ifscr@tso@\reserved@a @dynnumwidth}{%
+ \scr@ifundefinedorrelax
+ {scr@dte@\reserved@a @lastmaxnumwidth}{%
+ \advance\@tempdima
+ \@nameuse{scr@tso@\reserved@a @numwidth}\relax
+ }{%
+ \advance\@tempdima
+ \@nameuse{scr@dte@\reserved@a @lastmaxnumwidth}\relax
+ }%
+ }{%
+ \advance\@tempdima
+ \@nameuse{scr@tso@\reserved@a @numwidth}\relax
+ }%
+ \ifdim \@tempdima>\@nameuse{scr@tso@#1@indent}\relax
+ \expandafter\edef\csname scr@tso@#1@indent\endcsname
+ {\the\@tempdima}%
+ \fi
+ \fi
+ }%
+ \fi
+ }%
+ \fi
+ }{}%
{%
\Iftocfeature{\@currext}{noindent}{%
\leftskip \z@
@@ -2545,9 +2648,11 @@
\mkern \@dotsep mu\hbox{#1}\mkern \@dotsep
mu$}\hfill
}
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: style,toctext)
\DeclareTOCEntryStyle{toctext}[{%
+ \DefineTOCEntryLengthOption{beforeskip}%
+ {scr@tso@}{@beforeskip}{vertical skip before the entry}%
\DefineTOCEntryCommandOption{entryformat}%
{scr@tso@}{@entryformat}[1]{entry format}%
\DefineTOCEntryCommandOption{entrynumberformat}%
@@ -2693,6 +2798,8 @@
}%
}{}%
\expandafter\providecommand\expandafter*%
+ \csname scr@tso@#1@beforeskip\endcsname{\z@}%
+ \expandafter\providecommand\expandafter*%
\csname scr@tso@#1@numsep\endcsname{.4em}%
\expandafter\providecommand%
\csname scr@tso@#1@onstartfirstentry\endcsname{}%
@@ -2722,6 +2829,7 @@
\scr@dte@toctext@lastend
\@nameuse{scr@tso@#1@onstartentry}%
\else
+ \addvspace{\@nameuse{scr@tso@#1@beforeskip}}%
\leavevmode
\def\par{%
\scr@dte@toctext@raggedright
@@ -2740,8 +2848,17 @@
}%
\rightskip \@nameuse{scr@tso@#1@rightindent}\relax
\parfillskip \z@ \@plus 1fill\relax
- \edef\@noitemerr{\unexpanded{\par\def\@noitemerr}%
- {\unexpanded\expandafter{\@noitemerr}}}%
+ \ifx\addvspace\scr@dte@xaddvspace\else
+ \let\scr@dte@saddvspace\addvspace
+ \def\scr@dte@xaddvspace{%
+ \let\addvspace\scr@dte@saddvspace\par\addvspace}%
+ \let\addvspace\scr@dte@xaddvspace
+ \fi
+ \ifx\addpenalty\scr@dte@xaddpenalty\else
+ \let\scr@dte@saddpenalty\addpenalty
+ \def\scr@dte@xaddpenalty{%
+ \let\addpenalty\scr@dte@saddpenalty\par\addpenalty}%
+ \fi
\@nameuse{scr@tso@#1@onstartfirstentry}%
\fi
\@nameuse{Ifscr@tso@#1@raggedright}{%
@@ -2775,10 +2892,10 @@
\newcommand*{\scr@dte@toctext@raggedright}{}
\newcommand*{\scr@dte@toctext@parend}{}
\newcommand*{\scr@dte@toctext@lastend}{}
-%%% From File: $Id: scrkernel-tocstyle.dtx 3392 2019-11-19 09:37:46Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 3507 2020-06-11 14:57:03Z kohm $
%%% (run: style,dottedtocline)
\CloneTOCEntryStyle{dottedtocline}{default}
-%%% From File: $Id: tocbasic.dtx 3453 2020-02-25 07:33:30Z kohm $
+%%% From File: $Id: tocbasic.dtx 3508 2020-07-08 08:45:20Z kohm $
%%% (run: exit)
\AtBeginDocument{%
\@ifundefined{MakeMarkcase}{%