summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/etoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-19 22:03:39 +0000
committerKarl Berry <karl@freefriends.org>2015-03-19 22:03:39 +0000
commit6c101a17824b43c20d1c897aad00c2421d07c112 (patch)
tree7d7a2d2cdd2d0ba5157b430224af6a8f6b45bc5a /Master/texmf-dist/tex/latex/etoc
parent79b60926cca8d933838f849df1cba8da39a1f86c (diff)
etoc (19mar15)
git-svn-id: svn://tug.org/texlive/trunk@36564 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/etoc')
-rw-r--r--Master/texmf-dist/tex/latex/etoc/etoc.sty135
1 files changed, 75 insertions, 60 deletions
diff --git a/Master/texmf-dist/tex/latex/etoc/etoc.sty b/Master/texmf-dist/tex/latex/etoc/etoc.sty
index 867aa9278fd..b9251b3a4e3 100644
--- a/Master/texmf-dist/tex/latex/etoc/etoc.sty
+++ b/Master/texmf-dist/tex/latex/etoc/etoc.sty
@@ -23,14 +23,16 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{etoc}
- [2015/03/13 v1.08a Completely customisable TOCs (jfB)]
+ [2015/03/18 v1.08b Completely customisable TOCs (jfB)]
%%
%% Package: etoc
-%% Version: 1.08a (2015/03/13)
+%% Version: 1.08b (2015/03/18)
%% License: LPPL 1.3c or later (see etoc.dtx)
-%% Copyright (C) 2012-2015 Jean-Francois Burnol <jfbu at free dot fr>
-%% Copyright (C) 2014-2015 Christine Roemer <Christine_Roemer at t-online dot de>
-%% and collaborators for the translation into German of the documentation
+%% Copyright (C) 2012-2015 Jean-Francois Burnol
+%% <jfbu at free dot fr>
+%% Copyright (C) 2014-2015 Christine Roemer
+%% <Christine_Roemer at t-online dot de>
+%% and collaborators for the translation into German of the documentation
%%
\RequirePackage{multicol}
\DeclareOption*{\PackageWarning{etoc}{Option `\CurrentOption' is unknown.}}
@@ -493,9 +495,8 @@
\ifEtoc@jj \Etoc@end@minustwo\fi
\fi}
\def\etoc@@startlocaltoc#1#2{%
-\let\Etoc@next\relax
\ifEtoc@localtoc
- \ifEtoc@notactive
+ \ifEtoc@notactive
\ifnum #1=#2\relax
\ifEtoc@jj \Etoc@global\let\Etoc@localtop\Etoc@@minusone@@ \fi
\ifEtoc@j \Etoc@global\let\Etoc@localtop\Etoc@@zero@@ \fi
@@ -505,33 +506,38 @@
\ifEtoc@iii \Etoc@global\let\Etoc@localtop\Etoc@@four@@ \fi
\ifEtoc@iv \Etoc@global\let\Etoc@localtop\Etoc@@five@@ \fi
\ifEtoc@v \Etoc@global\let\Etoc@localtop\Etoc@@six@@ \fi
- \def\Etoc@next{\global\Etoc@notactivefalse
- \global\Etoc@vfalse
- \global\Etoc@ivfalse
- \global\Etoc@iiifalse
- \global\Etoc@iifalse
- \global\Etoc@ifalse
- \global\Etoc@false
- \global\Etoc@jfalse
- \global\Etoc@jjfalse}%
+ \global\Etoc@notactivefalse
+ \global\Etoc@vfalse
+ \global\Etoc@ivfalse
+ \global\Etoc@iiifalse
+ \global\Etoc@iifalse
+ \global\Etoc@ifalse
+ \global\Etoc@false
+ \global\Etoc@jfalse
+ \global\Etoc@jjfalse
\fi
- \fi\fi
-\Etoc@next}
+ \fi
+ \fi
+}
\let\etoc@startlocaltoc\@gobble
\def\Etoc@localtableofcontents#1{%
\edef\Etoc@tmp{#1}%
\ifnum\Etoc@tmp<\@ne
- \PackageWarning{etoc}
- {Unknown toc id: run LaTeX to get references right}%
- \let\Etoc@next\@gobble\else\let\Etoc@next\@firstofone\fi
+ \PackageWarning{etoc}%
+ {Unknown toc id: run LaTeX to get references right}%
+ \let\Etoc@next\@gobble
+ \else
+ \let\Etoc@next\@firstofone
+ \fi
\Etoc@next
- {\edef\etoc@startlocaltoc##1{%
- \noexpand\etoc@@startlocaltoc{##1}{#1}}
- \Etoc@localtoctrue
- \let\Etoc@localtop\Etoc@@minustwo@@
- \global\Etoc@stoptocfalse
- \global\Etoc@notactivetrue
- \Etoc@tableofcontents}%
+ {% 1.08b removes a space token from unprotected line ending
+ \edef\etoc@startlocaltoc##1{\noexpand\etoc@@startlocaltoc{##1}{#1}}%
+ \Etoc@localtoctrue
+ \let\Etoc@localtop\Etoc@@minustwo@@
+ \global\Etoc@stoptocfalse
+ \global\Etoc@notactivetrue
+ \Etoc@tableofcontents
+ }%
\endgroup\ifEtoc@mustclosegroup\endgroup\fi
\Etoc@aftertochook % 1.07h
\etocaftertochook % 1.07g
@@ -544,9 +550,11 @@
\@firstofone{\def\Etoc@again} {\futurelet\Etoc@nexttoken\Etoc@t@bleofcontents}
\def\Etoc@t@bleofcontents{%
\ifx\Etoc@nexttoken\label
- \def\Etoc@next{\expandafter\Etoc@label\@gobble}\else
+ \def\Etoc@next{\expandafter\Etoc@label\@gobble}%
+ \else
\ifx\Etoc@nexttoken\@sptoken
- \let\Etoc@next\Etoc@again\else
+ \let\Etoc@next\Etoc@again
+ \else
\ifEtoc@tocwithid
\def\Etoc@next{\Etoc@localtableofcontents{\c@etoc@tocid}}%
\else
@@ -569,8 +577,7 @@
\futurelet\Etoc@nexttoken\Etoc@t@bleofcontents}
\def\Etoc@localtable@fcontents{%
\refstepcounter{etoc@tocid}%
- \addtocontents{toc}
- {\string\etoc@startlocaltoc{\arabic{etoc@tocid}}}%
+ \addtocontents{toc}{\string\etoc@startlocaltoc{\arabic{etoc@tocid}}}%
\Etoc@tocwithidtrue
\futurelet\Etoc@nexttoken\Etoc@t@bleofcontents}
\let\etocaftertitlehook \@empty
@@ -599,8 +606,9 @@
\newcommand\etocsettocstyle[2]{%
\def\Etoc@tableofcontents
{%
- \ifnum\c@tocdepth>\Etoc@minf\else
- \expandafter\Etoc@gobbletoetoc@
+ \ifnum\c@tocdepth>\Etoc@minf
+ \else\expandafter
+ \Etoc@gobbletoetoc@ % skip all
\fi
\etocbeforetitlehook % 1.07m
\Etoc@storetocdepth % 1.07g
@@ -673,7 +681,7 @@
\def\etoctoclineleaders
{\hbox{\normalfont\normalsize\hb@xt@2ex {\hss.\hss}}}
\def\etocabbrevpagename {p.~}
-\def\etocpartname {\partname}
+\def\etocpartname {Part}% modified 1.08b
\def\etocbookname {Book}
\def\etocdefaultlines{\Etoc@standardfalse %
%% `book':
@@ -746,13 +754,13 @@
\vbox{\etocname~%
\leaders\box\z@\hfil\box\tw@
\baselineskip\etocbaselinespreadone\baselineskip
- \par}
+ \par}% 1.08b adds the % here
\else
\vbox{\etocname~%
\leaders\copy\z@\hfil\break
\hbox{}\leaders\box\z@\hfil\box\tw@
\baselineskip\etocbaselinespreadone\baselineskip
- \par}
+ \par}%
\fi
\endgroup}
{\addpenalty\@secpenalty\addvspace{\etocsepzero}}%
@@ -778,13 +786,13 @@
\vbox{\etocname~%
\leaders\box\z@\hfil\box\tw@
\baselineskip\etocbaselinespreadtwo\baselineskip
- \par}
+ \par}%
\else
\vbox{\etocname~%
\leaders\copy\z@\hfil\break
\hbox{}\leaders\box\z@\hfil\box\tw@
\baselineskip\etocbaselinespreadtwo\baselineskip
- \par}
+ \par}%
\fi
\endgroup}
{\addpenalty\@secpenalty\addvspace{\etocsepone}}%
@@ -818,10 +826,11 @@
\etocsettocstyle
{\let\etocoldpar\par
\addvspace{\etocabovetocskip}%
- \ifnum #1>\@ne\let\Etoc@next\@firstoftwo
- \else \let\Etoc@next\@secondoftwo\fi
- \Etoc@next{%
- \multicolpretolerance\etocmulticolpretolerance
+ \ifnum #1>\@ne
+ \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi
+ {\multicolpretolerance\etocmulticolpretolerance
\multicoltolerance\etocmulticoltolerance
\setlength{\columnsep}{\etoccolumnsep}%
\setlength{\multicolsep}{\etocmulticolsep}%
@@ -831,11 +840,15 @@
\fi
\nobreak\addvspace{\etocinnertopsep}%
\pretolerance\etocmulticolpretolerance
- \tolerance\etocmulticoltolerance}}
- {\ifnum #1>\@ne\let\Etoc@next\@firstofone
- \else \let\Etoc@next\@gobble\fi
- \Etoc@next{\end{multicols}}%
- \addvspace{\etocbelowtocskip}}}
+ \tolerance\etocmulticoltolerance}%
+ }%
+ {\ifnum #1>\@ne
+ \expandafter\@firstofone
+ \else \expandafter\@gobble
+ \fi
+ {\end{multicols}}%
+ \addvspace{\etocbelowtocskip}}%
+}
\def\etocinnerbottomsep{3.5ex}
\def\etocinnerleftsep{2em}
\def\etocinnerrightsep{2em}
@@ -857,9 +870,9 @@
\newcommand*\etocruledstyle[2][\etocdefaultnbcol]{%
\etocsettocstyle
{\addvspace{\etocabovetocskip}%
- \ifnum #1>\@ne\let\Etoc@next\@firstoftwo
- \else \let\Etoc@next\@secondoftwo\fi
- \Etoc@next
+ \ifnum #1>\@ne\expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi
{\multicolpretolerance\etocmulticolpretolerance
\multicoltolerance\etocmulticoltolerance
\setlength{\columnsep}{\etoccolumnsep}%
@@ -868,9 +881,10 @@
{\etoc@ruledheading{#2}%
\pretolerance\etocmulticolpretolerance
\tolerance\etocmulticoltolerance}}
- {\ifnum #1>\@ne\let\Etoc@next\@firstofone
- \else \let\Etoc@next\@gobble\fi
- \Etoc@next{\end{multicols}}%
+ {\ifnum #1>\@ne\expandafter\@firstofone
+ \else \expandafter\@gobble
+ \fi
+ {\end{multicols}}%
\addvspace{\etocbelowtocskip}}}
\def\etocframedmphook{\relax}
\long\def\etocbkgcolorcmd{\relax}
@@ -909,9 +923,9 @@
\hbox\bgroup
\begin{minipage}{\hsize}%
\etocframedmphook
- \ifnum #1>\@ne\let\Etoc@next\@firstoftwo
- \else \let\Etoc@next\@secondoftwo\fi
- \Etoc@next
+ \ifnum #1>\@ne\expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi
{\multicolpretolerance\etocmulticolpretolerance
\multicoltolerance\etocmulticoltolerance
\setlength{\columnsep}{\etoccolumnsep}%
@@ -919,9 +933,10 @@
\begin{multicols}{#1}}
{\pretolerance\etocmulticolpretolerance
\tolerance\etocmulticoltolerance}}
- {\ifnum #1>\@ne\let\Etoc@next\@firstofone
- \else \let\Etoc@next\@gobble\fi
- \Etoc@next{\end{multicols}\unskip}%
+ {\ifnum #1>\@ne\expandafter\@firstofone
+ \else \expandafter\@gobble
+ \fi
+ {\end{multicols}\unskip }%
\end{minipage}%
\egroup
\vskip\etocinnerbottomsep