summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/etoc/etoc.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/etoc/etoc.dtx')
-rw-r--r--macros/latex/contrib/etoc/etoc.dtx293
1 files changed, 122 insertions, 171 deletions
diff --git a/macros/latex/contrib/etoc/etoc.dtx b/macros/latex/contrib/etoc/etoc.dtx
index 6809655d29..9a0fc5716a 100644
--- a/macros/latex/contrib/etoc/etoc.dtx
+++ b/macros/latex/contrib/etoc/etoc.dtx
@@ -2,27 +2,26 @@
% 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: <15-05-2020 at 19:18:31 CEST>}%
+\def\etocdtxtimestamp {Time-stamp: <13-07-2021 at 10:15:28 CEST>}%
%</none>
%<*!readme>
%%
%% Package: etoc
-%% Version: 1.09c-2020/05/15
+%% Version: 1.09d
%% License: LPPL 1.3c
-%% Copyright (C) 2012-2020 Jean-Francois Burnol
+%% Copyright (C) 2012-2021 Jean-Francois Burnol
%% <jfbu at free dot fr>
-%% Copyright (C) 2014-2020 Christine Roemer
+%% Copyright (C) 2014-2015 Christine Roemer and collaborators
%% <Christine_Roemer at t-online dot de>
-%% and collaborators for the translation into German of the documentation
-%%
+%% (translation into German of the documentation)
%</!readme>
%<*none>
-\def\etocpkgdate {2020/05/15}
-\def\etocdocdate {2020/05/15}
-\def\etocpkgversion {v1.09c}
+\def\etocpkgdate {2021/07/13}
+\def\etocdocdate {2021/07/13}
+\def\etocpkgversion {v1.09d}
\def\etocpkgdescription {Completely customisable TOCs (JFB)}
-\def\etocDEpkgdate {15.05.2020}% METTRE À JOUR À CHAQUE BUMP!
-\def\etocDEdocdate {15.05.2020}
+\def\etocDEpkgdate {13.07.2021}% METTRE À JOUR À CHAQUE BUMP!
+\def\etocDEdocdate {13.07.2021}
\def\etocDEDEdocdate {09.04.2015}%
\def\etocDEDEpkgversion {v1.08d}%
% Definition of \etocLicense
@@ -33,11 +32,12 @@
\catcode32=13\catcode`\\=12^^Brelax^^A
^^Bfirstofone{^^Bendgroup^^Bdef^^BetocLicense^^A
{% Package: etoc
-% Version: 1.09c-2020/05/15
+% Version: 1.09d
% License: LPPL 1.3c
-% Copyright (C) 2012-2020 Jean-Francois Burnol <jfbu at free dot fr>
-% Copyright (C) 2014-2020 Christine Roemer <Christine_Roemer at t-online dot de>
-% and collaborators for the translation into German of the documentation
+% Copyright (C) 2012-2021 Jean-Francois Burnol <jfbu at free dot fr>
+% Copyright (C) 2014-2015 Christine Roemer and collaborators
+% <Christine_Roemer at t-online dot de>
+% (translation into German of the documentation)
%
% This Work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, in its
@@ -67,14 +67,14 @@
%<*readme>
<!-- -->
- Source: etoc.dtx (v1.09c-2020/05/15)
+ Source: etoc.dtx (v1.09d)
Author: Jean-Francois Burnol
Author: Christine Roemer et al. (German tranlation)
Info: Completely customisable TOCs
License: LPPL 1.3c
- Copyright (C) 2012-2020 Jean-Francois Burnol.
- Copyright (C) 2014-2020 Christine Roemer and collaborators for
- the translation into German of the documentation.
+ Copyright (C) 2012-2021 Jean-Francois Burnol.
+ Copyright (C) 2014-2015 Christine Roemer and collaborators
+ (translation into German of the documentation)
<jfbu at free dot fr> <Christine_Roemer at t-online dot de>
ABSTRACT
@@ -174,7 +174,20 @@ etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi.
RECENT CHANGES
==============
-v1.09c \[2020/05/05\]
+v1.09d \[2021/07/13\]
+-------------------------
+
+Some minor synching with tableof 1.4c.
+
+Add `\etockeeporiginaltableofcontents` to provide a work-around to a
+compatibility issue with listings's `\lstlistoflistings`, which abuses
+`\tableofcontents` for doing something unrelated to the actual contents.
+Thanks to Denis Bitouzé for report.
+
+Usage: `\usepackage{etoc}\etockeeporiginaltableofcontents`, then
+however you must employ `\etoctableofcontents`, not `\tableofcontents`.
+
+v1.09c \[2020/05/15\]
---------------------
Syncs with KOMA-script deprecation of `\iftocfeature`.
@@ -198,136 +211,9 @@ Note to hackers: internal control sequence `\Etoc@localtop` is gone.
etoc now requires e-TeX (`\numexpr`, `\unless`).
-
-v1.08p \[2018/07/04\]
----------------------
-
-Fixed bug surfacing in case of `linktoc=page` option of hyperref.
-Thanks to Denis Bitouzé for report (cf.
-https://github.com/ho-tex/hyperref/issues/65,
-https://github.com/dbitouze/yathesis/issues/61).
-
-
-v1.08o \[2018/06/15\]
----------------------
-
-Fixed bug showing up if an unnumbered TOC entry starts with a brace,
-and document uses hyperref. Caused by a typo in a macro name at
-previous release.
-
-
-v1.08n \[2018/02/23\]
----------------------
-
-Refactoring of core macros detecting `\numberline` and its variants.
-
-
-v1.08m \[2018/02/07\]
----------------------
-
-Fix to `1.08k`'s introduced incompatibility with KOMA-script
-and tocbasic's `\nonumberline`.
-
-
-v1.08l \[2017/10/23\]
----------------------
-
-Workaround an issue with `Emacs/AUCTeX` wrongly reporting about
-actually non-existent LaTeX errors, which was triggered by some
-strings written (indirectly) to log file by etoc under some
-circumstances.
-
-
-v1.08k \[2017/09/28\]
----------------------
-
-Adds `\etocsetlocaltop.toc`. See corresponding manual section for
-details.
-
-Adds `\etocsavedparttocline`, `\etocsavedchaptertocline`,
-`\etocsavedsectiontocline`, ... They can be used in the context of
-the technique explained in section "Another compatibility mode".
-
-Formerly, etoc redefined for the duration of the TOC the memoir
-macro `\chapternumberline` and its likes to have same meaning as
-`\numberline` (of course, not when executed in compatibility mode),
-for the sake of extraction of `\etocnumber`.
-
-New method detects presence of any `\<foo>numberline` macro without
-any change to originals; they can thus be used as is when applying
-the approach of "Another compatibility mode" section from manual.
-
-
-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` before the
-main `\tableofcontents`) created an "`Undefined control sequence`
-`\Etoc@localtop`" error. Thanks to Denis Bitouzé for reporting the
-problem.
-
-On this occasion, `\etocdoesnotcheckemptiness` has been
-added to unset the flag.
-
-A rather more exotic issue was fixed: the emptiness check for
-local tocs could get confused if the `tocdepth` counter was varying
-in some specific ways from inside the `toc` file.
-
-After adding to a document a `\localtableofcontents`, two LaTeX
-passes are needed for etoc to get a chance to print the
-correct local contents. Formerly, etoc issued a Warning on
-the first pass; it now also induces LaTeX into
-announcing "There were undefined references", as this is nearer
-to the end of the log file and console output.
-
-
-v1.08h \[2016/09/25\]
----------------------
-
-New functioning of `\etocsetnexttocdepth`: the tocdepth counter is
-modified only at the time of the table of contents, not before. This
-fixes an issue which arose when `\etocsetnexttocdepth` was used
-multiple times with no intervening table of contents. Thanks to
-Denis Bitouzé for reporting the problem.
-
-The PDF documentation includes about 25 LaTeX code snippets also
-as file attachment annotations, additionally to their verbatim
-typesetting. The ordering of the documentation contents has been
-slightly re-organized.
-
-A previous documentation-only update on 2016/09/09 added a new
-section with the (approximate) translation into etoc lingua of the
-book class toc style, for easy customizability.
-
-
-The latest translation into German of the additions made to the
-documentation dates back to v1.08d \[2015/04/09\].
-
-Thanks to Christine Römer!
+Note: the German version of the documentation was last updated
+at the time of the v1.08d \[2015/04/09\] release. Since then
+all additions to it have been left in English language.
%</readme>
%<*tex>-------------------------------------------------------------------------
%% run pdflatex thrice on this file etoc.tex to produce the documentation
@@ -1150,6 +1036,7 @@ etoc-right-rule-col-or-cmd
etoc-bot-tom-rule-col-or-cmd
etoc-bkg-col-or-cmd
etoc-framed-mp-hook
+etoc-keep-orig-i-nal-table-of-con-tents
}
\hyphenation{next-toc-with-tags}
@@ -1372,7 +1259,17 @@ etoc-framed-mp-hook
based on a multi-column format, with, optionally, a ruled title or framed
contents.
- The \csa{tableofcontents} command may be used arbitrarily many times and it
+ The \csa{tableofcontents} command may be used arbitrarily many times%
+%
+\footnote{Except if \texttt{\string\etockeeporiginaltableofcontents}
+ (\textcolor{Green}{\bfseries New with 1.09d}) is issued in the preamble
+ after package loading. Then the macro \texttt{\string\etoctableofcontents},
+ not \texttt{\string\tableofcontents}, must be used if the \etoc features
+ are to apply to the global TOC. This was added to fix a compatiblity issue
+ with \texttt{listings}'s \texttt{\string\lstlistoflistings}, as it needs the
+ \texttt{\string\tableofcontents} macro to keep its original meaning.}
+%
+ and it
has a variant \csa{localtableofcontents} which prints tables of contents
`local' to the current surrounding document unit. An extension of the
\csa{label}/\csa{ref} syntax allows to reproduce (with another layout) a local
@@ -6102,7 +5999,17 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}.
vordefinierte Stile, die auf der Mehrspaltenansicht mit optionalen,
unterstrichenen Titeln oder eingerahmten Inhalten basieren.
- Der \csa{tableofcontents}"=Befehl kann beliebig mehrfach benutzt werden. Er hat
+ Der \csa{tableofcontents}"=Befehl kann beliebig mehrfach benutzt werden.%
+%
+\footnote{Except if \texttt{\string\etockeeporiginaltableofcontents}
+ (\textcolor{Green}{\bfseries New with 1.09d}) is issued in the preamble
+ after package loading. Then the macro \texttt{\string\etoctableofcontents},
+ not \texttt{\string\tableofcontents}, must be used if the \etoc features
+ are to apply to the global TOC. This was added to fix a compatiblity issue
+ with \texttt{listings}'s \texttt{\string\lstlistoflistings}, as it needs the
+ \texttt{\string\tableofcontents} macro to keep its original meaning.}
+%
+ Er hat
die Variante \csa{localtableofcontents}, welche die Inhaltsangabe 'local' zur
aktuellen Dokumenten"=Sektion ausgibt. Eine Erweiterung der
\csa{label}/\csa{ref}-Syntax erlaubt die Reproduktion (mit anderem Layout)
@@ -10724,7 +10631,19 @@ Dokumentation erzeugt von der Quelldatei mit dem Stempel
\begin{multicols}{2}
\begin{jfverbatim}
-v1.09c [2020/05/05]^
+v1.09d [2021/07/13]^
+
+ Some minor synching with tableof 1.4c.
+
+ Add \etockeeporiginaltableofcontents to provide a work-around to a
+ compatibility issue with listings's \lstlistoflistings, which abuses
+ \tableofcontents for doing something unrelated to the actual contents.
+ Thanks to Denis Bitouzé for report.
+
+ Usage: \usepackage{etoc}\etockeeporiginal-tableofcontents, then
+ however you must employ \etoctableofcontents, not \tableofcontents.
+
+~v1.09c [2020/05/15]^
Syncs with KOMA-script deprecation of \iftocfeature.
@@ -12692,15 +12611,12 @@ v1.09c [2020/05/05]^
\Etoc@tocdepthset % new with 1.08h (\etocsetnexttocdepth)
\begingroup % closed in \Etoc@t@bleofcontents or \Etoc@localtableofcontents
% \end{macrocode}
-% No need for the |tableof| extra group level, even it is better to get rid of
-% it. I don't globally cancel |\tof@begingroup| and |\tof@endgroup| to leave
-% open for the user the (dubious) possibility of using directly |\tableof|,
-% |\tablenotof| (rather than only the reasonable thing which is
-% |\nexttocwithtags{}{}|).
-% \begin{macrocode}
- \let\tof@begingroup\@empty
- \let\tof@endgroup \@empty
-% \end{macrocode}
+% Prior to its release |1.4c|, |tableof| added a group pair via |\tof@begin|
+% and |\tof@finish|. This was removed at |1.4c|. So no need to do anything now
+% here about silencing |\tof@begingroup| and |\tof@endgroup|: they are
+% inserted only in the |tableof| private copy of the |.toc| file which is
+% used by its own table of contents typesetting command.
+%
% |1.08i| removes definition of |\etoc@startlocaltoc| from here. It is done
% in |\Etoc@localtableofcontents| or uses its default of |\@gobble|.
%
@@ -12712,13 +12628,19 @@ v1.09c [2020/05/05]^
{\let\Etoc@aftertitlehook\@empty\Etoc@table@fcontents}
{\def\Etoc@aftertitlehook{\etocaftertitlehook}\Etoc@table@fcontents}%
}% \etoctableofcontents
+% \end{macrocode}
+% See at end of this file for the explanation of this |1.09d| added saving
+% of original meaning at package loading time.
+% \begin{macrocode}
+\let\etocoriginaltableofcontents\tableofcontents
\let\tableofcontents\etoctableofcontents
\newcommand*\localtableofcontents{%
\Etoc@openouttoc
\Etoc@tocdepthset % new with 1.08h (\etocsetnexttocdepth)
\begingroup % closed in \Etoc@t@bleofcontents or \Etoc@localtableofcontents
- \let\tof@begingroup\@empty
- \let\tof@endgroup \@empty
+% \end{macrocode}
+% Same comment relative to |tableof|. No need to do anything here.
+% \begin{macrocode}
\@ifstar
{\let\Etoc@aftertitlehook\@empty\Etoc@localtable@fcontents}
{\def\Etoc@aftertitlehook{\etocaftertitlehook}\Etoc@localtable@fcontents}%
@@ -12823,15 +12745,36 @@ v1.09c [2020/05/05]^
#2\@nobreakfalse % 1.07d: \@nobreakfalse moved here
\Etoc@restoretocdepth % 1.07g. moved here from before #2 by 1.08
% \end{macrocode}
-% |1.08|: necessary if |tableof 1.4a| has been used in global mode and thus
-% was forced to modify globally |\contentsline|. The collateral effect is that
-% \etoc is now forced to reset globally |\contentsline|.
+% |\contentsline| was set to |\Etoc@etoccontentsline| by a non-global |\let|,
+% and it will recover its normal value from exiting a scope limiting group.
+% But |tableof| (since |1.4a|) under |\etocglobaldefstrue| does a global
+% redefinition of |\contentsline|. Its |\tof@finish| then does a global
+% restore of |\contentsline|, but it will be to the \etoc set
+% value. |\tof@finish| is active only if either the table of contents was
+% typeset using |\tableof|, |\tablenotof|, |\tableoftaggedcontents|, or
+% |\nextocwithtags| was used. If not active it is either undefined (no
+% package |tableof|) or |\@empty|. Prior to |tableof| |1.4c|, the
+% |\tof@finish| closed a group and could be undefined as well, but not if
+% |\etocglobaldefstrue|.
+%
+% \etoc |1.09c| tested here only equality to |\@empty| to decide if it is
+% needed to globally restore |\contentsline| but this meant the global restore
+% was done systematically in case of absence of package |tableof|.
+%
+% If rather than |\@empty| the |\tof@finish| fall-back was |\relax| we could
+% use here |\@ifundefined| to check in one go (matters of speaking because
+% expansion of |\@ifundefined| is not in "one-go"). Maybe I should update
+% |tableof|, but for time being I will simply add an extra test. All this is
+% probably lots of time on irrelevant issue.
% \begin{macrocode}
\ifx\Etoc@global\global
- \ifx\tof@finish\@empty
- \else
+ \@ifundefined{tof@finish}
+ {}
+ {\ifx\tof@finish\@empty
+ \else
\global\let\contentsline\Etoc@savedcontentsline
- \fi
+ \fi
+ }%
\fi
\@gobble\etoc@
}% end of \Etoc@tableofcontents definition by \etocsettocstyle
@@ -13765,6 +13708,14 @@ v1.09c [2020/05/05]^
\etocobeydepthtags
\let\etocaftertochook \@empty % public for end user.
\let\etocbeforetitlehook \@empty % new with 1.07m
+% \end{macrocode}
+% |listings| abuses |\tableofcontents| for its |\lstlistoflistings|. It
+% doesn't seem worth to let my version of |\tableofcontents| have to check for
+% this special circumstance. So at |1.09d|, simply add this (and induced
+% annoying updates to documentation at at least two locations):
+% \begin{macrocode}
+\def\etockeeporiginaltableofcontents
+ {\let\tableofcontents\etocoriginaltableofcontents}%
\endinput
% \end{macrocode}
% \MakePercentComment
@@ -13784,7 +13735,7 @@ v1.09c [2020/05/05]^
Grave accent \` Left brace \{ Vertical bar \|
Right brace \} Tilde \~}
-\CheckSum{3516}%
+\CheckSum{3513}%
\csname check@checksum\endcsname
\Finale