summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/etoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-02-22 22:56:51 +0000
committerKarl Berry <karl@freefriends.org>2013-02-22 22:56:51 +0000
commit4abd94a3d5c1416292c8e8a7ba4121173b2410da (patch)
tree9b4df66d206d518f654b67054d44378ef1204f7d /Master/texmf-dist/source/latex/etoc
parent45cbe76d48e9ae9e5c8162ec6b496607265f282f (diff)
etoc (22feb13)
git-svn-id: svn://tug.org/texlive/trunk@29203 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/etoc')
-rw-r--r--Master/texmf-dist/source/latex/etoc/etoc.dtx378
-rw-r--r--Master/texmf-dist/source/latex/etoc/etoc.ins4
2 files changed, 279 insertions, 103 deletions
diff --git a/Master/texmf-dist/source/latex/etoc/etoc.dtx b/Master/texmf-dist/source/latex/etoc/etoc.dtx
index caeaf1038aa..afd0241d96a 100644
--- a/Master/texmf-dist/source/latex/etoc/etoc.dtx
+++ b/Master/texmf-dist/source/latex/etoc/etoc.dtx
@@ -1,8 +1,8 @@
% -*- coding: iso-latin-1; -*-
%<*ins>
\def\pkgname{etoc}
-\def\pkgdate{2013/02/02}
-\def\pkgversion{v1.07b}
+\def\pkgdate{2013/02/22}
+\def\pkgversion{v1.07c}
\def\pkgdescription{easily customizable TOCs (jfB)}
%</ins>
%%
@@ -10,8 +10,8 @@
%% Copyright (C) 2012, 2013 by Jean-Francois Burnol
%%
%<*none>
-\def\lasttimestamp{Time-stamp: <02-02-2013 10:50:15 CET jfb>}
-\def\docdate{2013/02/02}
+\def\lasttimestamp{Time-stamp: <22-02-2013 09:48:08 CET jfb>}
+\def\docdate{2013/02/22}
\def\striptimestamp#1 <#2 #3 #4 #5>{#2 at #3 #4}
\edef\dtxtimestamp{\expandafter\striptimestamp\lasttimestamp}
\ProvidesFile{\pkgname.dtx}
@@ -161,6 +161,40 @@ pdfpagemode=UseOutlines}
\etocsetlevel{dummychapter}{6}
\etocsetlevel{dummysection}{6}
%--------
+% add-on for the documentation of 2013/02/21:
+\makeatletter
+\newcommand*{\MyQuasiStandardTOC}[1]{%
+ \begingroup
+ \let\savedsectionline\l@section
+ \let\savedsubsectionline\l@subsection
+ \etocsetstyle{section}{}
+ {\ifnum\etocthenumber=3
+ \etocsetstyle{subsection}
+ {\par\nopagebreak\begingroup
+ \leftskip1.5em \rightskip\@tocrmarg
+ \parfillskip \@flushglue
+ \parindent 0pt
+ \normalfont\normalsize\rmfamily\itshape
+ % \columnsep1em
+ % \begin{minipage}{\dimexpr\linewidth-\leftskip-\rightskip\relax}%
+ % \begin{multicols}{2}%
+ \etocskipfirstprefix}
+ {\allowbreak\,--\,}
+ {\etocname\ \textup{(\etocnumber)}}
+ % {.\par\end{multicols}\end{minipage}\par\endgroup}%
+ {.\par\endgroup}%
+ \else
+ \etocsetstyle{subsection}{}{}
+ {\savedsubsectionline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ \fi}
+ {\savedsectionline
+ {\numberline{{\color{cyan}\etocthenumber}}\etocname}{\etocpage}}
+ {}%
+ \etocstandarddisplaystyle
+ \setcounter{tocdepth}{2}
+ \tableofcontents #1
+ \endgroup}
+\makeatother
\newcommand\toc{\cs{table\-of\-contents}\xspace}
@@ -171,9 +205,10 @@ pdfpagemode=UseOutlines}
\newcommand\etoc{%
\texorpdfstring{{\color{joli}\ttfamily\bfseries etoc}}{etoc}\xspace}
+
\hyphenation{toc-depth sec-num-depth etoc-framed-style etoc-ruled-style}
\hyphenation{etoc-toc-style-with-marks etoc-ruled etoc-framed}
-\hyphenation{etoc-standard-display-style}
+\hyphenation{etoc-stan-dard-display-style}
\frenchspacing
@@ -204,7 +239,7 @@ pdfpagemode=UseOutlines}
\emph{line styles} for each sectioning level used in the
document. The package provides its own custom line styles.
Simpler ones are given as examples in the documentation. The
- simplest usage will be to take advantage the layout facilities
+ simplest usage will be to take advantage of the layout facilities
of packages dealing with list environments.
The \cs{tableofcontents} command may be used arbitrarily
@@ -308,33 +343,38 @@ compatible with the |article|, |book|, |report|, |scrartcl|,
\begin{multicols}{2}
\begin{verbatim}
-v1.02 [2012/11/18]
+v1.07c [2013/02/22]
- initial version
+ minor code changes and new documentation section
+ "Another compatibility mode".
-v1.04 [2012/11/24]
+v1.07b [2013/02/02]
- a (possibly local) table of contents can be labeled:
-
- \tableofcontents \label{toc:1}
+ decision is made to remove the \xspace from the
+ macros \etocname, \etocnumber, \etocpage.
- and reproduced elsewhere in the document (with a possibly
- completely different layout):
-
- \tableofcontents \ref{toc:1}
+ additional examples in the documentation.
-v1.05 [2012/12/01]
+v1.07 [2013/01/29]
- \localtableofcontents replaces \tableofcontents* (for
- compatibility with the memoir class)
+ new commands:
- compatibility with KOMA-script and memoir document
- classes.
+ \etocthename, \etocthenumber, \etocthepage, \etoclink,
+ \etoctoccontentsline, \etoctoccontentsline*
-v1.06 [2012/12/07]
+ \etocnopar, \etocaftercontentshook
+
+ modified command: \etocmulticolstyle
+
+ new documentation section `surprising uses of etoc' which
+ explains how to do `lists of arbitrary things', in
+ addition to the tables of contents.
+
+
+~v1.06 [2012/12/07]
the standard macros \l@section etc... are modified only
during the calls to \tableofcontents; they can thus be
@@ -343,35 +383,36 @@ v1.06 [2012/12/07]
by etoc for the TOCs typeset in compatibility mode.
-v1.07 [2013/01/29]
-
- new commands:
+v1.05 [2012/12/01]
- \etocthename, \etocthenumber, \etocthepage, \etoclink,
+ \localtableofcontents replaces \tableofcontents* (for
+ compatibility with the memoir class).
- \etoctoccontentsline, \etoctoccontentsline*
+ compatibility with KOMA-script and memoir document
+ classes.
- \etocnopar, \etocaftercontentshook
- modified command: \etocmulticolstyle
+v1.04 [2012/11/24]
- new documentation section `surprising uses of etoc' which
- explains how to do `lists of arbitrary things', in
- addition to the tables of contents.
+ a (possibly local) table of contents can be labeled:
+
+ \tableofcontents \label{toc:1}
-v1.07b [2013/02/02]
+ and reproduced elsewhere in the document (with a possibly
+ completely different layout):
+
+ \tableofcontents \ref{toc:1}
- decision is made to remove the \xspace from the
- macros \etocname, \etocnumber, \etocpage.
+
+v1.02 [2012/11/18]
- additional examples in the documentation.
+ initial version.
\end{verbatim}
\end{multicols}
\endgroup
\setcounter{tocdepth}{3}
-% \errorcontextlines5
\etoctoclines
\etocmarkboth\contentsname
@@ -382,7 +423,7 @@ v1.07b [2013/02/02]
\tableofcontents \label{toc:main}
-\part{Overview}
+\part{Overview}\label{part:one}
\setcounter{tocdepth}{-3}
\localtableofcontents \label{toc:partone}
@@ -487,7 +528,7 @@ entry of that type is found,} and 4) \emph{the last argument is the
code to execute when a division unit of higher importance is
again hit upon.}
-\subsection{Compatibility mode}
+\subsection{Compatibility mode}\label{ssub:compat}
Both for the ``line styles'' and the ``toc display style'', it is
possible to switch into a compatibility mode which uses the
@@ -521,6 +562,7 @@ their scope was not limited to a group or environment). The
command \csb{etocdefaultlines} resets the line styles to be
the package initial default ones.
+
\section{Arbitrarily many TOCs, and local ones too}
\etoc allows arbitrarily many \cs{tableofcontents} commands in
@@ -1006,12 +1048,32 @@ us explain how to instruct \etoc to display an hyperlinked list
of all these exercises. For this we put in the preamble:
\begin{verbatim}
\newtheorem{exerci}{}[section]
- % the exercice number will be recoverable with \etocname: v--------v
+ % the exercice number will be recoverable via \etocname: v--here--v
\newcommand*{\exercisetotoc}{\etoctoccontentsline{exercise}{\theexerci}}
\newenvironment{exercise}{\begin{exerci}\exercisetotoc}{\end{exerci}}
\etocsetlevel{exercise}{6}
\end{verbatim}
-The above was motivated by question |94766| on the
+In this way, \cs{etocname} will give the exercise number (but \cs{etocnumber}
+will be empty). Had we used instead
+\begin{verbatim}
+ \newcommand*{\exercisetotoc}
+ {\etoctoccontentsline{exercise}{\protect\numberline{\theexerci}}}
+\end{verbatim}
+the exercise number would then have been available via \cs{etocnumber}, and
+\cs{etocname} would have been empty. It doesn't matter which one of the two
+methods is used. The \etoc command \cs{etoctoccontentsline}|{..}{..}| is
+provided as a substitute to \cs{addcon\-tentsline}|{toc}{..}{..}|: this is to
+avoid the patching which is done by |hyperref| to \cs{addcontentsline} in its
+process of creation of bookmarks. If one wants to authorize |hyperref| to create
+bookmarks at a specific level \meta{n}, one can use (here with \meta{n}$=$|2|)
+the starred variant \starit{etoctoccontentsline} which has an additional
+argument:
+\begin{verbatim}
+\newcommand{\exercisetotoc}{\etoctoccontentsline*{exercise}{\theexerci}{2}}
+\end{verbatim}
+
+
+This example originates with question |94766| on the
\TeX-StackExchange site. The counter |exerci| is already
incremented by the |exerci| theorem environment, and
provides the correct destination for the link added by package
@@ -1022,11 +1084,11 @@ four-column list, including the sections, can then be
typeset with the following code:
\begin{verbatim}
\begingroup
- \setcounter{tocdepth}{2} % section is at level 1
- \etocsetlevel{exercise}{2}
- \etocsetlevel{chapter}{3} % no chapters
- \etocsetlevel{subsection}{3} % no subsections
- \etocsetlevel{part}{3} % no parts
+ \setcounter{tocdepth}{2} % we keep the sections which are at level 1
+ \etocsetlevel{exercise}{2} % so this will show up, but:
+ \etocsetlevel{chapter}{3} % no chapters
+ \etocsetlevel{subsection}{3} % no subsections
+ \etocsetlevel{part}{3} % no parts
\etocsetstyle{exercise}{}{} % \etocname = exercise number
{\noindent\etocname\strut\leaders\etoctoclineleaders\hfill\etocpage\par}
{\pagebreak[2]\vskip\baselineskip}
@@ -1040,14 +1102,6 @@ typeset with the following code:
\end{verbatim}
-We used \cs{etoctoccontentsline} and not
-\cs{addcontentsline}|{toc}{..}{..}| as we didn't want to have bookmark
-creation done by |hyperref|. To allow creation of bookmarks at
-the specific level \meta{n}, one can use (here with \meta{n}$=$|2|):
-\begin{verbatim}
- \newcommand{\exercisetotoc}{\etoctoccontentsline*{exercise}{\theexerci}{2}}
-\end{verbatim}
-
In the above, recall that \LaTeX{} counters are global. The
current |tocdepth| value is |2|, and if not reset it will prevent
|hyperref| to assign bookmarks to sub-subsections (level |3|).
@@ -1080,7 +1134,7 @@ displayed the table of contents following:
\setcounter{tocdepth}{1}
\end{verbatim}
-\clearpage
+% \clearpage
\begingroup
@@ -1131,10 +1185,10 @@ displayed the table of contents following:
\makeatletter
\etocsetstyle{dummysection}
{\setbox\forsectionnumbers=\hbox to .1\linewidth
- \bgroup\hss\etocskipfirstprefix}
+ \bgroup\color@begingroup\hss\etocskipfirstprefix}
{\@gobble}
{\etocnumber---}
- {\etocnumber\egroup
+ {\etocnumber\color@endgroup\egroup
% for reasons I do not quite understand, in some pdf viewers the dots
% do not completely disappear if here \fboxsep0pt is used.
\fboxsep=.5pt\colorbox{white}{\box\forsectionnumbers}\par
@@ -1156,9 +1210,9 @@ displayed the table of contents following:
}
\setcounter{tocdepth}{1}
- \leavevmode\vfill
+ \leavevmode\vfil
\tableofcontents
- \vfill\clearpage
+ \vfil\clearpage
\makeatletter
\def\adddummysection {\stepcounter{dummysection}%
@@ -1321,6 +1375,124 @@ displayed the table of contents following:
\repeat
\endgroup
+\subsection{Another compatibility mode}
+
+As explained in the section \ref{ssub:compat}, the commands
+\cs{etocstandardlines} and \cs{etocstandarddisplaystyle} tell \etoc to,
+essentially, act as an observer. The document class layout for the table of
+contents is then perfectly obeyed. There is no way to customize this standard
+layout (change fonts, margins, vertical spacings, etc...) from within the
+package. For this, use some package dedicated to this task; because \etoc either
+is (temporarily perhaps) in compatibility mode with no customization on its part
+possible, or the user has specified the layout in \cs{etocsetstyle} commands
+(and \cs{etocsettocstyle}) and is (supposedly...) in complete control.
+
+Well, there is actually an alternative. It is possible to use the
+\cs{etocsetstyle} commands to recreate an artificial compatibility mode, in
+order to achieve effects like the following, all things being otherwise equal to
+the document class defaults:
+\begin{enumerate}[noitemsep]
+\item get the |hyperref| link to encapsulate only the names, but not the numbers
+ of each entry of the table of contents,
+\item use the document class style for chapters and sections, but modify it only
+ for subsections,
+\item do either of the above only for some portions of the table of contents.
+\end{enumerate}
+
+Here is how to proceed. One puts in the preamble:
+\begingroup
+\def\MacroFont{\small\ttfamily\baselineskip11pt\relax}
+\begin{verbatim}
+\makeatletter
+\newcommand{\MyStandardTOC}{%
+ \begingroup
+ \let\savedpartline\l@part
+ \let\savedchapterline\l@chapter %% remove if article/scrartcl class
+ \let\savedsectionline\l@section
+ \let\savedsubsectionline\l@subsection
+ % and so on if \subsubsection, etc... is used
+ %
+ % for the book or article classes:
+ \etocsetstyle{part}{}{}
+ {\savedpartline{\etocnumber\hspace{1em}\etocname}{\etocpage}}{}%
+ % for the scrbook or scrartcl classes:
+ \etocsetstyle{part}{}{}
+ {\savedpartline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ % identical in book/article/scrbook/scrartcl classes:
+ \etocsetstyle{chapter}{}{} %%% only for book and scrbook
+ {\savedchapterline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ \etocsetstyle{section}{}{}
+ {\savedsectionline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ \etocsetstyle{subsection}{}{}
+ {\savedsubsectionline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ % etc... if further sectioning units are used
+ % (see the text for what to do with the memoir class)
+ \etocstandarddisplaystyle % this is for the title, page-marks, etc...
+ \tableofcontents
+ \endgroup}
+\makeatother
+\end{verbatim}
+Of course if the document has only one table of contents then there is no need
+to put the commands inside a macro, or even inside a group. With these commands
+\etoc will construct a TOC completely identical to what would have been done by
+one of the document class: |article|, |book|, |scrartcl|, |scrbook|. For the
+|memoir| class, one needs a bit more: each of the command \cs{booknumberline},
+\cs{partnumberline} and \cs{chapternumberline} will have to be saved with a
+\cs{let}, and, one then specifies (analogously for |part| and |book|):
+\begin{verbatim}
+\etocsetstyle{chapter}{}{}{\savedchapterline{\savedchapternumberline
+ {\etocnumber}\etocname}{\etocpage}}{}%
+\end{verbatim}
+The number and the name of each entry are each separately an |hyperref| link, as
+is always the case with \etoc, when not in compatibility mode. Replacing
+\cs{etocnumber} with \cs{etocthenumber} will give a TOC where the numbers are
+not links anymore, but the names still are.
+
+Here is a subtler example where one only marginally modifies the
+sections (adding color to the number and removing the |hyperref| link) and keeps
+the subsections as in the default, \emph{except} for those of one specific
+section, for which the layout is completely modified:
+\MyQuasiStandardTOC{\ref{toc:partone}}
+\bigskip
+This example only has sections and subsections, and the code used in \cs{MyStandardTOC} was:
+\begin{verbatim}
+\etocsetstyle{section}{}
+ {\ifnum\etocthenumber=3
+ \etocsetstyle{subsection}
+ {\par\nopagebreak\begingroup
+ \leftskip1.5em \rightskip\@tocrmarg \parfillskip\@flushglue
+ \parindent 0pt \normalfont\normalsize\rmfamily\itshape
+ % \columnsep1em
+ % \begin{minipage}{\dimexpr\linewidth-\leftskip-\rightskip\relax}%
+ % \begin{multicols}{2}%
+ \etocskipfirstprefix}
+ {\allowbreak\,--\,}
+ {\etocname\ \textup{(\etocnumber)}}
+ {.\par\endgroup}%
+ % {.\par\end{multicols}\end{minipage}\par\endgroup}%
+ \else
+ \etocsetstyle{subsection}
+ {}{}
+ {\savedsubsectionline{\numberline{\etocnumber}\etocname}{\etocpage}}
+ {}%
+ \fi}
+ {\savedsectionline{\numberline{{\color{cyan}\etocthenumber}}\etocname}{\etocpage}}
+ {}%
+\end{verbatim}
+\endgroup
+
+Notice the
+page head-mark added by this standard TOC. Sections and subsections are printed
+exactly as in the default (except for the subsections of one specific
+user-chosen section), with no need to specify explicitely any length, font or
+other formatting instructions. But we had to examine the |scrartcl| sources
+to determine what to use for \cs{leftskip} and \cs{rightskip} for our customized
+subsection entries.
+
+Also, a fancier layout has been commented out.
+
+
+%\clearpage
\part{Package commands for line styles}
\setcounter{tocdepth}{3}
@@ -1493,7 +1665,7 @@ without needing an added |\protect|.
The \cs{fbox} would give an unaesthetic result in the case of
an unnumbered section (which ended up in the table of
contents via an \cs{addcontentsline} command).\footnote{as
- seen below we use \cs{fcolorbox} rather than \cs{fbox}. Due
+ seen we use \cs{fcolorbox} rather than \cs{fbox}. Due
to some redefinition made by package |xcolor|, had we used
\cs{fbox} (and not used |hyperref|) we would have needed
\cs{protect}\cs{fbox}.}
@@ -1679,7 +1851,6 @@ the other one with the style we defined in the previous part
on the basis of enumerate environments.
\begin{verbatim}
-\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\end{verbatim}
@@ -1714,7 +1885,7 @@ provided by the document class, and a two-column layout:
\hyperref[toc:test]{\color{niceone}the next TOC} it
contains paragraph entries.}}
-\clearpage
+% \clearpage
\tableofcontents
@@ -2046,13 +2217,13 @@ beginning of this part \ref{part:globalcmds}.
We now opt for a ``framed'' style, using the package default
line styles and some colors added.
-\clearpage
+% \clearpage
\etocdefaultlines
\begingroup
-\renewcommand{\etoccolumnsep}{3em}
-\renewcommand{\etocinnerleftsep}{2em}
-\renewcommand{\etocinnerrightsep}{2em}
+\renewcommand{\etoccolumnsep}{2em}
+\renewcommand{\etocinnerleftsep}{1.5em}
+\renewcommand{\etocinnerrightsep}{1.5em}
% specify a background color for the toc contents
\renewcommand{\etocbkgcolorcmd}{\color{yellow!10}}
% set up the top and bottom rules
@@ -2082,9 +2253,9 @@ line styles and some colors added.
\begin{verbatim}
\etocdefaultlines
\begingroup % we use a group to limit the scope of the next commands
-\renewcommand{\etoccolumnsep}{3em}
-\renewcommand{\etocinnerleftsep}{2em}
-\renewcommand{\etocinnerrightsep}{2em}
+\renewcommand{\etoccolumnsep}{2em}
+\renewcommand{\etocinnerleftsep}{1.5em}
+\renewcommand{\etocinnerrightsep}{1.5em}
% specify a background color for the toc contents
\renewcommand{\etocbkgcolorcmd}{\color{yellow!10}}
%\renewcommand{\etocbkgcolorcmd}{\relax}
@@ -2120,6 +2291,7 @@ contents of this entire document. We will typeset the subsections as
footnotes... This kind of style is suitable for a hyperlinked
document, not for print!
+\vfil
\begingroup
\setcounter{tocdepth}{3}
@@ -2137,6 +2309,9 @@ document, not for print!
\tableofcontents
\endgroup
+\vfil
+
+\clearpage And the code which was used:
\begin{verbatim}
\begingroup
\setcounter{tocdepth}{3}
@@ -2177,15 +2352,14 @@ document, not for print!
\subsection{Setting up local styles}
\hbox{\color{green}\fboxrule1pt\fboxsep1em
-\setbox0\hbox{\cs{etocname}, \cs{etocnumber}, \cs{etocpage},
-\cs{etocifnumbered}\marg{A}\marg{B}}%
+\setbox0\hbox{\cs{etocthename}, \cs{etocthenumber}, \cs{etocthepage}, \cs{etoclink}\marg{linkname}}%
\framebox[\linewidth][c]
{\vbox{\hsize\wd0\normalcolor\noindent
\cs{etocsetstyle}\marg{levelname}%
\marg{start}\marg{prefix}\marg{contents}\marg{finish}\\
\cs{etocname}, \cs{etocnumber}, \cs{etocpage},
\cs{etocifnumbered}\marg{A}\marg{B}\\
-\cs{etocthename}, \cs{etocthenumber}, \cs{etocthepage}, \cs{etoclink}
+\cs{etocthename}, \cs{etocthenumber}, \cs{etocthepage}, \cs{etoclink}\marg{linkname}
}}}
\subsection{Setting up toc display styles}
@@ -2643,7 +2817,7 @@ label=,leftmargin=0pt]}
\subsection{Compatibility with other packages}
-\etoc uses the packages |multicol|.\footnote{\protect\fbox{up to version
+\etoc loads the package |multicol|.\footnote{\protect\fbox{up to version
\texttt{1.07a} it also used package \texttt{xspace}, and but this
has been removed.}} It is
|hyperref| aware and hopefully |hyperref| compatible! It
@@ -2711,22 +2885,22 @@ groups. All TOCs are typeset inside groups.
make sure that all levels needed for the next table of
contents are mutually compatible.
- When using multiple \toc commands in a document, one should
- beware from adding typesetting instructions directly in the
- |.toc| file, as they will be executed by \etoc for all TOCs:
- even for a \localtoc it doesn't matter if that instruction
- seems to concern material outside of its scope, it will get
- executed nevertheless. If absolutely necessary these
- instructions should be done in such a way that they can be
- activated or deactivated easily from the document source, as
- need be.
-
- Do not clone a clone but produce rather twins by cloning the
- same original local table of contents.
-
- As is usual with toc and labels, after each change, one has
- to run latex a certain number of times to let the produced
- document get its final appearance (at least twice).\par
+ % When using multiple \toc commands in a document, one should
+ % beware from adding typesetting instructions directly in the
+ % |.toc| file, as they will be executed by \etoc for all TOCs:
+ % even for a \localtoc it doesn't matter if that instruction
+ % seems to concern material outside of its scope, it will get
+ % executed nevertheless. If absolutely necessary these
+ % instructions should be done in such a way that they can be
+ % activated or deactivated easily from the document source, as
+ % need be.
+
+ % Do not clone a clone but produce rather twins by cloning the
+ % same original local table of contents.
+
+ % As is usual with toc and labels, after each change, one has
+ % to run latex a certain number of times to let the produced
+ % document get its final appearance (at least twice).\par
\end{small}
@@ -2954,14 +3128,20 @@ release.
% \begin{macrocode}
\AtBeginDocument{%
\@ifpackageloaded{hyperref}{\Etoc@hyperreftrue
- \def\Etoc@et@hop#1#2#3#4#5{#1{#3}{#4}{#5}#2}}
+ \def\Etoc@et@hop#1#2#3#4#5{#1{#3}{#4}{#5}#2}%
+ \long\def\Etoc@gobblesixorfive#1#2#3#4#5#6{}}
{\Etoc@hyperreffalse
- \def\Etoc@et@hop#1#2#3#4{#1{#3}{#4}#2}}}
- \def\Etoc@swa#1{%
+ \def\Etoc@et@hop#1#2#3#4{#1{#3}{#4}#2}%
+ \long\def\Etoc@gobblesixorfive#1#2#3#4#5{}}%
+}
+% \end{macrocode}
+% placeholder for comments
+% \begin{macrocode}
+\def\Etoc@swa#1{%
\Etoc@et@hop
{\Etoc@savedcontentsline{#1}}
{\Etoc@prefix\Etoc@contents}}
- \def\Etoc@swb#1{%
+\def\Etoc@swb#1{%
\Etoc@et@hop
{\Etoc@savedcontentsline{#1}}
{\Etoc@contents}}
@@ -2972,11 +3152,7 @@ release.
\def\Etoc@etoccontentsline#1{%
\global\expandafter\let\expandafter\Etoc@tmp\csname Etoc@#1@@\endcsname
\Etoc@skipthisonefalse
- \ifEtoc@hyperref
- \def\Etoc@next{\expandafter\@gobbletwo\@gobblefour}%
- \else
- \def\Etoc@next{\expandafter\@gobble\@gobblefour}%
- \fi
+ \let\Etoc@next\Etoc@gobblesixorfive
\ifnum\Etoc@tmp=\Etoc@@six@@
\Etoc@skipthisonetrue
\else
@@ -3521,11 +3697,11 @@ release.
{\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}%
\advance\dimen\z@\wd\tw@
\ifdim\dimen\z@ < \linewidth
- \vbox{\etocname~% modified in 1.07b (after removal of \xspace)
+ \vbox{\etocname~%
\leaders\box\z@\hfil\box\tw@
\baselineskip\etocbaselinespreadone\baselineskip\par}
\else
- \vbox{\etocname~% modified in 1.07b
+ \vbox{\etocname~%
\leaders\copy\z@\hfil\break
\hbox{}\leaders\box\z@\hfil\box\tw@
\baselineskip\etocbaselinespreadone\baselineskip\par}
@@ -3993,7 +4169,7 @@ release.
Grave accent \` Left brace \{ Vertical bar \|
Right brace \} Tilde \~}
-\CheckSum{2554}
+\CheckSum{2549}
\Finale
%%
diff --git a/Master/texmf-dist/source/latex/etoc/etoc.ins b/Master/texmf-dist/source/latex/etoc/etoc.ins
index 0980e42b7af..c3922595c6f 100644
--- a/Master/texmf-dist/source/latex/etoc/etoc.ins
+++ b/Master/texmf-dist/source/latex/etoc/etoc.ins
@@ -1,6 +1,6 @@
\def\pkgname{etoc}
-\def\pkgdate{2013/02/02}
-\def\pkgversion{v1.07b}
+\def\pkgdate{2013/02/22}
+\def\pkgversion{v1.07c}
\def\pkgdescription{easily customizable TOCs (jfB)}
%%
%% Package `etoc' by Jean-Francois Burnol