diff options
author | Karl Berry <karl@freefriends.org> | 2023-05-01 20:26:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-05-01 20:26:58 +0000 |
commit | 4af207bca68df6d8859bf95f75a5d13da9fa4369 (patch) | |
tree | 72158c38c95bdf26f6743b82b4753968719ee85b /Master/texmf-dist/tex/latex/etoc | |
parent | 688faa8ce089de9c0f3e102b54810b502ca4c81e (diff) |
etoc (1may23)
git-svn-id: svn://tug.org/texlive/trunk@66978 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/etoc')
-rw-r--r-- | Master/texmf-dist/tex/latex/etoc/etoc.sty | 346 |
1 files changed, 256 insertions, 90 deletions
diff --git a/Master/texmf-dist/tex/latex/etoc/etoc.sty b/Master/texmf-dist/tex/latex/etoc/etoc.sty index 070a3fe4ae7..07ed6524951 100644 --- a/Master/texmf-dist/tex/latex/etoc/etoc.sty +++ b/Master/texmf-dist/tex/latex/etoc/etoc.sty @@ -22,13 +22,25 @@ %% in the same archive or directory.) %% %% Package: etoc -%% Version: 1.2 +%% Version: 1.2a %% License: LPPL 1.3c %% Copyright (C) 2012-2023 Jean-Francois Burnol %% <jfbu at free dot fr> -\NeedsTeXFormat{LaTeX2e}[2020/10/01] -\ProvidesPackage{etoc} -[2023/03/01 v1.2 Completely customisable TOCs (JFB)] +\NeedsTeXFormat{LaTeX2e}[2003/12/01] +\ProvidesPackage{etoc}[2023/05/01 v1.2a Completely customisable TOCs (JFB)] +\newif\ifEtoc@oldLaTeX +\@ifl@t@r\fmtversion{2020/10/01} + {} + {\Etoc@oldLaTeXtrue + \PackageInfo{etoc}{Old LaTeX (\fmtversion) detected!\MessageBreak + Since 1.1a (2023/01/14), etoc prefers LaTeX at least\MessageBreak + as recent as 2020-10-01, for reasons of the .toc file,\MessageBreak + and used to require it (from 1.1a to 1.2).\MessageBreak + This etoc (1.2a) does not *require* it, but has not been\MessageBreak + tested thoroughly on old LaTeX (especially if document\MessageBreak + does not use hyperref) and retrofitting was done only\MessageBreak + on basis of author partial remembrances of old context.\MessageBreak + Reported}} \RequirePackage{kvoptions} \SetupKeyvalOptions{prefix=Etoc@} \newif\ifEtoc@lof @@ -56,10 +68,12 @@ \DeclareBoolOption[false]{locallottotoc} } \DeclareBoolOption[true]{ouroboros} +\DeclareBoolOption[false]{deeplevels} \DeclareDefaultOption{\PackageWarning{etoc}{Option `\CurrentOption' is unknown.}} \ProcessKeyvalOptions* \DisableKeyvalOption[action=error,package=etoc]{etoc}{lof} \DisableKeyvalOption[action=error,package=etoc]{etoc}{lot} +\DisableKeyvalOption[action=error,package=etoc]{etoc}{deeplevels} \def\etocsetup#1{\setkeys{etoc}{#1}} \def\etocifmaintoctotoc{\ifEtoc@maintoctotoc \expandafter\@firstoftwo @@ -146,24 +160,44 @@ \expandafter\chardef\csname Etoc@4@@\endcsname 4 \expandafter\chardef\csname Etoc@5@@\endcsname 5 \expandafter\chardef\csname Etoc@6@@\endcsname 6 -\expandafter\let\expandafter\Etoc@@six@@\csname Etoc@6@@\endcsname +\ifEtoc@deeplevels + \expandafter\chardef\csname Etoc@7@@\endcsname 7 + \expandafter\chardef\csname Etoc@8@@\endcsname 8 + \expandafter\chardef\csname Etoc@9@@\endcsname 9 + \expandafter\chardef\csname Etoc@10@@\endcsname 10 + \expandafter\chardef\csname Etoc@11@@\endcsname 11 + \expandafter\chardef\csname Etoc@12@@\endcsname 12 +\fi +\expandafter\let\expandafter\Etoc@maxlevel + \csname Etoc@\ifEtoc@deeplevels12\else6\fi @@\endcsname +\edef\etocthemaxlevel{\number\Etoc@maxlevel} \@ifclassloaded{memoir}{\def\Etoc@minf{-\thr@@}}{\def\Etoc@minf{-\tw@}} \let\Etoc@none@@ \Etoc@minf -\expandafter\let\expandafter\Etoc@all@@ \csname Etoc@5@@\endcsname +\expandafter\let\expandafter\Etoc@all@@ + \csname Etoc@\ifEtoc@deeplevels11\else5\fi @@\endcsname \let\Etoc@dolevels\@empty \def\Etoc@newlevel #1{\expandafter\def\expandafter\Etoc@dolevels\expandafter {\Etoc@dolevels\Etoc@do{#1}}} -\def\etocsetlevel#1#2{\expanded{\noexpand\etoc@setlevel{#1}{#2}}}% +\ifdefined\expanded + \def\etocsetlevel#1#2{\expanded{\noexpand\etoc@setlevel{#1}{#2}}}% +\else + \def\etocsetlevel#1#2{{\edef\Etoc@tmp{\noexpand\etoc@setlevel{#1}{#2}}\expandafter}\Etoc@tmp}% +\fi \def\etoc@setlevel#1#2{% \edef\Etoc@tmp{\the\numexpr#2}% - \if1\ifnum\Etoc@tmp>\Etoc@@six@@0\fi\ifnum\Etoc@tmp<-\tw@0\fi1% - \in@{.#1,}{.none,.all,.figure,.table,.-3,.-2,.-1,.0,.1,.2,.3,.4,.5,.6,}% + \if1\ifnum\Etoc@tmp>\Etoc@maxlevel0\fi\unless\ifnum\Etoc@minf<\Etoc@tmp;\fi1% + \ifEtoc@deeplevels + \in@{.#1,}{.none,.all,.figure,.table,.-3,.-2,.-1,.0,.1,.2,.3,.4,.5,.6,% + .7,.8,.9,.10,.11,.12,}% + \else + \in@{.#1,}{.none,.all,.figure,.table,.-3,.-2,.-1,.0,.1,.2,.3,.4,.5,.6,}% + \fi \ifin@\else\if\@car#1\@nil @\in@true\fi\fi \ifin@ \PackageWarning{etoc} {Sorry, but `#1' is forbidden as level name.\MessageBreak \if\@car#1\@nil @% - (because of the @, especially as first character)\MessageBreak\fi + (because of the @ as first character)\MessageBreak\fi Reported}% \else \etocifunknownlevelTF{#1}{\Etoc@newlevel{#1}}{}% @@ -177,19 +211,23 @@ \else \PackageWarning{etoc} {Argument `\detokenize{#2}' of \string\etocsetlevel\space should - represent\MessageBreak - -2, -1, 0, 1, 2, 3, 4, 5, or 6 but evaluates to \Etoc@tmp.\MessageBreak - The level of `#1' will be set to 6.\MessageBreak + represent one of\MessageBreak + \ifnum\Etoc@minf=-\thr@@-2, \fi-1, 0, 1, 2, \ifEtoc@deeplevels ...\else3, 4\fi, + \the\numexpr\Etoc@maxlevel-1, or \number\Etoc@maxlevel\space + but evaluates to \Etoc@tmp.\MessageBreak + The level of `#1' will be set to \number\Etoc@maxlevel.\MessageBreak Tables of contents will ignore `#1' as long\MessageBreak - as its level is 6.\MessageBreak + as its level is \number\Etoc@maxlevel\space (=\string\etocthemaxlevel).% + \MessageBreak Reported}% \etocifunknownlevelTF{#1}{\Etoc@newlevel{#1}}{}% - \expandafter\let\csname Etoc@#1@@\endcsname\Etoc@@six@@ + \expandafter\let\csname Etoc@#1@@\endcsname\Etoc@maxlevel \fi } \def\etoclevel#1{\csname Etoc@#1@@\endcsname} +\def\etocthelevel#1{\number\csname Etoc@#1@@\endcsname} \def\etocifunknownlevelTF#1{\@ifundefined{Etoc@#1@@}} -\etocsetlevel{book}{-2} +\@ifclassloaded{memoir}{\etocsetlevel{book}{-2}}{} \etocsetlevel{part}{-1} \etocsetlevel{chapter}{0} \etocsetlevel{section}{1} @@ -204,11 +242,26 @@ \fi \def\Etoc@do#1{\@namedef{l@@#1}{\csname l@#1\endcsname}} \Etoc@dolevels -\let\Etoc@figure@@\Etoc@@six@@ -\let\Etoc@table@@\Etoc@@six@@ +\let\Etoc@figure@@\Etoc@maxlevel +\let\Etoc@table@@ \Etoc@maxlevel +\let\Etoc@gobblethreeorfour\@gobblefour +\ifdefined\@gobblethree + \let\Etoc@gobblethree\@gobblethree +\else + \long\def\Etoc@gobblethree#1#2#3{}% +\fi \AtBeginDocument{% \@ifpackageloaded{parskip}{\Etoc@parskiptrue}{}% -\@ifpackageloaded{hyperref}{\Etoc@hyperreftrue}{}% +\@ifpackageloaded{hyperref} + {\Etoc@hyperreftrue} + {\ifEtoc@oldLaTeX + \let\Etoc@gobblethreeorfour\Etoc@gobblethree + \let\Etoc@etoccontentsline@fourargs\Etoc@etoccontentsline@ + \long\def\Etoc@etoccontentsline@#1#2#3{% + \Etoc@etoccontentsline@fourargs{#1}{#2}{#3}{}% + }% + \fi + }% } \def\etocskipfirstprefix {\global\Etoc@skipprefixtrue } \def\Etoc@updatestackofends#1\etoc@{\gdef\Etoc@stackofends{#1}} @@ -217,24 +270,27 @@ \expandafter\Etoc@traversestackofends\Etoc@stackofends\etoc@ } \def\Etoc@traversestackofends#1{% - \ifnum#1>\Etoc@level\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi - {\csname Etoc@end@#1\endcsname - \Etoc@traversestackofends - }% - {\ifnum#1<\Etoc@level - \csname Etoc@begin@\the\numexpr\Etoc@level\endcsname - \Etoc@global\Etoc@isfirsttrue - \edef\Etoc@tmp{{\the\numexpr\Etoc@level}}% - \else - \Etoc@global\Etoc@isfirstfalse - \let\Etoc@tmp\@empty - \fi - \expandafter\Etoc@updatestackofends\Etoc@tmp{#1}% - }% + \ifnum#1>\Etoc@level + \csname Etoc@end@#1\endcsname + \expandafter\Etoc@traversestackofends + \else + \Etoc@traversestackofends@done{#1}% + \fi +} +\def\Etoc@traversestackofends@done#1#2{#2% + \ifnum#1<\Etoc@level + \csname Etoc@begin@\the\numexpr\Etoc@level\endcsname + \Etoc@global\Etoc@isfirsttrue + \edef\Etoc@tmp{{\the\numexpr\Etoc@level}}% + \else + \Etoc@global\Etoc@isfirstfalse + \let\Etoc@tmp\@empty + \fi + \expandafter\Etoc@updatestackofends\Etoc@tmp{#1}% } \def\Etoc@etoccontentsline #1{% - \let\Etoc@next\@gobblefour - \ifnum\csname Etoc@#1@@\endcsname=\Etoc@@six@@ + \let\Etoc@next\Etoc@gobblethreeorfour + \ifnum\csname Etoc@#1@@\endcsname=\Etoc@maxlevel \else \Etoc@skipthisonefalse \global\expandafter\let\expandafter\Etoc@level\csname Etoc@#1@@\endcsname @@ -462,7 +518,7 @@ \ifEtoc@ouroboros \else \let\Etoc@tmp\contentsline - \def\contentsline{\let\contentsline\Etoc@tmp\@gobblefour}% + \def\contentsline{\let\contentsline\Etoc@tmp\Etoc@gobblethreeorfour}% \fi \fi \fi @@ -473,7 +529,8 @@ \let\etoc@startlocaltoc\@gobble \let\Etoc@@startlocaltoc@toc\Etoc@@startlocaltoc \let\Etoc@@startlocaltochook\@empty -\def\etocdivisionnameatlevel#1{% +\unless\ifEtoc@deeplevels + \def\etocdivisionnameatlevel#1{% \ifcase\numexpr#1\relax \ifdefined\c@chapter chapter\else section\fi% \or section% @@ -488,13 +545,36 @@ part% \fi \fi -} + } +\else + \def\etocdivisionnameatlevel#1{% + \ifcase\numexpr#1\relax + \ifdefined\c@chapter chapter\else section\fi% + \or section% + \or subsection% + \or subsubsection% + \or subsubsubsection% + \or subsubsubsubsection% + \or subsubsubsubsubsection% + \or subsubsubsubsubsubsection% + \or paragraph% + \or subparagraph% + \else\ifnum\numexpr#1>\z@ + empty% + \else\ifnum\numexpr#1=\m@ne + part% + \else + book% + \fi\fi + \fi + } +\fi \def\etoclocalheadtotoc#1#2{\addcontentsline{toc}{@#1}{#2}} \def\etocglobalheadtotoc{\addcontentsline{toc}} \providecommand*\UseName{\@nameuse} \def\etocetoclocaltocmaketitle{% \UseName{\etocdivisionnameatlevel{\etoclocaltop+1}}*{\localcontentsname}% - \ifnum\etoclocaltop>\tw@\mbox{}\par\fi + \if@noskipsec\leavevmode\par\fi \etociflocaltoctotoc {\etocifisstarred {}% star variant, do not add to toc @@ -514,14 +594,27 @@ \def\addcontentsline{\Etoc@hackedaddcontentsline}% }% \fi -\def\Etoc@hackedaddcontentsline#1{% - \expanded{\noexpand\in@{.#1,}{\ifEtoc@lof.lof,\fi\ifEtoc@lot.lot,\fi}}% - \ifin@\expandafter\Etoc@hackedaddcontentsline@i - \else\expandafter\Etoc@originaladdcontentsline +\ifEtoc@lof + \ifEtoc@lot + \def\Etoc@hackedaddcontentsline#1{% + \expanded{\noexpand\in@{.#1,}}{.lof,.lot,}% + \ifin@\expandafter\Etoc@hackedaddcontentsline@i + \else\expandafter\Etoc@originaladdcontentsline + \fi {#1}} + \else + \def\Etoc@hackedaddcontentsline#1{% + \expanded{\noexpand\in@{.#1,}}{.lof,}% + \ifin@\expandafter\Etoc@hackedaddcontentsline@i + \else\expandafter\Etoc@originaladdcontentsline + \fi {#1}} \fi - {#1}% -} - +\else + \def\Etoc@hackedaddcontentsline#1{% + \expanded{\noexpand\in@{.#1,}}{.lot,}% + \ifin@\expandafter\Etoc@hackedaddcontentsline@i + \else\expandafter\Etoc@originaladdcontentsline + \fi {#1}} +\fi \def\Etoc@hackedaddcontentsline@i#1#2#3{% \expanded{\noexpand\in@{.#1;#2,}}{.lof;figure,.lot;table,}% \ifin@ @@ -532,6 +625,26 @@ \fi \Etoc@originaladdcontentsline{#1}{#2}{#3}% } +\unless\ifdefined\expanded + \def\Etoc@hackedaddcontentsline#1{% + {\edef\Etoc@tmp{\noexpand\in@{.#1,}{\ifEtoc@lof.lof,\fi\ifEtoc@lot.lot,\fi}}\expandafter}% + \Etoc@tmp + \ifin@\expandafter\Etoc@hackedaddcontentsline@i + \else\expandafter\Etoc@originaladdcontentsline + \fi {#1}% + } + \def\Etoc@hackedaddcontentsline@i#1#2#3{% + {\edef\Etoc@tmp{\noexpand\in@{.#1;#2,}}\expandafter}% + \Etoc@tmp{.lof;figure,.lot;table,}% + \ifin@ + \addtocontents {toc}{% + \protect\contentsline{#2}{#3}{\thepage}{\ifEtoc@hyperref\@currentHref\fi}% + \ifdefined\protected@file@percent\protected@file@percent\fi + }% + \fi + \Etoc@originaladdcontentsline{#1}{#2}{#3}% + } +\fi \def\Etoc@@startlocallistof#1#2#3{% \ifEtoc@localtoc \ifnum #2=#3\relax @@ -554,7 +667,7 @@ \fi \def\Etoc@do##1{% \ifnum\etoclevel{##1}>\etoclocaltop - \expandafter\let\csname Etoc@##1@@\endcsname\Etoc@@six@@ + \expandafter\let\csname Etoc@##1@@\endcsname\Etoc@maxlevel \fi}% \Etoc@dolevels } @@ -589,8 +702,8 @@ {}% }% \let\Etoc@listofreset\@empty -\def\locallistoffigures{% - \ifEtoc@lof +\ifEtoc@lof + \def\locallistoffigures{% \def\Etoc@listofreset{% \let\Etoc@currext\Etoc@tocext \let\Etoc@@startlocaltoc\Etoc@@startlocaltoc@toc @@ -603,20 +716,22 @@ \def\Etoc@@startlocaltochook{\Etoc@@startlocallistof@setlevels{figure}}% \def\Etoc@listofhook{% \def\Etoc@do####1{% - \expandafter\let\csname Etoc@@####1@@\endcsname\Etoc@@six@@ + \expandafter\let\csname Etoc@@####1@@\endcsname\Etoc@maxlevel }% \Etoc@dolevels }% - \expandafter\localtableofcontents - \else + \localtableofcontents + } +\else + \def\locallistoffigures{% \PackageError{etoc}{% \string\locallistoffigures \on@line\space but\MessageBreak package was loaded without `lof' option}% {Try again with \string\usepackage[lof]{etoc}}% - \fi -} -\def\locallistoftables{% - \ifEtoc@lot + } +\fi +\ifEtoc@lot + \def\locallistoftables{% \def\Etoc@listofreset{% \let\Etoc@currext\Etoc@tocext \let\Etoc@@startlocaltoc\Etoc@@startlocaltoc@toc @@ -629,18 +744,20 @@ \def\Etoc@@startlocaltochook{\Etoc@@startlocallistof@setlevels{table}}% \def\Etoc@listofhook{% \def\Etoc@do####1{% - \expandafter\let\csname Etoc@@####1@@\endcsname\Etoc@@six@@ + \expandafter\let\csname Etoc@@####1@@\endcsname\Etoc@maxlevel }% \Etoc@dolevels }% - \expandafter\localtableofcontents - \else + \localtableofcontents + } +\else + \def\locallistoftables{% \PackageError{etoc}{% \string\locallistoftable \on@line\space but\MessageBreak package was loaded without `lot' option}% {Try again with \string\usepackage[lot]{etoc}}% - \fi -} + } +\fi \def\Etoc@checkifempty {% \global\Etoc@isemptytoctrue \global\Etoc@stoptocfalse @@ -672,7 +789,7 @@ \def\Etoc@testingcontentslinelocal #1{% \ifEtoc@stoptoc \else - \ifnum\csname Etoc@#1@@\endcsname=\Etoc@@six@@ + \ifnum\csname Etoc@#1@@\endcsname=\Etoc@maxlevel \else \global\expandafter\let\expandafter\Etoc@level\csname Etoc@#1@@\endcsname \if @\@car#1\@nil\else\global\let\Etoc@virtualtop\Etoc@level\fi @@ -689,12 +806,12 @@ \fi \fi \fi - \@gobblethree + \Etoc@gobblethreeorfour{}% } \def\Etoc@testingcontentsline #1{% \ifEtoc@stoptoc \else - \ifnum\csname Etoc@#1@@\endcsname=\Etoc@@six@@ + \ifnum\csname Etoc@#1@@\endcsname=\Etoc@maxlevel \else \unless\ifnum\csname Etoc@#1@@\endcsname>\c@tocdepth \global\Etoc@isemptytocfalse @@ -702,7 +819,7 @@ \fi \fi \fi - \@gobblethree + \Etoc@gobblethreeorfour{}% } \def\Etoc@localtableofcontents#1{% \gdef\etoclocaltop{-\@m}% @@ -912,20 +1029,32 @@ } \def\Etoc@setstyle@a #1{% \edef\Etoc@tmp{\the\numexpr\csname Etoc@#1@@\endcsname}% - \if1\unless\ifnum\Etoc@tmp<\Etoc@@six@@ 0\fi\unless\ifnum\Etoc@tmp>\Etoc@minf 0\fi1% + \if1\unless\ifnum\Etoc@tmp<\Etoc@maxlevel 0\fi + \unless\ifnum\Etoc@tmp>\Etoc@minf 0\fi1% \Etoc@standardlinesfalse \expandafter\Etoc@setstyle@b\expandafter\Etoc@tmp \else - \PackageWarning{etoc}{Sorry, but you can not set the style of `#1',\MessageBreak - as its level \Etoc@tmp\space is either \number\Etoc@minf\space - or 6.\MessageBreak - Consider using \string\etocsetlevel\space first, but note - that `all',\MessageBreak - `none', `figure' and `table' are forbidden there. \space - Check\MessageBreak - the documentation about how to proceed for customizing\MessageBreak - figure and table entries in \string\listoffigures/tables.\MessageBreak - Reported}% + \ifnum\Etoc@tmp=\Etoc@maxlevel + \in@{.#1,}{.figure,.table,}% + \ifin@ + \PackageWarning{etoc} + {You can not use \string\etocsetstyle\space with `#1'.\MessageBreak + Check the package documentation (in particular about\MessageBreak + \string\etoclocallistoffigureshook/\string\etoclocallistoftableshook)% + \MessageBreak on how to customize + figure and table entries in local\MessageBreak lists. Reported}% + \else + \PackageInfo{etoc} + {Attempt to set the style of `#1',\MessageBreak + whose level is currently the maximal one \etocthemaxlevel,\MessageBreak + which is never displayed. \space This will be ignored\MessageBreak + but note that we do quit compatibility mode.\MessageBreak + Reported}% + \Etoc@standardlinesfalse + \fi + \else + \PackageWarning{etoc}{This should not happen. Reported}% + \fi \expandafter\@gobblefour \fi } @@ -935,6 +1064,12 @@ \expandafter\def\csname Etoc@contents@#1\endcsname {#4}% \expandafter\def\csname Etoc@end@#1\endcsname {#5}% } +\def\Etoc@setstyle@e#1{% + \expandafter\let\csname Etoc@begin@#1\endcsname \@empty + \expandafter\let\csname Etoc@prefix@#1\endcsname \@empty + \expandafter\let\csname Etoc@contents@#1\endcsname \@empty + \expandafter\let\csname Etoc@end@#1\endcsname \@empty +} \def\Etoc@storelines@a#1{% \noexpand\Etoc@setstyle@b{#1}% {\expandafter\Etoc@expandonce\csname Etoc@begin@#1\endcsname}% @@ -946,7 +1081,12 @@ \def\etocstorelinestylesinto#1{% \edef#1{\Etoc@storelines@a{-2}\Etoc@storelines@a{-1}\Etoc@storelines@a{0}% \Etoc@storelines@a {1}\Etoc@storelines@a {2}\Etoc@storelines@a{3}% - \Etoc@storelines@a {4}\Etoc@storelines@a {5}}% + \Etoc@storelines@a {4}\Etoc@storelines@a {5}% + \ifEtoc@deeplevels + \Etoc@storelines@a{6}\Etoc@storelines@a{7}\Etoc@storelines@a{8}% + \Etoc@storelines@a{9}\Etoc@storelines@a{10}\Etoc@storelines@a{11}% + \fi + }% } \def\etocstorethislinestyleinto#1#2{% \edef#2{\expandafter\Etoc@storelines@a\expandafter{\number\etoclevel{#1}}}% @@ -978,9 +1118,19 @@ \def\etocabbrevpagename {p.~} \def\etocpartname {Part} \def\etocbookname {Book} -\def\etocdefaultlines{\Etoc@standardlinesfalse -%% `book': -\Etoc@setstyle@b +\def\etocdefaultlines{% + \Etoc@standardlinesfalse + \etocdefaultlines@setbook + \etocdefaultlines@setpart + \etocdefaultlines@setchapter + \etocdefaultlines@setsection + \etocdefaultlines@setsubsection + \etocdefaultlines@setsubsubsection + \etocdefaultlines@setdeeperones +} +\@ifclassloaded{memoir}{% + \def\etocdefaultlines@setbook{% + \Etoc@setstyle@b {-2}% {\addpenalty\@M\etocskipfirstprefix} {\addpenalty\@secpenalty} @@ -998,7 +1148,9 @@ \addpenalty\@M\addvspace{\etocsepminusone}% \endgroup} {}% -%% `part': + } + }{\let\etocdefaultlines@setbook\@empty} +\def\etocdefaultlines@setpart{% \Etoc@setstyle@b {-1}% {\addpenalty\@M\etocskipfirstprefix} @@ -1017,7 +1169,8 @@ \addpenalty\@M\addvspace{\etocsepzero}% \endgroup} {}% -%% `chapter': +} +\def\etocdefaultlines@setchapter{% \Etoc@setstyle@b {0}% {\addpenalty\@M\etocskipfirstprefix} @@ -1031,7 +1184,8 @@ \par}% \endgroup} {\addpenalty{-\@highpenalty}\addvspace{\etocsepminusone}}% -%% `section': +} +\def\etocdefaultlines@setsection{% \Etoc@setstyle@b {1}% {\addpenalty\@M\etocskipfirstprefix} @@ -1065,7 +1219,8 @@ \fi \endgroup} {\addpenalty\@secpenalty\addvspace{\etocsepzero}}% -%% `subsection': +} +\def\etocdefaultlines@setsubsection{% \Etoc@setstyle@b {2}% {\addpenalty\@medpenalty\etocskipfirstprefix} @@ -1098,7 +1253,8 @@ \fi \endgroup} {\addpenalty\@secpenalty\addvspace{\etocsepone}}% -%% `subsubsection': +} +\def\etocdefaultlines@setsubsubsection{% \Etoc@setstyle@b {3}% {\addpenalty\@M @@ -1113,10 +1269,20 @@ \baselineskip\etocbaselinespreadthree\baselineskip \par \endgroup - \addpenalty{-\@highpenalty}}% -\Etoc@setstyle@b{4}{}{}{}{}% -\Etoc@setstyle@b{5}{}{}{}{}% -}% end of \etocdefaultlines definition + \addpenalty{-\@highpenalty}} +} +\def\etocdefaultlines@setdeeperones{% +\Etoc@setstyle@e{4}% +\Etoc@setstyle@e{5}% +\ifEtoc@deeplevels + \Etoc@setstyle@e{6}% + \Etoc@setstyle@e{7}% + \Etoc@setstyle@e{8}% + \Etoc@setstyle@e{9}% + \Etoc@setstyle@e{10}% + \Etoc@setstyle@e{11}% +\fi +} \def\etocabovetocskip{3.5ex \@plus 1ex \@minus .2ex} \def\etocbelowtocskip{3.5ex \@plus 1ex \@minus .2ex} \def\etoccolumnsep{2em} @@ -1939,7 +2105,7 @@ }% }% \def\etoc@setlocaltop #1{% - \ifnum#1=\Etoc@@six@@ + \ifnum#1=\Etoc@maxlevel \Etoc@skipthisonetrue \else \Etoc@skipthisonefalse |