diff options
author | Karl Berry <karl@freefriends.org> | 2013-05-02 21:47:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-05-02 21:47:58 +0000 |
commit | 0aded7b9ed8d32ea2311499243871cc3ee7a7ec0 (patch) | |
tree | 5126a908d013417cb22a119d4611228e3268a03c /Master/texmf-dist/tex/latex | |
parent | 6cdb75282c226eb14173774707ff1d26629c47ac (diff) |
tocloft (2may13)
git-svn-id: svn://tug.org/texlive/trunk@30209 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/tocloft/tocloft.sty | 96 |
1 files changed, 53 insertions, 43 deletions
diff --git a/Master/texmf-dist/tex/latex/tocloft/tocloft.sty b/Master/texmf-dist/tex/latex/tocloft/tocloft.sty index 64f4beeb8d3..907d17a728c 100644 --- a/Master/texmf-dist/tex/latex/tocloft/tocloft.sty +++ b/Master/texmf-dist/tex/latex/tocloft/tocloft.sty @@ -23,15 +23,16 @@ %% This work consists of the files listed in the README file. %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tocloft}[2010/10/13 v2.3e parameterised ToC, etc., typesetting] +\ProvidesPackage{tocloft}[2013/05/02 v2.3f parameterised ToC, etc., typesetting] \newcommand{\@cftquit}{} \newif\if@cfthaschapter \newif\if@cftkoma - \@cftkomafalse +\@cftkomafalse \@ifclassloaded{scrartcl}{\@cftkomatrue}{} \@ifclassloaded{scrreprt}{\@cftkomatrue}{} \@ifclassloaded{scrbook}{\@cftkomatrue}{} - +\newif\if@cfttitlesec +\AtBeginDocument{\@ifpackageloaded{titlesec}{\@cfttitlesectrue}{}} \@ifundefined{chapter}{% \@cfthaschapterfalse \@ifundefined{section}{% @@ -127,13 +128,13 @@ Consider installing the current version of tocbibind.}} \newcommand{\@cftmaketoctitle}{% \addpenalty\@secpenalty \if@cfthaschapter - \vspace*{\cftbeforetoctitleskip} + \vspace*{\cftbeforetoctitleskip}% \else - \vspace{\cftbeforetoctitleskip} + \vspace{\cftbeforetoctitleskip}% \fi \@cftpagestyle {\interlinepenalty\@M - {\cfttoctitlefont\contentsname}{\cftaftertoctitle} + {\cfttoctitlefont\contentsname}{\cftaftertoctitle}% \cftmarktoc \par\nobreak \vskip \cftaftertoctitleskip @@ -157,11 +158,19 @@ Consider installing the current version of tocbibind.}} \newcommand{\cftaftertoctitle}{} \newcommand{\cftsetpnumwidth}[1]{\renewcommand{\@pnumwidth}{#1}} \newcommand{\cftsetrmarg}[1]{\renewcommand{\@tocrmarg}{#1}} +\newcommand{\cftpnumalign}{r} \providecommand{\cftdot}{.} \providecommand{\cftdotfill}[1]{% - \leaders\hbox{$\m@th\mkern #1 mu\hbox{\cftdot}\mkern #1 mu$}\hfill} + \def\@tempa{#1}% + \def\@tempb{\cftnodots}% + \ifx\@tempa\@tempb + \hfill + \else + \leaders\hbox{$\m@th\mkern #1 mu\hbox{\cftdot}\mkern #1 mu$}\hfill + \fi +} \providecommand{\cftdotsep}{4.5} -\newcommand{\cftnodots}{10000} +\newcommand{\cftnodots}{5000} \newcommand{\cftparfillskip}{\parfillskip=0pt plus1fil} \renewcommand{\numberline}[1]{% \hb@xt@\@tempdima{\@cftbsnum #1\@cftasnum\hfil}\@cftasnumb} @@ -203,7 +212,7 @@ Consider installing the current version of tocbibind.}} \let\@cftasnum \cftpartaftersnum \let\@cftasnumb \cftpartaftersnumb \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip - {\cftpartfont \cftpartpresnum #1}% + {\cftpartfont \if@cftkoma\else\if@cfttitlesec\else\cftpartpresnum\fi\fi #1}% \cftpartfillnum{#2}} \nobreak \if@cfthaschapter @@ -235,14 +244,14 @@ Consider installing the current version of tocbibind.}} \setlength{\cftpartindent}{0em} \newcommand{\cftpartfillnum}[1]{% {\cftpartleader}% - {\hb@xt@\@pnumwidth{\hss {\cftpartpagefont #1}}}\cftpartafterpnum\par} + {\makebox[\@pnumwidth][\cftpnumalign]{\cftpartpagefont #1}\cftpartafterpnum\par}% + } \if@cftkoma \setlength{\cftpartnumwidth}{2em} \renewcommand{\cftpartfont}{\sectfont\large} \renewcommand{\cftpartpagefont}{\sectfont\large} \fi \fi - \if@cfthaschapter \renewcommand*{\l@chapter}[2]{% \ifnum \c@tocdepth >\m@ne @@ -280,7 +289,8 @@ Consider installing the current version of tocbibind.}} \newcommand{\cftchapafterpnum}{} \newcommand{\cftchapfillnum}[1]{% {\cftchapleader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftchappagefont #1}\cftchapafterpnum\par} + \makebox[\@pnumwidth][\cftpnumalign]{\cftchappagefont #1}\cftchapafterpnum\par + } \if@cftkoma \renewcommand{\cftchapfont}{\sectfont} \fi @@ -334,8 +344,8 @@ Consider installing the current version of tocbibind.}} \newcommand{\cftsecafterpnum}{} \newcommand{\cftsecfillnum}[1]{% {\cftsecleader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftsecpagefont #1}\cftsecafterpnum\par} - + \makebox[\@pnumwidth][\cftpnumalign]{\cftsecpagefont #1}\cftsecafterpnum\par +} \renewcommand*{\l@subsection}[2]{% \ifnum \c@tocdepth >\@ne \vskip \cftbeforesubsecskip @@ -374,8 +384,8 @@ Consider installing the current version of tocbibind.}} \newcommand{\cftsubsecafterpnum}{} \newcommand{\cftsubsecfillnum}[1]{% {\cftsubsecleader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftsubsecpagefont #1}\cftsubsecafterpnum\par} - + \makebox[\@pnumwidth][\cftpnumalign]{\cftsubsecpagefont #1}\cftsubsecafterpnum\par +} \renewcommand*{\l@subsubsection}[2]{% \ifnum \c@tocdepth >\tw@ \vskip \cftbeforesubsubsecskip @@ -414,8 +424,8 @@ Consider installing the current version of tocbibind.}} \newcommand{\cftsubsubsecafterpnum}{} \newcommand{\cftsubsubsecfillnum}[1]{% {\cftsubsubsecleader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftsubsubsecpagefont #1}\cftsubsubsecafterpnum\par} - + \makebox[\@pnumwidth][\cftpnumalign]{\cftsubsubsecpagefont #1}\cftsubsubsecafterpnum\par +} \renewcommand*{\l@paragraph}[2]{% \ifnum \c@tocdepth >3\relax \vskip \cftbeforeparaskip @@ -454,8 +464,8 @@ Consider installing the current version of tocbibind.}} \newcommand{\cftparaafterpnum}{} \newcommand{\cftparafillnum}[1]{% {\cftparaleader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftparapagefont #1}\cftparaafterpnum\par} - + \makebox[\@pnumwidth][\cftpnumalign]{\cftparapagefont #1}\cftparaafterpnum\par +} \renewcommand*{\l@subparagraph}[2]{% \ifnum \c@tocdepth >4\relax \vskip \cftbeforesubparaskip @@ -494,8 +504,8 @@ Consider installing the current version of tocbibind.}} \newcommand{\cftsubparaafterpnum}{} \newcommand{\cftsubparafillnum}[1]{% {\cftsubparaleader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftsubparapagefont #1}\cftsubparaafterpnum\par} - + \makebox[\@pnumwidth][\cftpnumalign]{\cftsubparapagefont #1}\cftsubparaafterpnum\par +} \newcommand{\@cftdobiblof}{% \if@dotoclof \if@bibchapter @@ -591,8 +601,8 @@ Consider installing the current version of tocbibind.}} \newcommand{\cftfigafterpnum}{} \newcommand{\cftfigfillnum}[1]{% {\cftfigleader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftfigpagefont #1}\cftfigafterpnum\par} - + \makebox[\@pnumwidth][\cftpnumalign]{\cftfigpagefont #1}\cftfigafterpnum\par +} \if@cftsubfigopt\else \newcounter{lofdepth}\setcounter{lofdepth}{1} \newcounter{lotdepth}\setcounter{lotdepth}{1} @@ -693,8 +703,8 @@ Consider installing the current version of tocbibind.}} \newcommand{\cfttabafterpnum}{} \newcommand{\cfttabfillnum}[1]{% {\cfttableader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cfttabpagefont #1}\cfttabafterpnum\par} - + \makebox[\@pnumwidth][\cftpnumalign]{\cfttabpagefont #1}\cfttabafterpnum\par +} \newcommand{\@cftl@subfig}{% \renewcommand*{\l@subfigure}[2]{% \ifnum \c@lofdepth > \toclevel@subfigure @@ -734,7 +744,8 @@ Consider installing the current version of tocbibind.}} \providecommand{\toclevel@subfigure}{1} \newcommand{\cftsubfigfillnum}[1]{% {\cftsubfigleader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftsubfigpagefont ##1}\cftsubfigafterpnum\par} + \makebox[\@pnumwidth][\cftpnumalign]{\cftsubfigpagefont ##1}\cftsubfigafterpnum\par +} } \newcommand{\@cftl@subtab}{% @@ -775,7 +786,8 @@ Consider installing the current version of tocbibind.}} \providecommand{\toclevel@subtable}{1} \newcommand{\cftsubtabfillnum}[1]{% {\cftsubtableader}\nobreak - \hb@xt@\@pnumwidth{\hfil\cftsubtabpagefont ##1}\cftsubtabafterpnum\par} + \makebox[\@pnumwidth][\cftpnumalign]{\cftsubtabpagefont ##1}\cftsubtabafterpnum\par +} } @@ -854,20 +866,18 @@ Consider installing the current version of tocbibind.}} \@namedef{toclevel@#2}{#4} \@namedef{cft#2fillnum}##1{% {\@nameuse{cft#2leader}}\nobreak - \hb@xt@\@pnumwidth{\hfil\@nameuse{cft#2pagefont}##1}\@nameuse{cft#2afterpnum}\par} -} % end \newlistentry - + \makebox[\@pnumwidth][\cftpnumalign]{\@nameuse{cft#2pagefont}##1}\@nameuse{cft#2afterpnum}\par + } +} \newcommand{\newlistof}[4][\@empty]{% \ifx \@empty#1\relax \newlistentry{#2}{#3}{0} \else \newlistentry[#1]{#2}{#3}{0} \fi - - \@namedef{ext@#3}{#3} + \@namedef{ext@#2}{#3} \newcounter{#3depth} \setcounter{#3depth}{1} - \if@cftkoma \@namedef{cftmark#3}{% \@mkboth{#4}{#4}} @@ -901,16 +911,16 @@ Consider installing the current version of tocbibind.}} \@namedef{@cftmake#3title}{% \addpenalty\@secpenalty \if@cfthaschapter - \vspace*{\@nameuse{cftbefore#3titleskip}} + \vspace*{\@nameuse{cftbefore#3titleskip}}% \else - \vspace{\@nameuse{cftbefore#3titleskip}} + \vspace{\@nameuse{cftbefore#3titleskip}}% \fi \@cftpagestyle {\interlinepenalty\@M - {\@nameuse{cft#3titlefont}#4}{\@nameuse{cftafter#3title}} - \@nameuse{cftmark#3} + {\@nameuse{cft#3titlefont}#4}{\@nameuse{cftafter#3title}}% + \@nameuse{cftmark#3}% \par\nobreak - \vskip \@nameuse{cftafter#3titleskip} + \vskip \@nameuse{cftafter#3titleskip}% \@afterheading}} \expandafter\newlength\csname cftbefore#3titleskip\endcsname @@ -933,8 +943,7 @@ Consider installing the current version of tocbibind.}} \fi \fi \@namedef{cftafter#3title}{} -} % end \newlistof - +} \newcommand{\cftsetindents}[3]{% \def\@cftemp{#1} \ifx\@cftemp\cftchapname @@ -1066,8 +1075,9 @@ Consider installing the current version of tocbibind.}} \newcommand{\@cftpnumon}[1]{% \@namedef{cft#1fillnum}##1{% {\@nameuse{cft#1leader}}\nobreak - \hb@xt@\@pnumwidth{\hfil\@nameuse{cft#1pagefont}##1}\@nameuse{cft#1afterpnum}\par}} - + \makebox[\@pnumwidth][\cftpnumalign]{\@nameuse{cft#1pagefont}##1}\@nameuse{cft#1afterpnum}\par + }% +} \newcommand{\cftchapterprecis}[1]{% \cftchapterprecishere{#1} \cftchapterprecistoc{#1}} |