texlive[45380] Master/texmf-dist: etoc (22sep17)

commits+karl at tug.org commits+karl at tug.org
Sat Sep 23 00:54:02 CEST 2017


Revision: 45380
          http://tug.org/svn/texlive?view=revision&revision=45380
Author:   karl
Date:     2017-09-23 00:54:01 +0200 (Sat, 23 Sep 2017)
Log Message:
-----------
etoc (22sep17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/etoc/README.md
    trunk/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf
    trunk/Master/texmf-dist/doc/latex/etoc/etoc.pdf
    trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx
    trunk/Master/texmf-dist/source/latex/etoc/etoc.ins
    trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty

Modified: trunk/Master/texmf-dist/doc/latex/etoc/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/README.md	2017-09-22 22:53:46 UTC (rev 45379)
+++ trunk/Master/texmf-dist/doc/latex/etoc/README.md	2017-09-22 22:54:01 UTC (rev 45380)
@@ -1,12 +1,12 @@
 <!-- -->
 
-    Source:  etoc.dtx (v1.08i-2016/09/29)
+    Source:  etoc.dtx (v1.08j-2017/09/21)
     Author:  Jean-Francois Burnol
     Author:  Christine Roemer et al. (German tranlation)
     Info:    Completely customisable TOCs
     License: LPPL 1.3c
-    Copyright (C) 2012-2016 Jean-Francois Burnol.
-    Copyright (C) 2014-2016 Christine Roemer and collaborators for
+    Copyright (C) 2012-2017 Jean-Francois Burnol.
+    Copyright (C) 2014-2017 Christine Roemer and collaborators for
     the translation into German of the documentation.
     <jfbu at free dot fr>    <Christine_Roemer at t-online dot de>
 
@@ -116,6 +116,27 @@
 RECENT CHANGES
 ==============
 
+v1.08j \[2017/09/21\]
+---------------------
+
+Since `1.08a-2015/03/13` `\etocname`, `\etocnumber`, `\etocpage`
+contain, if hyperref is present and configured for using
+hyperlinks in the TOC, the link destination in already expanded
+form. This means one can use them even if the style closes a
+group (for example from a `&` in a tabular), if `\etocglobaldefs`
+was issued; also one can save their meaning for delayed usage
+(with for example `\LetLtxMacro` as they are robust).
+
+But for some legacy reason `\etoclink`, contrarily to
+`\etocthelink`, was handled differently. Now, `\etoclink` also
+contains the link destination in already expanded form, and can
+thus be used even if the line style issues a `&`, as long as
+`\etocglobaldefs` is issued.
+
+Also, bugs dating back to the early days of the package, but
+surfacing only under relatively rare conditions such as usage
+of hyperref with its option "linktoc=page" got fixed.
+
 v1.08i \[2016/09/29\]
 ---------------------
 
@@ -158,48 +179,7 @@
 section with the (approximate) translation into etoc lingua of the
 book class toc style, for easy customizability.
 
-v1.08g \[2015/08/29\]
----------------------
+The latest translation into German of the additions made to the
+documentation dates back to v1.08d \[2015/04/09\].
 
-Downgraded to a mere info message the etoc-issued warning
-(relative to `\settocdepth/\maxtocdepth`) under class `memoir`.
-
-v1.08f \[2015/04/28\]
----------------------
-
-Minor changes to the documentation. `\etocsetlevel` more economical.
-
-v1.08e \[2015/04/17\]
----------------------
-
-The command `\etocchecksemptiness` tells etoc to not print, from
-that point on, the headings of the local tables of contents if
-they have empty contents. This is mainly for class authors who
-might want to have their `\section` or `\chapter` automatically do
-a `\localtableofcontents`. Could prove also useful for batch
-conversions of documents. Thanks to Paul Gaborit who asked for
-such a feature.
-
-The command `\etocnotocifnotoc` extends this behaviour to global
-TOCs: indeed why should documents with no sectioning units take
-this as an excuse not to use package etoc ?
-
-The command `\etocifwasempty{yes}{no}` can be used for
-suitable extra action.
-
-A `\tableofcontents\ref{foo}` now expects foo to be a label to a
-_local_ TOC. The use with foo a label to a _global_ TOC is not
-supported anymore as it had no utility and made the code more
-complex.
-
-The syntax `\localtableofcontents\ref{foo}` is now accepted as a
-synonym to the earlier syntax `\tableofcontents\ref{foo}`.
-
-v1.08d \[2015/04/09\]
----------------------
-
-Translation into German of the additions made to the documentation
-for the 1.08x series of releases.
-
 Thanks to Christine Römer!
-

Modified: trunk/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/etoc/etoc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx	2017-09-22 22:53:46 UTC (rev 45379)
+++ trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx	2017-09-22 22:54:01 UTC (rev 45380)
@@ -2,29 +2,29 @@
 % N.B.: this dtx file is NOT for use with \DocInput. The latex source of the
 % user manual is not prefixed with percent signs.
 %<*none>
-\def\etocdtxtimestamp {Time-stamp: <29-09-2016 at 11:13:23 CEST>}%
+\def\etocdtxtimestamp {Time-stamp: <21-09-2017 at 19:38:23 CEST>}%
 %</none>
 %<*!readme>
 %%
 %% Package: etoc
-%% Version: 1.08i-2016/09/29
+%% Version: 1.08j-2017/09/21
 %% License: LPPL 1.3c
-%% Copyright (C) 2012-2016 Jean-Francois Burnol
+%% Copyright (C) 2012-2017 Jean-Francois Burnol
 %%                         <jfbu at free dot fr>
-%% Copyright (C) 2014-2016 Christine Roemer
+%% Copyright (C) 2014-2017 Christine Roemer
 %%                         <Christine_Roemer at t-online dot de>
 %% and collaborators for the translation into German of the documentation
 %%
 %</!readme>
 %<*insfile>
-\def\etocpkgdate        {2016/09/29}
-\def\etocdocdate        {2016/09/29}
-\def\etocpkgversion     {v1.08i}
+\def\etocpkgdate        {2017/09/21}
+\def\etocdocdate        {2017/09/21}
+\def\etocpkgversion     {v1.08j}
 \def\etocpkgdescription {Completely customisable TOCs (JFB)}
 %</insfile>
 %<*none>
-\def\etocDEpkgdate      {29.09.2016}
-\def\etocDEdocdate      {29.09.2016}
+\def\etocDEpkgdate      {21.09.2017}
+\def\etocDEdocdate      {21.09.2017}
 \def\etocDEDEdocdate    {09.04.2015}%
 \def\etocDEDEpkgversion {v1.08d}%
 % Definition of \etocLicense
@@ -35,10 +35,10 @@
     \catcode32=13\catcode`\\=12^^Brelax^^A
 ^^Bfirstofone{^^Bendgroup^^Bdef^^BetocLicense^^A
 {% Package: etoc
-% Version: 1.08i-2016/09/29
+% Version: 1.08j-2017/09/21
 % License: LPPL 1.3c
-% Copyright (C) 2012-2016 Jean-Francois Burnol <jfbu at free dot fr>
-% Copyright (C) 2014-2016 Christine Roemer <Christine_Roemer at t-online dot de>
+% Copyright (C) 2012-2017 Jean-Francois Burnol <jfbu at free dot fr>
+% Copyright (C) 2014-2017 Christine Roemer <Christine_Roemer at t-online dot de>
 % and collaborators for the translation into German of the documentation
 %
 %     This Work may be distributed and/or modified under the
@@ -69,13 +69,13 @@
 %<*readme>
 <!-- -->
 
-    Source:  etoc.dtx (v1.08i-2016/09/29)
+    Source:  etoc.dtx (v1.08j-2017/09/21)
     Author:  Jean-Francois Burnol
     Author:  Christine Roemer et al. (German tranlation)
     Info:    Completely customisable TOCs
     License: LPPL 1.3c
-    Copyright (C) 2012-2016 Jean-Francois Burnol.
-    Copyright (C) 2014-2016 Christine Roemer and collaborators for
+    Copyright (C) 2012-2017 Jean-Francois Burnol.
+    Copyright (C) 2014-2017 Christine Roemer and collaborators for
     the translation into German of the documentation.
     <jfbu at free dot fr>    <Christine_Roemer at t-online dot de>
 
@@ -185,6 +185,28 @@
 RECENT CHANGES
 ==============
 
+v1.08j \[2017/09/21\]
+---------------------
+
+Since `1.08a-2015/03/13` `\etocname`, `\etocnumber`, `\etocpage`
+contain, if hyperref is present and configured for using
+hyperlinks in the TOC, the link destination in already expanded
+form. This means one can use them even if the style closes a
+group (for example from a `&` in a tabular), if `\etocglobaldefs`
+was issued; also one can save their meaning for delayed usage
+(with for example `\LetLtxMacro` as they are robust).
+
+But for some legacy reason `\etoclink`, contrarily to
+`\etocthelink`, was handled differently. Now, `\etoclink` also
+contains the link destination in already expanded form, and can
+thus be used even if the line style issues a `&`, as long as
+`\etocglobaldefs` is issued.
+
+Also, bugs dating back to the early days of the package, but
+surfacing only under relatively rare conditions such as usage
+of hyperref with its option "linktoc=page" got fixed.
+
+
 v1.08i \[2016/09/29\]
 ---------------------
 
@@ -229,52 +251,10 @@
 book class toc style, for easy customizability.
 
 
-v1.08g \[2015/08/29\]
----------------------
+The latest translation into German of the additions made to the
+documentation dates back to v1.08d \[2015/04/09\].
 
-Downgraded to a mere info message the etoc-issued warning
-(relative to `\settocdepth/\maxtocdepth`) under class `memoir`.
-
-
-v1.08f \[2015/04/28\]
----------------------
-
-Minor changes to the documentation. `\etocsetlevel` more economical.
-
-v1.08e \[2015/04/17\]
----------------------
-
-The command `\etocchecksemptiness` tells etoc to not print, from
-that point on, the headings of the local tables of contents if
-they have empty contents. This is mainly for class authors who
-might want to have their `\section` or `\chapter` automatically do
-a `\localtableofcontents`. Could prove also useful for batch
-conversions of documents. Thanks to Paul Gaborit who asked for
-such a feature.
-
-The command `\etocnotocifnotoc` extends this behaviour to global
-TOCs: indeed why should documents with no sectioning units take
-this as an excuse not to use package etoc ?
-
-The command `\etocifwasempty{yes}{no}` can be used for
-suitable extra action.
-
-A `\tableofcontents\ref{foo}` now expects foo to be a label to a
-_local_ TOC. The use with foo a label to a _global_ TOC is not
-supported anymore as it had no utility and made the code more
-complex.
-
-The syntax `\localtableofcontents\ref{foo}` is now accepted as a
-synonym to the earlier syntax `\tableofcontents\ref{foo}`.
-
-v1.08d \[2015/04/09\]
----------------------
-
-Translation into German of the additions made to the documentation
-for the 1.08x series of releases.
-
 Thanks to Christine Römer!
-
 %</readme>
 %<*tex>-------------------------------------------------------------------------
 %% run pdflatex thrice on this file etoc.tex to produce the documentation
@@ -1298,7 +1278,7 @@
 % 39 hard coded mais je pourrais aussi le calculer
 % pour version rectangulaire, par tâtonnements:
         level 2/.append style={level width=21cm,level height=30cm, sibling
-          distance=2.37cm},% was 2.57cm
+          distance=2.31cm},% je passe à 2.29cm par tatons après ajout section 1.09j
                    ]
 \the\treetok
 \end{tikzpicture}}\endgroup }
@@ -2197,6 +2177,7 @@
 
 \subsection{The \csbhyp{etocchecksemptiness} command}
 \label{etocchecksemptiness}
+\label{etocdoesnotcheckemptiness}
 
 The user needs to issue \csb{etocchecksemptiness} to tell \etoc to check whether
 local tables of contents are empty and in case of emptiness to print nothing
@@ -2214,9 +2195,8 @@
 the |.toc| file. See \autoref{sec:addingtotoc} in this context.
 \begin{enumerate}
 \item the \csb{etocifwasempty} command discussed below can be used from inside
-\csb{etocaftertochook}.
-\item there is no \csa{etocdoesnotcheckemptiness} but if there was one
-it would do |\makeatletter\Etoc at checksemptinessfalse\makeatother|.
+\csb{etocaftertochook}, and even from inside \csb{etocbeforetitlehook}.
+\item there is also \csa{etocdoesnotcheckemptiness} (since |1.08i|.)
 \end{enumerate}
 
 The suppression of the heading (more precisely of the toc display style
@@ -4348,7 +4328,6 @@
 numeric context, or change its formatting. This is provided by
 \csb{etocthename}, \csb{etocthenumber}, and \csb{etocthepage}.
 
-
 These commands are not protected, so in moving argument
 contexts (for example in a label specification) they should be
 preceded by |\protect|.
@@ -4370,7 +4349,9 @@
 either, but |\etoclink{\etocthepage}| does. 
 
 
-The command \csa{etoclink} is robust.
+The command \csa{etoclink} is robust. Since |etoc 1.08j| it contains the link
+destination in an already expanded form, so for example can be used even after
+a |&| in a tabular construction, if \csb{etocglobaldefs} was issued.
 
 \subsection{The \csbhyp{etocthelinkedname}, \csbhyp{etocthelinkednumber},
 \csbhyp{etocthelinkedpage} and \csbhyp{etocthelink} commands}
@@ -4380,33 +4361,23 @@
 \label{etocthelink}
 
 
-This is for advanced uses by advanced users. 
-The \csa{etocthename} macro has
-been mentioned before; using it in instructions such as
-|\global\let\lastone\etocthename| in an \etoc line style will
-define the macro |\lastone| to expand to the last name seen at the
-corresponding level.
+These macros are fragile and contain the link destination in already expanded
+form. So their meaning can be stored for delayed usage. For example this is
+done here when doing the \hyperref[tocastree]{examples with trees}.
 
-% But no facilities was previously available to
-% do the same with the link data.
+Notice though that for example \csa{etocthelinkednumber} is really a link only
+if |hyperref| was configured to let the numbered heading be linked (which is
+the default). Similarly for the others.
 
-The package provides since |1.07f 2013/03/07| \csa{etocthelinkedname} to do
-the similar thing, with the link data included. It was used in this
-documentation when doing the \hyperref[tocastree]{examples with trees}.
+\csa{etocthelink} will fetch the link destination if available from name or
+page number and allows via |\etocthelink{foo}| to link an arbitrary text to
+the same destination inside the produced PDF.
 
-Also provided with the similar goal: \csa{etocthelinkednumber},
-\csa{etocthelinkedpage} (which contains a link only if |hyperref|
-added one to the page number) and \csa{etocthelink}\marg{linkname}
-which allows to make a link with an arbitrary name.
+All these commands are fragile. The \csb{etocname}, \csb{etocnumber},
+\csb{etocpage} and \csb{etoclink} are simply their robust variants. They too
+contain the hyperlink destination in already expanded form since |1.08a| for
+the first three, since |1.08j| for \csb{etoclink}.
 
-All these commands are fragile.
-
-% je supprime car suggère qu'avant pas robuste, ce qui n'est pas ce que je
-% voulais dire.
-
-% In fact starting with |1.08a|, \csa{etocname}
-% is exactly the robust variant of \csa{etocthelinkedname}.
-
 Obsolete example of \begingroup
         \etocsetstyle {section}
           {\begin{itemize*}[itemjoin={{; }}, itemjoin*={{, and }}]}
@@ -4442,7 +4413,7 @@
 
 \etoc |1.08a| offers a simpler way to the same result: thanks to
 \csb{etocglobaldefs} there is no need
-anymore here for \csa{etocthelinkedname}, \csa{etocname} works.
+anymore here for \csa{etocthelinkedname}, as \csa{etocname} works.
 \begin{verbatim}
 Example of 
 \begingroup\etocglobaldefs % <-- NEW mit etoc 1.08.
@@ -5351,6 +5322,19 @@
 
 %\section{... and tricks}
 
+\section{A known issue with \csbhyp{localtableofcontents}}
+
+The macro \csa{localtableofcontents} will be dysfunctional after a sectioning
+unit which \emph{does not make its way to the \texttt{.toc} file}: typically
+after a non-numbered section for example. The non-numbered section must be
+added to the \texttt{.toc} file via an \csa{addcontentsline}. Else, \etoc will
+construct a local TOC according to the last sectioning unit added to the
+\texttt{.toc} file. For example if this is a sub-section, then \etoc will think
+it must create a local TOC corresponding to a sub-section.
+
+This may be qualified a bug, perhaps a future version will fix
+this. If no one complains it might stay that way.
+
 \section{Hacking  framed parboxes}
 
 
@@ -6014,7 +5998,7 @@
   level 1 concept/.append style={font=\Large, text width = 3cm},
 % geändert 2015/11/12 20cm->21cm
   level 2/.append style={level width=21cm,level height=30cm, sibling
-          distance=2.37cm},% 2.57cm
+          distance=2.31cm},%
                    ]
 \the\treetok
 \end{tikzpicture}}\endgroup }
@@ -9052,8 +9036,14 @@
 \etoc's \csa{etocpage} auch keinen Link, |\etoclink{\etocthepage}| allerdings
 schon.
 
-Der Befehl \csa{etoclink} ist robust. 
+Der Befehl \csa{etoclink} ist robust.
 
+\begin{otherlanguage}{english}
+  Since |etoc 1.08j| it contains the link destination in an already expanded
+  form, so for example can be used even after a |&| in a tabular construction,
+  if \csb{etocglobaldefs} was issued.
+\end{otherlanguage}
+
 \subsection{Die Befehle \csbhyp{etocthelinkedname}, \csbhyp{etocthelinkednumber},
 \csbhyp{etocthelinkedpage} und \csbhyp{etocthelink}}
 \label{etocthelinkedname}
@@ -9061,30 +9051,42 @@
 \label{etocthelinkedpage}
 \label{etocthelink}
 
-Das Folgende ist für fortgeschrittene Anwendungen von fortgeschrittenen
-Benutzern. Das \csa{etocthename}-Makro wurde bereits schon einmal erwähnt;
-verwendet man es in Anweisungen wie |\global\let\lastone\etocthename| in einem
-\etoc line"=Stil, definiert das Macro |\lastone| so, dass es sich ausbreitet bis
-zum letzten Namen auf dem korrespondieren Level.
+% Das Folgende ist für fortgeschrittene Anwendungen von fortgeschrittenen
+% Benutzern. Das \csa{etocthename}-Makro wurde bereits schon einmal erwähnt;
+% verwendet man es in Anweisungen wie |\global\let\lastone\etocthename| in einem
+% \etoc line"=Stil, definiert das Macro |\lastone| so, dass es sich ausbreitet bis
+% zum letzten Namen auf dem korrespondieren Level.
 
-%  Jedoch bestand bisher keine
-% Möglichkeit, dass Gleiche auch für die Link"=Daten zu tun.
+% Das in diesem Paket enthaltene \csa{etocthelinkedname} stellt dies nun zur
+% Verfügung, inklusive der Link"=Daten. Es wurde in dieser Dokumentation benutzt
+% bei Erstellung der \hyperref[tocastree]{Beispiele mit Bäumen}.
 
-Das in diesem Paket enthaltene \csa{etocthelinkedname} stellt dies nun zur
-Verfügung, inklusive der Link"=Daten. Es wurde in dieser Dokumentation benutzt
-bei Erstellung der \hyperref[tocastree]{Beispiele mit Bäumen}.
+% Ebenfalls bereit gestellt mit ähnlichen Funktionen: \csa{etocthelinkednumber},
+% \csa{etocthelinkedpage} (welches nur einen Link enthält, wenn |hyperref| einen
+% zu dieser Seitenzahl hinzugefügt hat) und \csa{etocthelink}\marg{linkname},
+% welches es erlaubt einen Link mit einem beliebigen Name zu erstellen.
 
-Ebenfalls bereit gestellt mit ähnlichen Funktionen: \csa{etocthelinkednumber},
-\csa{etocthelinkedpage} (welches nur einen Link enthält, wenn |hyperref| einen
-zu dieser Seitenzahl hinzugefügt hat) und \csa{etocthelink}\marg{linkname},
-welches es erlaubt einen Link mit einem beliebigen Name zu erstellen.
+% All diese Befehle sind \emph{nicht} robust.
 
-All diese Befehle sind \emph{nicht} robust.
+\begin{otherlanguage}{english}
+  These macros are fragile and contain the link destination in already
+  expanded form. So their meaning can be stored for delayed usage. For example
+  this is done here when doing the \hyperref[tocastree]{examples with trees}.
 
-% In der Tat wurde mit
-% |1.08a| \csa{etocname} als robuste Variante von
-% \csa{etocthelinkedname} gestartet.
+  Notice though that for example \csa{etocthelinkednumber} is really a link
+  only if |hyperref| was configured to let the numbered heading be linked
+  (which is the default). Similarly for the others.
 
+  \csa{etocthelink} will fetch the link destination if available from name or
+  page number and allows via |\etocthelink{foo}| to link an arbitrary text to
+  the same destination inside the produced PDF.
+
+  The \csb{etocname}, \csb{etocnumber}, \csb{etocpage} and \csb{etoclink} are
+  simply their robust variants. They too contain the hyperlink destination in
+  already expanded form since |1.08a| for the first three, since |1.08j| for
+  \csb{etoclink}.
+\end{otherlanguage}
+
 Veralteter Beispiel\begingroup\
         \etocsetstyle {section}
           {\begin{itemize*}[itemjoin={{; }}, itemjoin*={{, und }}]}
@@ -10009,6 +10011,22 @@
 
 %\section{\ldots\ und Tricks}
 
+\section{A known issue with \csbhyp{localtableofcontents}}
+
+\begin{otherlanguage}{english}
+  The macro \csa{localtableofcontents} will be dysfunctional after a
+  sectioning unit which \emph{does not make its way to the \texttt{.toc}
+    file}: typically after a non-numbered section for example. The
+  non-numbered section must be added to the \texttt{.toc} file via an
+  \csa{addcontentsline}. Else, \etoc will construct a local TOC according to
+  the last sectioning unit added to the \texttt{.toc} file. For example if
+  this is a sub-section, then \etoc will think it must create a local TOC
+  corresponding to a sub-section.
+
+  This may be qualified a bug, perhaps a future version will fix this. If
+  no one complains it might stay that way.
+\end{otherlanguage}
+
 \section{Hacken "`framed parboxes"'}
 
 
@@ -10671,8 +10689,28 @@
 
 \begin{multicols}{2}
 \begin{jfverbatim}
-v1.08i [2016/09/29]^
+v1.08j [2017/09/21]^
 
+   Since 1.08a-2015/03/13 \etocname, \etocnumber, \etocpage
+   contain, if hyperref is present and configured for using
+   hyperlinks in the TOC, the link destination in already expanded
+   form. This means one can use them even if the style closes a
+   group (for example from a & in a tabular), if \etocglobaldefs
+   was issued; also one can save their meaning for delayed usage
+   (with for example \LetLtxMacro as they are robust).
+
+   But for some legacy reason \etoclink, contrarily to
+   \etocthelink, was handled differently. Now, \etoclink also
+   contains the link destination in already expanded form, and can
+   thus be used even if the line style issues a &, as long as
+   \etocglobaldefs is issued.
+
+   Also, bugs dating back to the early days of the package, but
+   surfacing only under relatively rare conditions such as usage
+   of hyperref with its option "linktoc=page" got fixed.
+
+~v1.08i [2016/09/29]^
+
    This fixes an issue dating back to 1.08e-2015/04/17: under
    \etocchecksemptiness regime, some circumstances (such as
    adding to an already compiled document a \localtableofcontents
@@ -11456,7 +11494,7 @@
 % file under some special context with flag |\ifEtoc at stoptoc| artificially set
 % to true. If |\Etoc at localtop| had not been initialized an undefined control
 % sequence error would occur. Furthermore as |\ifEtoc at notactive| was also set
-% to true, the case of no error lead then to unneededly expand|\Etoc at setflags|
+% to true, the case of no error leads then to unneededly expand |\Etoc at setflags|
 % code slowing down compilation.
 %
 % Also |1.08i| splits the macro into two, with accompanying slight
@@ -11598,6 +11636,8 @@
     \Etoc at et@hop{\Etoc at prefix\Etoc at contents}{\Etoc at savedcontentsline{#1}}%
 }
 %    \end{macrocode}
+% START OF MAINLY OBSOLETE COMMENTS
+% 
 % |2013/03/07|: up to |1.06| \etoc defined only \csa{etocname}, \csa{etocnumber} and
 % \csa{etocpage}. The |hyperref| added data is recycled in the simplest
 % manner, prefixing it with \csa{leavevmode}. The included
@@ -11627,6 +11667,8 @@
 % token in the paramaters. For \csa{Etoc at again} (which appears later in the
 % code), a \csa{@firstofone} construct is however the simplest of all.
 %
+% END OF MAINLY OBSOLETE COMMENTS
+%
 % |1.08| adds |\Etoc at global| prefix (|2015/03/09|).
 %
 % |1.08a| drops the original constructions of |\etocname| etc... The obvious
@@ -11637,20 +11679,27 @@
 % versions contained the hyperref destination only in unexpanded form, this
 % forced to use \csa{etocthelinkedname}, etc... in cases when the thing had to
 % be stored for delayed use. Now the user can do this directly with
-% \csa{etocname}, \csa{etocnumber}, \csa{etocpage}.
+% \csa{etocname}, \csa{etocnumber}, \csa{etocpage} (taking into account though
+% that these are robust macros, thus perhaps using something like |\LetLtxMacro|.)
+%
+% |1.08j| turns |\etoclink| into the robust version of |\etocthelink|. Indeed
+% so far only \csa{etocthelink} contained |\Hy at tocdestname| expanded. But
+% \csa{etoclink} did not, and thus it could not be used after a group was
+% closed for example by a |&| from the sectioning style, even if having used
+% |\etocglobaldefs|.
 %    \begin{macrocode}
 \def\Etoc at lxyz #1#2{% 
-    \Etoc at global\@namedef {etoclink }{\leavevmode}%        fall-back
-    \Etoc at global\let\etocthelink       \@empty  %        fall-back
-    \Etoc at global\def\etocthename       {#1}%  (if link, will be removed later)
-    \Etoc at global\def\etocthelinkedname {#1}%  will probably get redefined 
-    \Etoc at getthepage #2\etoc@ % defines \etocthelinkedpage (and \etoclink)
-    \Etoc at getnb #1\relax\relax\etoc@  % gets number *and* name, and \etoclink
+    \Etoc at global\let\etocthelink\@firstofone % fall-back, was let \@empty up to 1.08i (inc.)
+    \Etoc at global\def\etocthename       {#1}%  (if linked, will be removed later)
+    \Etoc at global\def\etocthelinkedname {#1}%  (probably redefined later)
+    \Etoc at getthepage #2\etoc@ % defines \etocthelinkedpage
+    \Etoc at getnb #1\relax\relax\etoc@  % sets number, name, and \etocthelink
     \ifEtoc at number\else               
       \ifnum\Etoc at level=\m at ne
         \Etoc at getit #1\hspace\relax\etoc@   % additional job for parts
       \fi
     \fi
+    \Etoc at global\expandafter\let\csname etoclink \endcsname\etocthelink
     \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
     \Etoc at global\expandafter\let\csname etocnumber \endcsname\etocthelinkednumber
     \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
@@ -11657,10 +11706,12 @@
     }
 %    \end{macrocode}
 % |1.08| adds the |\Etoc at global|'s.
+%
+% |1.08j| fixes old |\ifx #1\hyperlink at start| bug.
 %    \begin{macrocode}
 \def\Etoc at getthepage #1{%
   \let\Etoc at next\Etoc at getthepage@nohyp
-  \ifEtoc at hyperref\ifx #1\hyper at linkstart
+  \ifEtoc at hyperref\ifx\hyper at linkstart#1%
     \let\Etoc at next\Etoc at getthepage@hyp
   \fi\fi
   \Etoc at next #1%
@@ -11680,26 +11731,33 @@
 % |\contentsline|.
 %
 % |1.08| adds the |\Etoc at global|'s.
+%
+% |1.08j| does not define \csa{etoclink<space>} anymore, only \csa{etocthelink}
+% which contains the |\Hy at tocdestname| already expanded.
 %    \begin{macrocode}
 \def\Etoc at getthepage@hyp #1#2#3#4#5\etoc@ {%
-  \Etoc at global\@namedef{etoclink }##1{\leavevmode #1{#2}{#3}{##1}#5}%
   \Etoc at global\def\etocthepage {#4}%
   \edef\Etoc at tmp {{#3}}%
   \Etoc at global\expandafter\def\expandafter\etocthelinkedpage\expandafter
     {\expandafter\hyperlink \Etoc at tmp{#4}}%
+  \Etoc at global\edef\etocthelink##1{\noexpand\hyperlink\Etoc at tmp{##1}}%
 }
-%
+%    \end{macrocode}
+% |1.08j| fixes an old buggy |\ifx #1\hyper at linkstart|. This could show if
+% hyperref was present with |linktoc=page| option for example, because in that
+% case |#1| could be braced tokens. As this is rare condition, it had not been
+% reported so far by my single user user-base.
+%    \begin{macrocode}
 \def\Etoc at getnb #1{%
   \let\Etoc at next\Etoc at getnb@nohyp
-  \ifEtoc at hyperref\ifx #1\hyper at linkstart
+  \ifEtoc at hyperref\ifx\hyper at linkstart#1%
     \let\Etoc at next\Etoc at getnb@hyp
   \fi\fi
   \Etoc at next #1%
 }
-%
 \def\Etoc at getit #1{%
   \let\Etoc at next\Etoc at getit@nohyp
-  \ifEtoc at hyperref\ifx #1\hyper at linkstart
+  \ifEtoc at hyperref\ifx\hyper at linkstart#1%
     \let\Etoc at next\Etoc at getit@hyp
   \fi\fi
   \Etoc at next #1%
@@ -11706,6 +11764,8 @@
 }
 %    \end{macrocode}
 % |1.08| adds the |\Etoc at global|'s.
+%
+% |1.08j| corrects an old |\ifx#1\numberline| into |\ifx\numberline#1|.
 %    \begin{macrocode}
 \def\Etoc at getnb@nohyp #1#2#3\etoc@ {%
     \def\Etoc at getname ##1\relax\relax\etoc@ {%
@@ -11712,12 +11772,12 @@
       \Etoc at global\def\etocthename       {##1}%
       \Etoc at global\def\etocthelinkedname {##1}%
      }%
-  \ifx #1\numberline
+  \ifx\numberline#1%
     \Etoc at global\def\etocthenumber       {#2}%
     \Etoc at global\def\etocthelinkednumber {#2}%
     \Etoc at global\Etoc at numbertrue
     \Etoc at getname #3\etoc@
-  \else % then \etocthename and \etocthelinkedname already defined
+  \else % \etocthename and \etocthelinkedname already defined
     \Etoc at global\let\etocthenumber       \@empty
     \Etoc at global\let\etocthelinkednumber \@empty
     \Etoc at global\Etoc at numberfalse
@@ -11726,6 +11786,8 @@
 %    \end{macrocode}
 % |1.07n| replaces use of |\toks@| by macro |\Etoc at tmp|. |1.08| adds
 % the |\Etoc at global|'s.
+%
+% |1.08j| corrects the old |\ifx#1\numberline| into |\ifx\numberline#1|.
 %    \begin{macrocode}
 \def\Etoc at getnb@hyp #1#2#3#4#5#6\etoc@ {%
          \def\Etoc at getname ##1\relax\relax\etoc@ {%
@@ -11735,7 +11797,7 @@
                               {\expandafter\hyperlink \Etoc at tmp{##1}}%
          }%
          \def\Etoc at getnbr ##1##2##3\etoc@ {%
-          \ifx ##1\numberline
+          \ifx\numberline##1%
             \Etoc at global\def\etocthenumber {##2}%
             \edef\Etoc at tmp   {{#3}}%
             \Etoc at global\expandafter\def\expandafter\etocthelinkednumber
@@ -11752,7 +11814,6 @@
                         \expandafter {\expandafter\hyperlink \Etoc at tmp{#4}}%
           \fi
          }%
-  \Etoc at global\@namedef {etoclink }##1{\leavevmode #1{#2}{#3}{##1}#5}%
   \Etoc at global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
   \Etoc at getnbr #4\relax\relax\etoc@
 }
@@ -11774,11 +11835,18 @@
 %    \end{macrocode}
 % |1.07n| replaces use of |\toks@| by macro |\Etoc at tmp|. |1.08| adds
 % the |\Etoc at global|'s.
+%
+% |1.08j| adds \csa{etocthelink} definition here which was missing. This bug
+% showed in case hyperref was used with option |linktoc=page|, for |part|
+% styles: the |\etocthelink| would not create a link if used therein. But the
+% |linktoc=page| condition could easily however trigger the more serious
+% |\ifx| bug in |\Etoc at getnb| also fixed at |1.08j|, and this would have
+% overshadowed this one by a real compilation error rather than a missing link
+% in the procuced PDF.
 %    \begin{macrocode}
 \def\Etoc at getit@hyp #1#2#3#4#5#6\etoc@ {%
     \def\Etoc at getname ##1\hspace\relax\etoc@ {%
        \Etoc at global\def\etocthename {##1}%
-       \edef\Etoc at tmp   {{#3}}%
        \Etoc at global\expandafter\def\expandafter\etocthelinkedname
                    \expandafter{\expandafter\hyperlink \Etoc at tmp{##1}}%
     }%
@@ -11785,7 +11853,6 @@
     \def\Etoc at getnbr ##1\hspace##2##3\etoc@ {%
        \ifx\relax##2\else
          \Etoc at global\def\etocthenumber {##1}%
-         \edef\Etoc at tmp   {{#3}}%
          \Etoc at global\expandafter\def\expandafter\etocthelinkednumber
                      \expandafter{\expandafter\hyperlink \Etoc at tmp{##1}}%
          \Etoc at global\Etoc at numbertrue
@@ -11792,7 +11859,9 @@
          \Etoc at getname ##3\etoc@
        \fi
     }%
+  \edef\Etoc at tmp {{#3}}%
   \Etoc at getnbr #4\hspace\relax\etoc@
+  \Etoc at global\edef\etocthelink ##1{\noexpand\hyperlink\Etoc at tmp{##1}}%
 }
 %    \end{macrocode}
 % |1.08a| of |2015/03/12| does the long-postponed thing to let |\etocname|
@@ -11804,11 +11873,11 @@
 \let\etocthelinkedname   \@empty
 \let\etocthelinkednumber \@empty
 \let\etocthelinkedpage   \@empty
-\let\etocthelink   \@empty
+\let\etocthelink   \@firstofone % prior to 1.08j its was \let to \@empty
 \DeclareRobustCommand*{\etocname}  {}
 \DeclareRobustCommand*{\etocnumber}{}
 \DeclareRobustCommand*{\etocpage}  {}
-\DeclareRobustCommand*{\etoclink}  {}
+\DeclareRobustCommand*{\etoclink}  {\@firstofone}
 \DeclareRobustCommand*{\etocifnumbered}
    {\ifEtoc at number\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
 \expandafter\let\expandafter\etocxifnumbered\csname etocifnumbered \endcsname
@@ -13188,7 +13257,7 @@
   Grave accent  \`     Left brace    \{     Vertical bar  \|
   Right brace   \}     Tilde         \~}
 
-\CheckSum{3200}% 2^7 times 5^2 not bad.
+\CheckSum{3210}%
 
 \csname check at checksum\endcsname
 \Finale

Modified: trunk/Master/texmf-dist/source/latex/etoc/etoc.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/etoc/etoc.ins	2017-09-22 22:53:46 UTC (rev 45379)
+++ trunk/Master/texmf-dist/source/latex/etoc/etoc.ins	2017-09-22 22:54:01 UTC (rev 45380)
@@ -1,16 +1,16 @@
 %%
 %% Package: etoc
-%% Version: 1.08i-2016/09/29
+%% Version: 1.08j-2017/09/21
 %% License: LPPL 1.3c
-%% Copyright (C) 2012-2016 Jean-Francois Burnol
+%% Copyright (C) 2012-2017 Jean-Francois Burnol
 %%                         <jfbu at free dot fr>
-%% Copyright (C) 2014-2016 Christine Roemer
+%% Copyright (C) 2014-2017 Christine Roemer
 %%                         <Christine_Roemer at t-online dot de>
 %% and collaborators for the translation into German of the documentation
 %%
-\def\etocpkgdate        {2016/09/29}
-\def\etocdocdate        {2016/09/29}
-\def\etocpkgversion     {v1.08i}
+\def\etocpkgdate        {2017/09/21}
+\def\etocdocdate        {2017/09/21}
+\def\etocpkgversion     {v1.08j}
 \def\etocpkgdescription {Completely customisable TOCs (JFB)}
 %% Run etex on this file to extract from etoc.dtx:
 %%        etoc.sty, etoc.tex, etoc-DE.tex and README.md

Modified: trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty	2017-09-22 22:53:46 UTC (rev 45379)
+++ trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty	2017-09-22 22:54:01 UTC (rev 45380)
@@ -23,14 +23,14 @@
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{etoc}
- [2016/09/29 v1.08i Completely customisable TOCs (JFB)]
+ [2017/09/21 v1.08j Completely customisable TOCs (JFB)]
 %%
 %% Package: etoc
-%% Version: 1.08i-2016/09/29
+%% Version: 1.08j-2017/09/21
 %% License: LPPL 1.3c
-%% Copyright (C) 2012-2016 Jean-Francois Burnol
+%% Copyright (C) 2012-2017 Jean-Francois Burnol
 %%                         <jfbu at free dot fr>
-%% Copyright (C) 2014-2016 Christine Roemer
+%% Copyright (C) 2014-2017 Christine Roemer
 %%                         <Christine_Roemer at t-online dot de>
 %% and collaborators for the translation into German of the documentation
 %%
@@ -300,17 +300,17 @@
     \Etoc at et@hop{\Etoc at prefix\Etoc at contents}{\Etoc at savedcontentsline{#1}}%
 }
 \def\Etoc at lxyz #1#2{%
-    \Etoc at global\@namedef {etoclink }{\leavevmode}%        fall-back
-    \Etoc at global\let\etocthelink       \@empty  %        fall-back
-    \Etoc at global\def\etocthename       {#1}%  (if link, will be removed later)
-    \Etoc at global\def\etocthelinkedname {#1}%  will probably get redefined
-    \Etoc at getthepage #2\etoc@ % defines \etocthelinkedpage (and \etoclink)
-    \Etoc at getnb #1\relax\relax\etoc@  % gets number *and* name, and \etoclink
+    \Etoc at global\let\etocthelink\@firstofone % fall-back, was let \@empty up to 1.08i (inc.)
+    \Etoc at global\def\etocthename       {#1}%  (if linked, will be removed later)
+    \Etoc at global\def\etocthelinkedname {#1}%  (probably redefined later)
+    \Etoc at getthepage #2\etoc@ % defines \etocthelinkedpage
+    \Etoc at getnb #1\relax\relax\etoc@  % sets number, name, and \etocthelink
     \ifEtoc at number\else
       \ifnum\Etoc at level=\m at ne
         \Etoc at getit #1\hspace\relax\etoc@   % additional job for parts
       \fi
     \fi
+    \Etoc at global\expandafter\let\csname etoclink \endcsname\etocthelink
     \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
     \Etoc at global\expandafter\let\csname etocnumber \endcsname\etocthelinkednumber
     \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
@@ -317,7 +317,7 @@
     }
 \def\Etoc at getthepage #1{%
   \let\Etoc at next\Etoc at getthepage@nohyp
-  \ifEtoc at hyperref\ifx #1\hyper at linkstart
+  \ifEtoc at hyperref\ifx\hyper at linkstart#1%
     \let\Etoc at next\Etoc at getthepage@hyp
   \fi\fi
   \Etoc at next #1%
@@ -327,15 +327,15 @@
     \Etoc at global\def\etocthelinkedpage {#1}%
 }
 \def\Etoc at getthepage@hyp #1#2#3#4#5\etoc@ {%
-  \Etoc at global\@namedef{etoclink }##1{\leavevmode #1{#2}{#3}{##1}#5}%
   \Etoc at global\def\etocthepage {#4}%
   \edef\Etoc at tmp {{#3}}%
   \Etoc at global\expandafter\def\expandafter\etocthelinkedpage\expandafter
     {\expandafter\hyperlink \Etoc at tmp{#4}}%
+  \Etoc at global\edef\etocthelink##1{\noexpand\hyperlink\Etoc at tmp{##1}}%
 }
 \def\Etoc at getnb #1{%
   \let\Etoc at next\Etoc at getnb@nohyp
-  \ifEtoc at hyperref\ifx #1\hyper at linkstart
+  \ifEtoc at hyperref\ifx\hyper at linkstart#1%
     \let\Etoc at next\Etoc at getnb@hyp
   \fi\fi
   \Etoc at next #1%
@@ -342,7 +342,7 @@
 }
 \def\Etoc at getit #1{%
   \let\Etoc at next\Etoc at getit@nohyp
-  \ifEtoc at hyperref\ifx #1\hyper at linkstart
+  \ifEtoc at hyperref\ifx\hyper at linkstart#1%
     \let\Etoc at next\Etoc at getit@hyp
   \fi\fi
   \Etoc at next #1%
@@ -352,12 +352,12 @@
       \Etoc at global\def\etocthename       {##1}%
       \Etoc at global\def\etocthelinkedname {##1}%
      }%
-  \ifx #1\numberline
+  \ifx\numberline#1%
     \Etoc at global\def\etocthenumber       {#2}%
     \Etoc at global\def\etocthelinkednumber {#2}%
     \Etoc at global\Etoc at numbertrue
     \Etoc at getname #3\etoc@
-  \else % then \etocthename and \etocthelinkedname already defined
+  \else % \etocthename and \etocthelinkedname already defined
     \Etoc at global\let\etocthenumber       \@empty
     \Etoc at global\let\etocthelinkednumber \@empty
     \Etoc at global\Etoc at numberfalse
@@ -371,7 +371,7 @@
                               {\expandafter\hyperlink \Etoc at tmp{##1}}%
          }%
          \def\Etoc at getnbr ##1##2##3\etoc@ {%
-          \ifx ##1\numberline
+          \ifx\numberline##1%
             \Etoc at global\def\etocthenumber {##2}%
             \edef\Etoc at tmp   {{#3}}%
             \Etoc at global\expandafter\def\expandafter\etocthelinkednumber
@@ -388,7 +388,6 @@
                         \expandafter {\expandafter\hyperlink \Etoc at tmp{#4}}%
           \fi
          }%
-  \Etoc at global\@namedef {etoclink }##1{\leavevmode #1{#2}{#3}{##1}#5}%
   \Etoc at global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
   \Etoc at getnbr #4\relax\relax\etoc@
 }
@@ -407,7 +406,6 @@
 \def\Etoc at getit@hyp #1#2#3#4#5#6\etoc@ {%
     \def\Etoc at getname ##1\hspace\relax\etoc@ {%
        \Etoc at global\def\etocthename {##1}%
-       \edef\Etoc at tmp   {{#3}}%
        \Etoc at global\expandafter\def\expandafter\etocthelinkedname
                    \expandafter{\expandafter\hyperlink \Etoc at tmp{##1}}%
     }%
@@ -414,7 +412,6 @@
     \def\Etoc at getnbr ##1\hspace##2##3\etoc@ {%
        \ifx\relax##2\else
          \Etoc at global\def\etocthenumber {##1}%
-         \edef\Etoc at tmp   {{#3}}%
          \Etoc at global\expandafter\def\expandafter\etocthelinkednumber
                      \expandafter{\expandafter\hyperlink \Etoc at tmp{##1}}%
          \Etoc at global\Etoc at numbertrue
@@ -421,7 +418,9 @@
          \Etoc at getname ##3\etoc@
        \fi
     }%
+  \edef\Etoc at tmp {{#3}}%
   \Etoc at getnbr #4\hspace\relax\etoc@
+  \Etoc at global\edef\etocthelink ##1{\noexpand\hyperlink\Etoc at tmp{##1}}%
 }
 \let\etocthename   \@empty
 \let\etocthenumber \@empty
@@ -429,11 +428,11 @@
 \let\etocthelinkedname   \@empty
 \let\etocthelinkednumber \@empty
 \let\etocthelinkedpage   \@empty
-\let\etocthelink   \@empty
+\let\etocthelink   \@firstofone % prior to 1.08j its was \let to \@empty
 \DeclareRobustCommand*{\etocname}  {}
 \DeclareRobustCommand*{\etocnumber}{}
 \DeclareRobustCommand*{\etocpage}  {}
-\DeclareRobustCommand*{\etoclink}  {}
+\DeclareRobustCommand*{\etoclink}  {\@firstofone}
 \DeclareRobustCommand*{\etocifnumbered}
    {\ifEtoc at number\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
 \expandafter\let\expandafter\etocxifnumbered\csname etocifnumbered \endcsname



More information about the tex-live-commits mailing list