diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/koma-script/tocstyle.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/koma-script/tocstyle.sty | 66 |
1 files changed, 39 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/latex/koma-script/tocstyle.sty b/Master/texmf-dist/tex/latex/koma-script/tocstyle.sty index 409a2f42b93..816c9a97981 100644 --- a/Master/texmf-dist/tex/latex/koma-script/tocstyle.sty +++ b/Master/texmf-dist/tex/latex/koma-script/tocstyle.sty @@ -7,7 +7,7 @@ %% tocstyle.dtx (with options: `package,trace,tocstyle') %% scrlogo.dtx (with options: `logo') %% -%% Copyright (c) 2007-2009 by Markus Kohm <komascript(at)gmx.info> +%% Copyright (c) 2007-2010 by Markus Kohm <komascript(at)gmx.info> %% %% Copyright (c) 1994-2007 %% Markus Kohm and any individual authors listed elsewhere in this file. @@ -50,7 +50,7 @@ %%% From File: tocstyle.dtx \NeedsTeXFormat{LaTeX2e}[1995/06/01] \ProvidesPackage{tocstyle} - [2008/10/20 v0.2c-alpha LaTeX2e KOMA-Script package (versatile toc styles)] + [2009/11/09 v0.2d-alpha LaTeX2e KOMA-Script package (versatile toc styles)] \PackageWarningNoLine{tocstyle}{% THIS IS AN ALPHA VERSION!\MessageBreak USAGE OF THIS VERSION IS ON YOUR OWN RISK!\MessageBreak @@ -110,6 +110,12 @@ \fi \endgroup } +\newif\iftochaschapter\tochaschapterfalse +\ifcsname l@chapter\endcsname + \ifcsname chapter\endcsname + \tochaschaptertrue + \fi +\fi \DeclareOption{tocbreaksstrict}{\selecttocstyleoption\CurrentOption} \DeclareOption{tocbreakscareless}{\selecttocstyleoption\CurrentOption} \DeclareOption{tocindentauto}{\selecttocstyleoption\CurrentOption} @@ -169,19 +175,20 @@ \tocstyle@feature@raggedhook \@tempdima #3\relax \@tempdimb #2\relax - \typeout{m (\tocstyleTOC, \tocstyledepth): \the\@tempdima}% + \typeout{number indent by \string\l@... (\tocstyleTOC, \tocstyledepth): \space\the\@tempdimb}% + \typeout{text indent by \string\l@... (\tocstyleTOC, \tocstyledepth): \space\the\@tempdima}% \ifnum #1>\z@\relax \@tempcnta #1\relax \advance\@tempcnta \m@ne - \ifcsname tocstyle@skipwidth@\tocstyleTOC @\the\@tempcnta\endcsname - \ifcsname tocstyle@numwidth@\tocstyleTOC @\the\@tempcnta\endcsname + \ifcsname tocstyle@maxskipwidth@\tocstyleTOC @\the\@tempcnta\endcsname + \ifcsname tocstyle@maxnumwidth@\tocstyleTOC @\the\@tempcnta\endcsname \@tempdimb - \csname tocstyle@skipwidth@\tocstyleTOC @\the\@tempcnta\endcsname + \csname tocstyle@maxskipwidth@\tocstyleTOC @\the\@tempcnta\endcsname \advance\@tempdimb - \csname tocstyle@numwidth@\tocstyleTOC @\the\@tempcnta\endcsname + \csname tocstyle@maxnumwidth@\tocstyleTOC @\the\@tempcnta\endcsname \fi \fi \fi - \typeout{C (\tocstyleTOC, \tocstyledepth): \the\@tempdimb}% + \typeout{number indent by parent (\tocstyleTOC, \tocstyledepth): \space\the\@tempdimb}% \ifcsname tocstyle@skipwidth@\tocstyleTOC @#1\endcsname \ifdim \@tempdimb> \csname tocstyle@skipwidth@\tocstyleTOC @#1\endcsname\relax @@ -201,11 +208,11 @@ \@tempdima \csname tocstyle@maxnumwidth@\tocstyleTOC @#1\endcsname \relax \fi - \typeout{a (\tocstyleTOC, \tocstyledepth): \the\@tempdima}% - \typeout{A (\tocstyleTOC, \tocstyledepth): \the\@tempdimb}% + \typeout{text indent calculated (\tocstyleTOC, \tocstyledepth): \the\@tempdima}% + \typeout{number indent calculated (\tocstyleTOC, \tocstyledepth): \the\@tempdimb}% \else \@tempdimb #2\relax - \typeout{M (\tocstyleTOC, \tocstyledepth): \the\@tempdimb}% + \typeout{number indent explicite (\tocstyleTOC, \tocstyledepth): \the\@tempdimb}% \fi \ifcsname tocstyle@unumwidth@\tocstyleTOC @\endcsname \ifdim \@tempdima> @@ -223,8 +230,8 @@ \@tempdima \csname tocstyle@maxunumwidth@\tocstyleTOC @\endcsname \relax \fi - \typeout{s (\tocstyleTOC, \tocstyledepth): \the\@tempdima}% - \typeout{S (\tocstyleTOC, \tocstyledepth): \the\@tempdimb}% + \typeout{text noindent (\tocstyleTOC, \tocstyledepth): \the\@tempdima}% + \typeout{number noindent (\tocstyleTOC, \tocstyledepth): \the\@tempdimb}% \fi \advance\parindent \@tempdimb\@afterindenttrue \advance\leftskip \parindent @@ -306,13 +313,8 @@ } \AtBeginDocument{% \ifcsname l@part\endcsname - \ifcsname l@chapter\endcsname - \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@part{\tocstyle@l@define{part}{-1}}{}}% - \else - \setbox\@tempboxa\vbox{\hsize\maxdimen - \l@part{\tocstyle@l@define{part}{0}}{}}% - \fi + \setbox\@tempboxa\vbox{\hsize\maxdimen + \l@part{\tocstyle@l@define{part}{-1}}{}}% \fi \ifcsname l@chapter\endcsname \setbox\@tempboxa\vbox{\hsize\maxdimen @@ -509,7 +511,20 @@ \endgroup } \newcommand*{\tocstyle@set@width}[4]{% - \expandafter\gdef\csname tocstyle@max#1width@#2@#3\endcsname{#4}% + \iftocstyle@indentnotnumbered + \ifdim #4<\z@ + \expandafter\gdef\csname tocstyle@max#1width@#2@#3\endcsname{% + \dimexpr #4/2\relax}% + \else + \expandafter\gdef\csname tocstyle@max#1width@#2@#3\endcsname{#4}% + \fi + \else + \ifdim #4<\z@ + \expandafter\gdef\csname tocstyle@max#1width@#2@#3\endcsname{\z@}% + \else + \expandafter\gdef\csname tocstyle@max#1width@#2@#3\endcsname{#4}% + \fi + \fi } \newcommand*{\tocstyleTOC}{} \newcommand*{\tocstyleAliasTOC}{} @@ -738,8 +753,7 @@ \ifx\tocstyleAliasTOC\@tempa\aftergroup\bfseries\fi \endgroup }% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname l@chapter\endcsname\relax + \iftochaschapter\else \settocfeature[1]{entryvskip}{1em\@plus\p@}% \settocfeature[1]{leaders}{\hfill}% \settocfeature[1]{entryhook}{% @@ -765,8 +779,7 @@ \ifx\tocstyleAliasTOC\@tempa\aftergroup\sffamily\bfseries\fi \endgroup }% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname l@chapter\endcsname\relax + \iftochaschapter\else \settocfeature[1]{entryvskip}{1em\@plus\p@}% \settocfeature[1]{leaders}{\hfill}% \settocfeature[1]{entryhook}{% @@ -791,8 +804,7 @@ \ifx\tocstyleAliasTOC\@tempa\aftergroup\sectfont\fi \endgroup }% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname l@chapter\endcsname\relax + \iftochaschapter\else \settocfeature[1]{entryvskip}{1em\@plus\p@}% \settocfeature[1]{leaders}{\hfill}% \settocfeature[1]{entryhook}{% |