summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/etoc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-11-18 03:01:03 +0000
committerNorbert Preining <norbert@preining.info>2019-11-18 03:01:03 +0000
commit96f9362fc3e3bb70fa2411c62418c42d9acda4d7 (patch)
tree0a5b5a1a0eb542f5e4a01241ff22837cc0e86835 /macros/latex/contrib/etoc
parentee7abbf3326590ad80cbd11ae7756c9238f7dab8 (diff)
CTAN sync 201911180301
Diffstat (limited to 'macros/latex/contrib/etoc')
-rw-r--r--macros/latex/contrib/etoc/README.md30
-rw-r--r--macros/latex/contrib/etoc/etoc-DE.pdfbin561953 -> 565252 bytes
-rw-r--r--macros/latex/contrib/etoc/etoc.dtx471
-rw-r--r--macros/latex/contrib/etoc/etoc.pdfbin615419 -> 620437 bytes
4 files changed, 298 insertions, 203 deletions
diff --git a/macros/latex/contrib/etoc/README.md b/macros/latex/contrib/etoc/README.md
index 88f2d05bf8..9a186ade41 100644
--- a/macros/latex/contrib/etoc/README.md
+++ b/macros/latex/contrib/etoc/README.md
@@ -1,6 +1,6 @@
<!-- -->
- Source: etoc.dtx (v1.09-2019/03/09)
+ Source: etoc.dtx (v1.09b-2019/11/17)
Author: Jean-Francois Burnol
Author: Christine Roemer et al. (German tranlation)
Info: Completely customisable TOCs
@@ -48,22 +48,13 @@ to the standard `.toc` file.
INSTALLATION
============
-The simplest is to download
+To extract the package (.sty) and driver (.tex) files from etoc.dtx,
+execute `etex etoc.dtx`.
-> <http://mirrors.ctan.org/install/macros/latex/contrib/etoc.tds.zip>
-
-and then run `unzip etoc.tds.zip -d <DEST>` where `<DEST>` is a
-TDS-compliant repertory.
-
-Else, to extract the package (.sty) and driver (.tex) files from etoc.dtx:
-
-- if etoc.ins is present: etex etoc.ins
-- without etoc.ins: etex etoc.dtx
-
-It is also possible to run latex or pdflatex directly on etoc.dtx.
+It is also possible to execute latex or pdflatex directly on etoc.dtx.
To produce etoc.pdf one can run pdflatex (thrice) directly on etoc.dtx or on
-the file etoc.tex which was extracted from previous step.
+the file etoc.tex which was extracted from `etex etoc.dtx` step.
Options can be set in etoc.tex:
@@ -110,12 +101,21 @@ The Authors of this Work are:
collaborators for the translation into German of the documentation.
This Work consists of the main source file etoc.dtx and the
-derived files etoc.sty, etoc.ins, etoc.tex, etoc-DE.tex,
+derived files etoc.sty, etoc.tex, etoc-DE.tex,
etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi.
RECENT CHANGES
==============
+v1.09a, v1.09b \[2019/11/17\]
+-----------------------------
+
+Sync with `memoir v3.7i` which has a better location of the TOC
+hyperref anchor. The `\etocaftertitlehook` can now freely be
+used also with memoir class (formerly its usage in case of
+memoir class was preempted by etoc itself). For more details
+refer to the section "Compatibility with the memoir class".
+
v1.09 \[2019/03/09\]
--------------------
diff --git a/macros/latex/contrib/etoc/etoc-DE.pdf b/macros/latex/contrib/etoc/etoc-DE.pdf
index 7c82540906..6b443b78ae 100644
--- a/macros/latex/contrib/etoc/etoc-DE.pdf
+++ b/macros/latex/contrib/etoc/etoc-DE.pdf
Binary files differ
diff --git a/macros/latex/contrib/etoc/etoc.dtx b/macros/latex/contrib/etoc/etoc.dtx
index 9c997ac56a..a500a3b01d 100644
--- a/macros/latex/contrib/etoc/etoc.dtx
+++ b/macros/latex/contrib/etoc/etoc.dtx
@@ -2,12 +2,12 @@
% 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: <10-03-2019 at 09:35:44 CET>}%
+\def\etocdtxtimestamp {Time-stamp: <17-11-2019 at 13:36:39 CET>}%
%</none>
%<*!readme>
%%
%% Package: etoc
-%% Version: 1.09-2019/03/09
+%% Version: 1.09b-2019/11/17
%% License: LPPL 1.3c
%% Copyright (C) 2012-2019 Jean-Francois Burnol
%% <jfbu at free dot fr>
@@ -16,15 +16,13 @@
%% and collaborators for the translation into German of the documentation
%%
%</!readme>
-%<*insfile>
-\def\etocpkgdate {2019/03/09}
-\def\etocdocdate {2019/03/09}
-\def\etocpkgversion {v1.09}
-\def\etocpkgdescription {Completely customisable TOCs (JFB)}
-%</insfile>
%<*none>
-\def\etocDEpkgdate {09.03.2019}% METTRE À JOUR À CHAQUE BUMP!
-\def\etocDEdocdate {09.03.2019}
+\def\etocpkgdate {2019/11/17}
+\def\etocdocdate {2019/11/17}
+\def\etocpkgversion {v1.09b}
+\def\etocpkgdescription {Completely customisable TOCs (JFB)}
+\def\etocDEpkgdate {17.11.2019}% METTRE À JOUR À CHAQUE BUMP!
+\def\etocDEdocdate {17.11.2019}
\def\etocDEDEdocdate {09.04.2015}%
\def\etocDEDEpkgversion {v1.08d}%
% Definition of \etocLicense
@@ -35,7 +33,7 @@
\catcode32=13\catcode`\\=12^^Brelax^^A
^^Bfirstofone{^^Bendgroup^^Bdef^^BetocLicense^^A
{% Package: etoc
-% Version: 1.09-2019/03/09
+% Version: 1.09b-2019/11/17
% License: LPPL 1.3c
% Copyright (C) 2012-2019 Jean-Francois Burnol <jfbu at free dot fr>
% Copyright (C) 2014-2019 Christine Roemer <Christine_Roemer at t-online dot de>
@@ -57,11 +55,11 @@
% for the translation into German of the documentation.
%
% This Work consists of the main source file etoc.dtx and the derived
-% files etoc.sty, etoc.ins, etoc.tex, etoc-DE.tex, etoc.pdf, etoc-DE.pdf,
+% files etoc.sty, etoc.tex, etoc-DE.tex, etoc.pdf, etoc-DE.pdf,
% etoc.dvi, etoc-DE.dvi, README.md.
%
% Running etex (or latex or pdflatex) on etoc.dtx extracts etoc.sty,
-% etoc.ins, etoc.tex, etoc-DE.tex, and README.md. See README.md for
+% etoc.tex, etoc-DE.tex, and README.md. See README.md for
% further instructions.
}}%
\bgroup\catcode2 0 \catcode`\\ 12 ^^Biffalse
@@ -69,7 +67,7 @@
%<*readme>
<!-- -->
- Source: etoc.dtx (v1.09-2019/03/09)
+ Source: etoc.dtx (v1.09b-2019/11/17)
Author: Jean-Francois Burnol
Author: Christine Roemer et al. (German tranlation)
Info: Completely customisable TOCs
@@ -117,22 +115,13 @@ to the standard `.toc` file.
INSTALLATION
============
-The simplest is to download
-
-> <http://mirrors.ctan.org/install/macros/latex/contrib/etoc.tds.zip>
-
-and then run `unzip etoc.tds.zip -d <DEST>` where `<DEST>` is a
-TDS-compliant repertory.
-
-Else, to extract the package (.sty) and driver (.tex) files from etoc.dtx:
+To extract the package (.sty) and driver (.tex) files from etoc.dtx,
+execute `etex etoc.dtx`.
-- if etoc.ins is present: etex etoc.ins
-- without etoc.ins: etex etoc.dtx
-
-It is also possible to run latex or pdflatex directly on etoc.dtx.
+It is also possible to execute latex or pdflatex directly on etoc.dtx.
To produce etoc.pdf one can run pdflatex (thrice) directly on etoc.dtx or on
-the file etoc.tex which was extracted from previous step.
+the file etoc.tex which was extracted from `etex etoc.dtx` step.
Options can be set in etoc.tex:
@@ -179,12 +168,21 @@ The Authors of this Work are:
collaborators for the translation into German of the documentation.
This Work consists of the main source file etoc.dtx and the
-derived files etoc.sty, etoc.ins, etoc.tex, etoc-DE.tex,
+derived files etoc.sty, etoc.tex, etoc-DE.tex,
etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi.
RECENT CHANGES
==============
+v1.09a, v1.09b \[2019/11/17\]
+-----------------------------
+
+Sync with `memoir v3.7i` which has a better location of the TOC
+hyperref anchor. The `\etocaftertitlehook` can now freely be
+used also with memoir class (formerly its usage in case of
+memoir class was preempted by etoc itself). For more details
+refer to the section "Compatibility with the memoir class".
+
v1.09 \[2019/03/09\]
--------------------
@@ -364,69 +362,6 @@ Thanks to Christine Römer!
%%% mode: latex
%%% End:
%</DEtex>-----------------------------------------------------------------------
-%<*insfile>---------------------------------------------------------------------
-%% Run etex on this file to extract from etoc.dtx:
-%% etoc.sty, etoc.tex, etoc-DE.tex and README.md
-%%
-%% To produce etoc.pdf run pdflatex (thrice) on etoc.tex.
-%%
-%% Options can be set in etoc.tex (and etoc-DE.tex):
-%% - scrdoc class options (paper size, font size, ...)
-%% - with or without source code,
-%% - with dvipdfmx or with latex/pdflatex.
-%%
-%% Since release 1.08h pdflatex is the default in etoc.tex (prior it
-%% was latex+dvipdfmx as it produces smaller PDFs) in order to allow
-%% inclusion via the use of package `attachfile` of about 25 code
-%% samples as file attachment annotations.
-%%
-%% Um etoc-DE.pdf zu erzeugen ist pdflatex dreimal mit etoc-DE.tex
-%% laufen zu lassen.
-%%
-%% Installation:
-%%
-%% etoc.sty -> TDS:tex/latex/etoc/etoc.sty
-%% etoc.dtx -> TDS:source/latex/etoc/etoc.dtx
-%% etoc.pdf -> TDS:doc/latex/etoc/etoc.pdf
-%% etoc-DE.pdf -> TDS:doc/latex/etoc/etoc-DE.pdf
-%% README.md -> TDS:doc/latex/etoc/README.md
-%%
-\input docstrip.tex
-\askforoverwritefalse
-\def\etocpkgpreamble{\defaultpreamble^^J\MetaPrefix^^J%
-\string\NeedsTeXFormat{LaTeX2e}^^J%
-\string\ProvidesPackage{etoc}^^J%
-\space[\etocpkgdate\space\etocpkgversion\space\etocpkgdescription]}%
-\generate{\nopreamble\nopostamble
-\file{README.md}{\from{etoc.dtx}{readme}}%
-\usepostamble\defaultpostamble
-\file{etoc.tex}{\from{etoc.dtx}{tex}}%
-\file{etoc-DE.tex}{\from{etoc.dtx}{DEtex}}%
-\usepreamble\etocpkgpreamble
-\file{etoc.sty}{\from{etoc.dtx}{package}}}%
-\catcode32=13\relax% active space
-\let =\space%
-\Msg{************************************************************************}
-\Msg{*}
-\Msg{* To finish the installation you have to move the following}
-\Msg{* file into a directory searched by TeX:}
-\Msg{*}
-\Msg{* etoc.sty}
-\Msg{*}
-\Msg{* To produce the documentation run latex thrice on file etoc.tex}
-\Msg{* (or etoc-DE.tex) and then run dvipdfmx on file etoc.dvi, resp.}
-\Msg{* etoc-DE.dvi}
-\Msg{*}
-\Msg{* Happy TeXing!}
-\Msg{*}
-\Msg{************************************************************************}
-\ifx\numexpr\undefined
-\Msg{* warning: to get correct utf-8 encoded README.md }%
-\Msg{* do etex etoc.ins and not as here tex etoc.ins }%
-\Msg{************************************************************************}
-\fi
-\endbatchfile
-%</insfile>---------------------------------------------------------------------
%<*none>------------------------------------------------------------------------
^^Bfi^^Begroup
%
@@ -483,7 +418,6 @@ Thanks to Christine Römer!
\generate{\nopreamble\nopostamble
\file{README.md}{\from{etoc.dtx}{readme}}%
\usepostamble\defaultpostamble
- \file{etoc.ins}{\from{etoc.dtx}{insfile}}%
\file{etoc.tex}{\from{etoc.dtx}{tex}}%
\file{etoc-DE.tex}{\from{etoc.dtx}{DEtex}}%
\usepreamble\etocpkgpreamble
@@ -4774,55 +4708,50 @@ Issue \csb{etocdisplay} to return to the default situation that
|\tableofcontents| and variants issue a |\par| to switch to vertical
mode before typesetting the TOC title and contents.
-\section{Starred variants of the \csbhyp{tableofcontents} etc... commands}
+\section{Starred variants and hooks}
\label{tableofcontents*}
\label{localtableofcontents*}
\label{etocbeforetitlehook}
\label{etocaftertitlehook}
\label{etocaftercontentshook}
\label{etocaftertochook}
-\label{etocmemoirtoctotocfmt}
-The \toc, \localtoc, \csa{etocmulticol}, and all their cousins and
-variants have starred variants (the star must be before the other
-arguments). For all but the |memoir| class, they are like the original.
-For the |memoir| class, the original prints an entry in the |.toc| file,
-as is the usage for the original \toc command in that class, whereas the
-starred variants do not, as is the habit in that class.
-
-As soon as one starts using local table of contents one
-discovers that the default |memoir| thing which is to create a
-|chapter| entry for each TOC is not convenient. The command
-\csb{etocmemoirtoctotocfmt}\marg{kind}\marg{name} will change
-the format (\meta{kind} is |chapter|, |section|, |subsection|... and
-\meta{name} can be for example \csa{contentsname}.) The initial set-up
-is with |chapter| and |\contentsname|.
-
-The format of the actual heading of the TOC should also be set
-appropriately (for example with \csa{etoctocstyle}), to use the
-identical division unit as in the first argument to
-\csa{etocmemoirtoctotocfmt}.
-
-A weird situation arises when one has two successive
-\csa{localtableofcontents} (obviously this is not a truly real
-life situation), just after a \csa{part} for example. The first
-one creates (if the default has not been modified as indicated
-above) a Chapter heading which is
-written to the |.toc|. Then the second one thinks to be local
-to this chapter . . . and as a result it displays nothing. The
-fix is to define the second one to be a clone of the first
-one.
-
-Independently of the situation with the |memoir| class there is
-generally speaking a hook macro called
-\csb{etocaftertitlehook} which is inhibited by using the
-starred variants of the displaying commands. Except for the
-|memoir| class, this hook is initially defined to do nothing.
-
-There are also (independently of the document class)
+The \toc, \localtoc, \csa{etocmulticol}, and all their cousins have starred
+variants (the star must be before the other arguments). The non-starred
+variants execute the \csb{etocaftertitlehook}, whose default definition is to
+do nothing. The starred variants do not execute this hook.
+
+For example, imagine you are using |book| class and want \localtoc to use a
+section-like title, but unnumbered. Assuming the main \toc comes first in the
+document, you can insert this after it:
+\begin{verbatim}
+ \etocarticlestyle
+ \renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}}
+\end{verbatim}
+This configures the way \localtoc will behave (or \toc) from now on in the
+document.
+
+The first line tells essentially to use |\section*{\contentsname}|, and the
+second line says to insert the title in the |.toc| file itself (thus to be
+displayed by the main table of contents). Notice that |hyperref| package will
+then automatically create suitable anchor and one should \emph{not} use
+explicitly \cs{phantomsection} here (it would let the anchor be located below
+not above the title).
+
+With this set-up issuing \localtoc|*| will ignore the \csa{etocaftertitlehook}
+hence not send the local toc title to the |.toc| file. This mimicks the
+|memoir| class behavior, and can also be used with it. For more on |memoir|
+class with \etoc, see \autoref{ssec:memoir}.
+
+There are further hook macros:
\csb{etocaftercontentshook}, \csb{etocbeforetitlehook} and
\csb{etocaftertochook} which are initially defined to do nothing and can be
-used for some special effects.
+used for some special effects. They are executed whether or not the table of
+contents command was starred.%
+%
+\footnote{Hackers can test within these hooks if the context is starred or not
+ via an \cs{ifx}\cs{Etoc@aftertitlehook}\cs{@empty} conditional. Perhaps a
+ future release will provide \cs{etociftocisstarred} wrapper.}
\clearpage
@@ -5827,6 +5756,9 @@ example) throughout the document the macros \csa{l@section},
table of contents typeset by \etoc in compatibility mode.
\subsection{Compatibility with the \texttt{memoir} class}
+\label{ssec:memoir}
+\label{etocmemoirtoctotocfmt}
+\label{etocmemoirstyle}
Release |1.07l| has also improved the compatibility with the |memoir| class: its
|appendix| level has been made known to \etoc. It is at the same level as
@@ -5835,6 +5767,62 @@ defined boolean whose activation may be added to the |.toc| file at the suitable
location via |\addtocontents{toc}{..}|, if one needs to distinguish the two
kinds of divisions.
+The |memoir| mechanism relative to \toc versus \toc|*| is obeyed
+automatically, and applies with \localtoc too.
+
+A weird situation arises under when one has two successive
+\csa{localtableofcontents} (obviously this is not a truly real life
+situation), just after a \csa{part} for example. The first one creates (if the
+default has not been modified) a chapter heading which is written to the
+|.toc| (because \etoc by default obeys |memoir| class behaviour). Then the
+second one thinks to be local to this chapter . . . and as a result it
+displays nothing. The fix is to define the second one to be a clone of the
+first one.
+
+Actually, that \localtoc by default uses like \toc a chapter style is often
+inconvenient. One can use the |memoir| macros to modify this: according to
+|memoir| documentation, |\tocheadstart| and |\printtoctitle| seem to be the
+most relevant. If you do that you will probably want the added line in |.toc|
+file to use |{section}| not |{chapter}|. \etoc provides to this effect
+\csb{etocmemoirtoctotocfmt}\marg{kind}\marg{name} whose first argument
+\meta{kind} is |chapter|, |section|, |subsection|, etc... and the second
+argument stands for the title and thus \csa{contentsname} is appropriate. Hence
+\begin{verbatim}
+ \etocmemoirtoctotocfmt{section}{\contentsname}
+\end{verbatim}
+seems the natural choice in this context as an addition to the customizing the
+|memoir| toc related macros to achieve a section like rendering (for more
+details on the latter, please refer to |memoir| manual).
+
+A completely different approach, arguably simpler, is to overrule the \etoc
+default under |memoir| (after the main document \toc which should still use a
+chapter styling) via these simple
+commands:
+\begin{verbatim}
+ \etocarticlestyle % means to use \section*{\contentsname} (and marks)
+ \renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}}
+\end{verbatim}
+exactly as one would do with |book| class for example. Don't use any
+|\phantomsection| in there, |hyperref| hyperlinks will work just fine (and the
+anchor will be slightly above toc title, not below).
+
+Notice that prior to \etoc |1.09b|, the \csb{etocaftertitlehook} macro was
+used by \etoc itself under the |memoir| class. Hence \localtoc obeyed the
+|memoir| mechanism relative to starred or not starred, even after issuing
+\csa{etocarticlestyle}, as long as the user did not redefine
+\csb{etocaftertitlehook}. Starting with |1.09b| (which syncs with a |memoir|
+change at |v3.7i|) it is needed in a case like here where the user issues
+\csa{etocarticlestyle} to also configure explicitly the
+\csa{etocaftertitlehook} to achieve the ``insert title in |.toc|'' effect (if
+so wished), because \etoc uses another mechanism and does not pre-empt usage
+of this user macro anymore.
+
+To recover the \etoc default under |memoir| class one can issue
+\csa{etocmemoirstyle} and then
+\csa{etocmemoirtoctotocfmt}|{chapter}{\contentsname}| (but attention that a
+custom \csb{etocaftertitlehook} will still be obeyed; for info: it will get
+executed before the \cs{cfttocbeforelisthook}).
+
\subsection{Compatibility with package \texttt{tocvsec2}}
\etoc used to be incompatible with package
@@ -5889,6 +5877,7 @@ line containing an \etoc inner command and an identification
number is added to the |.toc| file. The correct local table of
contents will be displayed only on the next |latex| run.
+
\section{Errors and catastrophes}
After using \csa{etocsetstyle} for one level, the remaining
@@ -9423,53 +9412,54 @@ nichts im Token"=Stream hinterlassen.
Mit \csb{etocdisplay} werden (nochmal) von dem |\tableofcontents|"=Befehl und
seinen Varianten zuerst ein |\par| erstellt.
-\section{Gesternde Varianten des \csbhyp{tableofcontents} etc. Befehls}
+\begin{otherlanguage}{english}
+
+\section{Starred variants and hooks}
\label{tableofcontents*}
\label{localtableofcontents*}
\label{etocbeforetitlehook}
\label{etocaftertitlehook}
\label{etocaftercontentshook}
\label{etocaftertochook}
-\label{etocmemoirtoctotocfmt}
-
-Die Befehle \toc, \localtoc, \csa{etocmulticol} und all ihre Cousins und
-Varianten haben Stern"=Varianten (der Stern muss vor den anderen Argumenten
-kommen). Für alle Klassen außer |memoir| verhalten diese sich wie die Originale.
-Für |memoir| jedoch, schreibt das Original einen Eintrag in die |.toc|-Datei,
-genau so wie die Verwendung des echten \toc Befehls in dieser Klasse, während
-aber die Stern"=Variante genau das nicht tut, wie es in |memoir| die Regel ist.
-
-Sobald man damit beginnt, lokale Inhaltsverzeichnisse zu benutzen merkt man,
-dass der |memoir|-Standard, welcher dazu gedacht ist, einen |chapter|-Eintrag
-für jedes Inhaltsverzeichnis zu erzeugen, nicht praktisch ist. Der Befehl
-\csb{etocmemoirtoctotocfmt}\marg{Typ}\allowbreak\marg{name} ändert das Format
-(\meta{Typ} ist wieder |chapter|, |section|, |subsection| etc. und \meta{name}
-kann bspw. \csa{contentsname} sein.) Die Standardwerte für diese Größen sind
-|chapter| und |\contentsname|.
-
-Das Format der tatsächlichen Überschrift des Inhaltsverzeichnisses sollte
-ebenfalls ordnungsgemäß gesetzt werden (z.\,B. mit \csa{etoctocstyle}), um
-einfach die selbe Einheitsgröße zu nutzen wie im ersten Argument von
-\csa{etocmemoirtoctotocfmt}.
-
-Eine ungewöhnliche Situation tritt auf, wenn man zwei aufeinanderfolgende
-\csa{localtableofcontents} hat (offensichtlich ist das eine nicht sehr
-wahrscheinliche Situation), direkt nach einem \csa{part} zum Beispiel. Der erste
-würde dann eine Kapitelüberschrift erzeugen (wenn der Standard nicht geändert
-wurde, wie oben angedeutet), welche in die |.toc|-Datei geschrieben werden
-würde. Das zweite Inhaltsverzeichnis denkt dann, es ist ein lokales zu diesem
-Kapitel gehörig und würde aus diesem Grund nichts darstellen. Die Lösung für
-dieses Problem ist es, das zweite als Klon des ersten zu definieren.
-Unabhängig von der Situation hat man bei der |memoir|-Klasse immer ein
-Hook"=Makro namens \csb{etocaftertitlehook}, welches man unterdrückt, indem man
-die Stern"=Varianten der Darstellungsbefehle nutzt. Außer für die |memoir|-Klasse
-ist dieser Hook dazu gedacht, überhaupt nichts zu tun.
+The \toc, \localtoc, \csa{etocmulticol}, and all their cousins have starred
+variants (the star must be before the other arguments). The non-starred
+variants execute the \csb{etocaftertitlehook}, whose default definition is to
+do nothing. The starred variants do not execute this hook.
-Außerdem gibt es auch \csb{etocaftercontentshook}, \csb{etocbeforetitlehook}
-und \csb{etocaftertochook} all drei ähnlich definiert um nichts zu tun und die
-für einige spezielle Effekte genutzt werden können.
+For example, imagine you are using |book| class and want \localtoc to use a
+section-like title, but unnumbered. Assuming the main \toc comes first in the
+document, you can insert this after it:
+\begin{verbatim}
+ \etocarticlestyle
+ \renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}}
+\end{verbatim}
+This configures the way \localtoc will behave (or \toc) from now on in the
+document.
+
+The first line tells essentially to use |\section*{\contentsname}|, and the
+second line says to insert the title in the |.toc| file itself (thus to be
+displayed by the main table of contents). Notice that |hyperref| package will
+then automatically create suitable anchor and one should \emph{not} use
+explicitly \cs{phantomsection} here (it would let the anchor be located below
+not above the title).
+
+With this set-up issuing \localtoc|*| will ignore the \csa{etocaftertitlehook}
+hence not send the local toc title to the |.toc| file. This mimicks the
+|memoir| class behavior, and can also be used with it. For more on |memoir|
+class with \etoc, see \autoref{ssec:memoir}.
+
+There are further hook macros:
+\csb{etocaftercontentshook}, \csb{etocbeforetitlehook} and
+\csb{etocaftertochook} which are initially defined to do nothing and can be
+used for some special effects. They are executed whether or not the table of
+contents command was starred.%
+%
+\footnote{Hackers can test within these hooks if the context is starred or not
+ via an \cs{ifx}\cs{Etoc@aftertitlehook}\cs{@empty} conditional. Perhaps a
+ future release will provide \cs{etociftocisstarred} wrapper.}
+\end{otherlanguage}
\clearpage
@@ -10483,6 +10473,9 @@ benutzen und der Effekt wird im nächsten Inhaltsverzeichnis durch den
Kompatibilitätsmodus von \etoc sichtbar werden.
\subsection{Kompatibilität mit der \texttt{memoir}-Klasse}
+\label{ssec:memoir}
+\label{etocmemoirtoctotocfmt}
+\label{etocmemoirstyle}
Die Release |1.07l| hat ebenfalls die Kompatibilität mit der |memoir|-Klasse
verbessert: Seine |appendix|-Ebene kann mit \etoc gemacht werden. Es ist die
@@ -10491,6 +10484,71 @@ Test für einige boolesche"=Ausdrücke sein, die aktiviert sein können via eine
Instruktion an die |.toc|-Datei aufgenommen werden, wenn man zwei Arten von
Unterteilungen unterscheidet.
+\begin{otherlanguage}{english}
+
+The |memoir| mechanism relative to \toc versus \toc|*| is obeyed
+automatically, and applies with \localtoc too.
+
+\end{otherlanguage}
+
+Eine ungewöhnliche Situation tritt auf, wenn man zwei aufeinanderfolgende
+\csa{localtableofcontents} hat (offensichtlich ist das eine nicht sehr
+wahrscheinliche Situation), direkt nach einem \csa{part} zum Beispiel. Der erste
+würde dann eine Kapitelüberschrift erzeugen, welche in die |.toc|-Datei geschrieben werden
+würde. Das zweite Inhaltsverzeichnis denkt dann, es ist ein lokales zu diesem
+Kapitel gehörig und würde aus diesem Grund nichts darstellen. Die Lösung für
+dieses Problem ist es, das zweite als Klon des ersten zu definieren.
+
+\begin{otherlanguage}{english}
+
+Actually, that \localtoc by default uses like \toc a chapter style is often
+inconvenient. One can use the |memoir| macros to modify this: according to
+|memoir| documentation, |\tocheadstart| and |\printtoctitle| seem to be the
+most relevant. If you do that you will probably want the added line in |.toc|
+file to use |{section}| not |{chapter}|. \etoc provides to this effect
+\csb{etocmemoirtoctotocfmt}\marg{kind}\marg{name} whose first argument
+\meta{kind} is |chapter|, |section|, |subsection|, etc... and the second
+argument stands for the title and thus \csa{contentsname} is appropriate. Hence
+\begin{verbatim}
+ \etocmemoirtoctotocfmt{section}{\contentsname}
+\end{verbatim}
+seems the natural choice in this context as an addition to the customizing the
+|memoir| toc related macros to achieve a section like rendering (for more
+details on the latter, please refer to |memoir| manual).
+
+A completely different approach, arguably simpler, is to overrule the \etoc
+default under |memoir| (after the main document \toc which should still use a
+chapter styling) via these simple
+commands:
+\begin{verbatim}
+ \etocarticlestyle % means to use \section*{\contentsname} (and marks)
+ \renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}}
+\end{verbatim}
+exactly as one would do with |book| class for example. Don't use any
+|\phantomsection| in there, |hyperref| hyperlinks will work just fine (and the
+anchor will be slightly above toc title, not below).
+
+Notice that prior to \etoc |1.09b|, the \csb{etocaftertitlehook} macro was
+used by \etoc itself under the |memoir| class. Hence \localtoc obeyed the
+|memoir| mechanism relative to starred or not starred, even after issuing
+\csa{etocarticlestyle}, as long as the user did not redefine
+\csb{etocaftertitlehook}. Starting with |1.09b| (which syncs with a |memoir|
+change at |v3.7i|) it is needed in a case like here where the user issues
+\csa{etocarticlestyle} to also configure explicitly the
+\csa{etocaftertitlehook} to achieve the ``insert title in |.toc|'' effect (if
+so wished), because \etoc uses another mechanism and does not pre-empt usage
+of this user macro anymore.
+
+To recover the \etoc default under |memoir| class one can issue
+\csa{etocmemoirstyle} and then
+\csa{etocmemoirtoctotocfmt}|{chapter}{\contentsname}| (but attention that a
+custom \csb{etocaftertitlehook} will still be obeyed; for info: it will get
+executed before the \cs{cfttocbeforelisthook}).
+
+\end{otherlanguage}
+
+
+
\subsection{Kompatibilität mit \texttt{tocvsec2}}
% la traduction allemande était déficiente semble-t-il, j'améliore un peu
@@ -10661,7 +10719,15 @@ Dokumentation erzeugt von der Quelldatei mit dem Stempel
\begin{multicols}{2}
\begin{jfverbatim}
-v1.09 [2019/03/09]^
+v1.09a, v1.09b [2019/11/17]^
+
+ Sync with memoir v3.7i which has a better location of the TOC
+ hyperref anchor. The \etocaftertitlehook can now freely be
+ used also with memoir class (formerly its usage in case of
+ memoir class was preempted by etoc itself). For more details
+ refer to the section "Compatibility with the memoir class".
+
+~v1.09 [2019/03/09]^
New features: \etoclocaltop, \localtableofcontentswithrelativedepth. Thanks
to Tony Roberts for feature request.
@@ -11110,11 +11176,11 @@ v1.09 [2019/03/09]^
\texttt{\parindent 0pt\rightskip 1cm minus 1cm
This documentation has been compiled without inclusion of the source
code. To produce the English documentation with source code included:\endgraf
- \ \ \ \ run etex on etoc.dtx or etoc.ins to produce etoc.tex,\endgraf
+ \ \ \ \ run etex on etoc.dtx to produce etoc.tex,\endgraf
\ \ \ \ then thrice pdflatex on etoc.tex.\endgraf
\medskip
To produce the German documentation with source code included, run etex on
- etoc.dtx or etoc.ins to produce etoc-DE.tex, then edit etoc-DE.tex
+ etoc.dtx to produce etoc-DE.tex, then edit etoc-DE.tex
to set \string\NoSourceCode\space to 0, and run pdflatex thrice on etoc-DE.tex.\endgraf
}%
\fi
@@ -11126,12 +11192,12 @@ v1.09 [2019/03/09]^
% Um
% die englische Dokumentation mit dem Quellcode zu produzieren, ist
% einzubeziehen: \endgraf
- % \ \ \ \ kompilieren etex mit etoc.dtx oder etoc.ins, um etoc.tex zu
+ % \ \ \ \ kompilieren etex mit etoc.dtx, um etoc.tex zu
% produzieren, \endgraf
% \ \ \ \ dann dreimal pdflatex mit etoc.tex.\endgraf
\endgraf
Um die deutsche Dokumentation mit Einbeziehung des Quellcodes zu erstellen,
- ist zu kompilieren etex mit etoc.dtx oder etoc.ins, um etoc-DE.tex zu
+ ist zu kompilieren etex mit etoc.dtx, um etoc-DE.tex zu
erzeugen, dann ist \string\NoSourceCode\space in etoc-DE.tex auf 0 zu
setzen, dann ist pdflatex dreimal mit etoc-DE.tex laufen zu lassen.\endgraf
% \medskip
@@ -12628,10 +12694,14 @@ v1.09 [2019/03/09]^
% \end{macrocode}
% |1.08i| removes definition of |\etoc@startlocaltoc| from here. It is done
% in |\Etoc@localtableofcontents| or uses its default of |\@gobble|.
+%
+% |1.09b| uses a |\def| in non-starred variant for allowing tricks to
+% recognize later on if we are in a starred or non-starred case, whatever the
+% user definition of \cs{etocaftertitlehook} may be.
% \begin{macrocode}
\@ifstar
- {\def\Etoc@aftertitlehook{}\Etoc@table@fcontents}
- {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@table@fcontents}%
+ {\let\Etoc@aftertitlehook\@empty\Etoc@table@fcontents}
+ {\def\Etoc@aftertitlehook{\etocaftertitlehook}\Etoc@table@fcontents}%
}% \etoctableofcontents
\let\tableofcontents\etoctableofcontents
\newcommand*\localtableofcontents{%
@@ -12641,8 +12711,8 @@ v1.09 [2019/03/09]^
\let\tof@begingroup\@empty
\let\tof@endgroup \@empty
\@ifstar
- {\def\Etoc@aftertitlehook{}\Etoc@localtable@fcontents}
- {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@localtable@fcontents}%
+ {\let\Etoc@aftertitlehook\@empty\Etoc@localtable@fcontents}
+ {\def\Etoc@aftertitlehook{\etocaftertitlehook}\Etoc@localtable@fcontents}%
}% \localtableofcontents
% \end{macrocode}
% |1.09| adds \localtocwrdp. The motivation is that it is impossible to set
@@ -13272,19 +13342,44 @@ v1.09 [2019/03/09]^
{\if@restonecol \twocolumn \fi}}
\let\etocreportstyle\etocbookstyle
\let\etocreportstylenomarks\etocbookstylenomarks
+% \end{macrocode}
+% |v3.7i| of memoir has moved the \cs{phantomsection} to a better location,
+% before typesetting the title and we follow suit at |1.09a|, and less rashly
+% at |1.09b|. Formerly \etoc used \cs{etocaftertitlehook} to mimick the
+% memoir code but as its name indicate, it is supposedly executed after the
+% title... and this also had the defect of making \cs{etocaftertitlehook} not
+% anymore a user command. Thus we here use some refactoring of the
+% \cs{Etoc@aftertitlehook} internal mechanism to help recognize if we are
+% in the starred case or not.
+%
+% \cs{phantomsection} is always defined by memoir, empty if hyperref absent.
+% \begin{macrocode}
\def\etocmemoirtoctotocfmt #1#2{%
\def\Etoc@addsuitablecontentsline{\addcontentsline {toc}{#1}{#2}}%
- \renewcommand*\etocaftertitlehook{%
- \ifmem@em@starred@listof
- \else
- \phantomsection
- \aftergroup\Etoc@addsuitablecontentsline
- \fi}%
}
\def\etocmemoirstyle{%
\etocsettocstyle
- {\ensureonecol \par \begingroup \@nameuse {@tocmaketitle}
- \Etoc@aftertitlehook\let\Etoc@aftertitlehook\relax
+ {\ensureonecol \par \begingroup \phantomsection
+ \ifx\Etoc@aftertitlehook\@empty
+ \else
+ % non-starred variant
+ \ifmem@em@starred@listof
+ \else
+ \Etoc@addsuitablecontentsline
+ \fi
+ \fi
+ \@nameuse {@tocmaketitle} %<< space token here from memoir code
+ \ifx\Etoc@aftertitlehook\@empty
+ \else
+% \end{macrocode}
+% Execute etoc hook before the \cs{cfttocbeforelisthook} and keep distinction
+% between starred and non-starred contexts for other hooks. Notice that the
+% memoir class way of implementing \cs{tableofcontents} leaves no way for code
+% executed by the TOC code to know if it is executed in starred or non-starred
+% context.
+% \begin{macrocode}
+ \Etoc@aftertitlehook \let \Etoc@aftertitlehook \relax
+ \fi
\parskip \cftparskip \@nameuse {cfttocbeforelisthook}}
{\@nameuse {cfttocafterlisthook}\endgroup\restorefromonecol}}
% \end{macrocode}
@@ -13677,7 +13772,7 @@ v1.09 [2019/03/09]^
Grave accent \` Left brace \{ Vertical bar \|
Right brace \} Tilde \~}
-\CheckSum{3497}%
+\CheckSum{3506}%
\csname check@checksum\endcsname
\Finale
diff --git a/macros/latex/contrib/etoc/etoc.pdf b/macros/latex/contrib/etoc/etoc.pdf
index 1b43c65c89..111b8b2b7e 100644
--- a/macros/latex/contrib/etoc/etoc.pdf
+++ b/macros/latex/contrib/etoc/etoc.pdf
Binary files differ