diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/tocstyle.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/koma-script/tocstyle.dtx | 299 |
1 files changed, 216 insertions, 83 deletions
diff --git a/Master/texmf-dist/source/latex/koma-script/tocstyle.dtx b/Master/texmf-dist/source/latex/koma-script/tocstyle.dtx index 9d2bd1c0a37..66fd8729da8 100644 --- a/Master/texmf-dist/source/latex/koma-script/tocstyle.dtx +++ b/Master/texmf-dist/source/latex/koma-script/tocstyle.dtx @@ -1,8 +1,8 @@ -% \CheckSum{1699} +% \CheckSum{1886} % \iffalse meta-comment % ====================================================================== % tocstyle.dtx -% Copyright (c) Markus Kohm, 2007-2015 +% Copyright (c) Markus Kohm, 2007-2016 % % This file is part of the LaTeX2e KOMA-Script bundle. % @@ -29,7 +29,7 @@ % at least three times. % ---------------------------------------------------------------------- % tocstyle.dtx -% Copyright (c) Markus Kohm, 2007-2015 +% Copyright (c) Markus Kohm, 2007-2016 % % Diese Datei ist Teil des LaTeX2e KOMA-Script-Pakets. % @@ -75,7 +75,7 @@ % Right brace \} Tilde \~} % % \iffalse -%%% From File: $Id: tocstyle.dtx 1977 2015-03-09 08:17:29Z kohm $ +%%% From File: $Id: tocstyle.dtx 2428 2016-04-12 10:31:07Z kohm $ %<*dtx> % \fi \def\LaTeXformat{LaTeX2e} @@ -104,10 +104,7 @@ \preamble -Copyright (c) 2007-2013 by Markus Kohm <komascript(at)gmx.info> - -Copyright (c) 1994-2007 -Markus Kohm and any individual authors listed elsewhere in this file. +Copyright (c) 2007-2016 by Markus Kohm <komascript(at)gmx.info> This file was generated from file(s) of the KOMA-Script bundle. --------------------------------------------------------------- @@ -132,7 +129,7 @@ If this file is a beta version, you are not allowed to distribute it. English and German manuals are part of KOMA-Script bundle. ---------------------------------------------------------- -The english manual is at `tocstyle.dtx', too. +The english manual is in `tocstyle.dtx', too. The KOMA-Script bundle (but not this file) was based upon the LaTeX2.09 Script family created by Frank Neukam 1993 and the LaTeX2e standard @@ -178,7 +175,7 @@ THERE IS NO SUPPORT, IF YOU USE THIS PACKAGE! \Msg{* To finish the installation you have to copy the file `tocstyle.sty'} \Msg{* to folder `tex/latex/tocstyle/' of one of your TEXMF trees.} \Msg{* You should also produce the documentation using} - \Msg{*\space\space latex tocstyle.dtx} + \Msg{*\space\space pdflatex tocstyle.dtx} \Msg{* and copy it to folder `doc/latex/tocstyle/' of one of your} \Msg{* TEXMF trees.} \Msg{*} @@ -202,7 +199,7 @@ THERE IS NO SUPPORT, IF YOU USE THIS PACKAGE! %<driver>\ProvidesFile{tocstyle.drv} %<doc>\ProvidesFile{tocstyle.tex} %<*dtx|package|driver|doc> - [2013/08/11 v0.2e-alpha KOMA-Script package (versatile toc styles)] + [2016/04/12 v0.2h-alpha KOMA-Script package (versatile toc styles)] %</dtx|package|driver|doc> %<*driver> \documentclass{scrdoc} @@ -222,7 +219,6 @@ THERE IS NO SUPPORT, IF YOU USE THIS PACKAGE! \date{\filedate} \author{Markus Kohm} -\newenvironment{Explain}{\par}{\par} \let\Macro\cs \let\Package\textsf \let\File\texttt @@ -269,7 +265,9 @@ THERE IS NO SUPPORT, IF YOU USE THIS PACKAGE! % % \selectlanguage{english} % -% \changes{v0.1}{2007/06/23}{start of new package} +% \changes{v0.1}{2007/06/23}{start of new package}^^A +% \changes{v0.2h}{2016/04/12}{\cs{@ifnextchar} replaced by +% \cs{kernel@ifnextchar}}^^A % %\iffalse %<doc>\chapter{Other Styles for Table of Contents and Lists of Floats} @@ -288,6 +286,9 @@ author didn't like to change the \LaTeX\ kernel at a class, because this may result in serveral problems with other packages. The package \Package{tocstyle} will fill the gap. If it conflicts with another package, you simply may decide not to use it. + +Since \KOMAScript~3.20 most of the features of \Package{tocstyle} are also +provided by other \KOMAScript{} packages like \Package{tocbasic}. %\iffalse %</doc> %\fi @@ -301,45 +302,64 @@ you simply may decide not to use it. %<*doc> %\fi % +\section{Package Status} +\label{sec:tocstyle.status} + +Package \Package{tocstyle} has alpha status for a very long time (since +2007), despite the fact that it was very stable all over the years. The main +reason for this is that it was an experiment and I always intended to make a +better successor. Another reason was, that there are known issues, which are +hardly to fix. So \Package{tocstyle} never became an official part of +\KOMAScript. Nevertheless it has been published with \KOMAScript, because I +thought it would be an useful addition. I never thought that the interim +status of the package would be for more than eight years. + +With \KOMAScript~3.20 several features of \Package{tocstyle} can be found also +in \Package{tocbasic}. I recommend to use that official and essential part of +\KOMAScript{} instead of \Package{tocstyle} whenever possible. Nevertheless, I +plan to ensure the compatibility of \Package{tocstyle} with new releases of +\KOMAScript{} for at least already existing, unchanged documents as long as it +is possible. But expect that \Package{tocstyle} will move from +\KOMAScript{} bundle to another package, e.\,g., \KOMAScript-obsolete or a +stand-alone package. + \section{How It Works} \label{sec:tocstyle.howitworks} -\begin{Explain} - Loading the package \Package{tocstyle} will redefine the kernel macro - \Macro{@starttoc}. Using the redefined \Macro{@starttoc} will redefine - \Macro{@dottedtocline}, \Macro{l@part} down to \Macro{l@subparagraph}, - \Macro{l@figure}, and \Macro{l@table}, if and only if \Package{tocstyle} - wasn't deactivated for all TOCs or this TOC. Usage the redefined - \Macro{@dottedtocline} will redefine \Macro{numberline}. +Loading the package \Package{tocstyle} will redefine the kernel macro +\Macro{@starttoc}. Using the redefined \Macro{@starttoc} will redefine +\Macro{@dottedtocline}, \Macro{l@part} down to \Macro{l@subparagraph}, +\Macro{l@figure}, and \Macro{l@table}, if and only if \Package{tocstyle} +wasn't deactivated for all TOCs or this TOC. Usage the redefined +\Macro{@dottedtocline} will redefine \Macro{numberline}. - Redefining \Macro{@starttoc}, \Macro{@dottedtocline}, and \Macro{numberline} - will activate the features of \Package{tocstyle} for all lists that uses - these, e.g. table of contents, list of figures and list of tables at the - standard or the \KOMAScript{} classes. But while not all classes uses - \Macro{@dottedtocline} and \Macro{@numberline} for all entries to table of - contents and list of floats the package redefines some other macros that are - typically used for those entries. These are e.g. \Macro{l@part}, - \Macro{l@chapter} and some more. If the class even does not use those - macros, you may not use \Package{tocstyle} to change the lists. The term TOC - will be used for all kind of list, that may be processed by - \Package{tocstyle}. The package tests wether the original kernel macros - \Macro{@starttoc}, \Macro{@dottedtocline}, and \Macro{numberline} were used - or not and warns if not. +Redefining \Macro{@starttoc}, \Macro{@dottedtocline}, and \Macro{numberline} +will activate the features of \Package{tocstyle} for all lists that uses +these, e.g. table of contents, list of figures and list of tables at the +standard or the \KOMAScript{} classes. But while not all classes uses +\Macro{@dottedtocline} and \Macro{@numberline} for all entries to table of +contents and list of floats the package redefines some other macros that are +typically used for those entries. These are e.g. \Macro{l@part}, +\Macro{l@chapter} and some more. If the class even does not use those macros, +you may not use \Package{tocstyle} to change the lists. The term TOC will be +used for all kind of list, that may be processed by \Package{tocstyle}. The +package tests wether the original kernel macros \Macro{@starttoc}, +\Macro{@dottedtocline}, and \Macro{numberline} were used or not and warns if +not. - Package \Package{tocstyle} needs some more information. For the standard and - the \KOMAScript{} classes these informations may be detected by the - package. If the result is not the expected, you may configure these - informations manually. +Package \Package{tocstyle} needs some more information. For the standard and +the \KOMAScript{} classes these informations may be detected by the +package. If the result is not the expected, you may configure these +informations manually. - The entries of every TOC hat a depth. See the counter \Counter{tocdepth} for - more information about the depth. You may change several settings for the - entries of either all depths of all TOCs, all depths of one TOC, or one - depth of one TOC. +The entries of every TOC hat a depth. See the counter \Counter{tocdepth} for +more information about the depth. You may change several settings for the +entries of either all depths of all TOCs, all depths of one TOC, or one depth +of one TOC. - But most users will not need to set up \Package{tocstyle} at this low - level. They simply will select one of the predefined styles and maybe select - one of the optional features. -\end{Explain} +But most users will not need to set up \Package{tocstyle} at this low +level. They simply will select one of the predefined styles and maybe select +one of the optional features. \section{Optional Features} \label{sec:tocstyle.options} @@ -1068,11 +1088,11 @@ usefull to define your own toc styles. % \end{macro} % % \begin{option}{chapter} -% \changes{v3.05}{2009/11/11}{New} +% \changes{v0.2d}{2009/11/11}{New} % \begin{option}{nochapter} -% \changes{v3.05}{2009/11/11}{New} +% \changes{v0.2d}{2009/11/11}{New} % \begin{macro}{\iftochaschapter} -% \changes{v3.05}{2009/11/11}{New} +% \changes{v0.2d}{2009/11/11}{New} % Do we have \cs{chapter} and \cs{l@chapter}? % \begin{macrocode} \newif\iftochaschapter\tochaschapterfalse @@ -1413,7 +1433,7 @@ usefull to define your own toc styles. % \subsubsection{Redefining Class Macros} % % \begin{macro}{\l@part} -% \changes{v2.4}{2009/11/11}{part level is always -1} +% \changes{v0.2d}{2009/11/11}{part level is always -1} % \begin{macro}{\l@chapter} % \begin{macro}{\l@section} % \begin{macro}{\l@subsection} @@ -1423,44 +1443,147 @@ usefull to define your own toc styles. % \begin{macro}{\l@table} % \begin{macro}{\l@figure} % Try to redefine the toc commands at startup. +% \changes{v0.2f}{2016/03/22}{recognize all subs of part, chapter, +% section and paragraph}^^A +% \changes{v0.2g}{2016/03/23}{warning for usage of not recommended package +% combinations}^^A +% \changes{v0.2h}{2016/04/24}{lokal \cs{normalcolor} auf \cs{relax} +% setzen}^^A +% \changes{v0.2h}{2016/04/24}{lokal \cs{color} auf \cs{@gobble} setzen}^^A % \begin{macrocode} \AtBeginDocument{% - \ifcsname l@part\endcsname - \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@part{\tocstyle@l@define{part}{-1}}{}}% - \fi - \ifcsname l@chapter\endcsname - \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@chapter{\tocstyle@l@define{chapter}{0}}{}}% - \fi - \ifcsname l@section\endcsname + \@ifpackageloaded{tocbasic}{% + \@ifpackagelater{tocbasic}{2016/03/01}{% + \PackageWarningNoLine{tocstyle}{% + Usage of `tocstyle' with new `tocbasic' detected.\MessageBreak + This is not an error! You can do this.\MessageBreak + Nevertheless, you should note, combining `tocstyle'\MessageBreak + with this version of `tocbasic' will break several\MessageBreak + features of `tocbasic'. You should use `tocstyle'\MessageBreak + features instead of `tocbasic' attributes for all\MessageBreak + entry changes you want.\MessageBreak + You may also get additional warnings because of\MessageBreak + redefined `\string\numberline'. Ignore them}% + }{}% + }{}% + \@ifpackageloaded{etoc}{% + \PackageWarningNoLine{tocstyle}{% + Usage of `tocstyle' with `etoc' detected.\MessageBreak + I suggest to use either `tocstyle' or `etoc'\MessageBreak + but not both of them together}% + }{}% + \@ifpackageloaded{titletoc}{% + \PackageWarningNoLine{tocstyle}{% + Usage of `tocstyle' with `titletoc' detected.\MessageBreak + I suggest to use either `tocstyle' or `titletoc'\MessageBreak + but not both of them together. I expect even\MessageBreak + error messages because of this combination}% + }{}% + \def\tocstyle@test@level{-1}% + \def\tocstyle@test@levelname{part}% + \@whilesw\ifcsname l@\tocstyle@test@levelname\endcsname\fi{% \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@section{\tocstyle@l@define{section}{1}}{}}% - \fi - \ifcsname l@subsection\endcsname - \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@subsection{\tocstyle@l@define{subsection}{2}}{}}% + \let\normalcolor\relax + \let\color\@gobble + \edef\reserved@a{% + \expandafter\noexpand\csname l@\tocstyle@test@levelname\endcsname{% + \noexpand\tocstyle@l@define{\tocstyle@test@levelname}% + {\tocstyle@test@level}% + }{}% + }% + \reserved@a + }% + \edef\tocstyle@test@levelname{sub\tocstyle@test@levelname}% + \edef\tocstyle@test@level{\the\numexpr\tocstyle@test@level+1}% + }% + \ifnum\tocstyle@test@level<\z@ + \def\tocstyle@test@level{0}% \fi - \ifcsname l@subsubsection\endcsname + \def\tocstyle@test@levelname{chapter}% + \@whilesw\ifcsname l@\tocstyle@test@levelname\endcsname\fi{% \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@subsubsection{\tocstyle@l@define{subsubsection}{3}}{}}% + \let\normalcolor\relax + \let\color\@gobble + \edef\reserved@a{% + \expandafter\noexpand\csname l@\tocstyle@test@levelname\endcsname{% + \noexpand\tocstyle@l@define{\tocstyle@test@levelname}% + {\tocstyle@test@level}% + }{}% + }% + \reserved@a + }% + \edef\tocstyle@test@levelname{sub\tocstyle@test@levelname}% + \edef\tocstyle@test@level{\the\numexpr\tocstyle@test@level+1}% + }% + \ifnum\tocstyle@test@level<\@ne + \def\tocstyle@test@level{1}% \fi - \ifcsname l@paragraph\endcsname + \def\tocstyle@test@levelname{section}% + \@whilesw\ifcsname l@\tocstyle@test@levelname\endcsname\fi{% \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@paragraph{\tocstyle@l@define{paragraph}{4}}{}}% - \fi - \ifcsname l@subparagraph\endcsname + \let\normalcolor\relax + \let\color\@gobble + \edef\reserved@a{% + \expandafter\noexpand\csname l@\tocstyle@test@levelname\endcsname{% + \noexpand\tocstyle@l@define{\tocstyle@test@levelname}% + {\tocstyle@test@level}% + }{}% + }% + \reserved@a + }% + \edef\tocstyle@test@levelname{sub\tocstyle@test@levelname}% + \edef\tocstyle@test@level{\the\numexpr\tocstyle@test@level+1}% + }% + \def\tocstyle@test@levelname{paragraph}% + \@whilesw\ifcsname l@\tocstyle@test@levelname\endcsname\fi{% \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@subparagraph{\tocstyle@l@define{subparagraph}{5}}{}}% - \fi - \ifcsname l@table\endcsname + \let\normalcolor\relax + \let\color\@gobble + \edef\reserved@a{% + \expandafter\noexpand\csname l@\tocstyle@test@levelname\endcsname{% + \noexpand\tocstyle@l@define{\tocstyle@test@levelname}% + {\tocstyle@test@level}% + }{}% + }% + \reserved@a + }% + \edef\tocstyle@test@levelname{sub\tocstyle@test@levelname}% + \edef\tocstyle@test@level{\the\numexpr\tocstyle@test@level+1}% + }% + \def\tocstyle@test@level{1}% + \def\tocstyle@test@levelname{table}% + \@whilesw\ifcsname l@\tocstyle@test@levelname\endcsname\fi{% \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@table{\tocstyle@l@define{table}{1}}{}}% - \fi - \ifcsname l@figure\endcsname + \let\normalcolor\relax + \let\color\@gobble + \edef\reserved@a{% + \expandafter\noexpand\csname l@\tocstyle@test@levelname\endcsname{% + \noexpand\tocstyle@l@define{\tocstyle@test@levelname}% + {\tocstyle@test@level}% + }{}% + }% + \reserved@a + }% + \edef\tocstyle@test@levelname{sub\tocstyle@test@levelname}% + \edef\tocstyle@test@level{\the\numexpr\tocstyle@test@level+1}% + }% + \def\tocstyle@test@level{1}% + \def\tocstyle@test@levelname{figure}% + \@whilesw\ifcsname l@\tocstyle@test@levelname\endcsname\fi{% \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@figure{\tocstyle@l@define{figure}{1}}{}}% - \fi + \let\normalcolor\relax + \let\color\@gobble + \edef\reserved@a{% + \expandafter\noexpand\csname l@\tocstyle@test@levelname\endcsname{% + \noexpand\tocstyle@l@define{\tocstyle@test@levelname}% + {\tocstyle@test@level}% + }{}% + }% + \reserved@a + }% + \edef\tocstyle@test@levelname{sub\tocstyle@test@levelname}% + \edef\tocstyle@test@level{\the\numexpr\tocstyle@test@level+1}% + }% % \end{macrocode} % \begin{macro}{\@dottedtocline} % This will be used even for undotted toc lines. First check the definition, @@ -1594,7 +1717,9 @@ usefull to define your own toc styles. \if@filesw \begingroup \endlinechar=\m@ne +% \end{macrocode} % While \LaTeX{} does not close the files, we have to do it know. +% \begin{macrocode} \immediate\closeout\csname tf@#1\endcsname \immediate\openin\@inputcheck \jobname.#1 \immediate\openout\@partaux \jobname.#1#2 @@ -1686,7 +1811,8 @@ usefull to define your own toc styles. % \end{macro} % % \begin{macro}{\tocstyle@set@width} -% \changes{v3.05}{2009/11/11}{improve handling of standard classes} +% \changes{v0.2d}{2009/11/11}{improve handling of standard classes}^^A +% \changes{v0.2h}{2016/03/25}{use after definition in \texttt{aux}-file}^^A % Some classes do not use \cs{numberline}. This may result in negativ widths % (esp. negativ skips). Following special handling of negativ values improves % the toc handling of the standard classes. Nevertheless indentation of not @@ -1708,6 +1834,13 @@ usefull to define your own toc styles. \fi \fi } +\AtBeginDocument{% + \if@filesw + \immediate\write\@auxout{% + \string\providecommand*\string\tocstyle@set@width[4]{}% + }% + \fi +} % \end{macrocode} % \end{macro} % @@ -1747,7 +1880,7 @@ usefull to define your own toc styles. % The primary command to set the features of a depth of a TOC. % \begin{macrocode} \newcommand*{\@settocfeature}[1][]{% - \@ifnextchar[ {\@@settocfeature[{#1}]}{\@@settocfeature[{#1}][]} + \kernel@ifnextchar[ {\@@settocfeature[{#1}]}{\@@settocfeature[{#1}][]} } \def\@@settocfeature[#1][#2]#3#4{% %<trace> \typeout{exclude: \tocstyle@feature@excludelist}% @@ -1804,7 +1937,7 @@ usefull to define your own toc styles. % Same as above without TOC argument. % \begin{macrocode} \newcommand*{\@settocstylefeature}{% - \@ifnextchar[ {\@settocfeature[]}{\@settocfeature[][]}% + \kernel@ifnextchar[ {\@settocfeature[]}{\@settocfeature[][]}% } \newcommand*{\settocstylefeature}{} \let\settocstylefeature\@settocstylefeature @@ -1882,10 +2015,10 @@ usefull to define your own toc styles. % that defines all features doesn't need a parent. % \begin{macrocode} \newcommand*{\newtocstyle}{% - \@ifnextchar [{\@newtocstyle}{\@newtocstyle[]}} + \kernel@ifnextchar [{\@newtocstyle}{\@newtocstyle[]}} \newcommand*{\@newtocstyle}{} \def\@newtocstyle[#1]{% - \@ifnextchar [{\@@newtocstyle[{#1}]}{\@newtocstyle[{#1}][]}} + \kernel@ifnextchar [{\@@newtocstyle[{#1}]}{\@newtocstyle[{#1}][]}} \newcommand*{\@@newtocstyle}{} \def\@@newtocstyle[#1][#2]#3#4{% \@ifundefined{tocstyle@style@#3}{% @@ -1935,7 +2068,7 @@ usefull to define your own toc styles. but there's no TOC style `#2' defined.}% }{% \def\settocfeature{% - \@ifnextchar[ %] + \kernel@ifnextchar[ %] {\@@settocfeature[{#1}]}{\@@settocfeature[{#1}][]}% }% \let\settocstylefeature\settocfeature |