summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/etoc/README.md46
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etoc.pdfbin819311 -> 890715 bytes
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etoc.tex2
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-5.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-6.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-7.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex16
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-20-A.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-20-B.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-21-A.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-21-B.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-22-A.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex90
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex27
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex25
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex20
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex62
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-28.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-29.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-30-A.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-30-B.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-31.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-32.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-40.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex (renamed from Master/texmf-dist/doc/latex/etoc/etocsnippet-46.tex)4
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex76
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex71
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex50
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex79
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex94
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-48.tex74
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-52-A.tex47
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-52-B.tex31
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-53.tex67
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex50
-rw-r--r--Master/texmf-dist/source/latex/etoc/etoc.dtx2178
-rw-r--r--Master/texmf-dist/tex/latex/etoc/etoc.sty19
37 files changed, 1870 insertions, 1318 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/README.md b/Master/texmf-dist/doc/latex/etoc/README.md
index b58480ffb9e..96322539d80 100644
--- a/Master/texmf-dist/doc/latex/etoc/README.md
+++ b/Master/texmf-dist/doc/latex/etoc/README.md
@@ -1,6 +1,6 @@
<!-- -->
- Source: etoc.dtx (1.09g)
+ Source: etoc.dtx (1.09i)
Author: Jean-Francois Burnol
Info: Completely customisable TOCs
License: LPPL 1.3c
@@ -97,6 +97,23 @@ etoc.sty, etoc.tex, etoc.pdf, etoc.dvi.
RECENT CHANGES
==============
+1.09i \[2022/11/21\]
+--------------------
+
+Fix bug showing when a document uses both `\etocchecksemptiness` and
+`\etocsetlocaltop.toc`: the `start` and `finish` parts of some levels
+were executed possibly causing extra printed output.
+
+More hyperlinking in the implementation part of the documentation.
+
+1.09h \[2022/11/20\]
+--------------------
+
+Documentation improvements. In particular, attached code snippets
+are now visible via their filenames in the page margins. Also,
+command names are doubly hyperlinked: first half links to the devoted
+part of the user manual, second half links to the implementation part.
+
1.09g \[2022/11/17\]
--------------------
@@ -138,30 +155,3 @@ Also add `\etocimmediatesetlocaltop.toc`.
Fix an obscure bug (see source code comments) in the `\etocsetlocaltop.toc`
mechanism.
-
-1.09e \[2021/09/23\]
---------------------
-
-Needed (if etoc is used without hyperref) updates to
-internal macros to prepare for the upcoming LaTeX November
-2021 change to `\contentsline`.
-
-Related updates to the user macro `\etoctoccontentsline`.
-
-1.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`.
-
-1.09c \[2020/05/15\]
---------------------
-
-Syncs with KOMA-script deprecation of `\iftocfeature`.
diff --git a/Master/texmf-dist/doc/latex/etoc/etoc.pdf b/Master/texmf-dist/doc/latex/etoc/etoc.pdf
index 1cf82dd4741..1b24ab3fc63 100644
--- a/Master/texmf-dist/doc/latex/etoc/etoc.pdf
+++ b/Master/texmf-dist/doc/latex/etoc/etoc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/etoc/etoc.tex b/Master/texmf-dist/doc/latex/etoc/etoc.tex
index 75ac30e800e..d719ee65fec 100644
--- a/Master/texmf-dist/doc/latex/etoc/etoc.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etoc.tex
@@ -1,6 +1,6 @@
%%
%% Package: etoc
-%% Version: 1.09g (DEVELOPMENT)
+%% Version: 1.09i
%% License: LPPL 1.3c
%% Copyright (C) 2012-2022 Jean-Francois Burnol
%% <jfbu at free dot fr>
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-5.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex
index d56a57986d7..405ce84eea6 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-5.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-5.tex'
+%% LaTeX2e file `etocsnippet-01.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\begingroup\parindent 0pt \parfillskip 0pt \leftskip 0cm \rightskip 1cm
\etocsetstyle {section}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-6.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex
index 622dc90723b..919cbe51c0e 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-6.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-6.tex'
+%% LaTeX2e file `etocsnippet-02.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\begingroup
\newcommand*{\DotsAndPage}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-7.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex
index 772e5827896..604e7a6bf32 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-7.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-7.tex'
+%% LaTeX2e file `etocsnippet-03.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\begingroup % we start a group to keep the style changes local
\newlength{\tocleftmargin} \setlength{\tocleftmargin}{5cm}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex
new file mode 100644
index 00000000000..aeebe8259b9
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex
@@ -0,0 +1,16 @@
+%% LaTeX2e file `etocsnippet-04.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\begin{figure}[ht!]
+ \centering
+ \begingroup
+ \etocstandardlines
+ \renewcommand{\etocbkgcolorcmd}{\color{green!5}}
+ \renewcommand{\etocbelowtocskip}{0pt\relax}
+ \fboxsep1ex
+ \etocframedstyle [1]{\fbox{\makebox[.5\linewidth]{\etocfontminusone
+ \hyperref[toc:c]{I am from far away}}}}
+ \tableofcontents \label{toc:d} \ref{toc:c}
+ \endgroup
+\end{figure}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-A.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex
index bec3d0f9feb..5837cb9c717 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-A.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-20-A.tex'
+%% LaTeX2e file `etocsnippet-05.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\makeatletter
\newcommand{\MyStandardTOC}{%
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-B.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex
index 7122dcc6eb0..f2864ff9676 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-B.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-20-B.tex'
+%% LaTeX2e file `etocsnippet-06.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\etocsetstyle{section}{}
{\ifnum\etocthenumber=4
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-A.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex
index f2343282233..9e25d02804e 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-A.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-21-A.tex'
+%% LaTeX2e file `etocsnippet-07.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
% it will be easy to globally shift the TOC horizontally if needed
\def\TOCleftmargin {0pt}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-B.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex
index e5c18133b29..883664e559b 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-B.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-21-B.tex'
+%% LaTeX2e file `etocsnippet-08.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\makeatletter
\newcommand*\TOClocalstyle {%
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-22-A.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex
index a8d163e2269..8982e5513de 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-22-A.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-22-A.tex'
+%% LaTeX2e file `etocsnippet-09.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\etocdefaultlines
\begingroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex
index 543079b760c..a325452497d 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex
@@ -1,16 +1,80 @@
%% LaTeX2e file `etocsnippet-10.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
%%
-\begin{figure}[ht!]
- \centering
- \begingroup
- \etocstandardlines
- \renewcommand{\etocbkgcolorcmd}{\color{green!5}}
- \renewcommand{\etocbelowtocskip}{0pt\relax}
- \fboxsep1ex
- \etocframedstyle [1]{\fbox{\makebox[.5\linewidth]{\etocfontminusone
- \hyperref[toc:c]{I am from far away}}}}
- \tableofcontents \label{toc:d} \ref{toc:c}
- \endgroup
+\begin{figure}[htbp!]\centering
+\colorlet{subsecnum}{black}
+\colorlet{secbackground}{green!30}
+\colorlet{tocbackground}{red!20!green!20}
+
+\renewcommand{\etocbkgcolorcmd}{\color{tocbackground}}
+\renewcommand{\etocleftrulecolorcmd}{\color{tocbackground}}
+\renewcommand{\etocrightrulecolorcmd}{\color{tocbackground}}
+\renewcommand{\etocbottomrulecolorcmd}{\color{tocbackground}}
+\renewcommand{\etoctoprulecolorcmd}{\color{tocbackground}}
+
+\renewcommand{\etocleftrule}{\vrule width 3cm}
+\renewcommand{\etocrightrule}{\vrule width 1cm}
+\renewcommand{\etocbottomrule}{\hrule height 12pt}
+\renewcommand{\etoctoprule}{\hrule height 12pt}
+
+\renewcommand{\etocinnertopsep}{0pt}
+\renewcommand{\etocinnerbottomsep}{0pt}
+\renewcommand{\etocinnerleftsep}{0pt}
+\renewcommand{\etocinnerrightsep}{0pt}
+
+\newcommand\shiftedwhiterule[2]{%
+ \hbox to \linewidth{\color{white}%
+ \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip
+ \vskip#2}
+
+\etocsetstyle{subsubsection}
+{\etocskipfirstprefix}
+{\shiftedwhiterule{\leftskip}{6pt}}
+{\sffamily\footnotesize
+ \leftskip2.3cm\hangindent1cm\rightskip.5cm\relax
+ \makebox[1cm][l]{\color{subsecnum}\etocnumber}%
+ \color{black}\etocname
+ \nobreak\leaders\hbox to.2cm{\hss.}\hfill
+ \rlap{\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}\par
+ \nointerlineskip\vskip3pt}
+{}
+
+\etocsetstyle{subsection}
+{\etocskipfirstprefix}
+{\shiftedwhiterule{1.5cm}{6pt}}
+{\sffamily\small
+ \leftskip1.5cm\hangindent.8cm\rightskip.5cm\relax
+ \makebox[.75cm][l]{\color{subsecnum}\etocnumber}%
+ \color{black}\etocname
+ \nobreak\leaders\hbox to.2cm{\hss.}\hfill
+ \rlap{\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}\par
+ \nointerlineskip\vskip3pt}
+{}
+
+\newcommand{\coloredstuff}[2]{%
+ \leftskip0pt\rightskip0pt\parskip0pt
+ \fboxsep0pt % \colorbox uses \fboxsep also when no frame!
+ \noindent\colorbox{secbackground}
+ {\parbox{\linewidth}{%
+ \vskip5pt
+ {\noindent\color{#1}#2\par}\nointerlineskip
+ \vskip3pt}}%
+ \par\nointerlineskip}
+
+\etocsetstyle{section}
+{\coloredstuff{blue}{\hfil \bfseries\large Contents of Part One\hfil}}
+{\vskip3pt\sffamily\small}
+{\coloredstuff{blue}
+ {\leftskip1.5cm\rightskip.5cm\parfillskip-\rightskip
+ \makebox[0pt][r]{\makebox[.5cm][l]{\etocnumber}}%
+ \etocname\nobreak\hfill\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}%
+ \vskip6pt}
+{}
+
+\etocframedstyle[1]{}
+\tableofcontents \label{toc:floating} \ref{toc:overview}
+\vspace{-\baselineskip}
+\centeredline{|\tableofcontents \ref{toc:overview}|
+(\emph{cf.} \hyperref[toc:clone]{this other toc})}
\end{figure}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex
new file mode 100644
index 00000000000..597ee7a3b90
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex
@@ -0,0 +1,27 @@
+%% LaTeX2e file `etocsnippet-11.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\begingroup
+\newsavebox{\forsubsections}
+\etocsetstyle{part}{\upshape. \etocskipfirstprefix}
+ {. \upshape}
+ {\bfseries\etocname:~~}
+ {}
+\etocsetstyle{section}{\itshape\etocskipfirstprefix}
+ {, }
+ {\mdseries\etocname}
+ {}
+\etocsetstyle{subsection}
+ {\begin{lrbox}{\forsubsections}\footnotesize\upshape\etocskipfirstprefix}
+ {; }
+ {\etocname}
+ {.\end{lrbox}\footnote{\unhbox\forsubsections}}
+\etocsetstyle{subsubsection}
+ { (\itshape\etocskipfirstprefix}
+ {, }
+ {\etocname}
+ {\/\upshape)}
+\etocsettocstyle{Here is the inline table of contents. }{.\par}
+\tableofcontents \label{toc:crazyinline}
+\endgroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex
new file mode 100644
index 00000000000..83c2f15477e
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex
@@ -0,0 +1,25 @@
+%% LaTeX2e file `etocsnippet-12.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+ < in the preamble >
+\newcounter{visibletoc}
+\renewcommand{\etocaftertitlehook}
+ {\stepcounter{visibletoc}\etoctoccontentsline{visibletoc}{\thevisibletoc}}
+\etocsetlevel{visibletoc}{6}
+\begin{document}
+ < document body >
+\subsection{Surprising uses of etoc}
+\begingroup
+ \etocinline
+ \etocsetlevel{part}{1}
+ % \etocsetlevel{chapter}{1} % (no chapters in scrartcl class)
+ \etocsetlevel{visibletoc}{0}
+ \etocsetstyle{visibletoc}
+ {\etocskipfirstprefix}{, }{{\color{niceone}\etocname}}{}
+ \etocsettocstyle{}{} % don't set any title, rules or frame or multicol!
+ \etocsetnexttocdepth{visibletoc} % display only the `visibletoc' entries from .toc
+
+Here is the numbered and linked list of all tables of contents which are
+displayed within this document: \tableofcontents.
+\endgroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex
new file mode 100644
index 00000000000..a52e1fc8534
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex
@@ -0,0 +1,20 @@
+%% LaTeX2e file `etocsnippet-13.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+ \etocsetnexttocdepth{2} % sections are at level 1 and will show up
+\begingroup
+ \etocsetlevel{exercise}{2} % 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}
+ \etocsetstyle{section}{}{}
+ {\noindent\strut{\bfseries\large\etocnumber\hskip.5em\etocname}\par
+ \nopagebreak[3]}{}
+ \etocruledstyle[4]{\Large\bfseries List of the exercises}
+ \setlength{\columnseprule}{.4pt}
+ \tableofcontents
+\endgroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex
new file mode 100644
index 00000000000..fa6af45363b
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex
@@ -0,0 +1,62 @@
+%% LaTeX2e file `etocsnippet-14.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+% \newtoks\treetok % put this (uncommented) preferably in the preamble
+% \newtoks\tmptok % (idem)
+
+\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2
+ #1\expandafter\expandafter\expandafter
+ {\expandafter\the\expandafter #1#2}}
+
+\newcommand*\PrepareSectionNode{%
+ \tmptok {\centering\bfseries}%
+ \appendtotok\tmptok\etocthelinkedname
+ \edef\foresttreenode{ [{\noexpand\parbox{2cm}{\the\tmptok}}}%
+}
+
+\newcommand*{\PrepareSubsectionNode}{%
+ \tmptok {\raggedright}%
+ \appendtotok\tmptok\etocthelinkedname
+ \edef\foresttreenode{ [{\noexpand\parbox{6cm}{\the\tmptok}}}%
+}
+
+\etocsetstyle{section}
+ {\etocskipfirstprefix}
+ {\appendtotok\treetok{ ]}}
+ {\PrepareSectionNode \appendtotok\treetok\foresttreenode}
+ {\appendtotok\treetok{ ]}}
+
+\etocsetstyle{subsection}
+ {\etocskipfirstprefix}
+ {\appendtotok\treetok{ ]}}
+ {\PrepareSubsectionNode \appendtotok\treetok\foresttreenode}
+ {\appendtotok\treetok{ ]}}
+
+\etocsettocstyle
+ {\treetok{[{\hyperref[part:overview]{Overview}}}}
+ {\global\appendtotok\treetok{ ]}}
+
+% forest does not like @\the\treetok if \treetok is empty. On first latex
+% run, this will be the case because the TOC style defined above will not
+% have been executed, as the label {toc:overview} does not refer to a valid
+% TOC yet. So we must give a safe default value to \treetok
+\treetok{[{run latex again}]}
+
+\begin{figure}[th!]\centering
+ \etocsetnexttocdepth{subsection}
+ \tableofcontents \label{toc:forest}\ref{toc:overview}
+ \hypersetup{hidelinks}%
+ \bracketset{action character=@}
+ \begin{forest}
+ for tree={anchor=center,child anchor=west,
+ grow'=east,draw,thick,
+ edge={draw,thick,dashed,color=teal}},
+ where={level()==1}{circle,thick,fill=blue!5,
+ before computing xy={l=3cm}}{},
+ where={level()==2}{fill=red!5,
+ before computing xy={l=6cm}}{},
+ rectangle, thick, fill=cyan!5, inner sep=6pt,
+ @\the\treetok
+ \end{forest}
+\end{figure}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-28.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex
index 25d6c3fca1d..a03e35c1318 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-28.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-28.tex'
+%% LaTeX2e file `etocsnippet-15.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
% \newtoks\treetok % put this (uncommented) preferably in the preamble
% \newtoks\sectiontok
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-29.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex
index 2b74297a927..a5adf6d4aa7 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-29.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-29.tex'
+%% LaTeX2e file `etocsnippet-16.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\begingroup
% \newtoks\treetok % done in preamble
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-A.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex
index f595beff21e..45e48497685 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-A.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-30-A.tex'
+%% LaTeX2e file `etocsnippet-17.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\begingroup
\etocglobaldefs % necessary for \etocname etc... to survive &
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-B.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex
index c4b11e3404f..3be30b4d1ee 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-B.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-30-B.tex'
+%% LaTeX2e file `etocsnippet-18.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\begin{center}
\etocsetstyle{section}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-31.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex
index 6bc38ea7e93..f4a6baa380e 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-31.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-31.tex'
+%% LaTeX2e file `etocsnippet-19.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\makeatletter
\newcommand*\TOCcompute@numwidths [2]{% #1=empty/"local", #2=minimal indent
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-32.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex
index 72e3afd3eee..3c225162cc6 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-32.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-32.tex'
+%% LaTeX2e file `etocsnippet-20.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\etocsetstyle{section}
{\begin{enumerate}}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-40.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex
index a9f07c802c0..099c6217670 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-40.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-40.tex'
+%% LaTeX2e file `etocsnippet-21.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\etocsettocdepth {subsubsection} % set the initial tocdepth
\etocdefaultlines % use the package default line styles. At this early stage in
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-46.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex
index 39554d854ec..bc391b9a60f 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-46.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex
@@ -1,6 +1,6 @@
-%% LaTeX2e file `etocsnippet-46.tex'
+%% LaTeX2e file `etocsnippet-22.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape
\fbox{\parbox{.6\linewidth}{
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
index f631bfba37d..2fbde23154e 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
@@ -1,11 +1,11 @@
%% LaTeX2e file `etocsnippet-23.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
-\begin{figure}[htbp!]\centering
-\colorlet{subsecnum}{black}
-\colorlet{secbackground}{green!30}
-\colorlet{tocbackground}{red!20!green!20}
+\begingroup
+\definecolor{subsecnum}{RGB}{13,151,225}
+\definecolor{secbackground}{RGB}{0,177,235}
+\definecolor{tocbackground}{RGB}{212,237,252}
\renewcommand{\etocbkgcolorcmd}{\color{tocbackground}}
\renewcommand{\etocleftrulecolorcmd}{\color{tocbackground}}
@@ -13,8 +13,8 @@
\renewcommand{\etocbottomrulecolorcmd}{\color{tocbackground}}
\renewcommand{\etoctoprulecolorcmd}{\color{tocbackground}}
-\renewcommand{\etocleftrule}{\vrule width 3cm}
-\renewcommand{\etocrightrule}{\vrule width 1cm}
+\renewcommand{\etocleftrule}{\vrule width 1cm}
+\renewcommand{\etocrightrule}{\vrule width .5cm}
\renewcommand{\etocbottomrule}{\hrule height 12pt}
\renewcommand{\etoctoprule}{\hrule height 12pt}
@@ -25,32 +25,27 @@
\newcommand\shiftedwhiterule[2]{%
\hbox to \linewidth{\color{white}%
- \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip
- \vskip#2}
+ \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip\vskip#2}
-\etocsetstyle{subsubsection}
-{\etocskipfirstprefix}
-{\shiftedwhiterule{\leftskip}{6pt}}
-{\sffamily\footnotesize
- \leftskip2.3cm\hangindent1cm\rightskip.5cm\relax
- \makebox[1cm][l]{\color{subsecnum}\etocnumber}%
- \color{black}\etocname
- \nobreak\leaders\hbox to.2cm{\hss.}\hfill
- \rlap{\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}\par
- \nointerlineskip\vskip3pt}
-{}
+\etocsetstyle{subsubsection}{\etocskipfirstprefix}
+ {\shiftedwhiterule{\leftskip}{6pt}}
+ {\sffamily\footnotesize
+ \leftskip2.5cm\hangindent1cm\rightskip1cm\noindent
+ \hbox to 1cm{\color{subsecnum}\etocnumber\hss}%
+ \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill
+ \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par
+ \nointerlineskip\vskip3pt}
+ {}
-\etocsetstyle{subsection}
-{\etocskipfirstprefix}
-{\shiftedwhiterule{1.5cm}{6pt}}
-{\sffamily\small
- \leftskip1.5cm\hangindent.8cm\rightskip.5cm\relax
- \makebox[.75cm][l]{\color{subsecnum}\etocnumber}%
- \color{black}\etocname
- \nobreak\leaders\hbox to.2cm{\hss.}\hfill
- \rlap{\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}\par
- \nointerlineskip\vskip3pt}
-{}
+\etocsetstyle{subsection}{\etocskipfirstprefix}
+ {\shiftedwhiterule{1.5cm}{6pt}}
+ {\sffamily\small
+ \leftskip1.5cm\hangindent1cm\rightskip1cm\noindent
+ \hbox to 1cm{\color{subsecnum}\etocnumber\hss}%
+ \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill
+ \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par
+ \nointerlineskip\vskip6pt}
+ {}
\newcommand{\coloredstuff}[2]{%
\leftskip0pt\rightskip0pt\parskip0pt
@@ -63,18 +58,17 @@
\par\nointerlineskip}
\etocsetstyle{section}
-{\coloredstuff{blue}{\hfil \bfseries\large Contents of Part One\hfil}}
+{\coloredstuff{white}
+ {\hfil \hyperref[toc:b]{\bfseries\large I am a twin of
+ that other TOC (click me!)}\hfil}}
{\vskip3pt\sffamily\small}
-{\coloredstuff{blue}
+{\coloredstuff{white}
{\leftskip1.5cm\rightskip.5cm\parfillskip-\rightskip
- \makebox[0pt][r]{\makebox[.5cm][l]{\etocnumber}}%
- \etocname\nobreak\hfill\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}%
- \vskip6pt}
+ \makebox[0pt][r]{\makebox[.5cm][r]{\etocnumber\hspace{.2cm}}}%
+ \etocname\hfill\makebox[.5cm][r]{\etocpage\hspace{.2cm}}}%
+ \vskip6pt }
{}
\etocframedstyle[1]{}
-\tableofcontents \label{toc:floating} \ref{toc:overview}
-\vspace{-\baselineskip}
-\centeredline{|\tableofcontents \ref{toc:overview}|
-(\emph{cf.} \hyperref[toc:clone]{this other toc})}
-\end{figure}
+\tableofcontents \label{toc:clone} \ref{toc:globalcmds}
+\endgroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex
index a07fea86498..a3535259304 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex
@@ -1,27 +1,48 @@
%% LaTeX2e file `etocsnippet-24.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
%%
-\begingroup
-\newsavebox{\forsubsections}
-\etocsetstyle{part}{\upshape. \etocskipfirstprefix}
- {. \upshape}
- {\bfseries\etocname:~~}
- {}
-\etocsetstyle{section}{\itshape\etocskipfirstprefix}
- {, }
- {\mdseries\etocname}
- {}
-\etocsetstyle{subsection}
- {\begin{lrbox}{\forsubsections}\footnotesize\upshape\etocskipfirstprefix}
- {; }
- {\etocname}
- {.\end{lrbox}\footnote{\unhbox\forsubsections}}
-\etocsetstyle{subsubsection}
- { (\itshape\etocskipfirstprefix}
- {, }
- {\etocname}
- {\/\upshape)}
-\etocsettocstyle{Here is the inline table of contents. }{.\par}
-\tableofcontents \label{toc:crazyinline}
-\endgroup
+\newsavebox\firstnamei \newsavebox\firstnumberi
+\newsavebox\lastnamei \newsavebox\lastnumberi
+\newsavebox\firstnameii \newsavebox\firstnumberii
+\newsavebox\lastnameii \newsavebox\lastnumberii
+\newcounter{mycounti} \newcounter{mycountii}
+\newcommand*{\thispartstatsauxi}{} \newcommand*{\thispartstatsauxii}{}
+\newcommand*{\oldtocdepth}{}
+\newcommand*{\thispartstats}{%
+ \setcounter{mycounti}{0}%
+ \setcounter{mycountii}{0}%
+ \def\thispartstatsauxi{%
+ \sbox{\firstnamei}{\footnotesize\etocname}%
+ \sbox{\firstnumberi}{\footnotesize\etocnumber}%
+ \def\thispartstatsauxi{}}%
+ \def\thispartstatsauxii{%
+ \sbox{\firstnameii}{\footnotesize\etocname}%
+ \sbox{\firstnumberii}{\footnotesize\etocnumber}%
+ \def\thispartstatsauxii{}}%
+ \begingroup
+ \etocsetstyle{subsection} {} {}
+ {\thispartstatsauxii
+ \stepcounter{mycountii}%
+ \sbox{\lastnameii}{\footnotesize\etocname}%
+ \sbox{\lastnumberii}{\footnotesize\etocnumber}} {}%
+ \etocsetstyle{section} {} {}
+ {\thispartstatsauxi
+ \stepcounter{mycounti}%
+ \sbox{\lastnamei}{\footnotesize\etocname}%
+ \sbox{\lastnumberi}{\footnotesize\etocnumber}}
+ {{\footnotesize\itshape
+ Here are some statistics for this part: it contains \arabic{mycounti}
+ section\ifnum\value{mycounti}>1 s\fi{} and \arabic{mycountii}
+ subsection\ifnum\value{mycountii}>1 s\fi. The name of the first section is
+ \unhbox\firstnamei{} and the corresponding number is \unhbox\firstnumberi.
+ The name of the last section is \unhbox\lastnamei{} and its number is
+ \unhbox\lastnumberi. The name of the first subsection is \unhbox\firstnameii{}
+ and the corresponding number is \unhbox\firstnumberii. The name of the last
+ subsection is \unhbox\lastnameii{} and its number is \unhbox\lastnumberii.\par}}%
+ \etocinline % cancels the automatic \par automatically before the TOC
+ \etocsettocstyle {}{}
+ \etocsetnexttocdepth{2}%
+ \localtableofcontents % to be used at the top level of a Part.
+ \endgroup
+}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex
index 1ac3de3b69a..e820fbfd1c4 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex
@@ -1,25 +1,31 @@
%% LaTeX2e file `etocsnippet-25.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% from source `etoc' on 2022/11/21.
%%
- < in the preamble >
-\newcounter{visibletoc}
-\renewcommand{\etocaftertitlehook}
- {\stepcounter{visibletoc}\etoctoccontentsline{visibletoc}{\thevisibletoc}}
-\etocsetlevel{visibletoc}{6}
-\begin{document}
- < document body >
-\subsection{Surprising uses of etoc}
-\begingroup
- \etocinline
- \etocsetlevel{part}{1}
- % \etocsetlevel{chapter}{1} % (no chapters in scrartcl class)
- \etocsetlevel{visibletoc}{0}
- \etocsetstyle{visibletoc}
- {\etocskipfirstprefix}{, }{{\color{niceone}\etocname}}{}
- \etocsettocstyle{}{} % don't set any title, rules or frame or multicol!
- \etocsetnexttocdepth{visibletoc} % display only the `visibletoc' entries from .toc
-
-Here is the numbered and linked list of all tables of contents which are
-displayed within this document: \tableofcontents.
-\endgroup
+\makeatletter
+\newcommand*\firstsubname {} \newcommand*\lastsubname {}
+\newcommand*\firstsubnumber {} \newcommand*\lastsubnumber {}
+\newcommand*\thisspecialstatsaux{}
+\newcommand*{\thisspecialstats}{%
+ \setcounter{mycounti}{0}%
+ \def\thisspecialstatsaux{%
+ \let\firstsubname\etocthelinkedname
+ \let\firstsubnumber\etocthelinkednumber
+ \def\thisspecialstatsaux{}}
+ \begingroup
+ \etocsetstyle{subsection} {} {}
+ {\thisspecialstatsaux
+ \stepcounter{mycounti}%
+ \let\lastsubname\etocthelinkedname
+ \let\lastsubnumber\etocthelinkednumber }
+ {Here are some statistics for this section. It contains \arabic{mycounti}
+ subsections. The name of its first is \emph{\firstsubname{}} and the
+ corresponding number is {\firstsubnumber}. The name of the last
+ subsection is \emph{\lastsubname{}} and its number is {\lastsubnumber}.}%
+ \etocsettocstyle {}{}
+ \etocinline
+ \etocsetnexttocdepth {1}%
+ \localtableofcontents % to be used within a section
+ \endgroup
+}
+\makeatother
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex
index 756547769f6..e2c59ea86b4 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex
@@ -1,20 +1,67 @@
%% LaTeX2e file `etocsnippet-26.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
%%
- \etocsetnexttocdepth{2} % sections are at level 1 and will show up
+\etocsetnexttocdepth {all}
\begingroup
- \etocsetlevel{exercise}{2} % 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}
- \etocsetstyle{section}{}{}
- {\noindent\strut{\bfseries\large\etocnumber\hskip.5em\etocname}\par
- \nopagebreak[3]}{}
- \etocruledstyle[4]{\Large\bfseries List of the exercises}
- \setlength{\columnseprule}{.4pt}
- \tableofcontents
+\parindent 0pt \leftskip 0cm \rightskip .75cm \parfillskip -\rightskip
+\newcommand*{\EndParWithPagenoInMargin}
+ {\nobreak\hfill
+ \makebox[0.75cm][r]{\mdseries\normalsize\etocpage}%
+ \par}
+\renewcommand*\etoctoclineleaders
+ {\hbox{\normalfont\normalsize\hbox to .75ex {\hss.\hss}}}
+\newcommand*{\EndParWithPagenoInMarginAndLeaders}
+ {\nobreak\leaders\etoctoclineleaders\hfill
+ \makebox[0.75cm][r]{\mdseries\normalsize\etocpage}%
+ \par }
+\etocsetstyle {part}
+ {}
+ {\leavevmode\leftskip 1cm\relax}
+ {\bfseries\large\llap{\makebox[1cm][r]{\etocnumber\ \ }}%
+ \etocname\EndParWithPagenoInMargin\smallskip}
+ {}
+\etocsetstyle {section}
+ {}
+ {\leavevmode\leftskip 1.75cm\relax}
+ {\bfseries\normalsize\llap{\makebox[.75cm][l]{\etocnumber}}%
+ \etocname\EndParWithPagenoInMarginAndLeaders}
+ {}
+\etocsetstyle {subsection}
+ {}
+ {\leavevmode\leftskip 2.75cm\relax }
+ {\mdseries\normalsize\llap{\makebox[1cm][l]{\etocnumber}}%
+ \etocname\EndParWithPagenoInMarginAndLeaders}
+ {}
+\etocsetstyle {subsubsection}
+ {}
+ {\leavevmode\leftskip 4cm\relax }
+ {\mdseries\normalsize\llap{\makebox[1.25cm][l]{\etocnumber}}%
+ \etocname\EndParWithPagenoInMarginAndLeaders}
+ {}
+\etocsetstyle {paragraph}
+ {}
+ {\leavevmode\leftskip 5.5cm\relax }
+ {\mdseries\normalsize\llap{\makebox[1.5cm][l]{\etocnumber}}%
+ \etocname\EndParWithPagenoInMarginAndLeaders}
+ {}
+\etocsettagdepth {preamble} {none}
+\etocsettagdepth {overview} {part}
+%\etocsettagdepth {arbitrarily}{part}% not needed explicitely, keeps value
+%\etocsettagdepth {examples} {part}
+%\etocsettagdepth {surprising} {part}
+%\etocsettagdepth {linestyles} {part}
+\etocsettagdepth {globalcmds} {paragraph}
+\etocsettagdepth {custom} {part}
+%\etocsettagdepth {tips} {part}
+%\etocsettagdepth {etocandworld}{part}
+\etocsettagdepth {code} {none}
+\renewcommand\etoctoprule {\hrule height 3pt\relax }
+\renewcommand\etoctoprulecolorcmd {\color{blue}}
+\renewcommand\etocaftercontentshook
+ {\medskip\begingroup \color{blue}\hrule height 3pt \endgroup }
+\etocruledstyle [1]{\Large\bfseries
+ \fbox{\makebox[8cm]{A TOC using depth tags}}}
+\sloppy
+\tableofcontents
\endgroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex
index 4bb9e6d11e4..e4340697d6d 100644
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex
@@ -1,62 +1,50 @@
%% LaTeX2e file `etocsnippet-27.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
%%
-% \newtoks\treetok % put this (uncommented) preferably in the preamble
-% \newtoks\tmptok % (idem)
-
+\newtoks\toctabletok
\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2
- #1\expandafter\expandafter\expandafter
- {\expandafter\the\expandafter #1#2}}
-
-\newcommand*\PrepareSectionNode{%
- \tmptok {\centering\bfseries}%
- \appendtotok\tmptok\etocthelinkedname
- \edef\foresttreenode{ [{\noexpand\parbox{2cm}{\the\tmptok}}}%
+ #1\expandafter\expandafter\expandafter {\expandafter\the\expandafter #1#2}}
+
+\newcommand*\PreparePart{%
+ \toks0 \expandafter{\etocthelinkednumber}%
+ \toks2 \expandafter{\etocthelinkedname}%
+ \toks4 \expandafter{\etocthelinkedpage}%
+ \edef\toctablepiece {\noexpand\hline
+ \noexpand\strut\the\toks0 &\noexpand\bfseries\the\toks2
+ &\the\toks4 \noexpand\\\noexpand\hline}%
}
-
-\newcommand*{\PrepareSubsectionNode}{%
- \tmptok {\raggedright}%
- \appendtotok\tmptok\etocthelinkedname
- \edef\foresttreenode{ [{\noexpand\parbox{6cm}{\the\tmptok}}}%
+\newcommand*\PrepareSection{%
+ \toks0 \expandafter{\etocthelinkednumber}%
+ \toks2 \expandafter{\etocthelinkedname}%
+ \toks4 \expandafter{\etocthelinkedpage}%
+ \edef\toctablepiece {\the\toks0 &\the\toks2 &\the\toks4 \noexpand\\}%
+}
+% new version for 1.07k, 2014/03/06
+\newcommand*{\PrepareSubsection}{%
+ \toks0 \expandafter{\etocthelinkednumber}%
+ \toks2 \expandafter{\expandafter\itshape\etocthelinkedname\strut}%
+ \toks4 \expandafter{\expandafter\itshape\etocthelinkedpage}%
+ \edef\toctablepiece{&\noexpand\makebox[1cm][c]{\the\toks0}%
+ \noexpand\parbox[t]{\dimexpr6cm-\tabcolsep\relax}
+ {\noexpand\sloppy\the\toks2}%
+ &\the\toks4 \noexpand\\}%
}
-\etocsetstyle{section}
- {\etocskipfirstprefix}
- {\appendtotok\treetok{ ]}}
- {\PrepareSectionNode \appendtotok\treetok\foresttreenode}
- {\appendtotok\treetok{ ]}}
-
-\etocsetstyle{subsection}
- {\etocskipfirstprefix}
- {\appendtotok\treetok{ ]}}
- {\PrepareSubsectionNode \appendtotok\treetok\foresttreenode}
- {\appendtotok\treetok{ ]}}
+\begingroup
+\etocsetstyle{part}{}{}{\PreparePart \appendtotok\toctabletok\toctablepiece}{}
-\etocsettocstyle
- {\treetok{[{\hyperref[part:overview]{Overview}}}}
- {\global\appendtotok\treetok{ ]}}
+\etocsetstyle{section}{}{}{\PrepareSection \appendtotok\toctabletok\toctablepiece}{}
-% forest does not like @\the\treetok if \treetok is empty. On first latex
-% run, this will be the case because the TOC style defined above will not
-% have been executed, as the label {toc:overview} does not refer to a valid
-% TOC yet. So we must give a safe default value to \treetok
-\treetok{[{run latex again}]}
+\etocsetstyle{subsection}{}{}{\PrepareSubsection\appendtotok\toctabletok\toctablepiece}{}
-\begin{figure}[th!]\centering
- \etocsetnexttocdepth{subsection}
- \tableofcontents \label{toc:forest}\ref{toc:overview}
- \hypersetup{hidelinks}%
- \bracketset{action character=@}
- \begin{forest}
- for tree={anchor=center,child anchor=west,
- grow'=east,draw,thick,
- edge={draw,thick,dashed,color=teal}},
- where={level()==1}{circle,thick,fill=blue!5,
- before computing xy={l=3cm}}{},
- where={level()==2}{fill=red!5,
- before computing xy={l=6cm}}{},
- rectangle, thick, fill=cyan!5, inner sep=6pt,
- @\the\treetok
- \end{forest}
-\end{figure}
+\etocsettocstyle
+ {\toctabletok{\hypersetup{hidelinks}%
+ \begin{longtable}{|>{\bfseries}c|p{7cm}|r|}\hline
+ \multicolumn{3}{|c|}{\Large\bfseries\strut TABLE OF CONTENTS}%
+ \\\hline\hline}}
+ {\global\toctabletok\expandafter{\the\toctabletok\hline\end{longtable}}}
+\etocsettocdepth {subsection}
+\tableofcontents
+\the\toctabletok
+\endgroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-48.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-48.tex
deleted file mode 100644
index 0e5129ec7cb..00000000000
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-48.tex
+++ /dev/null
@@ -1,74 +0,0 @@
-%% LaTeX2e file `etocsnippet-48.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\begingroup
-\definecolor{subsecnum}{RGB}{13,151,225}
-\definecolor{secbackground}{RGB}{0,177,235}
-\definecolor{tocbackground}{RGB}{212,237,252}
-
-\renewcommand{\etocbkgcolorcmd}{\color{tocbackground}}
-\renewcommand{\etocleftrulecolorcmd}{\color{tocbackground}}
-\renewcommand{\etocrightrulecolorcmd}{\color{tocbackground}}
-\renewcommand{\etocbottomrulecolorcmd}{\color{tocbackground}}
-\renewcommand{\etoctoprulecolorcmd}{\color{tocbackground}}
-
-\renewcommand{\etocleftrule}{\vrule width 1cm}
-\renewcommand{\etocrightrule}{\vrule width .5cm}
-\renewcommand{\etocbottomrule}{\hrule height 12pt}
-\renewcommand{\etoctoprule}{\hrule height 12pt}
-
-\renewcommand{\etocinnertopsep}{0pt}
-\renewcommand{\etocinnerbottomsep}{0pt}
-\renewcommand{\etocinnerleftsep}{0pt}
-\renewcommand{\etocinnerrightsep}{0pt}
-
-\newcommand\shiftedwhiterule[2]{%
- \hbox to \linewidth{\color{white}%
- \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip\vskip#2}
-
-\etocsetstyle{subsubsection}{\etocskipfirstprefix}
- {\shiftedwhiterule{\leftskip}{6pt}}
- {\sffamily\footnotesize
- \leftskip2.5cm\hangindent1cm\rightskip1cm\noindent
- \hbox to 1cm{\color{subsecnum}\etocnumber\hss}%
- \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill
- \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par
- \nointerlineskip\vskip3pt}
- {}
-
-\etocsetstyle{subsection}{\etocskipfirstprefix}
- {\shiftedwhiterule{1.5cm}{6pt}}
- {\sffamily\small
- \leftskip1.5cm\hangindent1cm\rightskip1cm\noindent
- \hbox to 1cm{\color{subsecnum}\etocnumber\hss}%
- \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill
- \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par
- \nointerlineskip\vskip6pt}
- {}
-
-\newcommand{\coloredstuff}[2]{%
- \leftskip0pt\rightskip0pt\parskip0pt
- \fboxsep0pt % \colorbox uses \fboxsep also when no frame!
- \noindent\colorbox{secbackground}
- {\parbox{\linewidth}{%
- \vskip5pt
- {\noindent\color{#1}#2\par}\nointerlineskip
- \vskip3pt}}%
- \par\nointerlineskip}
-
-\etocsetstyle{section}
-{\coloredstuff{white}
- {\hfil \hyperref[toc:b]{\bfseries\large I am a twin of
- that other TOC (click me!)}\hfil}}
-{\vskip3pt\sffamily\small}
-{\coloredstuff{white}
- {\leftskip1.5cm\rightskip.5cm\parfillskip-\rightskip
- \makebox[0pt][r]{\makebox[.5cm][r]{\etocnumber\hspace{.2cm}}}%
- \etocname\hfill\makebox[.5cm][r]{\etocpage\hspace{.2cm}}}%
- \vskip6pt }
-{}
-
-\etocframedstyle[1]{}
-\tableofcontents \label{toc:clone} \ref{toc:globalcmds}
-\endgroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-A.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-A.tex
deleted file mode 100644
index 7c24c49f57b..00000000000
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-A.tex
+++ /dev/null
@@ -1,47 +0,0 @@
-%% LaTeX2e file `etocsnippet-52-A.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\newsavebox\firstnamei \newsavebox\firstnumberi
-\newsavebox\lastnamei \newsavebox\lastnumberi
-\newsavebox\firstnameii \newsavebox\firstnumberii
-\newsavebox\lastnameii \newsavebox\lastnumberii
-\newcounter{mycounti} \newcounter{mycountii}
-\newcommand*{\thispartstatsauxi}{} \newcommand*{\thispartstatsauxii}{}
-\newcommand*{\oldtocdepth}{}
-\newcommand*{\thispartstats}{%
- \setcounter{mycounti}{0}%
- \setcounter{mycountii}{0}%
- \def\thispartstatsauxi{%
- \sbox{\firstnamei}{\etocname}%
- \sbox{\firstnumberi}{\etocnumber}%
- \def\thispartstatsauxi{}}%
- \def\thispartstatsauxii{%
- \sbox{\firstnameii}{\etocname}%
- \sbox{\firstnumberii}{\etocnumber}%
- \def\thispartstatsauxii{}}%
- \begingroup
- \etocsetstyle{subsection} {} {}
- {\thispartstatsauxii
- \stepcounter{mycountii}%
- \sbox{\lastnameii}{\etocname}%
- \sbox{\lastnumberii}{\etocnumber}} {}%
- \etocsetstyle{section} {} {}
- {\thispartstatsauxi
- \stepcounter{mycounti}%
- \sbox{\lastnamei}{\etocname}%
- \sbox{\lastnumberi}{\etocnumber}}
- {Here are some statistics for this part: it contains \arabic{mycounti}
- section\ifnum\value{mycounti}>1 s\fi{} and \arabic{mycountii}
- subsection\ifnum\value{mycountii}>1 s\fi. The name of the first section is
- \unhbox\firstnamei{} and the corresponding number is \unhbox\firstnumberi.
- The name of the last section is \unhbox\lastnamei{} and its number is
- \unhbox\lastnumberi. The name of the first subsection is \unhbox\firstnameii{}
- and the corresponding number is \unhbox\firstnumberii. The name of the last
- subsection is \unhbox\lastnameii{} and its number is \unhbox\lastnumberii.}%
- \etocinline % cancels the automatic \par automatically before the TOC
- \etocsettocstyle {}{}
- \etocsetnexttocdepth{2}%
- \localtableofcontents % to be used at the top level of a Part.
- \endgroup
-}
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-B.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-B.tex
deleted file mode 100644
index 2f81ab6e84f..00000000000
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-B.tex
+++ /dev/null
@@ -1,31 +0,0 @@
-%% LaTeX2e file `etocsnippet-52-B.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\makeatletter
-\newcommand*\firstsubname {} \newcommand*\lastsubname {}
-\newcommand*\firstsubnumber {} \newcommand*\lastsubnumber {}
-\newcommand*\thisspecialstatsaux{}
-\newcommand*{\thisspecialstats}{%
- \setcounter{mycounti}{0}%
- \def\thisspecialstatsaux{%
- \let\firstsubname\etocthelinkedname
- \let\firstsubnumber\etocthelinkednumber
- \def\thisspecialstatsaux{}}
- \begingroup
- \etocsetstyle{subsection} {} {}
- {\thisspecialstatsaux
- \stepcounter{mycounti}%
- \let\lastsubname\etocthelinkedname
- \let\lastsubnumber\etocthelinkednumber }
- {Here are some statistics for this section. It contains \arabic{mycounti}
- subsections. The name of its first is \emph{\firstsubname{}} and the
- corresponding number is {\firstsubnumber}. The name of the last
- subsection is \emph{\lastsubname{}} and its number is {\lastsubnumber}.}%
- \etocsettocstyle {}{}
- \etocinline
- \etocsetnexttocdepth {1}%
- \localtableofcontents % to be used within a section
- \endgroup
-}
-\makeatother
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-53.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-53.tex
deleted file mode 100644
index f00f1f5ed86..00000000000
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-53.tex
+++ /dev/null
@@ -1,67 +0,0 @@
-%% LaTeX2e file `etocsnippet-53.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\etocsetnexttocdepth {all}
-\begingroup
-\parindent 0pt \leftskip 0cm \rightskip .75cm \parfillskip -\rightskip
-\newcommand*{\EndParWithPagenoInMargin}
- {\nobreak\hfill
- \makebox[0.75cm][r]{\mdseries\normalsize\etocpage}%
- \par}
-\renewcommand*\etoctoclineleaders
- {\hbox{\normalfont\normalsize\hbox to .75ex {\hss.\hss}}}
-\newcommand*{\EndParWithPagenoInMarginAndLeaders}
- {\nobreak\leaders\etoctoclineleaders\hfill
- \makebox[0.75cm][r]{\mdseries\normalsize\etocpage}%
- \par }
-\etocsetstyle {part}
- {}
- {\leavevmode\leftskip 1cm\relax}
- {\bfseries\large\llap{\makebox[1cm][r]{\etocnumber\ \ }}%
- \etocname\EndParWithPagenoInMargin\smallskip}
- {}
-\etocsetstyle {section}
- {}
- {\leavevmode\leftskip 1.75cm\relax}
- {\bfseries\normalsize\llap{\makebox[.75cm][l]{\etocnumber}}%
- \etocname\EndParWithPagenoInMarginAndLeaders}
- {}
-\etocsetstyle {subsection}
- {}
- {\leavevmode\leftskip 2.75cm\relax }
- {\mdseries\normalsize\llap{\makebox[1cm][l]{\etocnumber}}%
- \etocname\EndParWithPagenoInMarginAndLeaders}
- {}
-\etocsetstyle {subsubsection}
- {}
- {\leavevmode\leftskip 4cm\relax }
- {\mdseries\normalsize\llap{\makebox[1.25cm][l]{\etocnumber}}%
- \etocname\EndParWithPagenoInMarginAndLeaders}
- {}
-\etocsetstyle {paragraph}
- {}
- {\leavevmode\leftskip 5.5cm\relax }
- {\mdseries\normalsize\llap{\makebox[1.5cm][l]{\etocnumber}}%
- \etocname\EndParWithPagenoInMarginAndLeaders}
- {}
-\etocsettagdepth {preamble} {none}
-\etocsettagdepth {overview} {part}
-%\etocsettagdepth {arbitrarily}{part}% not needed explicitely, keeps value
-%\etocsettagdepth {examples} {part}
-%\etocsettagdepth {surprising} {part}
-%\etocsettagdepth {linestyles} {part}
-\etocsettagdepth {globalcmds} {paragraph}
-\etocsettagdepth {custom} {part}
-%\etocsettagdepth {tips} {part}
-%\etocsettagdepth {etocandworld}{part}
-\etocsettagdepth {code} {none}
-\renewcommand\etoctoprule {\hrule height 3pt\relax }
-\renewcommand\etoctoprulecolorcmd {\color{blue}}
-\renewcommand\etocaftercontentshook
- {\medskip\begingroup \color{blue}\hrule height 3pt \endgroup }
-\etocruledstyle [1]{\Large\bfseries
- \fbox{\makebox[8cm]{A TOC using depth tags}}}
-\sloppy
-\tableofcontents
-\endgroup
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex
deleted file mode 100644
index e67eb2196a9..00000000000
--- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex
+++ /dev/null
@@ -1,50 +0,0 @@
-%% LaTeX2e file `etocsnippet-54.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\newtoks\toctabletok
-\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2
- #1\expandafter\expandafter\expandafter {\expandafter\the\expandafter #1#2}}
-
-\newcommand*\PreparePart{%
- \toks0 \expandafter{\etocthelinkednumber}%
- \toks2 \expandafter{\etocthelinkedname}%
- \toks4 \expandafter{\etocthelinkedpage}%
- \edef\toctablepiece {\noexpand\hline
- \noexpand\strut\the\toks0 &\noexpand\bfseries\the\toks2
- &\the\toks4 \noexpand\\\noexpand\hline}%
-}
-\newcommand*\PrepareSection{%
- \toks0 \expandafter{\etocthelinkednumber}%
- \toks2 \expandafter{\etocthelinkedname}%
- \toks4 \expandafter{\etocthelinkedpage}%
- \edef\toctablepiece {\the\toks0 &\the\toks2 &\the\toks4 \noexpand\\}%
-}
-% new version for 1.07k, 2014/03/06
-\newcommand*{\PrepareSubsection}{%
- \toks0 \expandafter{\etocthelinkednumber}%
- \toks2 \expandafter{\expandafter\itshape\etocthelinkedname\strut}%
- \toks4 \expandafter{\expandafter\itshape\etocthelinkedpage}%
- \edef\toctablepiece{&\noexpand\makebox[1cm][c]{\the\toks0}%
- \noexpand\parbox[t]{\dimexpr6cm-\tabcolsep\relax}
- {\noexpand\sloppy\the\toks2}%
- &\the\toks4 \noexpand\\}%
-}
-
-\begingroup
-\etocsetstyle{part}{}{}{\PreparePart \appendtotok\toctabletok\toctablepiece}{}
-
-\etocsetstyle{section}{}{}{\PrepareSection \appendtotok\toctabletok\toctablepiece}{}
-
-\etocsetstyle{subsection}{}{}{\PrepareSubsection\appendtotok\toctabletok\toctablepiece}{}
-
-\etocsettocstyle
- {\toctabletok{\hypersetup{hidelinks}%
- \begin{longtable}{|>{\bfseries}c|p{7cm}|r|}\hline
- \multicolumn{3}{|c|}{\Large\bfseries\strut TABLE OF CONTENTS}%
- \\\hline\hline}}
- {\global\toctabletok\expandafter{\the\toctabletok\hline\end{longtable}}}
-\etocsettocdepth {subsection}
-\tableofcontents
-\the\toctabletok
-\endgroup
diff --git a/Master/texmf-dist/source/latex/etoc/etoc.dtx b/Master/texmf-dist/source/latex/etoc/etoc.dtx
index 362219028f8..5e19538d9f0 100644
--- a/Master/texmf-dist/source/latex/etoc/etoc.dtx
+++ b/Master/texmf-dist/source/latex/etoc/etoc.dtx
@@ -2,20 +2,20 @@
% 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: <17-11-2022 at 23:14:36 CET>}%
+\def\etocdtxtimestamp {Time-stamp: <21-11-2022 at 19:35:48 CET>}%
%</none>
%<*!readme>
%%
%% Package: etoc
-%% Version: 1.09g (DEVELOPMENT)
+%% Version: 1.09i
%% License: LPPL 1.3c
%% Copyright (C) 2012-2022 Jean-Francois Burnol
%% <jfbu at free dot fr>
%</!readme>
%<*none>
-\def\etocpkgdate {2022/11/17}
-\def\etocdocdate {2022/11/17}
-\def\etocpkgversion {1.09g}
+\def\etocpkgdate {2022/11/21}
+\def\etocdocdate {2022/11/21}
+\def\etocpkgversion {1.09i}
\def\etocpkgdescription {Completely customisable TOCs (JFB)}
%% German translation was last udpated on April 2015 and all new material
%% was included since in English. During 2020/2021/2022 emerged a still
@@ -33,7 +33,7 @@
\catcode32=13\catcode`\\=12^^Brelax^^A
^^Bfirstofone{^^Bendgroup^^Bdef^^BetocLicense^^A
{% Package: etoc
-% Version: 1.09g
+% Version: 1.09i
% License: LPPL 1.3c
% Copyright (C) 2012-2022 Jean-Francois Burnol <jfbu at free dot fr>
%
@@ -60,7 +60,7 @@
%<*readme>
<!-- -->
- Source: etoc.dtx (1.09g)
+ Source: etoc.dtx (1.09i)
Author: Jean-Francois Burnol
Info: Completely customisable TOCs
License: LPPL 1.3c
@@ -157,6 +157,23 @@ etoc.sty, etoc.tex, etoc.pdf, etoc.dvi.
RECENT CHANGES
==============
+1.09i \[2022/11/21\]
+--------------------
+
+Fix bug showing when a document uses both `\etocchecksemptiness` and
+`\etocsetlocaltop.toc`: the `start` and `finish` parts of some levels
+were executed possibly causing extra printed output.
+
+More hyperlinking in the implementation part of the documentation.
+
+1.09h \[2022/11/20\]
+--------------------
+
+Documentation improvements. In particular, attached code snippets
+are now visible via their filenames in the page margins. Also,
+command names are doubly hyperlinked: first half links to the devoted
+part of the user manual, second half links to the implementation part.
+
1.09g \[2022/11/17\]
--------------------
@@ -198,33 +215,6 @@ Also add `\etocimmediatesetlocaltop.toc`.
Fix an obscure bug (see source code comments) in the `\etocsetlocaltop.toc`
mechanism.
-
-1.09e \[2021/09/23\]
---------------------
-
-Needed (if etoc is used without hyperref) updates to
-internal macros to prepare for the upcoming LaTeX November
-2021 change to `\contentsline`.
-
-Related updates to the user macro `\etoctoccontentsline`.
-
-1.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`.
-
-1.09c \[2020/05/15\]
---------------------
-
-Syncs with KOMA-script deprecation of `\iftocfeature`.
%</readme>
%<*tex>-------------------------------------------------------------------------
%% run pdflatex thrice on this file etoc.tex to produce the documentation
@@ -472,38 +462,68 @@ Syncs with KOMA-script deprecation of `\iftocfeature`.
\usepackage[utf8]{inputenc}
\usepackage[hscale=0.66,vscale=0.75]{geometry}
\pagestyle{headings}
-% \usepackage{layout}
-
-% January 2014. work-around a bug in KOMA 3.12 (December 2013):
+% \sectionmark uses \markboth in twoside but
+% with an empty right mark! As a result if a section starts
+% on an odd page, it does not appear in the header mark.
+% Perhaps there was a subsection of 3 lines on that page
+% and it is the subsection which decides what is in the header.
\makeatletter
-\def\buggysectionmark #1{% KOMA 3.12 as released to CTAN December 2013
- \if@twoside\expandafter\markboth\else\expandafter\markright\fi
- {\MakeMarkcase{\ifnumbered{section}{\sectionmarkformat\fi}{}#1}}{}}
-\ifx\buggysectionmark\sectionmark
-\def\sectionmark #1{%
- \if@twoside\expandafter\markboth\else\expandafter\markright\fi
- {\MakeMarkcase{\ifnumbered{section}{\sectionmarkformat}{}#1}}{}}
-\fi
+% \newwrite\out
+% \immediate\openout\out=\jobname.headings
+% \immediate\write\out{\meaning\ps@headings}
+% \immediate\closeout\out
+% from \ps@headings:
+% \renewcommand *{\sectionmark }[1]{\if@twoside \expandafter \markboth
+% \else \expandafter \markright \fi {\MakeMarkcase {\Ifnumbered
+% {section}{\sectionmarkformat }{}##1}}{}}
+% \renewcommand *{\subsectionmark }[1]{\if@twoside \markright {\MakeMarkcase
+% {\Ifnumbered {subsection}{\subsectionmarkformat }{}##1}}\fi }
+
+% Some custom \sectionmark to get headers more to my taste.
+% But it is hard to find algorithm giving satisfaction in all cases.
+
+\renewcommand *{\sectionmark }[1]{%
+% Que c'est pénible cette syntaxe \markboth/\markright de LaTeX !
+% Pourquoi est-ce que \markright n'a pas été définie comme #1#2-> truc avec #2 ??
+ \if@twoside \expandafter \markboth \else
+ \expandafter\expandafter\expandafter \markright\expandafter \@firstoftwo
+ \fi
+ {\MakeMarkcase {\Ifnumbered {section}{\sectionmarkformat }{}#1}}%
+ {\MakeMarkcase {\Ifnumbered {section}{\sectionmarkformat }{}#1}}%
+}
+
+% Par ailleurs je vais remplacer \firstmark par \botmark dans \rightmark
+% dont la définition par défaut est :
+
+% \rightmark:
+% macro:->\expandafter \@rightmark \firstmark \@empty \@empty
+
+\renewcommand*\rightmark{\expandafter\@rightmark\botmark \@empty\@empty}
+% Au passage l'output de latexdef à un : supplémentaire bizarre
+% $ latexdef botmark
+%
+% \botmark:
+% \botmark:
+%
+
+% NĂ©anmoins pour les \part il ne faut clairement pas utiliser \botmark
+% Tous mes \part sont après un \clearpage explicite
+% Je crois que le plus simple est encore de faire ceci:
+\def\ps@mypartheadings{%
+ \ps@headings
+ \let\@evenhead\@empty
+ \let\@oddhead\@empty
+}
+
+% peut-être serait-ce mieux de mettre le \thispagestyle après mon \clearpage,
+% explicitement dans la source
+\def\part{\thispagestyle{mypartheadings}\scr@startpart {part}}
+
\makeatother
-\makeatletter
-% 2013/03/07.
-% This macro allows to conveniently center a line inside a paragraph and still
-% use therein \verb or other commands changing catcodes.
-% Note: \centerline in LaTeX still uses \hsize and not \linewidth/\columnwidth
- \def\@centeredline {\hbox to \linewidth
- \bgroup \hss \bgroup
- \aftergroup\centeredline@ }
- \newcommand*\centeredline {%
- \ifhmode
- \\\relax
- \def\centeredline@{\hss\egroup\hskip\z@skip}%
- \else
- \def\centeredline@{\hss\egroup}%
- \fi
- \afterassignment\@centeredline
- \let\next=}
+\usepackage{centeredline}% replaces the 2013/03/07 original code
+\makeatletter
% pour maintenir les % en début de ligne dans les blocs verbatim
%
@@ -723,7 +743,8 @@ pdftitle={The etoc package},%
pdfsubject={Tables of contents with LaTeX},%
pdfkeywords={LaTeX, table of contents},%
pdfstartview=FitH,%
-pdfpagemode=UseOutlines}
+%%pdfpagemode=UseOutlines,% commented-out for 1.09h
+}
% added usage of package bookmark 2013/10/10
\usepackage{bookmark}
@@ -827,12 +848,12 @@ pdfpagemode=UseOutlines}
\setcounter{mycounti}{0}%
\setcounter{mycountii}{0}%
\def\thispartstatsauxi{%
- \sbox{\firstnamei}{\etocname}%
- \sbox{\firstnumberi}{\etocnumber}%
+ \sbox{\firstnamei}{\footnotesize\etocname}%
+ \sbox{\firstnumberi}{\footnotesize\etocnumber}%
\def\thispartstatsauxi{}}%
\def\thispartstatsauxii{%
- \sbox{\firstnameii}{\etocname}%
- \sbox{\firstnumberii}{\etocnumber}%
+ \sbox{\firstnameii}{\footnotesize\etocname}%
+ \sbox{\firstnumberii}{\footnotesize\etocnumber}%
\def\thispartstatsauxii{}}%
\begingroup
\etocsetstyle{subsection}
@@ -840,17 +861,18 @@ pdfpagemode=UseOutlines}
{}
{\thispartstatsauxii
\stepcounter{mycountii}%
- \sbox{\lastnameii}{\etocname}%
- \sbox{\lastnumberii}{\etocnumber}}
+ \sbox{\lastnameii}{\footnotesize\etocname}%
+ \sbox{\lastnumberii}{\footnotesize\etocnumber}}
{}
\etocsetstyle{section}
{}
{}
{\thispartstatsauxi
\stepcounter{mycounti}%
- \sbox{\lastnamei}{\etocname}%
- \sbox{\lastnumberi}{\etocnumber}}
- {Here are some statistics for this part: it contains \arabic{mycounti}
+ \sbox{\lastnamei}{\footnotesize\etocname}%
+ \sbox{\lastnumberi}{\footnotesize\etocnumber}}
+ {{\footnotesize\itshape
+ Here are some statistics for this part: it contains \arabic{mycounti}
section\ifnum\value{mycounti}>1 s\fi{} and
\arabic{mycountii} subsection\ifnum\value{mycountii}>1 s\fi. The name of
the first section is
@@ -863,7 +885,8 @@ pdfpagemode=UseOutlines}
``\unhbox\firstnameii{}'' and the corresponding number is
``\unhbox\firstnumberii''. The name of the last subsection is
``\unhbox\lastnameii{}'' and its number is
- ``\unhbox\lastnumberii''.\fi }
+ ``\unhbox\lastnumberii''.\fi
+ \par}}
\etocinline
% october 10, 2013.
\etocsetnexttocdepth {2}%
@@ -902,18 +925,73 @@ pdfpagemode=UseOutlines}
\newcommand\etoc{%
\texorpdfstring{{\color{joli}\ttfamily\bfseries etoc}}{etoc}\xspace}
-\DeclareRobustCommand\csa [1] {{\ttfamily\hyphenchar\font45 \char`\\ #1}}
-\DeclareRobustCommand\csb [1]
- {\hyperref[#1] {\ttfamily\hyphenchar\font45 \char`\\ #1}}
+% hyperlinks to source code... added November 20, 2022
+% works in sync with macrocode hacks explained after \StopEventually
+% which were added in August 2022
+% imported/adapted from code originally added to xint.dtx
+
+% FINALLY, after many hesitations and great suffering with \marginpar
+% I decide to simply divide the name into two parts and use two
+% distinct hyperlinks, so as to not render the reading to painful.
+\usepackage{xinttools}
+
+% \makeatletter
+% \newsavebox\sourcelinkbox
+% \sbox\sourcelinkbox{\color{red}\normalfont\footnotesize\itshape src}
+% % This simply is not workable. I can not use \marginpar in footnotes,
+% % in multicols, etc... and I can not avoid mysterious margin par lost
+% % messages and ! LaTeX Error: Float(s) lost. on page 25 for example.
+% \def\marginsourcelink#1{\normalmarginpar\marginpar{%
+% {%\normalfont\footnotesize#1...
+% \ifodd\value{page}\else\hfill\fi
+% {\hyperref[etocmacro-#1]{\usebox\sourcelinkbox}}%
+% \ifodd\value{page}\hfill\fi
+% }%
+% }}%
+% %
+% % Si j'utilise \smash à l'intérieur, la zone cliquable devient réduite à rien verticalement
+% % ah ok avec \smash à l'extérieur
+% \def\exponentsourcelink#1{{\m@th\kern-\wd\sourcelinkbox
+% \smash{$^{\raisebox{0.75ex}{{\hyperref[etocmacro-#1]{\usebox\sourcelinkbox}}}}$}%
+% }}%
+% \makeatother
+
+% use a slightly different colour for second half?
+% MEMO: we can change \ttfamily as hyperref uses a scope limiting group.
+\DeclareRobustCommand\csb[1]{%
+ \edef\nbmoitie{\the\numexpr\xintLength{#1}/2}%
+ \ifcsname r@#1\endcsname
+ \hyperref[#1]{\ttfamily\hyphenchar\font45 \char`\\ \xintKeepUnbraced{\nbmoitie}{#1}}%
+ \ifcsname r@etocmacro-#1\endcsname
+ \hyperref[etocmacro-#1]{\ttfamily\hyphenchar\font45 \xintTrim{\nbmoitie}{#1}}%
+ \else
+ % for .toc suffixed macros
+ \ifcsname r@etocmacro-\xintTrimUnbraced{-4}{#1}\endcsname
+ \hyperref[etocmacro-\xintTrimUnbraced{-4}{#1}]{\ttfamily\hyphenchar\font45
+ \xintTrim{\nbmoitie}{#1}}%
+ \else
+ \hyperref[#1]{\ttfamily\hyphenchar\font45 \xintTrim{\nbmoitie}{#1}}%
+ \fi
+ \fi
+ \else
+ \textcolor{red}{\ttfamily\hyphenchar\font45 \char`\\ #1}%
+ \fi
+}
+
+\DeclareRobustCommand\csa [1]
+ {{\ttfamily\hyphenchar\font45 \char`\\ #1}}
\newcommand\cshyp[1]{\texorpdfstring{\csa{#1}}{\textbackslash #1}}
\newcommand\csbhyp[1]{\texorpdfstring{\csa{#1}}{\textbackslash #1}}
-\newcommand\toc{\csa{tableofcontents}\xspace}
-\newcommand\localtoc{\csa{localtableofcontents}\xspace}
-\newcommand\localtocwrdp{\csa{localtableofcontentswithrelativedepth}\xspace}
+\DeclareRobustCommand\ctanpkg[1]
+ {\texorpdfstring{\href{https://ctan.org/pkg/#1}{#1}}{#1}}
+
+\newcommand\toc{\csb{tableofcontents}\xspace}
+\newcommand\localtoc{\csb{localtableofcontents}\xspace}
+\newcommand\localtocwrdp{\csb{localtableofcontentswithrelativedepth}\xspace}
\newcommand\lowast{\raisebox{-.25\height}{*}}
\newcommand\starit[1]{\csa{#1\lowast}}
@@ -1070,11 +1148,76 @@ etoc-im-me-di-ate-set-local-top
\def\ExtractDateStamp #1<#2-#3-#4 at #5:#6:#7 #8>%
{D:#4#3#2#5#6#7\csname#8\endcsname}
\edef\DateForSamples {\expandafter\ExtractDateStamp\etocdtxtimestamp}
-\attachfilesetup{icon=Paperclip, mimetype=application/x-tex, appearance=false,
- author={Jean-François Burnol}, date=\DateForSamples}% print=false ?
-% attention Paperclip pas PaperClip !!
+\attachfilesetup{%icon=Paperclip,% attention Paperclip pas PaperClip !!
+ mimetype=application/x-tex,
+ %appearance=false,
+% author={Jean-François Burnol},
+% author={\pdfescapestring{Jean-François Burnol}},
+% TODO: resolve this at some point in my future life
+ author={Jean-Francois Burnol},
+% doing this has fixed the date shown in Acrobat annotation panel
+% but now some strange seemingly unrelated date is printed in
+% the "Comment panel"
+ created=\DateForSamples,
+ modified=\DateForSamples,
+% allright this one next sets the dates shown in the "Comment Panel",
+% whereas the above two (or only modified) impacts the panel of
+% annotations on the left in my (very old) Adobe Reader. Not yet
+% tested with evince
+ date=\DateForSamples
+ }%
+
+\colorlet{etocsnippet}{blue}
+\newcommand\marginattach[1]{% #1 is from some legacy mark-up and is ignored
+ \noindent Depending on your PDF viewer\normalmarginpar
+% syntaxe pénible n'y-a-t-il pas un moyen plus commode
+% j'hésite à tester \value{page}
+ \marginpar
+ [% left
+ {\hfill
+ \textattachfile[description={in section \the\value{section}}]%
+ {etocsnippet-\snippetno.tex}%
+ {\textcolor{etocsnippet}{etocsnippet-\snippetno.tex}}%
+ }%
+ ]%
+ {% right
+ \textattachfile[description={in section \the\value{section}}]%
+ {etocsnippet-\snippetno.tex}%
+ {\textcolor{etocsnippet}{etocsnippet-\snippetno.tex}}%
+ \hfill
+ },
+ clicking on the margin filename may allow to extract it.%
+ \stepcounter{snippet}%
+}
+% Sadly, on non-attachement supporting viewers such as Skim.app,
+% the filename is not even searchable : entering "etocsnippet"
+% in the PDF viewer search form does not find the margin texts.
+
+% But I did not want to add to the filename the section number,
+% or perhaps even the page number (which could have been perilous
+% and I did not want to have to test and experiment, as I have
+% done enough for today with these code snippets).
+
+% In Acrobat the description field gives rise to some "tooltip"
+% display on hover, which displays the description field.
-\begin{document}%\layout
+\newcounter{snippet}%[section]
+\stepcounter{snippet}
+\makeatletter
+\newcommand\snippetno{%
+ \ifnum\value{snippet}<10 0\fi\the\value{snippet}%
+%%% emulating former manual mark-up (with reset at each section) but I drop this
+%%% \ifnum\value{snippet}>0 -\@Alph{\numexpr\value{snippet}+\@ne\relax}\fi
+}
+\makeatother
+%\usepackage{layout}
+
+\usepackage{ragged2e}
+\begin{document}%\normalmarginpar\layout %marginparwidth is 96pt
+%\normalmarginpar\marginparwidth72bp% keep 96pt for etocsnippet-XX.tex filenames
+% will set to 72bp for the two margin notes at start of code comments
+% but let's reduce from the 12pt margin parsep
+\marginparsep 6bp
\rmfamily
\thispagestyle{empty}
@@ -1103,17 +1246,21 @@ etoc-im-me-di-ate-set-local-top
\fi
\ifnum\tikztreelevel=2
% hard-coded section numbers for branching
+ % il y a un décalage de 3 avec les numéros de sections numérotées
\if1\ifnum\tikznumberofcurrentgrandchild>2
\ifnum\tikznumberofcurrentgrandchild<6 0%
\else
- \ifnum\tikznumberofcurrentgrandchild>21
- \ifnum\tikznumberofcurrentgrandchild<28 0%
+ \ifnum\tikznumberofcurrentgrandchild>20 % Ă©tait 21 mais
+ % \etocsetlocaltop déplacé
+ \ifnum\tikznumberofcurrentgrandchild<27 0% Ă©tait 28 mais
+ % \etocsetlocaltop déplacé
\else
- \ifnum\tikznumberofcurrentgrandchild>51
+ \ifnum\tikznumberofcurrentgrandchild>50 % Ă©tait 51
\ifnum\tikznumberofcurrentgrandchild<58 0%
\fi\fi\fi\fi\fi\fi
1%
-% le "9+" choisi manuellement jusqu'Ă  obtenir quelque chose de bien
+ % ceci correspond aux sections qui seront sur le bord rectangulaire
+ % le "9+" choisi manuellement jusqu'Ă  obtenir quelque chose de bien
\pgfmathsetmacro\tikzoffsetofcurrentchild{(\tikzsiblingdistance)*(7+\tikznumberofcurrentgrandchild
+\tikzdeltaofcurrentgrandchild)}%
\ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight
@@ -1143,30 +1290,32 @@ etoc-im-me-di-ate-set-local-top
%\fi
\fi\fi\fi\fi
\else
- % NEW BRANCH ADDED AT 1.09f
+ % les sections spéciales pas mises sur bord rectangulaires mais à
+ % distance constante du parent
+ % NEW BRANCH ADDED AT 1.09f
\ifnum\tikznumberofcurrentgrandchild<6
\tikzset{level distance=8cm}% TikZ est tout de même assez génial dans l'interface
\fi
\pgftransformrotate {\ifnum\tikznumberofcurrentgrandchild<6 -12
- \else\ifnum\tikznumberofcurrentgrandchild<28 180
+ \else\ifnum\tikznumberofcurrentgrandchild<27 180
\else0\fi\fi +
\pgfkeysvalueof{/tikz/sibling angle}*\tikznumberofcurrentgrandchild}%
\pgftransformxshift {\the\tikzleveldistance}%
\ifnum\tikznumberofcurrentgrandchild=5
\global\advance\tikzdeltaofcurrentgrandchild by-3
\fi
- \ifnum\tikznumberofcurrentgrandchild=27
+ \ifnum\tikznumberofcurrentgrandchild=26 % était 27 mais déplacement \etoclocaltop
\global\advance\tikzdeltaofcurrentgrandchild by-6
\fi
\ifnum\tikznumberofcurrentgrandchild=57
- \global\advance\tikzdeltaofcurrentgrandchild by-6
+ \global\advance\tikzdeltaofcurrentgrandchild by-7 % Ă©tait -6
\fi
\fi
\global\advance\tikznumberofcurrentgrandchild by1
\fi
}
-%version circulaire utilisée avec les version 1.08a--1.09e du manuel.
+%version circulaire utilisée avec les versions 1.08a--1.09e du manuel.
% \def\tikzmycustomgrowth {%
% \pgftransformreset
% \ifnum\tikztreelevel=1
@@ -1232,6 +1381,8 @@ etoc-im-me-di-ate-set-local-top
% title page toc
% 1.09f uses a prepend for last part so we need to delay
% start of tree construction in \treetok
+% MEMO: le gap entre fin et début se situe donc entre Errors and Catastrophes
+% et Timestamp, sibling distance doit être ajusté manuellement
\treetok{}
\makeatletter
\etocsettocstyle
@@ -1293,15 +1444,12 @@ etoc-im-me-di-ate-set-local-top
% level 1 concept/.append style={font=\Large, text width = 3cm},
% ancienne version circulaire
% level 2/.append style={level distance=12.5cm, sibling angle=360/39},%
-% % distance par rapport au CENTRE ! (avec le code tel qu'en ce moment)
-% 39 hard coded mais je pourrais aussi le calculer
-%
% pour version rectangulaire, par tâtonnements:
% réactivée pour 1.09f (étonnamment, juste quelques petits ajustements, mais ça
% a tout de mĂŞme pris pas mal de temps...)
level 2/.append style={level width=21cm,
level height=30cm,
- sibling distance=2.21cm,% ajusté à la
+ sibling distance=2.22cm,% ajusté à la
% main... dépend de ce qui qu'on conserve par
% les depth tags...
% 1.09f pour essayer certaines parties en circulaire
@@ -1316,7 +1464,7 @@ etoc-im-me-di-ate-set-local-top
}% end of \hbox
\endgroup% fin de la défintion de la mind map pour la page de titre
-\noindent\null
+\noindent\null\par\vskip-5cm\hbox{\hypertarget{FRONTPAGE}{}}\vskip5cm
% On l'envoie au shipout
\AddToShipoutPictureFG*{\put(.5\paperwidth,.5\paperheight)
@@ -1336,29 +1484,57 @@ etoc-im-me-di-ate-set-local-top
{\noindent
\bfseries\Large
\leaders\hrule height1pt\hfill
- \MakeUppercase{Table of Contents}\let\thefootnote\empty
+ TABLE OF CONTENTS\let\thefootnote\empty
\footnote{Documentation (\etocdocdate) generated from the source file
with timestamp ``\etocdtxtimestamp''.}\setcounter{footnote}{0}%
}
\pdfbookmark[1]{Table of contents}{MAINTOC}%
+%\begin{framed}
+\begingroup\footnotesize\itshape
+ Starting with 1.08h, about 25 code samples (especially the longer ones)
+ are incorporated into the PDF file (thanks to \textsc{Scott
+ Pakin}'s \href{http://www.ctan.org/pkg/attachfile}{attachfile} package) as
+ \textbf{file attachement annotations}. Each file is represented by its
+ filename in the margin after the verbatim rendering of the corresponding
+ code. Clicking on this filename will on supporting viewers trigger some
+ dialog for extracting the file, or perhaps even will extract it
+ automatically and open it in some text editor. This is much better than
+ copy-paste which often loses indentation.
+At 1.09h the formerly used icon in the text body has been replaced by the
+filename itself, placed in the page margin.
+
+ In some PDF viewers side panels may provide a convenient clickable list of
+ all these \textbf{attachments annotations}.
+
+\endgroup
+%\end{framed}
+% https://helpx.adobe.com/acrobat/using/comments.html
+
+% I move colours mostly used only after stopeventually
+\definecolor{etocnamecolor}{RGB}{228,57,0}
+\colorlet{verbcolor}{Maroon}
+\colorlet{privatecommentcolor}{cyan}
+\colorlet{macrocodecommentcolor}{gray}
+\colorlet{macrocodenewmacrocolor}{verbcolor}
+\colorlet{macrocodelinktouserdoccolor}{etocnamecolor}% and bold face
+\colorlet{macrocodelinktosectioncolor}{DarkBlue}% and bold face
+\colorlet{macrocodelinktocodelinecolor}{Blue}
+\colorlet{macrocodenoncscolor}{Green}
+
+%\ifnum\NoSourceCode=0
\begin{framed}
- Starting with |1.08h|, about 25 code samples (especially the longer
- ones) are incorporated into the PDF file (thanks to \textsc{Scott
- Pakin}'s \href{http://www.ctan.org/pkg/attachfile}{attachfile}
- package) as \emph{file attachement annotations}. Each file is represented
- by an icon after the verbatim rendering of the corresponding code.
- Clicking suitably on the icon will open a dialog to open or save the
- file contents. This is much better than copy-paste which loses
- indentation. There is also in some viewer a \emph{Comment pane} which can
- be opened on the right side of the main window and which provides a
- convenient clickable list of all these \emph{attachments annotations}.
-
- PDF viewers unable to make these attachments accessible to the
- user may replace the clickable icons by some blank space.
+ Throughout the documentation the command names displayed
+ {\textcolor{RoyalBlue}{with this colour}} are doubly hyperlinked: the left
+ half of the name links to the user documentation, the second half links to
+ the source code. You can try it out now: \csb{localtableofcontents}. But
+ read this first: if you get lost inside the source code, clicking on control
+ sequences displayed {\textcolor{macrocodelinktouserdoccolor}{with this
+ colour}} brings you back to the part of the user manual discussing that
+ specific command. \ifnum\NoSourceCode=1 (but this PDF does not include the source code)\fi
\end{framed}
-% https://helpx.adobe.com/acrobat/using/comments.html
+%\fi
\begingroup
\etocsetlevel{subsection}{3}
@@ -1391,14 +1567,14 @@ etoc-im-me-di-ate-set-local-top
based on a multi-column format, with, optionally, a ruled title or framed
contents.
- The \csa{tableofcontents} command may be used arbitrarily many times%
+ The \toc 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
+\footnote{\label{etockeeporiginaltableofcontents}%
+ If \csb{etockeeporiginaltableofcontents} is issued in the preamble
+ after package loading, then \toc keeps the non-\etoc meaning and one must
+ use \csb{etoctableofcontents} in its place to get the \etoc features. This
+ was added to fix a compatiblity issue with \ctanpkg{listings}'s
+ \texttt{\string\lstlistoflistings}, as it needs the
\texttt{\string\tableofcontents} macro to keep its original meaning.}
%
and it
@@ -1423,12 +1599,25 @@ etoc-im-me-di-ate-set-local-top
\section{Foreword}
-Popular packages dealing with TOCs include |tocloft|, |titletoc|
-and |minitoc|. Why another one? I started \etoc
+%\ifnum\NoSourceCode=0
+\begin{framed}
+ Throughout the documentation the command names displayed
+ {\textcolor{RoyalBlue}{with this colour}} are doubly hyperlinked: the left
+ half of the name links to the user documentation, the second half links to
+ the source code. You can try it out now: \csb{localtableofcontents}. But
+ read this first: if you get lost inside the source code, clicking on control
+ sequences displayed {\textcolor{macrocodelinktouserdoccolor}{with this
+ colour}} brings you back to the part of the user manual discussing that
+ specific command. \ifnum\NoSourceCode=1 (but this PDF does not include the source code)\fi
+\end{framed}
+%\fi
+
+Popular packages dealing with TOCs include \ctanpkg{tocloft}, \ctanpkg{titletoc}
+and \ctanpkg{minitoc}. Why another one? I started \etoc
for my own use, and found out only later about these mentioned
packages.
-As is well explained in the |tocloft| package documentation,
+As is well explained in the \ctanpkg{tocloft} package documentation,
the standard \LaTeX{} layout for the Table of Contents is
buried in the class definitions. In particular, most of the
lengths therein are hardcoded, and the only way for the user
@@ -1436,7 +1625,7 @@ to change them is to recopy the class definitions into the
document and then change them to obtain what is desired
(within suitable \csa{makeatletter} and \csa{makeatother}).
The more reasonable alternative is to use a dedicated package such as
-|tocloft| or to use another flexible document class.
+\ctanpkg{tocloft} or to use another flexible document class.
However, although now things are hopefully not hard-coded, one
still has to go through the package or class interface. This
@@ -1452,8 +1641,8 @@ manner: they are made available via the \csb{etocname},
\csb{etocnumber}, and \csb{etocpage} commands.
\etoc appears to be (at least partially) compatible with the
-|article|, |book|, |report|, |scrartcl|, |scrbook|, |scrreprt| and
-|memoir| classes.
+|article|, |book|, |report|, \ctanpkg{scrartcl}, \ctanpkg{scrbook}, \ctanpkg{scrreprt} and
+\ctanpkg{memoir} classes.
\section{License}
@@ -1479,7 +1668,7 @@ manner: they are made available via the \csb{etocname},
Not quite. The simplest way is to use |enumerate| environments,
with the customizing facilities of packages such as
-|enumitem|,\footnote{\url{http://ctan.org/pkg/enumitem}} to
+\ctanpkg{enumitem}, to
display the data fetched by \etoc from the |.toc| file. The data
consists of the \emph{name} (\csb{etocname}), \emph{number}
(\csb{etocnumber}), and \emph{page number} (\csb{etocpage}) as
@@ -1616,7 +1805,7 @@ the second is executed after the TOC contents.
\etoc provides four (customizable) higher level toc styles:
\csb{etocmulticolstyle}, \csb{etoctocstyle},
\csb{etocruledstyle}, and \csb{etocframedstyle}. All use the
-|multicol| package with a default of two columns
+\ctanpkg{multicol} package with a default of two columns
(single-column mode is obtained with the optional argument |[1]|).
These commands must be followed either by \toc or \localtoc.
@@ -1625,18 +1814,25 @@ These commands must be followed either by \toc or \localtoc.
\label{etoctoclines}
\label{etocstandardlines}
-Both for the ``line styles'' and the ``toc display style'', it is
-possible to switch into a compatibility mode which uses the
-defaults from the
-document class.\footnote{for the ``toc display style''
- \etoc checks if it knows the class, and if not defaults to
- the |article| class layout. It will also check if
- \texttt{tocloft} has customized the TOC title.}
-This is activated by:\\
-\makebox[5.2cm][l]{\csb{etocstandardlines}}
- |% `line entries' as without \usepackage{etoc}|\\
-\makebox[5.2cm][l]{\csb{etocstandarddisplaystyle}}
- |% `toc display' as without \usepackage{etoc}|
+Both for the ``line styles'' and the ``toc display style'', \etoc defaults to
+a compatibility mode which uses the defaults from the document
+class.%
+%
+\footnote{\label{fn:compat}for the ``toc display style'' \etoc checks if it knows the class,
+ and then uses emulation code which was added manually to its source, and
+ if not it defaults to the |article| class layout. No automated way to recover
+ the global toc display for arbitrary document classes is implemented. But \etoc
+ will detect if \ctanpkg{tocloft} has customized the TOC title.}
+%
+This can always be re-activated by:\\
+% \makebox[5.2cm][l]{\csb{etocstandardlines}}
+% |% `line entries' as without \usepackage{etoc}|\\
+% \makebox[5.2cm][l]{\csb{etocstandarddisplaystyle}}
+% |% `toc display' as without \usepackage{etoc}|
+\csb{etocstandardlines}\hfill
+|% `line entries' as without \usepackage{etoc}|\\
+\csb{etocstandarddisplaystyle}\hfill
+|% `toc display' as without \usepackage{etoc}|
If the command \csb{etocsetstyle} has \emph{not been used in the
@@ -1644,7 +1840,7 @@ preamble} the package will be at |\begin{document}| in this
compatibility mode: hence just adding \csa{usepackage\{etoc\}}
should hopefully not change anything to the look of a
previously existing document, under the |article|, |book|,
- |report|, |scrartcl|, |scrbook|, |scrreprt| and |memoir|
+ |report|, \ctanpkg{scrartcl}, \ctanpkg{scrbook}, \ctanpkg{scrreprt} and \ctanpkg{memoir}
classes.
Any use of \csb{etocsetstyle} in the \emph{preamble or body} of
@@ -1656,13 +1852,13 @@ preamble} the package will be at |\begin{document}| in this
with the help of \csb{etocsetstyle}, if their scope was not
limited to a group or environment.
- The command \csb{etocdefaultlines} resets the line styles as
+ The command \csb{etocdefaultlines} sets the line styles to custom ones
pre-defined internally by \etoc and described in
\autoref{etocdefaultlines}.
Even if \csb{etocsetstyle} has been used, the global display style
-remains initially as defined by the document class (or the
-|tocloft| package); one needs to use the command
+remains initially as defined by the document class or the
+\ctanpkg{tocloft} package (but see footnote\footref{fn:compat}); one needs to use the command
\csb{etocsettocstyle} or its variants to exit from this
compatibility mode at the ``toc display style'' level. It will be
re-activated if use if made of \csb{etocstandarddisplaystyle}.
@@ -1671,11 +1867,12 @@ See further \autoref{sec:anothercompat}.
\section{A first example}
\label{sec:firstexample}
+\label{invisiblelocaltableofcontents}
Let us present a first example of specification for line styles.
Immediately after the start of \autoref{part:overview} we inserted in the
source file:
-\centeredline{|\invisiblelocaltableofcontents \label{toc:overview}|} This
+\centeredline{\csb{invisiblelocaltableofcontents} |\label{toc:overview}|} This
sets-up the label |toc:overview|, and we can use it at any location in the
document: \centeredline{|\tableofcontents \ref{toc:overview}|} And as we used
|\invisible...|,\footnote{this is a shortcut for setting temporarily the
@@ -1683,7 +1880,7 @@ document: \centeredline{|\tableofcontents \ref{toc:overview}|} And as we used
and not even the heading.} the local TOC will exist only through its clones
elsewhere in the document.
-\begin{filecontentsdef}{etocsnippet-\the\value{section}.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\begingroup\parindent 0pt \parfillskip 0pt \leftskip 0cm \rightskip 1cm
\etocsetstyle {section}
{}
@@ -1740,8 +1937,33 @@ which was inspired from what \LaTeX2e's |\@dottedtocline| macro does.
Here is how it was produced:
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
-
+% vendredi 18 novembre 2022
+% very strange problem/bug with \marginpar which did not work
+% prior to add \normalmarginpar. Whether or not using any
+% extra text. Unless using \normalmarginpar, the test text HELLO
+% was placed in left not right margin and beyond page borders,
+% one saw only last O. Strange.
+% I do not understand what is happening.
+% > \normalmarginpar=macro:
+% ->\global \@mparbottom \z@ \@reversemarginfalse .
+% l.1753 \show\normalmarginpar
+% ?
+% > 0.0pt.
+% l.1754 \showthe\@mparbottom
+% % 0.0pt
+% The \@mparbottom is already 0pt... but one has strangely
+% > \if@reversemargin=\iftrue.
+% l.1765 \makeatletter\show\if@reversemargin
+% \makeatother
+% ?
+% Why is it currently \iftrue?
+% The strange placement happens whether or not I put some text
+% before using \marginpar.
+% \marginpar
+% {\textattachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}{\textcolor{blue}{HELLO}}}
+%
+%
+\marginattach{}
\section{A second example}
\label{sec:secondexample}
@@ -1753,7 +1975,7 @@ is done via the technique of \emph{depth tags}, described in
layout is a bit like the one of the \hyperref[toc:main]{main document
TOC}, although the line styles are coded very differently.
-\begin{filecontentsdef}{etocsnippet-\the\value{section}.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\begingroup
\newcommand*{\DotsAndPage}
{\nobreak\leaders\hbox{\bfseries\normalsize\hbox to .75ex {\hss.\hss}}%
@@ -1808,7 +2030,7 @@ layout is a bit like the one of the \hyperref[toc:main]{main document
The code:
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\section{A Beautiful Thesis example}
@@ -1820,7 +2042,7 @@ sub-sections in an average length memoir. The line style specifications have
some redundancy for clarity, and do not care about what to do at possible page
breaks. Also, they do not worry about potential multi-column use.
-\begin{filecontentsdef}{etocsnippet-\the\value{section}.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\begingroup % we start a group to keep the style changes local
\newlength{\tocleftmargin} \setlength{\tocleftmargin}{5cm}
\newlength{\tocrightmargin} \setlength{\tocrightmargin}{1cm}
@@ -1854,7 +2076,7 @@ breaks. Also, they do not worry about potential multi-column use.
\filecontentsexec\foo
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\section{Linked list of the main package commands}
@@ -1916,11 +2138,9 @@ breaks. Also, they do not worry about potential multi-column use.
\csb{etocimmediatedepthtag.toc}\par
\csb{etocimmediatesettocdepth.toc}\par
\csb{etocimmediatetoccontentsline}\par
- \csb{etocimmediatesetlocaltop.toc}\par
\csb{etocinline}\par
\csb{etoclink}\par
\csb{etoclocalframed}\par
- \csb{etoclocaltop}\par
\csb{etoclocalmulticol}\par
\csb{etoclocalruled}\par
\csb{etocmulticolstyle}\par
@@ -1934,7 +2154,6 @@ breaks. Also, they do not worry about potential multi-column use.
\csb{etocruledstyle}\par
\csb{etocruled}\par
\csb{etocsetlevel}\par
- \csb{etocsetlocaltop.toc}\par
\csb{etocsetnexttocdepth}\par
\csb{etocsetstyle}\par
\csb{etocsettagdepth}\par
@@ -1960,7 +2179,7 @@ breaks. Also, they do not worry about potential multi-column use.
\end{multicols}
%\end{minipage}\par
-The above is not an exhaustive list of all the package user commands, although
+The above is not an exhaustive list of all the package user commands. And
for legacy arbitrary reasons some of the more obscure commands are included
here.
@@ -1977,14 +2196,20 @@ here.
\etocstandardlines
\localtableofcontents
-\section{The \toc, \localtoc and \localtocwrdp commands}
+\section{The \csbhyp{tableofcontents}, \csbhyp{localtableofcontents} and
+ \csbhyp{localtableofcontentswithrelativedepths} commands}
\label{tableofcontents}
+\label{etoctableofcontents}
\label{localtableofcontents}
\label{localtableofcontentswithrelativedepth}
\begin{description}
\item[\toc] can be used arbitrarily many times in the document. Styling either
- globally the TOC or its individual entries is customizable at any time in the document.
+ globally the TOC or its individual entries is customizable at any time in
+ the document.
+
+ \csb{etoctableofcontents} is a synonym to \etoc's \toc. See
+ footnote\footref{etockeeporiginaltableofcontents} on page \pageref{etockeeporiginaltableofcontents}.
\item[\localtoc] will print local tables of
contents: \emph{i.e.} all sections and sub-units inside a
given chapter, or all subsubsections and lower inside a given
@@ -2038,7 +2263,7 @@ current value of the |tocdepth| counter is obeyed. As an
example the table of contents of
\autoref{part:custom} is in a \hyperref[toc:d]{float} which appears
\vpageref{toc:d}.
-\begin{filecontentsdef}{etocsnippet-\the\value{section}.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\begin{figure}[ht!]
\centering
\begingroup
@@ -2055,7 +2280,8 @@ example the table of contents of
\filecontentsexec\foo
We used this: \filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex} In the above example, not
+\marginattach{}
+In the above example, not
only did we use |\ref{toc:c}| to print here the distant (local) table of
contents which has been labeled |toc:c| but we added a (possibly confusing)
|\label{toc:d}|. This is done for the down-to-earth reason of being able
@@ -2074,7 +2300,7 @@ This original local table of contents is to be found \vpageref{toc:c}.
\label{sec:tocdepth}
The intrinsic levels manipulated by \etoc are numeric: from
-|-2| (which corresponds to |book| in the |memoir| class)
+|-2| (which corresponds to |book| in the \ctanpkg{memoir} class)
down (from the big to the small)
to |5| (|subparagraph|). But the assignment of a numeric level
to a given name can be modified at any time with the command
@@ -2103,7 +2329,7 @@ explained further in \autoref{part:surprising}.
relevance to the \textbf{|tocdepth|} counter in the standard
classes and are recapitulated in this table: \centeredline{
\fbox{\begin{tabular}{rc}
- (|memoir| class) book&-2\\ part&-1\\ chapter&0 \\
+ (\ctanpkg{memoir} class) book&-2\\ part&-1\\ chapter&0 \\
section&1\\ subsection&2 \\
subsubsection&3 \\ paragraph&4 \\ subparagraph& 5
\end{tabular}}}
@@ -2126,6 +2352,7 @@ table of contents of all the paragraphs from the document!
\section{The \csbhyp{etocsettocdepth} and \csbhyp{etocsetnexttocdepth} commands}
\label{etocsettocdepth}
\label{etocsetnexttocdepth}
+\label{invisibletableofcontents}
The |tocdepth| counter has no bearing on what gets written to the |.toc| file;
its action is only on the actual typesetting of the table of
@@ -2144,13 +2371,15 @@ numeric (from |-3| to |5|) or a division name such as |subsection| or
corresponding to a document division).
This does the appropriate |\setcounter{tocdepth}{numeric_level}|.
-As is explained in the next subsection, |tocdepth| is used by |hyperref|, and
+As is explained in the next subsection, |tocdepth| is used by \ctanpkg{hyperref}, and
one must take steps to prevent its changes from influencing the bookmarks, too.
So, \etoc has \csb {etocsetnexttocdepth}\marg{level} whose influence ceases
-immediately after the next table of contents. Thus, |\invisibletableofcontents|
-is essentially |\etocsetnexttocdepth{none}\tableofcontents|.
+immediately after the next table of contents. The package defines
+\csb{invisibletableofcontents}
+essentially as
+\centeredline{\csb{etocsetnexttocdepth}|{none}|\csb{tableofcontents}}
-The simplest course is thus to have after |\begin{document}| and before the
+The simplest organization is probably to have after |\begin{document}| and before the
first |\tableofcontents| a single instance of the \csb{etocsettocdepth}
command, with argument the deepest level (or most commonly used deepest level)
among the tables of contents of the document, and to use locally,
@@ -2181,7 +2410,7 @@ The simplest course is thus to have after |\begin{document}| and before the
When modifying the counter |tocdepth| for the purposes of
multiple uses of \toc or \localtoc, one should be aware that
-package |hyperref| by default takes into account the
+package \ctanpkg{hyperref} by default takes into account the
\emph{current} value of the |tocdepth| counter to decide
whether the |pdf| file will contain a bookmark corresponding
to sectioning commands encountered in the source file. Thus,
@@ -2190,10 +2419,10 @@ value after having temporarily modified it for a given table of
contents.
Or, there is the \emph{bookmarksdepth=n} option of package
-|hyperref|, with \emph{n} the desired document bookmarks
+\ctanpkg{hyperref}, with \emph{n} the desired document bookmarks
maximal depth, which can be numeric or the name of a level known to
-|hyperref|. This documentation previously passed |bookmarksdepth=3| as
-option to |hyperref|, so even if |tocdepth| was left to |1|
+\ctanpkg{hyperref}. This documentation previously passed |bookmarksdepth=3| as
+option to \ctanpkg{hyperref}, so even if |tocdepth| was left to |1|
by inadvertance after printing a certain table of contents
this did not modify the bookmark tree of the |pdf| file. Now that
\csb{etocsetnexttocdepth} has been added to the package, we have used it
@@ -2206,8 +2435,12 @@ systematically and there was no need for |bookmarksdepth=3| anymore.
\label{etocimmediatesettocdepth.toc}
This command \csb{etocsettocdepth.toc} implements some functionality of
-|tocvsec2|\footnote{\url{http://ctan.org/pkg/tocvsec2}. I thank Denis \textsc{Bitouzé} for drawing
- my attention to the incompatibility of this package with \etoc.}, a package
+\ctanpkg{tocvsec2}%
+%
+\footnote{I thank Denis \textsc{Bitouzé} for drawing
+ my attention to the incompatibility of this package with \etoc.},
+%
+a package
which however was incompatible with \etoc (it can still be used for its
|secnumdepth|-related commands, but its |toc|-related activities will get
canceled by \etoc) and more-or-less designed for a single table of contents.
@@ -2273,7 +2506,7 @@ re-activate it. The package does initially \csb{etocobeytoctocdepth}.
% \begin{enumerate*}[label={(\roman*)}]
% \item the second argument to \csb{etocsetlevel} must be numeric,
% \item it can not be set to |-3| (which would be necessary if one wanted to
-% exclude an entire Book from a TOC in a |memoir| document with multiple such
+% exclude an entire Book from a TOC in a \ctanpkg{memoir} document with multiple such
% Books \dots admittedly a possibly rare case!),
% \item it is a bit of a hack as |partIII| is not a real division unit, but just
% a \emph{tag}.
@@ -2463,58 +2696,6 @@ empty, this does mean that \etoc considered the just encountered local table
of contents to be empty (for that run) and thus printed nothing (not even a
|\par|).
-% pas traduit
-\section{The \csbhyp{etoclocaltop} command}
-\label{etoclocaltop}
-
-\textbf{New with 1.09 (2019/03/09)}.
-
-Within either the TOC style
-(\csb{etocsettocstyle}) or the local title styles (\csb{etocsetstyle}), the
-control sequence \csb{etoclocaltop} is made equivalent for the duration of
-\csb{localtableofcontents} to a numeric (self-delimiting) denotation of the
-current top level.
-
-Thus: it will in numeric contexts (|\ifnum|, |\ifcase|, ...) represent zero
-for a local TOC corresponding to chapter, or one if in a section, or two if in
-a subsection, etc..., assuming of course here that the default levels are
-obeyed (see \autoref{sec:tocdepth}).
-
-\begin{framed}
- \csb{etoclocaltop} from inside the TOC heading (first argument of
- \csb{etocsettocstyle}) has the correct value \emph{only under
- \csb{etocchecksemptiness} regime}. Special circumstances correspond to
- some special values:
- \begin{description}[nolistsep]
- \item[|-3|] (|-\thr@@|)\newline
- signals that \etoc considers the local TOC to be
- ``unknown''; this happens at the last local TOC, for the first \LaTeX\ run
- after adding a new \localtoc to the document. In doubt, \etoc assumes the
- TOC will prove non empty, hence it prints (independently of whether the
- check for emptiness was activated or not) the heading as specified by
- \csb{etocsettocstyle}. Thus, check if \csb{etoclocaltop} gives |-3| as a
- a \meta{number} to detect that situation from within the first argument of
- \csb{etocsettocstyle}, if desired.
- \item[|-1000|](|-\@m|)\newline is in case of a \localtoc
- being considered ``known'' (although it may still refer to the data in the
- |.toc| file from the previous run) but without the check for emptiness
- having been executed.
- \item[|-10000|](|-\@M|)\newline is the value when accessed from the title
- of a global TOCs.
- \end{description}
-\end{framed}
-\begin{framed}
- When executed from within a local table of contents \textbf{line styles}
- (\csb{etocsetstyle}), \csb{etoclocaltop} always will hold the correct value,
- whether or not the emptiness check was executed.
-
- For a global table of contents however, it will always keep the value |-3|.
-\end{framed}
-
-Attention! \cs{etoclocaltop} is only to be queried; modifying it is strictly
-forbidden and falls under the most rigorous prosecution allowed by federal
-law.
-
\section{Adding commands to the \texorpdfstring{\texttt{.toc}}{.toc} file}
\label{sec:addingtotoc}
@@ -2541,7 +2722,7 @@ document and to use where needed something like:
\tableofcontents
\let\myclearpage\relax
\end{verbatim}
-The |memoir| class has the command \csa{settocdepth} which
+The \ctanpkg{memoir} class has the command \csa{settocdepth} which
writes a \csa{changetoc\-depth} command inside the |.toc| file.
This will impact the typesetting by \etoc of \emph{all} tables
of contents, with (possibly) unexpected results: imagine the
@@ -2551,9 +2732,9 @@ in the main table of contents. Then a local table of contents
in one of these chapters will print a title but will be
without any entry.
-As the |memoir| class by itself allows multiple\toc
+As the \ctanpkg{memoir} class by itself allows multiple\toc
these issues already arise there,
- independently of \etoc, see page 170 of the |memoir|
+ independently of \etoc, see page 170 of the \ctanpkg{memoir}
manual.
For this specific issue, the commands \csb{etocsettocdepth.toc},
@@ -2591,7 +2772,7 @@ I use the following trick: either in the preamble using
I found out experimentally that the option |hidelinks| could
indeed be set many times with |\hypersetup| (this is not the
- case of all |hyperref| options).
+ case of all \ctanpkg{hyperref} options).
\clearpage
@@ -2612,7 +2793,7 @@ and \autoref{part:globalcmds}.
As a further example we now print the local table of contents
of \autoref{part:globalcmds}. First we will test the compatibility mode.\footnote{the
-present document uses the |scrartcl| class, and we check here that
+present document uses the \ctanpkg{scrartcl} class, and we check here that
the \etoc compatibility mode does respect the customizing done via the
class commands.} The original was invisibly defined with a label at the
beginning of \autoref{part:globalcmds}.
@@ -2648,7 +2829,7 @@ Well, there is actually an alternative. It is possible to use the
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
+\item get the \ctanpkg{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,
@@ -2662,7 +2843,7 @@ automatically in \csb{etocsavedsectiontocline}, \csb{etocsavedchaptertocline}
etc... the meaning of the \LaTeX\ |\l@section|, |\l@chapter|, etc... macros as
they were at the time the TOC is typeset.
-\begin{filecontentshere}{etocsnippet-\the\value{section}-A.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\makeatletter
\newcommand{\MyStandardTOC}{%
\begingroup
@@ -2685,7 +2866,7 @@ they were at the time the TOC is typeset.
\endgroup}
\makeatother
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}-A}]{etocsnippet-\the\value{section}-A.tex}
+\marginattach{-A}
One can add to the above arbitrary text formatting commands, for example
replace |\etocpage| by |\textcolor{blue}{\etocpage}|.
@@ -2694,16 +2875,16 @@ 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.\footnote{and if
moreover one just wants to keep the same layout as in the default, one may
question why using \etoc... there is \emph{one} good reason: numbers and names
-are separately \texttt{hyperref} links, whereas normally there is only one link
+are separately \ctanpkg{hyperref} links, whereas normally there is only one link
holding both the number and the name corresponding to one toc entry.} 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|.\footnote{For the
-|memoir| class, one needed prior to \etoc |1.08k| a bit more: each of the command \csa{booknumberline},
+one of the document class: |article|, |book|, \ctanpkg{scrartcl}, \ctanpkg{scrbook}.\footnote{For the
+\ctanpkg{memoir} class, one needed prior to \etoc |1.08k| a bit more: each of the command \csa{booknumberline},
\csa{partnumberline} and \csa{chapternumberline} had to be saved. They can now
be used directly in the line styles, because their meanings are not modified
anymore by \etoc during its TOC typesetting.}
-The number and the name of each entry are each separately an |hyperref| link, as
+The number and the name of each entry are each separately an \ctanpkg{hyperref} link, as
is always the case with \etoc, when not in compatibility mode. Replacing
\csb{etocnumber} with \csb{etocthenumber} will give a TOC where the numbers are
not links anymore, but the names still are. Or one may decide to use \csb{etocthename}
@@ -2711,13 +2892,13 @@ and keep an hyperlinked number with
\csb{etocnumber}.
Here is a subtler example where one only marginally modifies the
-sections (adding color to the number and removing the |hyperref| link) and keeps
+sections (adding color to the number and removing the \ctanpkg{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:overview}}
\bigskip
This example only has sections and subsections, and the code used in \csa{MyStandardTOC} was:
-\begin{filecontentshere}{etocsnippet-\the\value{section}-B.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\etocsetstyle{section}{}
{\ifnum\etocthenumber=4
\etocsetstyle{subsection}
@@ -2741,12 +2922,12 @@ This example only has sections and subsections, and the code used in \csa{MyStan
{\etocsavedsectiontocline{\numberline{{\color{cyan}\etocthenumber}}\etocname}{\etocpage}}
{}%
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}-B}]{etocsnippet-\the\value{section}-B.tex}
+\marginattach{-B}
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 and except for the color of the section numbers),
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
+instructions. But we had to examine the \ctanpkg{scrartcl} sources to determine what to
use for \csa{leftskip} and \csa{rightskip} for our customized section
entries.
@@ -2757,9 +2938,9 @@ As explained in \autoref{subs:compat}: without explicit use of an
hand regarding the ``toc line styles''. It is sometimes asked by users (for
example those using \etoc for its \csb{localtableofcontents}) how to stay
close to but not completely identical with the design implemented by the
-standard classes, such as |book|. I can recommend package |tocloft| for this,
+standard classes, such as |book|. I can recommend package \ctanpkg{tocloft} for this,
as it is compatible with \etoc (see \autoref{subs:tocloft}) and thus \etoc will
-obey the |tocloft| customizations (as long as no use has been made of
+obey the \ctanpkg{tocloft} customizations (as long as no use has been made of
\csb{etocsetstyle}). It is also possible to modify only the style for, say,
sections and leave the parts, chapters, subsections as in the document class,
via the technique from \autoref{sec:anothercompat}.
@@ -2791,7 +2972,7 @@ besides, with the \csa{TOCcomputenumwidths} from
\autoref{sec:thirdexampleextra} these macros will actually hold a dimension
using |pt| as dimensional unit.
-\begin{filecontentshere}{etocsnippet-\the\value{section}-A.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
% it will be easy to globally shift the TOC horizontally if needed
\def\TOCleftmargin {0pt}
\def\TOCrightmargin {2.55em}% like LaTeX's \@tocrmarg
@@ -2889,7 +3070,7 @@ using |pt| as dimensional unit.
}
\makeatother
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}-A}]{etocsnippet-\the\value{section}-A.tex}
+\marginattach{-A}
Nota Bene: the code deliberately handles the non-numbered sectioning units
unlike the way of the standard document classes (particularly regarding the
alignment of multi-line headings.)
@@ -2902,7 +3083,7 @@ TOC, or rather before using \localtoc. If one wants a full
TOC at end of document one will naturally have to issue again
\csa{TOCglobalstyle} there.
-\begin{filecontentshere}{etocsnippet-\the\value{section}-B.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\makeatletter
\newcommand*\TOClocalstyle {%
\etocsettocstyle
@@ -2949,7 +3130,7 @@ TOC at end of document one will naturally have to issue again
}% end of \TOClocalstyle
\makeatother
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}-B}]{etocsnippet-\the\value{section}-B.tex}
+\marginattach{-B}
As mentioned previously, this handles non-numbered (multi-line) sectioning
units somewhat differently from what happens in the standard document classes.
@@ -2974,7 +3155,7 @@ line styles and some colors added (it has been put in a float which appears
% environment. This bug has nothing to do with \etoc.}
% RETIRÉ le 28 avril 2015 pour 1.08f
-\begin{filecontentshere}{etocsnippet-\the\value{section}-A.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\etocdefaultlines
\begingroup
\renewcommand{\etoccolumnsep}{2em}
@@ -3007,7 +3188,7 @@ line styles and some colors added (it has been put in a float which appears
\end{figure}
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}-A}]{etocsnippet-\the\value{section}-A.tex}
+\marginattach{-A}
\filecontentsexec\filecontentsheremacro
@@ -3060,7 +3241,7 @@ code is used also for \hyperref[toc:clone]{this other toc}.
% attention car \ref{toc:floating} fera référence au compteur de
% toutes les toc, pas visibletoc.
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\begin{figure}[htbp!]\centering
\colorlet{subsecnum}{black}
\colorlet{secbackground}{green!30}
@@ -3138,7 +3319,7 @@ code is used also for \hyperref[toc:clone]{this other toc}.
(\emph{cf.} \hyperref[toc:clone]{this other toc})}
\end{figure}
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\filecontentsexec\filecontentsheremacro
@@ -3161,7 +3342,7 @@ many matters do not seem to be widely shared).
%%%% dvipdfmx does not know how to handle completely. Apart from that the output
%%%% is ok, thus no need to try seriously to avoid them.
-\begin{filecontentsdef}{etocsnippet-\the\value{section}.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\begingroup
\newsavebox{\forsubsections}
\etocsetstyle{part}{\upshape. \etocskipfirstprefix}
@@ -3191,7 +3372,7 @@ many matters do not seem to be widely shared).
The code used:
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\clearpage
@@ -3264,10 +3445,10 @@ it here we just wrote:\par\smallskip
\centeredline{| ||\addcontentsline{toc}|\marg{level\_name}\marg{name}}
but its usefulness is to circumvent\footnote{using \csa{addtocontents} rather
than \csa{addcontentsline}} the patching for automatic creation
- of bookmarks done to \csa{addcontentsline} by the |hyperref| package,
+ of bookmarks done to \csa{addcontentsline} by the \ctanpkg{hyperref} package,
as pdf bookmarks don't make
much sense here (and would elicit a complaint
- of |hyperref| that the bookmark level is `unknown').\footnote{%
+ of \ctanpkg{hyperref} that the bookmark level is `unknown').\footnote{%
The package provides a starred variant
\staritb{etoctoccontentsline}, which does allow the creation
of bookmarks and has a third mandatory argument which is the
@@ -3296,7 +3477,7 @@ it here we just wrote:\par\smallskip
Here are the implementation details:
\begingroup
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
< in the preamble >
\newcounter{visibletoc}
\renewcommand{\etocaftertitlehook}
@@ -3319,7 +3500,7 @@ Here is the numbered and linked list of all tables of contents which are
displayed within this document: \tableofcontents.
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\endgroup
After |\etocsetstyle{visibletoc}{..}{..}{..}{..}|, all future TOCs (not in
@@ -3363,8 +3544,8 @@ the exercise number would then have been available via \csb{etocnumber}, and
\csb{etocname} would have been empty. It doesn't matter which one of the two
methods is used. The \etoc command \csb{etoctoccontentsline}|{..}{..}| is
provided as a substitute to \csa{addcon\-tentsline}|{toc}{..}{..}|: this is to
-avoid the patching which is done by |hyperref| to \csa{addcontentsline} in its
-process of creation of bookmarks. If one wants to authorize |hyperref| to create
+avoid the patching which is done by \ctanpkg{hyperref} to \csa{addcontentsline} in its
+process of creation of bookmarks. If one wants to authorize \ctanpkg{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:
@@ -3375,12 +3556,12 @@ argument:
The counter |exerci| is already
incremented by the |exerci| theorem environment, and
provides the correct destination for the link added by package
-|hyperref|. The command \csa{exercisetotoc} adds for each exercise a line
+\ctanpkg{hyperref}. The command \csa{exercisetotoc} adds for each exercise a line
to the |.toc| file, corresponding to a fictitious document
unit with name `|exercise|'. A
four-column list, including the sections, can then be
typeset with the following code:
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\etocsetnexttocdepth{2} % sections are at level 1 and will show up
\begingroup
\etocsetlevel{exercise}{2} % but:
@@ -3398,7 +3579,7 @@ typeset with the following code:
\tableofcontents
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
A related command \csb{etocimmediatetoccontentsline} (and its starred version)
is also provided. For discussion and the meaning of ``immediate'', refer to
@@ -3406,8 +3587,8 @@ the analogous case of \csb{etocimmediatedepthtag.toc}.
\section{The TOC as a tree}\label{tocastree}
-Using |tikz|\footnote{\url{http://ctan.org/pkg/pgf}} and the package
-|forest|\footnote{\url{http://ctan.org/pkg/forest}} we shall display the table
+Using \ctanpkg{tikz} and the package
+\ctanpkg{forest} we shall display the table
of contents of this part as a tree. The technique is to
use the \etoc modified command \toc not for typesetting, but to
prepare a macro, or rather here a \emph{token list} variable, with all the
@@ -3422,7 +3603,7 @@ commands in \csa{treetok} would be of no use: to which number or name would they
then refer to, in a delayed execution?
We need to store, not the macro names, but the macro contents. And also we wish
-to maintain the correct |hyperref| hyperlinks.\footnote{This manual up to the
+to maintain the correct \ctanpkg{hyperref} hyperlinks.\footnote{This manual up to the
version of May 14, 2013 used package |tikz-qtree| but there were problems with
hyperlinks. No such problem arises either when using |forest| or the native
|tikz| syntax for trees (which will be illustrated in the next section).} The
@@ -3464,7 +3645,7 @@ which will be given the contents of |\treetok|.
\let\appendtotok\relax
-\begin{filecontentsdef}{etocsnippet-\the\value{section}.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
% \newtoks\treetok % put this (uncommented) preferably in the preamble
% \newtoks\tmptok % (idem)
@@ -3530,7 +3711,7 @@ The resulting tree has been put in a \hyperref[toc:forest]{float}, which
appears \vpageref[above]{toc:forest}. Here is the
code used for its production:
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
Why |\hypersetup{hidelinks}|? as explained in
\autoref{ssec:hidelinks}, I prefer the links in TOCs not to be
colorized, nor framed, so this document inserts a command
@@ -3543,7 +3724,7 @@ originating in
|\etocthelinkedname|, etc\dots{} will be executed in the normal
environment for links (which, in this document, is to colorize
them). Rather than having \etoc's code try to guess what the current ``style''
-for links is (a concept not really provided by |hyperref| it
+for links is (a concept not really provided by \ctanpkg{hyperref} it
seems) and store it in |\etocthelinkedname|, etc\dots, I opted for
the simpler solution to leave it up to the user to recreate
whatever conditions are desired. So here it is necessary to re-issue
@@ -3581,7 +3762,7 @@ contents of this (or another) document part, only a \csa{sectiontok} and a
\csa{subsectiontok} will be needed.
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
% \newtoks\treetok % put this (uncommented) preferably in the preamble
% \newtoks\sectiontok
% \newtoks\subsectiontok
@@ -3627,7 +3808,7 @@ contents of this (or another) document part, only a \csa{sectiontok} and a
\end{tikzpicture}
\end{figure}
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\filecontentsexec\filecontentsheremacro
@@ -3709,7 +3890,7 @@ example was motivated on |2015/03/11| by
\let\appendtotok\relax
\expandafter\let\csname c@partco\endcsname\relax
-\begin{filecontentsdef}{etocsnippet-\the\value{section}.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\begingroup
% \newtoks\treetok % done in preamble
% \newtoks\parttok
@@ -3836,7 +4017,7 @@ example I excluded some sections from the display, using the technique of the
appears \vpageref{toc:mindmap}.
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
An interesting alternative is to use \etoc rather to convert the entire TOC
into a TikZ tree (perhaps excluding some parts) and print it out to a file
from which it can be recovered and manipulated directly by the author of the
@@ -3856,7 +4037,7 @@ suitable tikz picture. See also
for an elaboration of this.
-\section{The TOC as a table}
+\section{The TOC as a (long) table}
\label{sec:tocastable}
With release |1.08| it is easier to typeset a TOC as a table. It is
@@ -3885,7 +4066,7 @@ conditions and a few caveats:
Here is an example of a TOC as a |longtable| (yes this is only \emph{one} table),
as is possible relatively simply now with |1.08|. The code follows.
-\begin{filecontentsdef}{etocsnippet-\the\value{section}-A.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\begingroup
\etocglobaldefs % necessary for \etocname etc... to survive &
\makeatletter
@@ -3951,7 +4132,7 @@ as is possible relatively simply now with |1.08|. The code follows.
\filecontentsexec\foo
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}-A}]{etocsnippet-\the\value{section}-A.tex}
+\marginattach{-A}
Examining the code above the reader will wonder why the |\\| are
always given first in \meta{prefix+contents} and not, as is more
intuitive, rather last. In some favorable cases (but almost never
@@ -3996,7 +4177,7 @@ For the hardliner's old way see \autoref{ssec:tocastableold}.
Here is also a much simpler example. It is a local table of
contents.
-\begin{filecontentsdef}{etocsnippet-\the\value{section}-B.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\begin{center}
\etocsetstyle{section}
{}
@@ -4021,7 +4202,7 @@ contents.
\filecontentsexec\foo
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}-B}]{etocsnippet-\the\value{section}-B.tex}
+\marginattach{-B}
\section{A TOC self-adjusting widths for its typesetting}
\label{sec:thirdexampleextra}
@@ -4029,7 +4210,7 @@ contents.
This is a continuation of \autoref{sec:thirdexample}. The goal is to adjust
automatically the ``numwidths'' used for typesetting the unit numbers in the
(local) tables of contents.
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\makeatletter
\newcommand*\TOCcompute@numwidths [2]{% #1=empty/"local", #2=minimal indent
\begingroup
@@ -4084,7 +4265,7 @@ automatically the ``numwidths'' used for typesetting the unit numbers in the
}%
\makeatother
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
The optional parameter to \csa{TOCcomputenumwidths} specifies the minimal
indent. In case nothing is numbered you may wish a higher value than |0.5em|.
For each local table of contents to have its own width computations, the macro
@@ -4102,7 +4283,7 @@ Notes:
simultaneously compute the numwidths and then typeset the (local) table of
contents.
\item if you want to adjust the |tocdepth| recall from
- \autoref{ssec:bookmarksdepth} that it influences |hyperref| hence you may
+ \autoref{ssec:bookmarksdepth} that it influences \ctanpkg{hyperref} hence you may
need to use a group |\begingroup...\endgroup|. Or, one can use
\csb{etocsetnexttocdepth}\marg{level} but (with the code as here) this must
then be issued twice, once for \csa{TOCcomputelocalnumwidths}, once for
@@ -4131,7 +4312,7 @@ Notes:
% with xcolor, as xcolor modifies \fbox
% (try \section{\fbox{A}} with and without xcolor). The fix
% was to \protect the \fbox used in the |enumitem| label.
-% Strangely enough, with |hyperref| active, the problem did
+% Strangely enough, with \ctanpkg{hyperref} active, the problem did
% not show up. Anyhow I now use \fcolorbox rather than \fbox
% and there is no problem anymore. Also I don't have now to
% use \normalcolor which already needed protection.
@@ -4184,7 +4365,7 @@ obtained in the following manner:%
\csa{rmfamily} instead.}
\begingroup\small
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\etocsetstyle{section}
{\begin{enumerate}}
{\normalsize\bfseries\rmfamily\item}
@@ -4204,7 +4385,7 @@ obtained in the following manner:%
{\etocname}
{.\hfil\par\endgroup\pagebreak[3]}
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\endgroup
These provisory style definitions rely on the automatic
@@ -4225,13 +4406,13 @@ where no provision is made for them and added the definitive:
\end{verbatim}
This is also the situation with the default package line styles!
-Each \csb{etocsetstyle} command has five mandatory arguments:\\
-\hbox to \linewidth
-{\hfil\csb{etocsetstyle}\color{blue}\marg{levelname}%
- \marg{start}\marg{prefix}\marg{contents}\marg{finish}\hfil}
+Each \csb{etocsetstyle} command has five mandatory arguments:
+\centeredline
+{\csb{etocsetstyle}\color{blue}\marg{levelname}%
+ \marg{start}\marg{prefix}\marg{contents}\marg{finish}}
The initially recognized \meta{levelname}'s are the sectioning
levels of the standard document classes: from \emph{part} (or
-\emph{book} which is used by the |memoir| class) down to
+\emph{book} which is used by the \ctanpkg{memoir} class) down to
\emph{subparagraph}.
The \meta{start} code is executed when a toc entry of that level is
@@ -4244,10 +4425,10 @@ typeset by executing first the \meta{prefix} code and then the
The (robust) commands \csb{etocname}, \csb{etocnumber} and \csb{etocpage} are
provided for use inside the \meta{prefix} and \meta{contents} parts of the
\csb{etocsetstyle} specification. They represent of course, the name, number,
-and page number of the corresponding toc entry. If package |hyperref| is
+and page number of the corresponding toc entry. If package \ctanpkg{hyperref} is
active in the document and has added hyperlinks to the TOC data, then these
links are kept in the commands \csb{etocname}, \csb{etocnumber} and
-\csb{etocpage} (this last one will have a link only if |hyperref| was passed
+\csb{etocpage} (this last one will have a link only if \ctanpkg{hyperref} was passed
option \emph{linktoc=all}.)%
%
\footnote{In case of \emph{linktoc=page}, only \csb{etocpage} is an hyperlink;
@@ -4306,7 +4487,7 @@ an unnumbered section (which ended up in the table of
contents via an \csa{addcontentsline} command).\footnote{as
seen we use \csa{fcolorbox} rather than \csa{fbox}. Due
to some redefinition made by package |xcolor|, had we used
- \csa{fbox} (and not used |hyperref|) we would have needed
+ \csa{fbox} (and not used \ctanpkg{hyperref}) we would have needed
\csa{protect}\csa{fbox}.}
The \csb{etocifnumbered}\marg{A}\marg{B} command executes
@@ -4346,7 +4527,7 @@ The command \csb{etocifnumbered} is robust; \csb{etocxifnumbered}
It is sometimes desirable to have access to the name, number and page
number without the hyperref link data: something similar to the starred
-variant of the \csa{ref} command, when package |hyperref| is used. For
+variant of the \csa{ref} command, when package \ctanpkg{hyperref} is used. For
example one may wish to use the unit or page number in some kind of
numeric context, or change its formatting. This is provided by
\csb{etocthename}, \csb{etocthenumber}, and \csb{etocthepage}.
@@ -4360,14 +4541,14 @@ preceded by |\protect|.
The command \csb{etoclink}\marg{text} can be used in the line style
specifications in a manner analogous to \csb{etocname}, \csb{etocnumber} and
-\csb{etocpage}. It creates a link (if such a link was added by |hyperref| to
+\csb{etocpage}. It creates a link (if such a link was added by \ctanpkg{hyperref} to
the |.toc| file entry) whose target is the corresponding document unit and
whose name is the given \meta{text} mandatory argument.
-Hence |\etoclink{\etocthename}| is under default conditions of |hyperref| like
+Hence |\etoclink{\etocthename}| is under default conditions of \ctanpkg{hyperref} like
the original |\etocname|, because the latter is already hyperlinked. Under
\emph{linktoc=page} context |\etoclink{\etocthename}| adds the hyperlink which
-is missing from \csb{etocname}. Similarly under the default |hyperref|
+is missing from \csb{etocname}. Similarly under the default \ctanpkg{hyperref}
condition (\emph{linktoc=section}) \csb{etocpage} is not an hyperlink, but one
can use |\etoclink{\etocthepage}|.
@@ -4381,21 +4562,43 @@ The command \csb{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.
-\section{The \csbhyp{etocthelinkedname}, \csbhyp{etocthelinkednumber},
-\csbhyp{etocthelinkedpage} and \csbhyp{etocthelink} commands}
+
+% Sadly the [] syntax influences both the header and the entry in the TOC
+% Which is clearly a design limitation of LaTeX.
+% Ah! I see it seems KOMA has a way out there is \scr@osectarg
+% I had to dig a bit into scrartcl.cls and then make a divination
+% of where to look in the pdf, once I had gone through the barrier
+% of the html opener (why? as the documentation is not in html format!)
+
+% Another special feature of KOMA-Script is the handling of the optional
+% argument of the sectioning commands \part, \chapter, etc. down to
+% \subparagraph. You can change its function and meaning with the options
+% headings=optiontohead, headings=optiontotoc and headings=optiontoheadandtoc.
+
+% Mais j'ai déjà utilisé parfois le [] pour vraiment impacter la toc
+% Donc je dois faire manuellement
+\makeatletter\scr@activate@xsection{1}\makeatother
+% [] goes to head but {} to toc
+
+% What would really be useful is an option for the length of {} to be measured
+% and opt for [] only if does not fit on one header line
+\section[The \csbhyp{etocthelinkedname} et al.\protect\@{} commands]
+ {The \csbhyp{etocthelinkedname}, \csbhyp{etocthelinkednumber},
+ \csbhyp{etocthelinkedpage} and \csbhyp{etocthelink} commands}
\label{etocthelinkedname}
\label{etocthelinkednumber}
\label{etocthelinkedpage}
\label{etocthelink}
+\makeatletter\scr@activate@xsection{0}\makeatother
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}.
Notice though that \csb{etocthelinkednumber} and \csb{etocthelinkedname} are
-hyperlinks only if |hyperref| was configured to let the heading name be
-linked (this is the default). So under |hyperref| option \emph{linktoc=page},
+hyperlinks only if \ctanpkg{hyperref} was configured to let the heading name be
+linked (this is the default). So under \ctanpkg{hyperref} option \emph{linktoc=page},
both \csb{etocthelinkednumber} and \csb{etocthelinkedname} are no different
from respectively \csb{etocthenumber} and \csb{etocthename}.
@@ -4420,7 +4623,7 @@ Obsolete example of \begingroup
{\end{itemize*}.}%
\etocsetnexttocdepth {section}%
\etocsettocstyle {a table of contents done as an inline
- \texttt{enumitem} environment: }{}%
+ \ctanpkg{enumitem} environment: }{}%
\etocinline\tableofcontents \ref{toc:globalcmds}
\endgroup
@@ -4449,7 +4652,7 @@ anymore here for \csb{etocthelinkedname}, as \csb{etocname} works.
Example of
\begingroup\etocglobaldefs % <-- NEW mit etoc 1.08.
\etocsetstyle {section}
- {\begin{itemize*}[itemjoin={{; }}, itemjoin*={{, und }}]}
+ {\begin{itemize*}[itemjoin={{; }}, itemjoin*={{, and }}]}
{}
{\item [{\bfseries\etocnumber.}] \etocname\ (\emph{p. \etocpage })}
{\end{itemize*}.}%
@@ -4462,14 +4665,14 @@ Example of
Example of
\begingroup\etocglobaldefs % <-- NEW mit etoc 1.08.
\etocsetstyle {section}
- {\begin{itemize*}[itemjoin={{; }}, itemjoin*={{, und }}]}
+ {\begin{itemize*}[itemjoin={{; }}, itemjoin*={{, and }}]}
{}
{\item [{\bfseries\etocnumber.}]
\etocname\ (\emph{p. \etocpage })}
{\end{itemize*}.}%
\etocsetnexttocdepth {section}%
\etocsettocstyle {a table of contents done as an inline
- \texttt{enumitem} environment: }{}%
+ \ctanpkg{enumitem} environment: }{}%
\etocinline\tableofcontents \ref{toc:globalcmds}
\endgroup
@@ -4532,7 +4735,7 @@ These level assignments can be modified at anytime: see
technique. As one
further example, let's mention here that the \hyperref[toc:main]{main table of
contents} of this document was typeset following these instructions:
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\etocsettocdepth {subsubsection} % set the initial tocdepth
\etocdefaultlines % use the package default line styles. At this early stage in
% the document they had not yet been modified by \etocsetstyle
@@ -4549,7 +4752,7 @@ contents} of this document was typeset following these instructions:
\tableofcontents \label{toc:main}
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
In this way, the subsections used the style originally designed for
subsubsections, the subsubsections were not printed. Without this modification,
the appearance would have been very different: the package line styles were
@@ -4582,7 +4785,7 @@ Let us switch to the color red, and also add this command to the |.toc| file:
\subsection{This is a (pale) red subsection for illustrative purposes}
-Actually, this title here was printed black, due to the way the |scrartcl| class
+Actually, this title here was printed black, due to the way the \ctanpkg{scrartcl} class
works (it would have been red in the |article| class), but we are more
interested in how it looks in the tables of contents: it does appear red in the
\hyperref[toc:main]{main table of contents} at the beginning of
@@ -4618,7 +4821,7 @@ file.
\addtocontents{toc}{\string\normalcolor}
Back to black. Note that this scope problem arises in real life in a
-multi-lingual document, as the |babel| package writes to the |.toc| file the
+multi-lingual document, as the \ctanpkg{babel} package writes to the |.toc| file the
language changes occurring in the document.
@@ -4654,8 +4857,7 @@ shortcuts: \etocruled[1]{Title} (or \etoclocalruled[1]{Title})
\label{etocsettocstyle}
This is a command with two mandatory arguments:\\
-\centerline{\csb{etocsettocstyle}\marg{before\_toc}%
-\marg{after\_toc}}
+\centeredline{\csb{etocsettocstyle}\marg{before\_toc}\marg{after\_toc}}
The \marg{before\_toc} part is responsible for typesetting the
heading, for example it can be something like
\starit{section}|{\contentsname}|.
@@ -4706,9 +4908,9 @@ The commands to be described next \csb{etocmulticolstyle},
\label{etocmulticol}
\label{etoclocalmulticol}
-This is a command with one optional and one mandatory argument:\\
-\centerline{\csb{etocmulticolstyle}%
- \oarg{number\_of\_columns}\marg{heading}} The
+This is a command with one optional and one mandatory argument:
+\centeredline{\csb{etocmulticolstyle}\oarg{number\_of\_columns}\marg{heading}}
+The
\meta{number\_of\_columns} can go from 1 to 10 (it defaults to 2; if its
value is 1, naturally no |multicols| environment is then created). The
\meta{heading} will typically be some `vertical' material like:
@@ -4726,8 +4928,8 @@ configured:
After \csb{etocmulticolstyle} all future \csa{tableofcontents} will use the
specified style, if it does not get changed in-between. A shortcut for
just one table of contents and
-no impact on the styles of later TOCs is:\\
-\centerline{\csb{etocmulticol}\oarg{number\_of\_columns}\marg{heading}}
+no impact on the styles of later TOCs is:
+\centeredline{\csb{etocmulticol}\oarg{number\_of\_columns}\marg{heading}}
And there is also
\csb{etoclocalmulticol}\oarg{number\_of\_columns}\marg{heading}.
@@ -4767,7 +4969,7 @@ which does not uppercase.
\label{etoclocalruled}
The general format of \csb{etocruledstyle} is:\\
-\centerline{\csb{etocruledstyle}%
+\centeredline{\csb{etocruledstyle}%
\oarg{number of columns}\marg{title of the toc}}
\noindent
The title is horizontal material (the |LR| mode of
@@ -4787,10 +4989,10 @@ the \hyperref[toc:a]{start of the second part of this
As a shortcut to set the style with \csb{etocruledstyle} and
then issue a
-\csa{tableofcontents}, all inside a group
+\toc, all inside a group
so that future table of contents will not be
-affected, there is:\\
-\centerline{\csb{etocruled}\oarg{number\_of\_columns}\marg{title}}
+affected, there is:
+\centeredline{\csb{etocruled}\oarg{number\_of\_columns}\marg{title}}
And the local form will be \csb{etoclocalruled}.
\subsection{The commands \csbhyp{etocframedstyle}, \csbhyp{etocframed}, and \csbhyp{etoclocalframed}}
@@ -4798,11 +5000,11 @@ And the local form will be \csb{etoclocalruled}.
\label{etocframed}
\label{etoclocalframed}
-Same mechanism:\\
-\centerline{\csb{etocframedstyle}%
+Same mechanism:
+\centeredline{\csb{etocframedstyle}%
\oarg{number\_of\_columns}\marg{title}}
-and the accompanying shortcut:\\
-\centerline{\csb{etocframed}\oarg{number\_of\_columns}\marg{title}} The
+and the accompanying shortcut:
+\centeredline{\csb{etocframed}\oarg{number\_of\_columns}\marg{title}} The
shortcut is used if one does not want to modify the style of the next
TOCs (the other way is to put the whole thing inside braces or a
|\begingroup...\endgroup|; there is also \csb{etoclocalframed} for a
@@ -4818,9 +5020,9 @@ border are specified via suitable |\renewcommand|'s (see
A |minipage| is used, hence the produced table of contents isn't
compatible with a page break. For allowing page breaks, use of
the commands of
-\href{http://ctan.org/pkg/mdframed}{mdframed}\footnote{\url{http://ctan.org/pkg/mdframed}}
+\ctanpkg{mdframed}
or
-\href{http://ctan.org/pkg/tcolorbox}{tcolorbox}\footnote{\url{http://ctan.org/pkg/tcolorbox}}
+\ctanpkg{tcolorbox}
in the arguments of \csb{etocsettocstyle}
is recommended.
@@ -4878,6 +5080,8 @@ class should be obeyed, too.
\subsubsection{The commands \csbhyp{etocarticlestyle}, \csbhyp{etocbookstyle},
\dots}
+\label{etocarticlestyle}
+\label{etocbookstyle}
These are the commands used internally by \etoc in compatibility mode
depending on the document class. For example \csb{etocarticlestyle} instructs
@@ -4927,14 +5131,15 @@ 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
+displayed by the main table of contents). Notice that \ctanpkg{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 \csb{etocaftertitlehook}
+% problème avec \xspace
+With this set-up issuing \localtoc\unskip|*| will ignore the \csb{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|
+\ctanpkg{memoir} class behavior, and can also be used with it. For more on \ctanpkg{memoir}
class with \etoc, see \autoref{ssec:memoir}.
There are further hook macros:
@@ -5045,7 +5250,9 @@ can be followed with optional labels or references:\par
\medskip
-New with |1.08e|: \localtoc \csa{ref}|{toc:far}| as synonym for \toc
+%New with |1.08e|:
+
+\localtoc \csa{ref}|{toc:far}| acts the same as \toc
\csa{ref}|{toc:far}|.
% (obsolète depuis 1.08e)
@@ -5102,7 +5309,7 @@ medium series; we modify the \csb{etocfontone} command for that. Also we use dot
leaders which are less spread out than in the package default.
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape
\fbox{\parbox{.6\linewidth}{
\leftskip 0pt plus .5fil
@@ -5123,13 +5330,40 @@ leaders which are less spread out than in the package default.
\tableofcontents
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\filecontentsexec\filecontentsheremacro
\section{Customizing \etoc}
\subsection{Customizing the \etoc pre-defined line styles}
+\label{etocfontminustwo}
+\label{etocfontminusone}
+\label{etocfontzero}
+\label{etocfontone}
+\label{etocfonttwo}
+\label{etocfontthree}
+\label{etocsepminustwo}
+\label{etocsepminusone}
+\label{etocsepzero}
+\label{etocsepone}
+\label{etocseptwo}
+\label{etocsepthree}
+\label{etocminustwoleftmargin}
+\label{etocminustworightmargin}
+\label{etocminusoneleftmargin}
+\label{etocminusonerightmargin}
+\label{etocbaselinespreadminustwo}
+\label{etocbaselinespreadminusone}
+\label{etocbaselinespreadzero}
+\label{etocbaselinespreadone}
+\label{etocbaselinespreadtwo}
+\label{etocbaselinespreadthree}
+\label{etoctoclineleaders}
+\label{etocabbrevpagename}
+\label{etocpartname}
+\label{etocbookname}
+
We will simply list the relevant commands as defined in the
package. Customizing them goes through suitable
@@ -5176,7 +5410,7 @@ within \etoc. As already explained, when
itself very discrete and acts only at the global level, and
the TOC entries are (hopefully) formatted as would have
happened in the absence of \etoc.\footnote{with the
- KOMA-script classes, we noticed that
+ \ctanpkg{KOMA-script} classes, we noticed that
\csb{etocstandarddisplaystyle} was apparently needed for the
KOMA options |toc=left| to be active at the level of the line entries.}
@@ -5194,6 +5428,27 @@ switching off the compatibility mode.
\subsection{Customizing the toc display styles}
\label{ssec:customdisplay}
+\label{etocabovetocskip}
+\label{etocbelowtocskip}
+\label{etoccolumnsep}
+\label{etocmulticolsep}
+\label{etocmulticolpretolerance}
+\label{etocmulticoltolerance}
+\label{etocdefaultnbcol}
+%\label{etocinnertopsep}% déjà défini
+\label{etoctoprule}
+\label{etoctoprulecolorcmd}
+\label{etocinnerleftsep}
+\label{etocinnerrightsep}
+\label{etocinnerbottomsep}
+\label{etocleftrule}
+\label{etocrightrule}
+\label{etocbottomrule}
+\label{etocleftrulecolorcmd}
+\label{etocrightrulecolorcmd}
+\label{etocbottomrulecolorcmd}
+\label{etocbkgcolorcmd}
+\label{etocframedmphook}
Again we list the relevant macros, what they do should be
legible from their names. Note that \csa{renewcommand}'s and
@@ -5249,8 +5504,8 @@ in |ex|'s or |em|'s as in this example:
\centeredline{|\renewcommand{\etoctoprule}{\hrule height 1ex}|}
The package code is done in such a manner
that it is the font size in instance at the end of typesetting
-the title argument to \csb{etocruledtoc} or
-\csb{etocframedtoc} which will be used for the meaning of the
+the title argument to \csb{etocruled} or
+\csb{etocframed} which will be used for the meaning of the
`1ex'. Of course also the other rule commands can have their
dimensions in font relative units, but their values are
decided on the basis of the font in effect just before the
@@ -5272,7 +5527,7 @@ this example so we included the title as part of the
\meta{start} code at section level, to get it \emph{inside}
the frame.
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\begingroup
\definecolor{subsecnum}{RGB}{13,151,225}
\definecolor{secbackground}{RGB}{0,177,235}
@@ -5344,7 +5599,7 @@ the frame.
\tableofcontents \label{toc:clone} \ref{toc:globalcmds}
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\filecontentsexec\filecontentsheremacro
% 1.07l on the occasion of traduction into German documentation
@@ -5384,6 +5639,58 @@ use or not colors is left to the user.
%\section{... and tricks}
+% pas traduit
+\section{The \csbhyp{etoclocaltop} command}
+\label{etoclocaltop}
+
+%\textbf{New with 1.09 (2019/03/09)}.
+
+Within either the TOC style
+(\csb{etocsettocstyle}) or the local title styles (\csb{etocsetstyle}), the
+control sequence \csb{etoclocaltop} is made equivalent for the duration of
+\csb{localtableofcontents} to a numeric (self-delimiting) denotation of the
+current top level.
+
+Thus: it will in numeric contexts (|\ifnum|, |\ifcase|, ...) represent zero
+for a local TOC corresponding to chapter, or one if in a section, or two if in
+a subsection, etc..., assuming of course here that the default levels are
+obeyed (see \autoref{sec:tocdepth}).
+
+\begin{framed}
+ \csb{etoclocaltop} from inside the TOC heading (first argument of
+ \csb{etocsettocstyle}) has the correct value \emph{only under
+ \csb{etocchecksemptiness} regime}. Special circumstances correspond to
+ some special values:
+ \begin{description}[nolistsep]
+ \item[|-3|] (|-\thr@@|)\newline
+ signals that \etoc considers the local TOC to be
+ ``unknown''; this happens at the last local TOC, for the first \LaTeX\ run
+ after adding a new \localtoc to the document. In doubt, \etoc assumes the
+ TOC will prove non empty, hence it prints (independently of whether the
+ check for emptiness was activated or not) the heading as specified by
+ \csb{etocsettocstyle}. Thus, check if \csb{etoclocaltop} gives |-3| as a
+ a \meta{number} to detect that situation from within the first argument of
+ \csb{etocsettocstyle}, if desired.
+ \item[|-1000|](|-\@m|)\newline is in case of a \localtoc
+ being considered ``known'' (although it may still refer to the data in the
+ |.toc| file from the previous run) but without the check for emptiness
+ having been executed.
+ \item[|-10000|](|-\@M|)\newline is the value when accessed from the title
+ of a global TOCs.
+ \end{description}
+\end{framed}
+\begin{framed}
+ When executed from within a local table of contents \textbf{line styles}
+ (\csb{etocsetstyle}), \csb{etoclocaltop} always will hold the correct value,
+ whether or not the emptiness check was executed.
+
+ For a global table of contents however, it will always keep the value |-3|.
+\end{framed}
+
+Attention! \cs{etoclocaltop} is only to be queried; modifying it is strictly
+forbidden and falls under the most rigorous prosecution allowed by federal
+law.
+
\section[The \csbhyp{etocsetlocaltop.toc} command]
{The \csbhyp{etocsetlocaltop.toc} and
\csbhyp{etocimmediatesetlocaltop.toc} commands}
@@ -5574,18 +5881,18 @@ sections and subsections it has. Well, each one of this paragraph is a
table of contents! We designed a macro \csa{thispartstats} to do that.
It uses ``storage'' boxes to keep the information about the first and
last section or subsection. Using boxes is the simplest manner to
-encapsulate the |hyperref| link for later use (whether there is one or
+encapsulate the \ctanpkg{hyperref} link for later use (whether there is one or
none). However, one cannot modify then the font or the color.
% (using the
% \TeX{} primitive \csa{setbox} rather than the \LaTeX{} \csa{sbox} would
% allow to change the color of the un-boxed saved box)
If such a need
arises, one must switch from using boxes to using macros, and store the
-|hyperref| data for later use as was done in the code presented in
+\ctanpkg{hyperref} data for later use as was done in the code presented in
\autoref{sec:molecule}. We present also this second method.
But first, the code of \csa{thispartstats}:\par
-\begin{filecontentshere}{etocsnippet-\the\value{section}-A.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\newsavebox\firstnamei \newsavebox\firstnumberi
\newsavebox\lastnamei \newsavebox\lastnumberi
\newsavebox\firstnameii \newsavebox\firstnumberii
@@ -5597,32 +5904,33 @@ But first, the code of \csa{thispartstats}:\par
\setcounter{mycounti}{0}%
\setcounter{mycountii}{0}%
\def\thispartstatsauxi{%
- \sbox{\firstnamei}{\etocname}%
- \sbox{\firstnumberi}{\etocnumber}%
+ \sbox{\firstnamei}{\footnotesize\etocname}%
+ \sbox{\firstnumberi}{\footnotesize\etocnumber}%
\def\thispartstatsauxi{}}%
\def\thispartstatsauxii{%
- \sbox{\firstnameii}{\etocname}%
- \sbox{\firstnumberii}{\etocnumber}%
+ \sbox{\firstnameii}{\footnotesize\etocname}%
+ \sbox{\firstnumberii}{\footnotesize\etocnumber}%
\def\thispartstatsauxii{}}%
\begingroup
\etocsetstyle{subsection} {} {}
{\thispartstatsauxii
\stepcounter{mycountii}%
- \sbox{\lastnameii}{\etocname}%
- \sbox{\lastnumberii}{\etocnumber}} {}%
+ \sbox{\lastnameii}{\footnotesize\etocname}%
+ \sbox{\lastnumberii}{\footnotesize\etocnumber}} {}%
\etocsetstyle{section} {} {}
{\thispartstatsauxi
\stepcounter{mycounti}%
- \sbox{\lastnamei}{\etocname}%
- \sbox{\lastnumberi}{\etocnumber}}
- {Here are some statistics for this part: it contains \arabic{mycounti}
+ \sbox{\lastnamei}{\footnotesize\etocname}%
+ \sbox{\lastnumberi}{\footnotesize\etocnumber}}
+ {{\footnotesize\itshape
+ Here are some statistics for this part: it contains \arabic{mycounti}
section\ifnum\value{mycounti}>1 s\fi{} and \arabic{mycountii}
subsection\ifnum\value{mycountii}>1 s\fi. The name of the first section is
\unhbox\firstnamei{} and the corresponding number is \unhbox\firstnumberi.
The name of the last section is \unhbox\lastnamei{} and its number is
\unhbox\lastnumberi. The name of the first subsection is \unhbox\firstnameii{}
and the corresponding number is \unhbox\firstnumberii. The name of the last
- subsection is \unhbox\lastnameii{} and its number is \unhbox\lastnumberii.}%
+ subsection is \unhbox\lastnameii{} and its number is \unhbox\lastnumberii.\par}}%
\etocinline % cancels the automatic \par automatically before the TOC
\etocsettocstyle {}{}
\etocsetnexttocdepth{2}%
@@ -5630,10 +5938,10 @@ But first, the code of \csa{thispartstats}:\par
\endgroup
}
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}-A}]{etocsnippet-\the\value{section}-A.tex}
+\marginattach{-A}
And now, the variant with macros rather than boxes (this variant as it
stands here is for using within a section).
-\begin{filecontentshere}{etocsnippet-\the\value{section}-B.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\makeatletter
\newcommand*\firstsubname {} \newcommand*\lastsubname {}
\newcommand*\firstsubnumber {} \newcommand*\lastsubnumber {}
@@ -5662,7 +5970,7 @@ stands here is for using within a section).
}
\makeatother
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}-B}]{etocsnippet-\the\value{section}-B.tex}
+\marginattach{-B}
\section{Using depth tags}
\label{ssec:tocwithdepthtags}
@@ -5688,7 +5996,7 @@ underneath the numbers contrarily to the code from
lengths (now that this has been done once, it can be recycled easily) we
get:
-\begin{filecontentsdef}{etocsnippet-\the\value{section}.tex}{\foo}
+\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
\etocsetnexttocdepth {all}
\begingroup
\parindent 0pt \leftskip 0cm \rightskip .75cm \parfillskip -\rightskip
@@ -5757,7 +6065,7 @@ get:
\filecontentsexec\foo
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\section{Typesetting the TOC as a table (the old way)}
\label{ssec:tocastableold}
@@ -5801,7 +6109,7 @@ external macros inserted in the |.toc| file by other packages.
Note: rather than |\toks| registers it would be easier here to use \eTeX{}
\csa{unexpanded} primitive. See for example \autoref{sec:mindmap}.
-\begin{filecontentshere}{etocsnippet-\the\value{section}.tex}
+\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\newtoks\toctabletok
\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2
#1\expandafter\expandafter\expandafter {\expandafter\the\expandafter #1#2}}
@@ -5849,20 +6157,18 @@ Note: rather than |\toks| registers it would be easier here to use \eTeX{}
\the\toctabletok
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\clearpage
\etocdepthtag.toc {etocandworld}
\part{\etoc and the outside world}
-\section{Compatibility with other packages}
-
-\subsection{Generalities}
+\section{Constraints on the \texttt{.toc} file constitution}
The contents of the |.toc| file (if it already exists) are read into memory by
-\etoc once, at the time of |\begin{document}|.\footnote{New with |1.07m|.
- Earlier versions read the |.toc| file at the time of
+\etoc once, at the time of |\begin{document}|.\footnote{%
+ Versions earlier than |1.07m| read the |.toc| file at the time of
\csa{usepackage\{etoc\}}. Thanks to Denis Bitouzé who signaled a Babel
related problem, which turned out to be caused by this.}
@@ -5888,7 +6194,8 @@ Also a |\else| immediately following \csa{tableofcontents} or
\centeredline{|\renewcommand\tableofcontents{\oldtableofcontents foo}|}
as this will make the |\label/\ref| mechanism impossible.
- Rather use \centeredline{|\renewcommand\etocaftertochook{foo}|} and there
+ Rather, redefine \csb{etocaftertochook}
+\centeredline{|\renewcommand\etocaftertochook{foo}|} and there
is also \csb{etocaftercontentshook} which is executed a bit
earlier\footnotemark{} just before the closing part of the toc display
style (and thus still within a group.)
@@ -5912,92 +6219,53 @@ Also a |\else| immediately following \csa{tableofcontents} or
not use the \csa{contentsline} macro or if the \csa{contentsline} macro
does not invoke the \csa{l@<divisionunit>} macros.
-\subsection{Compatibility with \texttt{beamer}}
-
-For the very reasons mentioned right before, \etoc is incompatible with the
-|beamer| class. However, if |beamer| is used in an article mode, i.e., with
-the article class in conjunction with the |beamerarticle| package, then \etoc
-should work.
-
-\subsection{Compatibility with \texttt{Babel}}
-
-\begin{framed}
- One must load \etoc \emph{after} \texttt{babel}. This is in order for
- |babel|'s shorthands to be active at the time when \etoc loads the |.toc|
- file.
-\end{framed}
-
-\subsection{Compatibility with \texttt{hyperref}}
-
-Please inform the author in case of issues: \etoc was from the start designed
-to be |100%| compatible with package |hyperref|.
-
-The macros \csb{etocname}, \csb{etocnumber}, and \csb{etocpage} contain the
-|hyperref| links, if present (note that the \emph{linktoc=all} option of
-|hyperref| tells it to put a link also in the page number corresponding to a
-given toc entry). For example, the tables of contents of the present document
-are all fully linked. It doesn't matter whether \etoc or |hyperref| is loaded
-first.
-
-% \typeout{ICI}
-% \showhyphens{Compatibility}
-% [] \T1/txss/m/n/10.95 Com-pat-i-bil-ity
-
-% 2015/11/12
-% Pour une raison que j'ignore dans la TOC principale j'ai un problème avec
-% cette sous-section.
-
-\subsection{Com\-pat\-i\-bil\-ity with \texttt{multicol}}
-
-\etoc loads the package |multicol|.
-
-\subsection{Compatibility with \texttt{tocloft}}\label{subs:tocloft}
-
-Release |1.07k| added compatibility with package
-|tocloft|:\footnote{\url{http://ctan.org/pkg/tocloft}} steps are
-taken to prevent the redefinition of |\tableofcontents| done by
-|tocloft| at |\begin{document}|.
-%
-As long as \etoc is left in compatibility mode the customization done by
-|tocloft| will be obeyed, for both the line styles and the TOC title.
-One may still benefit from the \emph{depth tags} management by \etoc,
-from its |\localtableofcontents|, from its |\label+\ref| mechanism. One
-may use |\etocsetstyle| to define via \etoc the layout for one TOC and
-then use rather |tocloft| for another one, if |\tableofcontents| follows
-\csb{etocstandardlines} and \csb{etocstandarddisplaystyle}. In this
-compatibility mode |\etocsetlevel{division unit}{6}| will render
-invisible the chosen division level, but exchanging levels is otherwise
-not possible.
-
-\begin{framed}
- One should load \etoc \emph{after} \texttt{tocloft}. A warning is
- issued if otherwise, because if \etoc is loaded before it will realize that at
- the time of |\begin{document}| and trick \texttt{tocloft} into believing
- having been loaded with the |titles| option.
-\end{framed}
-
-It is possible to modify midway in the document the macros \csa{l@section},
-\csa{l@subsection} ... but the effect will be seen only in table of contents
-typeset by \etoc in compatibility mode (and of course after those
-customizations). It will have no effect on true \etoc TOCs.
+\section{Compatibility with document classes}
+
+\etoc has mainly been tested with the |article| and |book| standard classes.
+Some compatibility layer with the \ctanpkg{KOMA-script} and \ctanpkg{memoir} classes was added at
+|1.05| of |2012/12/01|. Such compatibilty layer regards what this
+documentation calls the global display style: when \etoc gets activated
+because the user employed some \csb{etocsetstyle}|{section}| (etc), i.e.\@ it
+is not used purely in compatibility mode (which happens I guess for
+\csb{localtableofcontents} functionality as it does not require reading the
+user manual), \etoc tries in absence of usage by the user of
+\csb{etocsettocstyle} to create itself a ``TOC display style'' emulating the
+default behaviour of the document class. There does not seem to be an easy
+way to extract this in an automated manner dynamically, so it is basically
+some manual work which the author initiated in 2012 and which got sporadically
+updated since.
+
+\subsection{Compatibility with the \ctanpkg{KOMA-script} classes}
+\label{etocscrartclstyle}
+\label{etocscrbookstyle}
+\label{etocscrreprtstyle}
+
+Not really tested. But nominally supported, as the code contains this
+\begin{verbatim}
+\@ifclassloaded{scrartcl}
+ {\renewcommand*\etocstandarddisplaystyle{\etocscrartclstyle}}{}
+\end{verbatim}
+and \cs{etocscrartclstyle} tries to emulate the global display style of the
+\cs{tableofcontents} command with the class \ctanpkg{scrartcl}. It was last updated
+at |1.09f|.
-\subsection{Compatibility with the \texttt{memoir} class}
+\subsection{Compatibility with the \ctanpkg{memoir} class}
\label{ssec:memoir}
\label{etocmemoirtoctotocfmt}
\label{etocmemoirstyle}
-Release |1.07l| has also improved the compatibility with the |memoir| class: its
+Release |1.07l| has also improved the compatibility with the \ctanpkg{memoir} class: its
|appendix| level has been made known to \etoc. It is at the same level as
|chapter|, thus the chapter line style should possibly do a test for some user
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
+The \ctanpkg{memoir} mechanism relative to \toc versus \toc|*| is obeyed
automatically, and applies with \localtoc too.
But, attention, this means that \localtoc should preferentially be used with
-the |*|. Else the |memoir| mechanism will insert a specific line in the
+the |*|. Else the \ctanpkg{memoir} mechanism will insert a specific line in the
|.toc| file, using by default the |chapter| sectioning level. But \etoc has
already written to the |.toc| file an instruction that the user wants a local
table of contents. As a result, the fake |chapter| will let \etoc consider
@@ -6012,8 +6280,8 @@ mechanism instructs to compile once more, and we end in a never stabilizing
conundrum.
Thus we see that the fact that \localtoc by default use like the global \toc a
-chapter style is inconvenient. One can use the |memoir| macros to modify this:
-according to |memoir| documentation, |\tocheadstart| and |\printtoctitle| seem
+chapter style is inconvenient. One can use the \ctanpkg{memoir} macros to modify this:
+according to \ctanpkg{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
@@ -6024,12 +6292,12 @@ appropriate. Hence
\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). This is appropriate
+\ctanpkg{memoir} toc related macros to achieve a section like rendering (for more
+details on the latter, please refer to \ctanpkg{memoir} manual). This is appropriate
for local TOCs in chapters. Adapt to finer sectioning levels.
Another approach is to overrule the \etoc
-default under |memoir| like this
+default under \ctanpkg{memoir} like this
\begin{verbatim}
\etocarticlestyle % means to use \section*{\contentsname} (and marks)
\renewcommand{\etocaftertitlehook}{\addcontentsline{toc}{section}{\contentsname}}
@@ -6041,34 +6309,101 @@ use \localtoc after a \csa{chapter}. But if you want one after a
\csa{section}, you should modify \csb{etocaftertitlehook} to assign
|subsection| level to the \localtoc own styling.
+\subsection{Compatibility with \ctanpkg{beamer}}
+
+For the reasons mentioned already regarding the constraints on the |.toc| file
+constitution, \etoc is incompatible with the
+\ctanpkg{beamer} class. However, if \ctanpkg{beamer} is used in an article mode, i.e., with
+the article class in conjunction with the \ctanpkg{beamerarticle} package, then \etoc
+should work.
+
+\section{Compatibility with other packages}
-\subsection{Compatibility with package \texttt{tocvsec2}}
+\subsection{Compatibility with \ctanpkg{babel}}
+
+\begin{framed}
+ One must load \etoc \emph{after} \ctanpkg{babel}. This is in order for
+ \ctanpkg{babel}'s shorthands to be active at the time when \etoc loads the |.toc|
+ file.
+\end{framed}
+
+\subsection{Compatibility with \ctanpkg{hyperref}}
+
+Please inform the author in case of issues: \etoc was from the start designed
+to be |100%| compatible with package \ctanpkg{hyperref}.
+
+The macros \csb{etocname}, \csb{etocnumber}, and \csb{etocpage} contain the
+\ctanpkg{hyperref} links, if present (note that the \emph{linktoc=all} option of
+\ctanpkg{hyperref} tells it to put a link also in the page number corresponding to a
+given toc entry). For example, the tables of contents of the present document
+are all fully linked. It doesn't matter whether \etoc or \ctanpkg{hyperref} is loaded
+first.
+
+% 2015/11/12
+% Pour une raison que j'ignore dans la TOC principale j'ai un problème avec
+% cette sous-section.
+
+\subsection{Com\-pat\-i\-bil\-ity with \ctanpkg{multicol}}
+
+\etoc loads the package \ctanpkg{multicol}.
+
+\subsection{Compatibility with \ctanpkg{tocloft}}\label{subs:tocloft}
+
+Release |1.07k| added compatibility with package
+\ctanpkg{tocloft}: steps are
+taken to prevent the redefinition of |\tableofcontents| done by
+\ctanpkg{tocloft} at |\begin{document}|.
+%
+As long as \etoc is left in compatibility mode the customization done by
+\ctanpkg{tocloft} will be obeyed, for both the line styles and the TOC title.
+One may still benefit from the \emph{depth tags} management by \etoc,
+from its |\localtableofcontents|, from its |\label+\ref| mechanism. One
+may use |\etocsetstyle| to define via \etoc the layout for one TOC and
+then use rather \ctanpkg{tocloft} for another one, if |\tableofcontents| follows
+\csb{etocstandardlines} and \csb{etocstandarddisplaystyle}. In this
+compatibility mode |\etocsetlevel{division unit}{6}| will render
+invisible the chosen division level, but exchanging levels is otherwise
+not possible.
+
+\begin{framed}
+ One should load \etoc \emph{after} \ctanpkg{tocloft}. A warning is
+ issued if otherwise, because if \etoc is loaded before it will realize that at
+ the time of |\begin{document}| and trick \ctanpkg{tocloft} into believing
+ having been loaded with the |titles| option.
+\end{framed}
+
+It is possible to modify midway in the document the macros \csa{l@section},
+\csa{l@subsection} ... but the effect will be seen only in table of contents
+typeset by \etoc in compatibility mode (and of course after those
+customizations). It will have no effect on true \etoc TOCs.
+
+\subsection{Compatibility with \ctanpkg{tocvsec2}}
\etoc used to be incompatible with package
- |tocvsec2|\footnote{\url{http://ctan.org/pkg/tocvsec2}}; it now cohabits, sort
- of, as it deactivates |tocvsec2|'s modification of |\tableofcontents|
+ \ctanpkg{tocvsec2}; it now cohabits, sort
+ of, as it deactivates \ctanpkg{tocvsec2}'s modification of |\tableofcontents|
and also cancels its other |toc|-related macros, but
reimplements partially their functionality with \csb{etocsettocdepth.toc}. By
the way, at least two latex runs are necessary for new uses of this command in
a document to have an effect in tables of contents.
-\subsection{Compatibility with package \texttt{tableof}}
+\subsection{Compatibility with \ctanpkg{tableof}}
It is possible to use simultaneously \etoc and
-{\color{niceone}|tableof|}\footnote{\url{http://ctan.org/pkg/tableof}}. Release
-|1.08| of \etoc requires at least version |1.4a| of |tableof|. If
+\ctanpkg{tableof}. Release
+|1.08| of \etoc requires at least version |1.4a| of \ctanpkg{tableof}. If
\csb{etocglobaldefs} is put in the preamble, this must be after the loading of
-package |tableof|. {\color{niceone}|tableof|} command \csa{nexttocwithtags}
+package \ctanpkg{tableof}. {\color{niceone}\ctanpkg{tableof}} command \csa{nexttocwithtags}
should work as expected.
-{\color{niceone}|tableof|} commands \csa{tableof}, \csa{tablenotof}, ... will
+\ctanpkg{tableof} commands \csa{tableof}, \csa{tablenotof}, ... will
typeset the (a priori global) table of contents according to the document
-class defaults, obeying the \etoc depth tags; as explained in the |tableof|
+class defaults, obeying the \etoc depth tags; as explained in the \ctanpkg{tableof}
documentation they do not typeset a TOC title. They should \emph{not} be used
in case \csb{etocglobaldefs} was issued before, except if its scope has been
terminated since then, or \csb{etoclocaldefs} has cancelled its influence.
-\subsection{Compatibility with package \texttt{tocstyle}}
+\subsection{Compatibility with \ctanpkg{tocstyle}}
Unknown. (not tested a.t.t.o.w).
@@ -6076,8 +6411,8 @@ Unknown. (not tested a.t.t.o.w).
\section{\TeX nical matters}
The \csb{etocname}, \csb{etocnumber}, \csb{etocpage} commands are protected
-against premature expansion. They contain suitable |hyperref| links if package
-|hyperref| is loaded and active for the TOC. The commands \csb{etoclink} and
+against premature expansion. They contain suitable \ctanpkg{hyperref} links if package
+\ctanpkg{hyperref} is loaded and active for the TOC. The commands \csb{etoclink} and
\csb{etocifnumbered} are also protected against premature expansion. Also
\csb{etociffirst} and \csb{etoctoccontentsline}.
@@ -6098,22 +6433,24 @@ The correct local table of
contents will be displayed only on the second compilation.
-\section{Errors and catastrophes}
+%%% de-\section this for matters of avoiding too cramped mindmap TOC
+%%%\section{Errors and catastrophes}
After using \csb{etocsetstyle} for one level, the remaining
uncustomized levels use the \etoc default styles (those
which are activated by \csb{etocdefaultlines}). One has to
- make sure that all levels needed for the next table of
+ make sure that \textbf{all levels} needed for the next table of
contents are mutually compatible: in particular the \etoc
default line styles expect each to be started in ``vertical mode''.
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 extra commands in the |.toc|
- file should be configured in such a way that they can be activated or
- deactivated easily from the document source, as need be.
+ executed by \etoc for \textbf{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 to add extra
+ commands to the |.toc| file, make it in such a way that they can be
+ activated or deactivated easily from the document source, e.g.\@ via some
+ booleans.
As is usual with toc and labels, after each change, one has
to run latex a certain number of times to let the produced
@@ -6121,11 +6458,51 @@ contents will be displayed only on the second compilation.
\clearpage
\etocdepthtag.toc {code}
-
+\normalmarginpar\marginparwidth72bp
\part{The code}
\localtableofcontents
+% IL FAUT METTRE AVANT \section{Timestamps} SINON FOUTU
+% (non plus maintenant puisque j'utilise \botmark pas \firstmark
+% dans le \rightmark)
+% Que c'est pénible cette syntaxe \markboth/\markright de LaTeX !
+% Pourquoi est-ce que \markright n'a pas été définie comme #1#2-> truc avec #2 ??
+\makeatletter
+\if@twoside
+\renewcommand *{\sectionmark }[1]{%
+ \markboth
+ {\unexpanded{\ifodd\value{page}(\hyperref[imp]{implementation},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\hfill\fi
+ \hyperref[changelog]{\thesection. Change history}%
+ \ifodd\value{page}\else\hfill(\hyperref[imp]{implementation},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\fi}}%
+ {\unexpanded{\ifodd\value{page}(\hyperref[imp]{implementation},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\hfill\fi
+ \hyperref[changelog]{\thesection. Change history}%
+ \ifodd\value{page}\else\hfill(\hyperref[imp]{implementation},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\fi}}%
+}
+\else\error
+% faudrait cependant que je réfléchisse à quoi faire exactement en oneside
+% mais comme ceci ne peut arriver que si quelqu'un customise etoc.tex
+% ce qui n'arrivera JAMAIS, je laisse tomber
+\renewcommand *{\sectionmark }[1]{%
+ \markright
+ {\unexpanded{\ifodd\value{page}(\hyperref[imp]{implementation},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\hfill\fi
+ \hyperref[changelog]{\thesection. Change history}%
+ \ifodd\value{page}\else\hfill(\hyperref[imp]{implementation},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\fi}}%
+}
+\fi
+\makeatother
\section{Timestamp}
This is the documentation as of \texttt{\etocdocdate}, printed from the
@@ -6138,7 +6515,7 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}.
\renewcommand\lowast{{\normalsize\raisebox{-.4\height}{*}}}
\small
- \section{Change history}
+ \section{Change history}\label{changelog}
\setlength{\columnsep}{\etoccolumnsep}
@@ -6199,7 +6576,22 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}.
\def {\ifvmode\advance\jfverbadim.5em\relax\else\expandafter\jfverbaspace\fi}}\x
\makeatother
\begin{jfverbatim}
-1.09g [2022/11/17]^
+1.09i [2022/11/21]^
+
+ Fix bug showing when a document uses both \etocchecksemptiness and
+ \etocsetlocaltop.toc: the start and finish parts of some levels were
+ executed possibly causing extra printed output.
+
+ More hyperlinking in the implementation part of the documentation.
+
+~1.09h [2022/11/20]^
+
+ Documentation improvements. In particular, attached code snippets
+ are now visible via their filenames in the page margins. Also,
+ command names are doubly hyperlinked: first half links to the devoted
+ part of the user manual, second half links to the implementation part.
+
+~1.09g [2022/11/17]^
Compatibility hotfix with recent hyperref 7.00u of 2022-11-13.
Thanks to Denis Bitouzé for signaling the breakage to the author.
@@ -6692,7 +7084,61 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}.
\small
-\section{Implementation}
+% Que c'est pénible cette syntaxe \markboth/\markright de LaTeX !
+% Pourquoi est-ce que \markright n'a pas été définie comme #1#2-> truc avec #2 ??
+\makeatletter
+\if@twoside
+\renewcommand *{\sectionmark }[1]{%
+ \markboth
+ {\unexpanded{{%
+% counteract some changes done by my macrocode hooks
+% so we must make sure it is in a scope limiting context
+% (perhaps it is already, will not check, wasted already
+% too much time on this header matter) November 2022
+ \hypersetup{linkcolor=RoyalBlue}%
+ \ifodd\value{page}(\hyperref[changelog]{change log},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\hfill\fi
+ \hyperref[imp]{\thesection. Implementation}%
+ \ifodd\value{page}\else\hfill(\hyperref[changelog]{change log},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\fi
+ }}%
+ }
+ {\unexpanded{{%
+ \hypersetup{linkcolor=RoyalBlue}%
+ \ifodd\value{page}(\hyperref[changelog]{change log},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\hfill\fi
+ \hyperref[imp]{\thesection. Implementation}%
+ \ifodd\value{page}\else\hfill(\hyperref[changelog]{change log},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\fi
+ }}%
+ }%
+}
+\else
+% faudrait cependant que je réfléchisse à quoi faire exactement en oneside
+% mais comme ceci ne peut arriver que si quelqu'un customise etoc.tex
+% ce qui n'arrivera JAMAIS, je laisse tomber
+\renewcommand *{\sectionmark }[1]{%
+ \markright
+ {\unexpanded{{%
+ \hypersetup{linkcolor=RoyalBlue}%
+ \ifodd\value{page}(\hyperref[changelog]{change log},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\hfill\fi
+ \hyperref[imp]{\thesection. Implementation}%
+ \ifodd\value{page}\else\hfill(\hyperref[changelog]{change log},
+ \hyperlink{FRONTPAGE}{user manual
+ front page})\fi
+ }}%
+ }%
+}
+\fi
+\makeatother
+
+\section{Implementation}\label{imp}
% ce \noindent est obsolète 2022/08/26 à cause des hooks à macrocode plus bas
% transférés depuis xint.dtx. Il est doublement obsolète car je rajoute un
@@ -6772,16 +7218,16 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}.
%%% \catcode`^ 11 \catcode`_ 11 }
%%% \def\xintexprMakePrivateLetters{\xintMakePrivateLetters \catcode`! 11 }
%%% \let\MakePrivateLetters\xintMakePrivateLetters
-\definecolor{xintnamecolor}{RGB}{228,57,0}
-\colorlet{verbcolor}{Maroon}
-%
-\colorlet{privatecommentcolor}{cyan}
-\colorlet{macrocodecommentcolor}{gray}
-\colorlet{macrocodenewmacrocolor}{verbcolor}
-\colorlet{macrocodelinktouserdoccolor}{xintnamecolor}% and bold face
-\colorlet{macrocodelinktosectioncolor}{DarkBlue}% and bold face
-\colorlet{macrocodelinktocodelinecolor}{DarkBlue}
-\colorlet{macrocodenoncscolor}{Green}
+% \definecolor{etocnamecolor}{RGB}{228,57,0}
+% \colorlet{verbcolor}{Maroon}
+%
+% \colorlet{privatecommentcolor}{cyan}
+% \colorlet{macrocodecommentcolor}{gray}
+% \colorlet{macrocodenewmacrocolor}{verbcolor}
+% \colorlet{macrocodelinktouserdoccolor}{etocnamecolor}% and bold face
+% \colorlet{macrocodelinktosectioncolor}{DarkBlue}% and bold face
+% \colorlet{macrocodelinktocodelinecolor}{DarkBlue}
+% \colorlet{macrocodenoncscolor}{Green}
\def\xintdocMacrocodeFallbackColorCmd{\normalcolor}
\odef\init@crossref{\init@crossref%
\everypar{\refstepcounter{CodelineNo}%
@@ -6851,11 +7297,11 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}.
{\xintdocMacrocodeFallbackColorCmd\special@escape@char\macro@namepart}%
\else
\ifcsname alreadydefined-\macro@namepart\endcsname
- \hyperref[xintmacro-\macro@namepart]{\special@escape@char\macro@namepart}%
+ \hyperref[etocmacro-\macro@namepart]{\special@escape@char\macro@namepart}%
\else
% this will make a rather large number of macro names in the string pool...
\global\expandafter\let\csname alreadydefined-\macro@namepart\endcsname\@empty
- \label{xintmacro-\macro@namepart}%
+ \label{etocmacro-\macro@namepart}%
\stepcounter{xintMacroCnt}%
% try to link to a labeled reference in the user documentation (xint-all.pdf)
\ifcsname r@\xintdoclabelprefix\macro@namepart\endcsname
@@ -6885,11 +7331,11 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}.
\if0\ifx\next\scan@macro0\else\ifx\next\lowast0\else1\fi\fi
\expandafter\in@\expandafter{\expandafter.\macro@namepart,}%
{.def,.edef,.let,.gdef,.xdef,%
- .chardef,.newif,.newtoks,.newcommand,}%.odef,.oodef,.fdef,}%
+ .chardef,.newif,.newtoks,.newcommand,.DeclareRobustCommand,}%.odef,.oodef,.fdef,}%
\ifin@\labelmacro@allowedtrue\fi
\fi
- \ifcsname r@xintmacro-\macro@namepart\endcsname
- \hyperref[xintmacro-\macro@namepart]{\special@escape@char\macro@namepart}%
+ \ifcsname r@etocmacro-\macro@namepart\endcsname
+ \hyperref[etocmacro-\macro@namepart]{\special@escape@char\macro@namepart}%
\else
{\xintdocMacrocodeFallbackColorCmd\special@escape@char\macro@namepart}%
\fi
@@ -6933,26 +7379,102 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}.
\makeatother
-Control sequences are mostly hyperlinks. When a user level command is
-defined it hyperlinks to the user documentation with
-\textbf{\textcolor{macrocodelinktouserdoccolor}{this colour}} (and bold
-face); for other macro definitions
-\textbf{\textcolor{macrocodenewmacrocolor}{this colour}} is used, and
-bold face. It is not an hyperlink then. When a previously defined
-macro is used it uses \textcolor{macrocodelinktocodelinecolor}{this
- colour} and is then an hyperlink to the macro definition in the source
-code. Comments have been configured
-\textcolor{macrocodecommentcolor}{to be rendered in their own colour},
-and \textcolor{macrocodenoncscolor}{non commented-out and non-control
- sequences tokens use this colour}. Other tokens use the fall-back
-normal colour.
-
-Warning: the code author's brain reboots frequently, and more and more often.
+Control\normalmarginpar\marginpar{\footnotesize\rmfamily\itshape\RaggedRight
+ The ``syntax highlighting'' was added at release 1.09f of 2022/08/30.\par}
+sequences are mostly hyperlinks. When a user level command gets defined it
+hyperlinks to the user documentation with bold face and
+\textbf{\textcolor{macrocodelinktouserdoccolor}{using this colour}}. Further
+instances if they occur will use \textcolor{macrocodelinktocodelinecolor}{this
+ colour} to link to their place of first definition. The latter applies also
+to non-user level macros. And such non-user level macros, at the location of
+their first definitions will have their names displayed using bold face and
+\textbf{\textcolor{macrocodenewmacrocolor}{this colour}} and there is no
+hyperlink then. Comments belonging to the code source have been configured
+\textcolor{macrocodecommentcolor}{to be rendered in their own colour}, and
+\textcolor{macrocodenoncscolor}{non commented-out and non-control sequences
+ tokens use this colour}. Other tokens use the fall-back normal colour.
+
+Further, when a package macro is mentioned in code comments it also hyperlinks
+to the location of its first definition using
+{\textcolor{macrocodelinktocodelinecolor}{this colour}} (user level commands
+do not link back to the user manual, but they link to their place of first
+macro definition, which is the one hyperlinking to the relevant user manual
+section). Sometimes however the location of first definition is disappointing
+as it may basically be provisory. Or the macro is in fact re-defined during
+execution of other macros. Besides, some macros are defined using
+|\csname...\endcsname| constructs (typically things defined with |part|,
+|chapter|, |section| etc... in their names) and thus can not be detected by
+the syntax highlighting automatization.
+
+% will be used in code comments
+% I could re-define \csb, but perhaps better as the mark-up is not yet there
+% when I define this to opt for a new name
+\DeclareRobustCommand\csbc[1]{{\hypersetup{linkcolor=macrocodelinktocodelinecolor}%
+ \ifcsname r@etocmacro-#1\endcsname
+ \hyperref[etocmacro-#1]{\ttfamily\hyphenchar\font45 \char`\\ #1}%
+ \else
+ % for .toc suffixed macros
+ \ifcsname r@etocmacro-\xintTrimUnbraced{-4}{#1}\endcsname
+ \hyperref[etocmacro-\xintTrimUnbraced{-4}{#1}]
+ {\ttfamily\hyphenchar\font45 \char`\\ #1}%
+ \else
+ \textcolor{red}{\ttfamily\hyphenchar\font45 \char`\\ #1}%
+ \fi
+ \fi }%
+}
+
+Warning: the author's brain reboots frequently, and more and more often.
Hence most comments are not for the general reader, they are for the author
himself and they document more the history of the package than its actual
functioning, because the historical evolution is the way the author can
remember and understand the code. There are a few precious isolated
-paragraphs which may prove vaguely useful to people not the author.
+paragraphs which may prove vaguely useful to people who are not the author.
+
+\etoc,\normalmarginpar\marginpar{\footnotesize\rmfamily\itshape\RaggedRight
+ This paragraph and the next were added very late in the history of the
+ package, at 1.09h.\par} when not left in compatibility mode, hijacks the
+\csa{contentsline} expansion so as to not execute \csa{l@chapter},
+\csa{l@section} etc..., but use \csbc{Etoc@lxyz}, which will parse the data and
+extract from it the name, number and page number. Indeed, for legacy reasons
+the \LaTeX{} |.toc| data is \emph{not structured}, but already to some extent
+oriented towards typesetting tasks, in an already pre-decided orderly manner.
+This part of \etoc maneuvers is fragile as 1) it requires the |.toc| file to
+be built from \csa{contentsline} entries, and 2) and relies on
+\csa{contentsline} to hand over the job to \csa{l@chapter}, \csa{l@section},
+etc... macros. Of course \etoc can be easily broken if changes happen to how
+data is stored there, in particular to how the text (which in \etoc lingua is
+called the \emph{name}) and the number (this one is called by us also
+\emph{number}) are put together. Things would have been much easier for \etoc
+in 2012 if the \csa{contentsline} arguments separated text (name) and number;
+unfortunately some mix is prepared, which may depend on the document class
+also, and typically handles \csa{part} levels very differently (and with more
+hard-coded stuff). Anyway, fortunately upstream changes happen rarely. The
+|7.00u| release of \ctanpkg{hyperref} was such an instance.
+
+The other core part of \etoc present from day one of the package is that it
+creates (but only virtually, and dynamically, not statically) a tree-like
+structure of the sectioning levels present in the |.toc| file. It could be
+fun to actually implement officially such a tree (where the children of a
+sectioning title are the sectioning levels at a greater depth such as
+subsections versus a section). Let us recall that \LaTeX{} provides zero
+means to know from a subsection for example, what is the title of the section
+containing it, or chapter, or part. To do this one has to create a really
+structured document which neither core \LaTeX{} nor the main document classes
+do. This remark was given for document body, but it also applies to |.toc|
+data. But \etoc adds at least some kind of follow-up to the successive
+encountered sectioning titles, and is thus able, to ``on-the-fly'' add some
+kind of structure and follow the succession of levels. Ultimately this is why
+the \csbc{etocsetstyle} offers \marg{start} and \marg{finish} parts in
+additions to \marg{contents} (which I divided into a \marg{prefix} and a
+\marg{contents}). At some point one could imagine that a really
+\emph{structured} document (in opposition to what core \LaTeX{} from thirty
+years ago up to nowadays realizes) would store in the |.toc| data directly a
+tree structure, where each node would have attributes name, number, page
+number, completely separated from any typesetting. Once this exists then
+basically \etoc disappears. In brief, once \etoc ideas will have permeated
+the society, it will disappear as its was born only to palliate the absence of
+real structure in the |.toc| file (which is sort of inherited from the absence
+of real structure in a \LaTeX{} document body).
% 9 avril 2015 (1.08d) pour forcer indentation après macrocode
% par un effet particulier si avant macrocode un enumerate, inefficient,
@@ -6972,6 +7494,8 @@ paragraphs which may prove vaguely useful to people not the author.
% \makeatother
+% This is obsolete as 1.09g of 2022/11/17 has removed this hack, also
+% for colorizing reasons from 1.09n.
% November 2012
% I don't want to have to type at this location (far from the top of the
% file) explicitly the package version or version date, as it is
@@ -6996,13 +7520,13 @@ paragraphs which may prove vaguely useful to people not the author.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{etoc}
-[2022/11/17 v1.09g Completely customisable TOCs (JFB)]
+[2022/11/21 v1.09i Completely customisable TOCs (JFB)]
\RequirePackage{multicol}
\DeclareOption*{\PackageWarning{etoc}{Option `\CurrentOption' is unknown.}}
\ProcessOptions\relax
% \end{macrocode}
% |1.08| suppresses |\ifEtoc@part| and defines |\ifEtoc@skipprefix|. It
-% also defines |\etocglobaldefs|, |\etoclocaldefs| and |\Etoc@global|.
+% also defines \csbc{etocglobaldefs}, \csbc{etoclocaldefs} and \csbc{Etoc@global}.
% \begin{macrocode}
\newtoks\Etoc@toctoks
\def\Etoc@par{\par}
@@ -7010,9 +7534,9 @@ paragraphs which may prove vaguely useful to people not the author.
\let\etocnopar\etocinline
\def\etocdisplay{\def\Etoc@par{\par}}% 1.07m 2015/01/23
% \end{macrocode}
-% |\etocglobaldefs| should be used only for special things such as TOC as a
+% \csbc{etocglobaldefs} should be used only for special things such as TOC as a
% table; it should be put in a group to limit its scope. If used in the
-% preamble, it must come \emph{after} |tableof| if the latter is loaded too.
+% preamble, it must come \emph{after} \ctanpkg{tableof} if the latter is loaded too.
% \begin{macrocode}
\let\Etoc@global\@empty % 1.08 2015/03/10
\def\etocglobaldefs{\let\Etoc@global\global\let\tof@global\global}
@@ -7093,17 +7617,17 @@ paragraphs which may prove vaguely useful to people not the author.
\let\Etoc@all@@ \Etoc@@five@@
\let\Etoc@none@@ \Etoc@minf
% \end{macrocode}
-% Versions earlier than |1.08| did |\Etoc@newlevel| in a quite
+% Versions earlier than |1.08| did \csbc{Etoc@newlevel} in a quite
% embarrassing way with an |\edef|.
%
-% |1.08f|'s \csa{etocsetlevel} avoids multiple insertions of the same level
-% in the \csa{Etoc@levellist} list.
+% |1.08f|'s \csbc{etocsetlevel} avoids multiple insertions of the same level
+% in the \csbc{Etoc@levellist} list.
%
-% |1.08k| modified \csa{Etoc@newlevel}: formerly a token |\l@#1| was stored in
+% |1.08k| modified \csbc{Etoc@newlevel}: formerly a token |\l@#1| was stored in
% place of braced name |{#1}|. This changed is to facilitate creation of the
-% |\etocsavedsectiontocline| etc... macros later on, at each TOC. But the
+% \csa{etocsavedsectiontocline} etc... type macros later on, at each TOC. But the
% stored |#1| is not expanded immediately, although it is in other parts of
-% \csa{etocsetlevel}, which may cause timing problems if |#1| is a macro.
+% \csbc{etocsetlevel}, which may cause timing problems if |#1| is a macro.
% \begin{macrocode}
\let\Etoc@levellist\@empty
\def\Etoc@newlevel #1{\expandafter\def\expandafter\Etoc@levellist\expandafter
@@ -7156,23 +7680,23 @@ paragraphs which may prove vaguely useful to people not the author.
\etocsetlevel{paragraph}{4}
\etocsetlevel{subparagraph}{5}
% \end{macrocode}
-% The first two parameters of |\Etoc@et@hop| are exchanged in |1.08|
+% The first two parameters of \csbc{Etoc@et@hop} are exchanged in |1.08|
% compared to earlier versions; this is in relation to changes done in
-% |\Etoc@etoccontentsline|.
+% \csbc{Etoc@etoccontentsline}.
%
% |1.08i 2016/09/29| has a |fourorthree| rather than as formerly a |sixorfive|.
%
% \LaTeX\ of November 2021 will have its |\contentsline| always grab four
-% arguments. So we must adjust |\Etoc@et@hop| et al., else usage of \etoc
+% arguments. So we must adjust \csbc{Etoc@et@hop} et al., else usage of \etoc
% without hyperref will be broken. Done at |1.09e 2021/09/23|.
%
%^^A Side note to myself: I see there is now a |\@gobblethree| in latex.ltx and
%^^A I wonder since when. No time to lose on checking that.
%^^A Answer: 2020-02-27 ltdefns.dtx 1.5g |\@gobblethree|: Macro added
%
-% |1.09g| adapts to |hyperref| depending on
+% |1.09g| adapts to \ctanpkg{hyperref} depending on
% whether the latter is at |7.00u| or earlier. Indeed internal changes to
-% |hyperref| at |7.00u| broke \etoc. Thanks to Denis~\textsc{Bitouzé} for
+% \ctanpkg{hyperref} at |7.00u| broke \etoc. Thanks to Denis~\textsc{Bitouzé} for
% reporting the issue.
% \begin{macrocode}
\AtBeginDocument{%
@@ -7230,7 +7754,14 @@ paragraphs which may prove vaguely useful to people not the author.
\def\Etoc@et@hop#1#2#3#4{#2{#3}{#4}#1}%
\long\def\Etoc@gobblefourorthree#1#2#3{}%
}%
-\@ifl@t@r\fmtversion{2021/11/15}%
+% \end{macrocode}
+% Until |1.09i| the date threshold was erroneously set to 2021/11/15.
+% In practice this meant that for some version of \LaTeX{} \etoc was
+% a bit sloppy and left some empty brace pairs |{}|, which however
+% could possibly impact I think only TOCs executed in math mode... not
+% very frequent!
+% \begin{macrocode}
+\@ifl@t@r\fmtversion{2020/10/01}%
{%
\def\Etoc@et@hop#1#2#3#4#5{#2{#3}{#4}{#5}#1}%
\let\Etoc@gobblefourorthree\@gobblefour
@@ -7242,11 +7773,11 @@ paragraphs which may prove vaguely useful to people not the author.
% defined macros which may close groups. This has always been the reason
% for the |\global|'s here and elsewhere.
%
-% |1.08| uses |\Etoc@level| rather than a |#1| which used to be anyhow always
-% the |\Etoc@tmp|. Now |\Etoc@level| is what was called formerly |\Etoc@tmp|
-% in |\Etoc@etoccontentsline|.
+% |1.08| uses \csbc{Etoc@level} rather than a |#1| which used to be anyhow always
+% the |\Etoc@tmp|. Now \csbc{Etoc@level} is what was called formerly |\Etoc@tmp|
+% in \csbc{Etoc@etoccontentsline}.
%
-% Attention that |\Etoc@setflags| must not modify |\Etoc@next|!
+% Attention that \csbc{Etoc@setflags} must not modify |\Etoc@next|!
% \begin{macrocode}
\def\Etoc@setflags {%
\ifcase \Etoc@level
@@ -7292,10 +7823,10 @@ paragraphs which may prove vaguely useful to people not the author.
\fi
}
% \end{macrocode}
-% |1.08| This was originally in |\Etoc@etoccontentsline|, intermixed
-% with the definitions of |\Etoc@contents| and |\Etoc@prefix|. Separated
+% |1.08| This was originally in \csbc{Etoc@etoccontentsline}, intermixed
+% with the definitions of \csbc{Etoc@contents} and \csbc{Etoc@prefix}. Separated
% here for clarity of code. One has to be careful that this may close
-% groups. The conditionals are all global. The |\Etoc@level| has been
+% groups. The conditionals are all global. The \csbc{Etoc@level} has been
% |\global\let| to a |\chardef| variable. The final |\else| of the
% |\ifcase| assumes none of the |\Etoc@end@..| routines modify it,
% naturally.
@@ -7336,15 +7867,15 @@ paragraphs which may prove vaguely useful to people not the author.
}
% \end{macrocode}
% |1.08| the |\Etoc@next| will (possibly) execute the |begin| code,
-% \emph{before} |\Etoc@contents| and |\Etoc@prefix| get defined,
+% \emph{before} \csbc{Etoc@contents} and \csbc{Etoc@prefix} get defined,
% contrarily to what I did in earlier versions. I still reset the flags
% before execution of the |begin| codes (although the flags are not
% supposed to be used therein anyhow).
%
-% Also the \meta{begin} code does |\Etoc@isfirsttrue|.
+% Also the \meta{begin} code does \csa{Etoc@isfirsttrue}.
%
-% |1.08k| This was originally in |\Etoc@etoccontentsline|. Extracted for
-% re-use by |\etocsetlocaltop.toc|. Calls |\Etoc@setflags| which must not
+% |1.08k| This was originally in \csbc{Etoc@etoccontentsline}. Extracted for
+% re-use by \csbc{etocsetlocaltop.toc}. Calls \csbc{Etoc@setflags} which must not
% modify |\Etoc@next|.
% \begin{macrocode}
\def\Etoc@dobegins{%
@@ -7406,17 +7937,17 @@ paragraphs which may prove vaguely useful to people not the author.
% |\contentsline {<unit>}...| instructions, with
% the standard meaning of executing |\l@unit| (the hyperref
% modifications are taken into account). It is the various |\l@unit|'s
-% which are (locally) |\let| to |\Etoc@lxyz| and it is |\Etoc@lxyz|
+% which are (locally) |\let| to \csbc{Etoc@lxyz} and it is \csbc{Etoc@lxyz}
% which does the parsing of the arguments in order to extract name,
% number and page number. Once they are obtained, via the execution of
% this indirectly hacked |\contentsline|, the code executes the
-% |\Etoc@prefix| and |\Etoc@contents| corresponding to that unit level,
-% according to the user |\etocsetstyle| declarations. Before that the
+% \csbc{Etoc@prefix} and \csbc{Etoc@contents} corresponding to that unit level,
+% according to the user \csbc{etocsetstyle} declarations. Before that the
% begin part is executed when \etoc first encounters that level
% coming from a higher one and the end part will be executed when
% hitting a more important level.
%
-% |\etocskipfirstprefix| was already part of the very first release of
+% \csbc{etocskipfirstprefix} was already part of the very first release of
% \etoc. Up to |1.07n| it was just an elegant |\@thirdofthree| possibly
% executed just before a |\@firstoftwo{\Etoc@swa{#1}}{\Etoc@swb{#1}}|
% line. But this made it impossible for me to execute things after the
@@ -7425,53 +7956,53 @@ paragraphs which may prove vaguely useful to people not the author.
% Executing stuff before |begin| is now a potential problem because the user
% can close some group in the |begin| code (this was in fact impossible in
% versions |<1.08| because this would have erased the definitions of
-% |\Etoc@contents| and |\Etoc@prefix|). Thus I am not so free now to define
+% \csbc{Etoc@contents} and \csbc{Etoc@prefix}). Thus I am not so free now to define
% things before execution of begin, if I allow people to close a group
% therein, except if I make them global.
%
-% The mechanism of |\etocskipfirstprefix| made it impossible to add
+% The mechanism of \csbc{etocskipfirstprefix} made it impossible to add
% anything at the end of the |begin| codes. Thus I changed it in |1.08|
% to simply work with a (global) boolean flag. This gives user the
-% freedom to use |\etocskipfirstprefix| anywhere in the |begin| code and
-% it made room for a delimited macro I called |\etoconlyonfirst|. But
-% then I dropped it in favor of definition of the |\etociffirst|
+% freedom to use \csbc{etocskipfirstprefix} anywhere in the |begin| code and
+% it made room for a delimited macro I called \csa{etoconlyonfirst}. But
+% then I dropped it in favor of definition of the \csbc{etociffirst}
% conditional.
%
-% Macros |\Etoc@swa| and |\Etoc@swb| which did the |\Etoc@et@hop| thing have
+% Macros |\Etoc@swa| and |\Etoc@swb| which did the \csbc{Etoc@et@hop} thing have
% been suppressed, their effect is incorporated to the end of
-% |\Etoc@etoccontentsline|.
+% \csbc{Etoc@etoccontentsline}.
% \begin{macrocode}
\def\etocskipfirstprefix {\global\Etoc@skipprefixtrue }
% \end{macrocode}
-% |2015/03/08| let's record that |\Etoc@level| used to be called
+% |2015/03/08| let's record that \csbc{Etoc@level} used to be called
% |\Etoc@tmp| in versions earlier than |1.08| (and |\Etoc@tmp| is used
-% in the completely different ulterior |\Etoc@lxyz| context). The code
-% sets it for example to be |\Etoc@section@@| which has been let by
-% |\etocsetlevel| to |\@ne|, thus is always self-terminating in
+% in the completely different ulterior \csbc{Etoc@lxyz} context). The code
+% sets it for example to be \csa{Etoc@section@@} which has been let by
+% \csbc{etocsetlevel} to |\@ne|, thus is always self-terminating in
% |\ifnum..\fi| contexts.
%
% |1.08i-2016/09/29| makes some changes in the organization of the
% conditionals. It could happen in certain special circumstances (created by
-% that part in |\Etoc@localtableofcontents| which is executed after the test
-% of emptiness) that |\Etoc@localtop| was still undefined. Earlier version of
+% that part in \csbc{Etoc@localtableofcontents} which is executed after the test
+% of emptiness) that \csa{Etoc@localtop} was still undefined. Earlier version of
% the code was a bit lazy and did not avoid some unneeded |\ifnum| with
-% |\Etoc@localtop| in context where the flag |\ifEtoc@stoptoc| was |\iftrue|;
-% this was not an issue when code was first written, |\Etoc@localtop| was
-% always initialized back then. But the code in |\Etoc@localtableofcontents|
+% \csa{Etoc@localtop} in context where the flag \csbc{ifEtoc@stoptoc} was |\iftrue|;
+% this was not an issue when code was first written, \csa{Etoc@localtop} was
+% always initialized back then. But the code in \csbc{Etoc@localtableofcontents}
% handling local TOCs with unrecognized ids would call execution of the |.toc|
-% file under some special context with flag |\ifEtoc@stoptoc| artificially set
-% to true. If |\Etoc@localtop| had not been initialized an undefined control
+% file under some special context with flag \csbc{ifEtoc@stoptoc} artificially set
+% to true. If \csa{Etoc@localtop} had not been initialized an undefined control
% sequence error would occur. Furthermore as |\ifEtoc@notactive| was also set
-% to true, the case of no error leads then to unneededly expand |\Etoc@setflags|
+% to true, the case of no error leads then to unneededly expand \csbc{Etoc@setflags}
% code slowing down compilation.
%
% Also |1.08i| splits the macro into two, with accompanying slight
% refactoring. I had such problems with the behaviour of TeX booleans in
% 2011/12 that I got excessively cautious then, and was using an |\Etoc@next|
-% for the |\Etoc@setflags| rather than leaving it like here deep inside
+% for the \csbc{Etoc@setflags} rather than leaving it like here deep inside
% conditional branches.
%
-% Attention! |1.09|'s \cs{etoclocaltop} is the former \cs{Etoc@localtop}
+% Attention! |1.09|'s \csbc{etoclocaltop} is the former \csa{Etoc@localtop}
% \emph{minus one}. Hence some slight change in conditional here.
% \begin{macrocode}
\def\Etoc@etoccontentsline #1{%
@@ -7512,7 +8043,7 @@ paragraphs which may prove vaguely useful to people not the author.
% |1.08| New way to handle the compatibility mode. One has to worry
% only for the local tables of contents (in inactive state, which still
% must be parsed for global level flags) but in this case
-% |\Etoc@setflags| was done above already. Earlier method proceeded with
+% \csbc{Etoc@setflags} was done above already. Earlier method proceeded with
% dummy empty line styles.
%
% |2015/03/08| Ever since the first release of \etoc, the code has
@@ -7520,14 +8051,14 @@ paragraphs which may prove vaguely useful to people not the author.
% close groups. This is the reason why some assignments have to be done
% globally. The |\let\Etoc@next\Etoc@gobblesixorfive| above could be
% local, because it is used only in case the stuff below is skipped,
-% inclusive of |\Etoc@doends| which may close groups. (code has changed since,
+% inclusive of \csbc{Etoc@doends} which may close groups. (code has changed since,
% slightly).
%
-% |1.08| extracts to a separate macro |\Etoc@doends|. Earlier code
+% |1.08| extracts to a separate macro \csbc{Etoc@doends}. Earlier code
% did |\global\let\Etoc@next\relax| but we can now give a default |\relax|
% value to |\Etoc@next| with no need of a |\global| prefix.
%
-% |1.08k| extracts |\Etoc@dobegins|.
+% |1.08k| extracts \csbc{Etoc@dobegins}.
% \begin{macrocode}
\def\Etoc@etoccontentsline@ #1{%
\Etoc@doends % separated since 1.08
@@ -7535,20 +8066,20 @@ paragraphs which may prove vaguely useful to people not the author.
% \end{macrocode}
% |1.08|:
% \begin{enumerate}
-% \item separates the definition of |\Etoc@prefix| and
-% |\Etoc@contents| from the execution of the |end| parts. And it does
+% \item separates the definition of \csbc{Etoc@prefix} and
+% \csbc{Etoc@contents} from the execution of the |end| parts. And it does
% the definition with some |\csname|'s.
%
-% \item implements |\etocskipfirstprefix| with a boolean, this is less slick
+% \item implements \csbc{etocskipfirstprefix} with a boolean, this is less slick
% but more flexible than the earlier method.
%
-% \item defines the |\etociffirst| conditional.
+% \item defines the \csbc{etociffirst} conditional.
%
-% \item has |\Etoc@level| rather than |\Etoc@tmp| and thus we can dispense
+% \item has \csbc{Etoc@level} rather than |\Etoc@tmp| and thus we can dispense
% with the |\ifEtoc@part| switch as we will be able to test the equality
-% |\Etoc@level=-1| inside of |\Etoc@lxyz|.
+% |\Etoc@level=-1| inside of \csbc{Etoc@lxyz}.
%
-% \item adds the |\Etoc@global| prefix.
+% \item adds the \csbc{Etoc@global} prefix.
% \end{enumerate}
% |1.08i| uses an |\edef| rather than |\def| with a chain of |\expandafter|.
% \begin{macrocode}
@@ -7567,11 +8098,11 @@ paragraphs which may prove vaguely useful to people not the author.
% For the record we don't do |\csname l@#1\endcsname| mainly because
% hyperref patches |\contentsline|.
%
-% The location where |\Etoc@savedcontentsline| is |\let| to
+% The location where \csbc{Etoc@savedcontentsline} is |\let| to
% |\contentsline| has been moved with release |1.08| to before the
-% title as set by |\etocsettoctyle|, thus it is now possible to open a
+% title as set by \csbc{etocsettocstyle}, thus it is now possible to open a
% tabular in this part. And with the |\Etoc@global| prefix the user may
-% opt for global definitions of |\etocname| and the like, thus use
+% opt for global definitions of \csbc{etocname} and the like, thus use
% freely |&| and other group closing things. Also, some care has been
% put into doing only expandable things after expansion of the
% \meta{prefix} and \meta{contents} parts of a sectioning unit
@@ -7579,7 +8110,7 @@ paragraphs which may prove vaguely useful to people not the author.
%
% |1.09e| prepares for LaTeX November 2021 upcoming release
% whose |\contentsline| will always grab four arguments whether or
-% not hyperref is loaded. The |\Etoc@et@hop| definition done at
+% not hyperref is loaded. The \csbc{Etoc@et@hop} definition done at
% begin document must now swap the same number of arguments
% whether or not hyperref is loaded (else \etoc would be broken in
% absence of hyperref).
@@ -7589,59 +8120,59 @@ paragraphs which may prove vaguely useful to people not the author.
% \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
+% |2013/03/07|: up to |1.06| \etoc defined only \csbc{etocname}, \csbc{etocnumber} and
+% \csbc{etocpage}. The \ctanpkg{hyperref} added data is recycled in the simplest
% manner, prefixing it with \csa{leavevmode}. The included
% \csa{Hy@tocdestname} is (was, see below |1.07f| and |1.08a|) left
% unexpanded. We have to spend some time with delimited macros to dis-entangle
-% the |.toc| data, and reconstruct the possible |hyperref| data. If the page
-% number is not hyperlinked, \csa{etocpage} does \emph{not} add the link found
+% the |.toc| data, and reconstruct the possible \ctanpkg{hyperref} data. If the page
+% number is not hyperlinked, \csbc{etocpage} does \emph{not} add the link found
% possibly in the name.
%
-% |1.07| adds \csa{etocthename}, \csa{etocthenumber}, \csa{etocthepage} which
+% |1.07| adds \csbc{etocthename}, \csbc{etocthenumber}, \csbc{etocthepage} which
% are left fragile and do not have the links data, and
-% \csa{etoclink}\marg{linkname} which is robust and reconstructs an
+% \csbc{etoclink}\marg{linkname} which is robust and reconstructs an
% arbitrarily named link.
%
% A need (for things like building up a token list to be used in a
% |tikzpicture|) arose later to have some form of the link which could be
% saved by a simple command like one can do
% |\global\let\lastname\etocthename|, and avoid having to manipulate
-% \csa{Hy@tocdestname}. So |1.07f| adds \csa{etocthelinkedname},
-% \csa{etocthelinkednumber}, \csa{etocthelinkedpage}, \csa{etocthelink}: they
+% \csa{Hy@tocdestname}. So |1.07f| adds \csbc{etocthelinkedname},
+% \csbc{etocthelinkednumber}, \csbc{etocthelinkedpage}, \csbc{etocthelink}: they
% use \csa{hyperlink} with an expanded \csa{Hy@tocdestname}.
%
-% |1.07f| also adds \csa{leavevmode} to \csa{etoclink} which
-% should have been done earlier, as it was included in \csa{etocname} etc...
+% |1.07f| also adds \csa{leavevmode} to \csbc{etoclink} which
+% should have been done earlier, as it was included in \csbc{etocname} etc...
% attention, \csa{@namedef}|{A}{B}| and not \csa{@namedef}|{A} {B}| !!
% on the other hand this gives a simple way to insert a space as the first
-% token in the paramaters. For \csa{Etoc@again} (which appears later in the
+% token in the paramaters. For \csbc{Etoc@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@global| prefix (|2015/03/09|).
+% |1.08| adds \csbc{Etoc@global} prefix (|2015/03/09|).
%
-% |1.08a| drops the original constructions of |\etocname| etc... The obvious
-% decision to convert \csa{etocname}, etc ... to be the robust versions of
-% \csa{etocthelinkedname}, etc ... was delayed two years
+% |1.08a| drops the original constructions of \csbc{etocname} etc... The obvious
+% decision to convert \csbc{etocname}, etc ... to be the robust versions of
+% \csbc{etocthelinkedname}, etc ... was delayed two years
% (from |1.07f 2013/03/07| to |1.08a 2015/03/13|) for sentimental reason. But
% the original
% versions contained the hyperref destination only in unexpanded form, this
-% forced to use \csa{etocthelinkedname}, etc... in cases when the thing had to
+% forced to use \csbc{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} (taking into account though
+% \csbc{etocname}, \csbc{etocnumber}, \csbc{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@tocdestname| expanded. But
-% \csa{etoclink} did not, and thus it could not be used after a group was
+% |1.08j| turns \csbc{etoclink} into the robust version of \csbc{etocthelink}. Indeed
+% so far only \csbc{etocthelink} contained |\Hy@tocdestname| expanded. But
+% \csbc{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|.
+% \csbc{etocglobaldefs}.
%
% |1.08n| adds |\futurelet|-based methods to avoid unbracing things.
%
-% |1.08p| uses |\Etoc@@getnb| (and |\Etoc@@getit|) to intercept cases
+% |1.08p| uses \csbc{Etoc@@getnb} (and \csbc{Etoc@@getit}) to intercept cases
% when |\numberline| is hidden behind braces
% (\url{https://github.com/ho-tex/hyperref/issues/65}).
% \begin{macrocode}
@@ -7666,20 +8197,20 @@ paragraphs which may prove vaguely useful to people not the author.
\Etoc@global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
}
% \end{macrocode}
-% |1.08| adds the |\Etoc@global|'s.
+% |1.08| adds the \csbc{Etoc@global}'s.
%
% |1.08j| fixes an old |\ifx #1\hyperlink@start| bug.
%
% Potential (but rather exotic) brace removal problems avoided at |1.08n|.
%
-% |1.09g| delays definition of \cs{Etoc@getthepage} to \cs{AtBeginDocument} to
-% check if |hyperref| is at version |7.00u 2022-11-13| or later, as that
-% version replaced \cs{hyper@linkstart} with \cs{protected} macro
-% \cs{Hy@toclinkstart} which furthermore requires one more expansion step.
-% Formerly, the \cs{ifEtoc@hyperref} test was executed via the expansion of
-% \cs{Etoc@getthepage} but now this test is tacitly done only once at begin
-% document to define appropriately \cs{Etoc@getthepage}. Falls back to
-% \cs{Etoc@getthepage@nohyp}.
+% |1.09g| delays definition of \csbc{Etoc@getthepage} to \csa{AtBeginDocument} to
+% check if \ctanpkg{hyperref} is at version |7.00u 2022-11-13| or later, as that
+% version replaced \csa{hyper@linkstart} with \csa{protected} macro
+% \csa{Hy@toclinkstart} which furthermore requires one more expansion step.
+% Formerly, the \csbc{ifEtoc@hyperref} test was executed via the expansion of
+% \csbc{Etoc@getthepage} but now this test is tacitly done only once at begin
+% document to define appropriately \csbc{Etoc@getthepage}. Falls back to
+% \csbc{Etoc@getthepage@nohyp}.
% \begin{macrocode}
\def\Etoc@getthepage@nohyp #1\etoc@ {%
\Etoc@global\def\etocthepage {#1}%
@@ -7695,9 +8226,9 @@ paragraphs which may prove vaguely useful to people not the author.
% store information whose scope extends beyond the execution of each
% |\contentsline|.
%
-% |1.08| adds the |\Etoc@global|'s.
+% |1.08| adds the \csbc{Etoc@global}'s.
%
-% |1.08j| does not define \csa{etoclink<space>} anymore, only \csa{etocthelink}
+% |1.08j| does not define \csa{etoclink<space>} anymore, only \csbc{etocthelink}
% which contains the |\Hy@tocdestname| already expanded.
% \begin{macrocode}
\def\Etoc@getthepage@hyp #1#2#3#4#5\etoc@ {%
@@ -7721,8 +8252,8 @@ paragraphs which may prove vaguely useful to people not the author.
%
% |1.09f| examines also if next token in a space token; if it is we know
% that we are not with a hyperref-customized entry and that we do not have a
-% numbered entry. We thus jump directly to \csa{Etoc@getnb@nohyp@nonbr}, so
-% \csa{etocthename} is certainly not redefined and there is no risk of space
+% numbered entry. We thus jump directly to \csbc{Etoc@getnb@nohyp@nonbr}, so
+% \csbc{etocthename} is certainly not redefined and there is no risk of space
% gobbling and brace removal. This precaution is a bit academic though as
% code from previous release could derail (i.e. mis-interpret data) only in
% especially crafted circumstances.
@@ -7749,9 +8280,10 @@ paragraphs which may prove vaguely useful to people not the author.
\futurelet\Etoc@getnb@token\Etoc@getnb
}
% \end{macrocode}
-% |1.09g| adds an \cs{Etoc@getnb@a} which defaults to \cs{Etoc@getnb@nohyp}
-% and gets defined only at begin document to adapt to |hyperref| depending on
-% whether the latter is at |7.00u| or earlier.
+% |1.09g| adds an \csa{Etoc@getnb@a} which
+% gets defined only at begin document to adapt to \ctanpkg{hyperref} depending on
+% whether the latter is at |7.00u| or earlier. In absence of \ctanpkg{hyperref}
+% it is \csa{let} to \csbc{Etoc@getnb@nohyp}.
% \begin{macrocode}
\def\Etoc@getnb {%
\ifx\Etoc@getnb@token\bgroup
@@ -7761,14 +8293,14 @@ paragraphs which may prove vaguely useful to people not the author.
\fi
}
% \end{macrocode}
-% |1.08| adds the |\Etoc@global|'s.
+% |1.08| adds the \csbc{Etoc@global}'s.
%
% |1.08j| corrects an old |\ifx#1\numberline| into |\ifx\numberline#1|.
%
% |1.08k| uses a delimited macro to identify \csa{numberline},
% \csa{chapternumberline} etc... in one go, avoiding
% the |\let\chapternumberline\numberline| etc... which were done formerly
-% in \csa{Etoc@tableofcontents}. Currently \etoc does not yet use \eTeX.
+% in \csbc{Etoc@tableofcontents}. Currently \etoc does not yet use \eTeX.
%
% |1.08m| fixes incompatibility of |1.08k|'s delimited macro method with KOMA's
% \csa{nonumberline}.
@@ -7777,13 +8309,13 @@ paragraphs which may prove vaguely useful to people not the author.
% |1.08m| actually would have needed some |\detokenize| for complete safety
% and so far \etoc does not use e-\TeX. So here at |1.08n| I refactored the
% whole thing. And I added a |\futurelet|-based brace detection in
-% |\Etoc@getnb| so here |#1| is guaranteed not braced now.
+% \csbc{Etoc@getnb} so here |#1| is guaranteed not braced now.
%
-% |1.08n| tries to handle reasonably the |\nonumberline| of KOMA-script.
+% |1.08n| tries to handle reasonably the |\nonumberline| of \ctanpkg{KOMA-script}.
% If it expands to |\numberline{}|, \etoc will thus consider the line
% numbered with an empty number.
%
-% At |1.09f| complications to get rid of a KOMA-script |\nonumberline|
+% At |1.09f| complications to get rid of a \ctanpkg{KOMA-script} |\nonumberline|
% even though its meaning is |\empty| then, but for case of delayed use.
% \begin{macrocode}
\def\Etoc@getnb@nohyp #1{%
@@ -7815,8 +8347,8 @@ paragraphs which may prove vaguely useful to people not the author.
\Etoc@global\let\etocthelinkedname \etocthename
}
% \end{macrocode}
-% \csa{etocthename} and \csa{etocthelinkedname} already defined in
-% \csa{Etoc@lxyz}, no need to update.
+% \csbc{etocthename} and \csbc{etocthelinkedname} already defined in
+% \csbc{Etoc@lxyz}, no need to update.
% \begin{macrocode}
\def\Etoc@getnb@nohyp@nonbr #1\etoc@ {%
\Etoc@global\Etoc@numberfalse
@@ -7826,7 +8358,7 @@ paragraphs which may prove vaguely useful to people not the author.
% \end{macrocode}
% Special KOMA branch: |#1| starts with |\nonumberline| which has here same
% meaning as |\empty|. It is in the current provisory definition of
-% \csa{etocthename}. We get rid of this token, in case usage is delayed,
+% \csbc{etocthename}. We get rid of this token, in case usage is delayed,
% to avoid improbable problems.
% \begin{macrocode}
\def\Etoc@getnb@nohyp@nonumberline #1\relax\relax\etoc@ {%
@@ -7843,7 +8375,7 @@ paragraphs which may prove vaguely useful to people not the author.
}
% \end{macrocode}
% |1.07n| replaces use of |\toks@| by macro |\Etoc@tmp|. |1.08| adds
-% the |\Etoc@global|'s.
+% the \csbc{Etoc@global}'s.
%
% |1.08j| corrects the old |\ifx#1\numberline| into |\ifx\numberline#1|.
%
@@ -7860,10 +8392,21 @@ paragraphs which may prove vaguely useful to people not the author.
% in this branch (hyperref does not brace the hyperlink). So we ignore
% the |\ifEtoc@bracedname| setting.
%
-% At |1.09f| complications to get rid of a KOMA-script |\nonumberline|
+% At |1.09f| complications to get rid of a \ctanpkg{KOMA-script} |\nonumberline|
% even though its meaning is |\empty| then, but for case of delayed use.
+%
+% At |1.09h| I converted the |#5#6| into |#5|, the |#5#6| had been kept
+% around for ages here, perhaps a legacy of early versions, anyway
+% here the macro really wants the |#4| anyhow only (and |#3|) and there
+% can be only one \csa{etoc@}.
+%
+% The |7.00u| \ctanpkg{hyperref} has modified the mark-up, but \csa{Etoc@getnb@a}
+% defined at begin document has caused the expansion of \csa{Hy@toclinkstart}
+% so we are back to the |<7.00u| situation; and \csa{Hy@toclinkend} is anyhow
+% gobbled as part of |#5| as was formerly \csa{hyper@linkend} so we don't have
+% to worry about that \ctanpkg{hyperref} change.
% \begin{macrocode}
-\def\Etoc@getnb@hyp #1#2#3#4#5#6\etoc@ {%
+\def\Etoc@getnb@hyp #1#2#3#4#5\etoc@ {%
\edef\Etoc@tmp {{#3}}%
\Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
\Etoc@global\def\etocthename {#4}% temporary definition
@@ -7874,7 +8417,7 @@ paragraphs which may prove vaguely useful to people not the author.
% \end{macrocode}
% In case of an upfront brace, the sectioning heading is not numbered, so we
% can avoid potential brace removal problems by jumping now to the not
-% numbered branch not hyperlinked branch; indeed \csa{etocthelinkedname} has
+% numbered branch not hyperlinked branch; indeed \csbc{etocthelinkedname} has
% already been defined with the |\hyperlink| so we can bail out.
% \begin{macrocode}
\def\Etoc@getnb@hyp@a {%
@@ -7891,7 +8434,7 @@ paragraphs which may prove vaguely useful to people not the author.
\else
% \end{macrocode}
% If not numbered we can bail out to the "nohyp" branch, as
-% \csa{etocthelinkedname} has already been defined with the |\hyperlink|.
+% \csbc{etocthelinkedname} has already been defined with the |\hyperlink|.
% \begin{macrocode}
\let\Etoc@next\Etoc@getnb@nohyp@nonbr
\in@{#1}{\nonumberline}%
@@ -7899,8 +8442,8 @@ paragraphs which may prove vaguely useful to people not the author.
% \end{macrocode}
% In case of presence of KOMA \csa{nonumberline} we need to expand it
% once, and then execute the numbered branch which will redefine
-% \csa{etocthename} as well. But in case it is empty we will have to
-% correct \csa{etocthename}, just to be perfect.
+% \csbc{etocthename} as well. But in case it is empty we will have to
+% correct \csbc{etocthename}, just to be perfect.
% \begin{macrocode}
\ifx\nonumberline\empty
\let\Etoc@next\Etoc@getnb@hyp@nonumberline
@@ -7941,7 +8484,7 @@ paragraphs which may prove vaguely useful to people not the author.
\expandafter\Etoc@tmp\expandafter{\etocthename}}%
}
% \end{macrocode}
-% |1.08| adds the |\Etoc@global|'s.
+% |1.08| adds the \csbc{Etoc@global}'s.
%
% |1.08n| refactors this but it is still not extremely robust.
%
@@ -7960,8 +8503,8 @@ paragraphs which may prove vaguely useful to people not the author.
}
\def\Etoc@getit@nameisbraced {\futurelet\Etoc@getit@token\Etoc@getit }
% \end{macrocode}
-% |1.09g| delays defining \cs{Etoc@getit} to at begin document to adapt to
-% |hyperref| depending on whether the latter is at |7.00u| or earlier.
+% |1.09g| delays defining \csbc{Etoc@getit} to at begin document to adapt to
+% \ctanpkg{hyperref} depending on whether the latter is at |7.00u| or earlier.
% \begin{macrocode}
\def\Etoc@getit@nohyp #1\hspace#2#3\etoc@ {%
\ifx\relax#2%
@@ -7982,24 +8525,27 @@ paragraphs which may prove vaguely useful to people not the author.
}
% \end{macrocode}
% |1.07n| replaces use of |\toks@| by macro |\Etoc@tmp|. |1.08| adds
-% the |\Etoc@global|'s.
+% the \csbc{Etoc@global}'s.
%
-% |1.08j| adds \csa{etocthelink} definition here which was missing. This bug
+% |1.08j| adds \csbc{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
+% styles: the \csbc{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@getnb| also fixed at |1.08j|, and this would have
+% |\ifx| bug in \csbc{Etoc@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.
%
% |1.08n| refactors the whole thing. |1.08o| chooses better names for
% macros.
%
-% For |1.08p| fix of hyperref's extra brace (see |\Etoc@@getnb|,
-% |\Etoc@@getit|), this branch should not suffer the issue, hence I
+% For |1.08p| fix of hyperref's extra brace (see \csbc{Etoc@@getnb},
+% \csbc{Etoc@@getit}), this branch should not suffer the issue, hence I
% don't bother checking |\ifEtoc@bracedname| status.
+%
+% At |1.09h| the |#5#6| becomes |#5|, the |#5#6| was for some legacy reason
+% I guess, but here the macro really wants the |#4| anyhow only (and |#3|).
% \begin{macrocode}
-\def\Etoc@getit@hyp #1#2#3#4#5#6\etoc@ {%
+\def\Etoc@getit@hyp #1#2#3#4#5\etoc@ {%
\edef\Etoc@tmp {{#3}}%
\Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink \Etoc@tmp{##1}}%
\Etoc@global\def\etocthename {#4}% temporary definition
@@ -8023,8 +8569,8 @@ paragraphs which may prove vaguely useful to people not the author.
\expandafter{\expandafter\hyperlink \Etoc@tmp{#1}}%
}%
% \end{macrocode}
-% |1.08a| of |2015/03/12| does the long-postponed thing to let |\etocname|
-% etc.. be simply the robust variant of |\etocthelinkedname| etc...
+% |1.08a| of |2015/03/12| does the long-postponed thing to let \csbc{etocname}
+% etc.. be simply the robust variant of \csbc{etocthelinkedname} etc...
% \begin{macrocode}
\let\etocthename \@empty
\let\etocthenumber \@empty
@@ -8041,13 +8587,13 @@ paragraphs which may prove vaguely useful to people not the author.
{\ifEtoc@number\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
\expandafter\let\expandafter\etocxifnumbered\csname etocifnumbered \endcsname
% \end{macrocode}
-% |1.08| defines |\etociffirst|
+% |1.08| defines \csbc{etociffirst}
% \begin{macrocode}
\DeclareRobustCommand*{\etociffirst}
{\ifEtoc@isfirst\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
\expandafter\let\expandafter\etocxiffirst\csname etociffirst \endcsname
% \end{macrocode}
-% |1.07j| modifies |\Etoc@readtoc|.
+% |1.07j| modifies \csbc{Etoc@readtoc}.
% \begin{macrocode}
\def\Etoc@readtoc {%
\ifeof \Etoc@tf
@@ -8073,7 +8619,7 @@ paragraphs which may prove vaguely useful to people not the author.
\closein\Etoc@tf}}
{\typeout{No file \jobname.toc.}}}
% \end{macrocode}
-% 1.07d: parskip and |\@nobreakfalse| stuff moved to |\Etoc@tableofcontents|
+% 1.07d: parskip and |\@nobreakfalse| stuff moved to \csbc{Etoc@tableofcontents}
% \begin{macrocode}
\def\Etoc@openouttoc{%
\ifEtoc@hyperref
@@ -8095,11 +8641,11 @@ paragraphs which may prove vaguely useful to people not the author.
% \end{macrocode}
% |1.08| has a new way to handle |\Etoc@standardtrue|.
%
-% Also the expansion of |\Etoc@levelist| is moved to inside
-% |\Etoc@tableofcontents| as set-up by |\etocsettocstyle|. This opens up
+% Also the expansion of \csbc{Etoc@levellist} is moved to inside
+% \csbc{Etoc@tableofcontents} as set-up by \csbc{etocsettocstyle}. This opens up
% the possibility for the user to open a group in the title (for example
% start a tabular) which would be closed (by the first |&|) sometime
-% later. In combination with |\etocglobaldefs| it will be now much
+% later. In combination with \csbc{etocglobaldefs} it will be now much
% easier to typeset TOC as tables with \etoc!
% \begin{macrocode}
\def\Etoc@toctoc{%
@@ -8128,19 +8674,19 @@ paragraphs which may prove vaguely useful to people not the author.
% Slightly better coded in |1.08b|. Had some bad experiences with TeX
% conditionals back in 2011/2012 when I started LaTeX programming, and the
% code was a remnant of extra cautious attitude. Also, now
-% \csa{etoc@@startlocaltoc} is expandable if it does nothing.
+% \csbc{etoc@@startlocaltoc} is expandable if it does nothing.
%
-% |2015/04/16|: |1.08e| removes a \csa{ifEtoc@notactive} test as |\ifnum| can
-% be positive only once anyhow; although the \csa{ifEtoc@notactive} boolean
+% |2015/04/16|: |1.08e| removes a \csbc{ifEtoc@notactive} test as |\ifnum| can
+% be positive only once anyhow; although the \csbc{ifEtoc@notactive} boolean
% could be faster than an |\ifnum|, it adds to it as long as the local toc id
% is not yet found.
%
-% I replace (|1.08e|) the |\Etoc@global|'s for |\Etoc@localtop| by
+% I replace (|1.08e|) the \csbc{Etoc@global}'s for \csa{Etoc@localtop} by
% |\global|'s. The |\relax| is needed because |#2| may sometimes be a count,
% sometimes tokens.
%
-% Attention! |1.09| defines a public \cs{etoclocaltop} in replacement of old
-% \cs{Etoc@localtop} \emph{minus one}. Memo: \cs{etoclocaltop} has only
+% Attention! |1.09| defines a public \csbc{etoclocaltop} in replacement of old
+% \csa{Etoc@localtop} \emph{minus one}. Memo: \csbc{etoclocaltop} has only
% meaningful meaning when the local toc has its "active" flag set. Except that
% I used a "notactive" flag to torture myself, so: has the "notactive" flag
% off.
@@ -8178,51 +8724,51 @@ paragraphs which may prove vaguely useful to people not the author.
% \end{macrocode}
% |2015/03/16|: |1.08e| tests if a local table of contents turns out empty.
% The \csa{Etoc@localtop} there does not have the same meaning as when set-up
-% by the regular \csa{etoc@@startlocaltoc}. It is off by 1 (in general). THIS
-% IS OBSOLETE since |1.09|: a \cs{etoclocaltop} is used with same meaning in
+% by the regular \csbc{etoc@@startlocaltoc}. It is off by 1 (in general). THIS
+% IS OBSOLETE since |1.09|: a \csbc{etoclocaltop} is used with same meaning in
% all code branches.
%
% After some hesitation I opted for making and obeying the test always (*) for
% local tables of contents, and do it also for global tables of contents but
-% for the latter the user must issue \csa{etocnotocifnotoc} for the emptiness
+% for the latter the user must issue \csbc{etocnotocifnotoc} for the emptiness
% test to be obeyed. The emptiness tests are to be trusted only when the
% compilations have stabilized.
%
-% (*) finally the user must issue \csa{etocchecksemptiness} once.
+% (*) finally the user must issue \csbc{etocchecksemptiness} once.
%
-% |\Etoc@tocid| is the number of the toc (possibly gotten via a |\ref|
-% following a \csa{tableofcontents}), or it is |\z@| if the emptiness test is
+% \csbc{Etoc@tocid} is the number of the toc (possibly gotten via a |\ref|
+% following a \csbc{tableofcontents}), or it is |\z@| if the emptiness test is
% from a global toc. Until the compilations stabilize, some local TOCs can get
% printed at wrong locations naturally and emptiness tests can not be trusted
% either. Releases earlier than |1.08e| authorized
-% \csa{tableofcontents}|\ref{foo}| with |foo| the label of a \emph{global}
+% \csbc{tableofcontents}|\ref{foo}| with |foo| the label of a \emph{global}
% toc. But as it was impossible (without much complications) to discriminate,
% until auxiliary files have stabilized, between a |\ref| to a local toc whose
% id is not yet in the |.toc| file and a |\ref| to a global toc whose id will
% in the end definitely not be in the |.toc| file, I decided that this silly
% possibility should not be supported anymore. This allowed to remove a few
-% tokens from \csa{Etoc@tableofcontents} as well. And it also allowed
-% improvements to \csa{Etoc@localtableofcontents}.
+% tokens from \csbc{Etoc@tableofcontents} as well. And it also allowed
+% improvements to \csbc{Etoc@localtableofcontents}.
%
% Note: (|1.08i 2016/09/29|) the code has to handle both local and total toc.
-% Hence the flag |\ifEtoc@notactive| has to be set prior to it. For a global
-% toc, the |\Etoc@tocid| was set to |\z@|, and the |\ifnum| in
-% |\etoc@startlocaltoc| did always fail, but I now prefer to simply nullify
-% the |\etoc@startlocaltoc|. As its default fallback is |\@gobble| I simply
-% test here for the |localtoc| flag. The |\Etoc@tocid| will be undefined for a
+% Hence the flag \csbc{ifEtoc@notactive} has to be set prior to it. For a global
+% toc, the \csbc{Etoc@tocid} was set to |\z@|, and the |\ifnum| in
+% \csbc{etoc@startlocaltoc} did always fail, but I now prefer to simply nullify
+% the \csbc{etoc@startlocaltoc}. As its default fallback is |\@gobble| I simply
+% test here for the \csbc{ifEtoc@localtoc} flag. The \csbc{Etoc@tocid} will be undefined for a
% global toc but it is not tested anymore.
%
% Note: the mechanism for recognizing the level when a local toc is
-% encountered is different from the one in |\etoc@@startlocaltoc| which uses
-% the level flags. Here we just record in |\Etoc@level| where we last stood.
+% encountered is different from the one in \csbc{etoc@@startlocaltoc} which uses
+% the level flags. Here we just record in \csbc{Etoc@level} where we last stood.
% The initialization |\global\let\Etoc@level\Etoc@minf| is thus needed in case
-% the |.toc| file contains an |\etoc@startlocaltoc| before any
+% the |.toc| file contains an \csbc{etoc@startlocaltoc} before any
% |\contentsline|.
%
% |1.08i| has two |testingcontentsline| macros, one for local, one for global.
%
-% |1.09| renames the \cs{Etoc@localtop} which was used here to a public
-% \cs{etoclocaltop} to make it usable in \cs{etocsettocstyle}.
+% |1.09| renames the \csa{Etoc@localtop} which was used here to a public
+% \csbc{etoclocaltop} to make it usable in \csbc{etocsettocstyle}.
% \begin{macrocode}
\def\Etoc@setemptytocbool {%
\global\Etoc@emptytoctrue
@@ -8240,6 +8786,10 @@ paragraphs which may prove vaguely useful to people not the author.
\let\contentsline\Etoc@testingcontentsline
\fi
\Etoc@storetocdepth
+% \end{macrocode}
+% |1.09i| fixes a bug arising when document has used \csbc{etocsetlocaltop.toc}.
+% \begin{macrocode}
+ \let\Etoc@setlocaltop@doends@dobegins\@empty
\the\Etoc@toctoks
\Etoc@restoretocdepth
\endgroup
@@ -8255,13 +8805,13 @@ paragraphs which may prove vaguely useful to people not the author.
\else
\global\expandafter\let\expandafter\Etoc@level\csname Etoc@#1@@\endcsname
% \end{macrocode}
-% |\ifEtoc@notactive| set to False by |\etoc@startlocaltoc| with right id. It
+% |\ifEtoc@notactive| set to False by \csbc{etoc@startlocaltoc} with right id. It
% that happened, check level of hit against unit. Will decide if empty or not.
-% Set |stoptoc| flag afterwards in all cases. |\Etoc@localtop| will have been
-% initialized by |\etoc@@startlocaltoc| as |\ifEtoc@notactive| flag can be
+% Set \csbc{ifEtoc@stoptoc} flag afterwards in all cases. \csa{Etoc@localtop} will have been
+% initialized by \csbc{etoc@@startlocaltoc} as \csbc{ifEtoc@notactive} flag can be
% false only then.
%
-% |1.09| renamed the \cs{Etoc@localtop} as formerly here to \cs{etoclocaltop}
+% |1.09| renamed the \csa{Etoc@localtop} as formerly here to \csbc{etoclocaltop}
% and adds support for \localtocwrdp.
% \begin{macrocode}
\ifEtoc@notactive
@@ -8294,50 +8844,50 @@ paragraphs which may prove vaguely useful to people not the author.
}
% \end{macrocode}
% |1.07g| suppresses the printing of |--unknown etoc ref: run latex again--| as
-% sometimes one uses \csa{localtableofcontents} to prepare something else, and one
+% sometimes one uses \csbc{localtableofcontents} to prepare something else, and one
% does not want any text output even in intermediate runs.
%
-% Also |1.07g| adds \csa{etocaftertochook} to help with
-% \csa{invisiblelocaltableofcontents} (and then I did \csa{etocsetnexttocdepth}).
-% |1.07h| makes the hook used by \csa{etocsetnexttocdepth} private.
+% Also |1.07g| adds \csbc{etocaftertochook} to help with
+% \csbc{invisiblelocaltableofcontents} (and then I did \csbc{etocsetnexttocdepth}).
+% |1.07h| makes the hook used by \csbc{etocsetnexttocdepth} private.
%
% |2015/03/14|: |1.08b| suppresses a space token from an unprotected end of
-% line at the end after the replacement text of \csa{etoc@startlocaltoc} (bug
+% line at the end after the replacement text of \csbc{etoc@startlocaltoc} (bug
% dating back to |1.03 2012/11/23|). I didn't see it due to the originally
% badly formatted source of |\Etoc@next|.
%
-% |2015/03/16|: |1.08e| lets \csa{localtableofcontents} do a first scan of the
-% |.toc| file (as stored in |\Etoc@toctoks|) to determine if the table of
+% |2015/03/16|: |1.08e| lets \csbc{localtableofcontents} do a first scan of the
+% |.toc| file (as stored in \csbc{Etoc@toctoks}) to determine if the table of
% contents will in fact end up empty. In that case, nothing is typeset. The
-% command \csa{etocaftertochook} is still executed though. Other ways were
+% command \csbc{etocaftertochook} is still executed though. Other ways were
% envisioned (like delimited macros) to determine this potential emptiness, but
% in the end I opted for execution of the |.toc| file with suitable definitions
-% for \csa{contentsline} and \csa{etoc@startlocaltoc}. Notice though that if
+% for \csa{contentsline} and \csbc{etoc@startlocaltoc}. Notice though that if
% emptiness would result from empty line styles, this can not be detected.
% Emptiness means ``no executed \csa{contentsline}''.
%
% For this detection of emptiness, assignments (here and in
-% \csa{Etoc@testingcontentsline}) are made globally, I think this is the best
+% \csbc{Etoc@testingcontentsline}) are made globally, I think this is the best
% (just in case some portions of the |.toc| file turn out to be inside some
% groups --- perhaps for some silly color assignments, etc... --- whose
% boundaries do not necessarily respect unit levels).
%
-% The flag |\Etoc@tocwithid| discriminates between a \localtoc and a
+% The flag \csbc{ifEtoc@tocwithid} discriminates between a \localtoc and a
% \toc|\ref{foo}|; the latter could so far possibly refer to a local or also to
% a global table of contents but release |1.08e| has deprecated the latter use
% as it complicated the code, for something truly silly. Thus |\ref{foo}| must
-% now be with |foo| a label of a local TOC. As a result |\Etoc@tocwithid| is
+% now be with |foo| a label of a local TOC. As a result \csbc{ifEtoc@tocwithid} is
% less used now.
%
% In the case of a |\ref|ed-to toc whose label was just added hence is not yet
-% in the |.aux| file, |\Etoc@tocid| is |0|. \etoc used to issue a warning to
+% in the |.aux| file, \csbc{Etoc@tocid} is |0|. \etoc used to issue a warning to
% run latex again and did no printing at all. Release |1.08e| in such cases
% prints the heading (this may gain one compilation step). Emptiness test is
% not executed as it would necessarily turn out positive and can not be
% trusted anyhow. The TOC is declared non empty, which it probably is...
%
% Emptiness detection for local tables of contents (either from a
-% \csa{localtableofcontents} or from a \csa{tableofcontents}|\ref{localtoc}|)
+% \csbc{localtableofcontents} or from a \csbc{tableofcontents}|\ref{localtoc}|)
% can be trusted only when the |.toc| file has stabilized.The emptiness status
% of a local TOC whose Id is not yet in the |.toc| is by necessity undecided
% yet (and not to be trusted really as the numbering may have changed; only
@@ -8352,22 +8902,22 @@ paragraphs which may prove vaguely useful to people not the author.
% |1.08i-2016/09/29| now does |\Etoc@localtoctrue| right at the start (the
% earlier code could have to handle table of contents which were actually
% global, via the |\label/\ref| mechanism.) It does not rely on the |\ifnum|
-% automatically false in |\etoc@@startlocaltoc| due to the special values |0|
-% or |\z@| for |\Etoc@tocid|, but simply leaves |\etoc@startlocaltoc| to its
-% default |\@gobble|. The |\Etoc@emptytocfalse| flag is upfront in case some
-% code using |\etocifwasempty| is in user hooks. The default is to assume the
+% automatically false in \csbc{etoc@@startlocaltoc} due to the special values |0|
+% or |\z@| for \csbc{Etoc@tocid}, but simply leaves \csbc{etoc@startlocaltoc} to its
+% default |\@gobble|. The \csa{Etoc@emptytocfalse} is upfront in case some
+% code using \csbc{etocifwasempty} is in user hooks. The default is to assume the
% TOC non-empty as its contents are actually still unknown. Under the
-% |stoptoc| flag, the |\Etoc@etoccontentsline| is more efficient now.
+% \csa{Etoc@stoptoctrue} flag, the \csbc{Etoc@etoccontentsline} is more efficient now.
%
-% The |\Etoc@notactive| flag needs to be set before calling
-% |\Etoc@setemptytocbool|.
+% The \csbc{ifEtoc@notactive} flag needs to be set before calling
+% \csbc{Etoc@setemptytocbool}.
%
% I hesitated with |1.08i| to write something to aux file in order to let
% \LaTeX\ prompt the user for extra pass, after insertion of some new
% |\localtableofcontents|, but finally I prefer to only trick \LaTeX\ into
% telling about undefined references.
%
-% The \cs{PackageWarning} approach has the advantage
+% The \csa{PackageWarning} approach has the advantage
% that at least in Emacs/AUCTeX the |C-cC-c| will propose |LaTeX|, not |View|.
% But perhaps some automated scripts checking |aux| file will not like the
% extra line which is then removed in next pass, and could possibly do one
@@ -8400,7 +8950,7 @@ paragraphs which may prove vaguely useful to people not the author.
\fi
\global\Etoc@notactivetrue
% \end{macrocode}
-% |1.08i|'s |\Etoc@setemptytocbool| now checks |localtoc| flag.
+% |1.08i|'s \csbc{Etoc@setemptytocbool} now checks |localtoc| flag.
% \begin{macrocode}
\ifEtoc@checksemptiness
\Etoc@setemptytocbool
@@ -8422,15 +8972,15 @@ paragraphs which may prove vaguely useful to people not the author.
\global\Etoc@stoptocfalse
\global\Etoc@notactivetrue
% \end{macrocode}
-% Prior to |1.09| a \cs{Etoc@localtop} was reset here. This has now been
-% moved to \cs{Etoc@tableofcontents} and \cs{Etoc@localtop} replaced by a
-% public \cs{etoclocaltop} usable in line styles, and in \cs{etocsettocstyle}
+% Prior to |1.09| a \csa{Etoc@localtop} was reset here. This has now been
+% moved to \csbc{Etoc@tableofcontents} and \csa{Etoc@localtop} replaced by a
+% public \csbc{etoclocaltop} usable in line styles, and in \csbc{etocsettocstyle}
% (under checksemptinesstrue regime).
%
% We can end up here either if the emptiness check was done and turned
-% negative (then \cs{etoclocaltop} has the correct level for usage in first
-% argument of \cs{etocsettocstyle}), or if the emptiness check was not done.
-% For the latter case \cs{etoclocaltop} has setting |-\@m|.
+% negative (then \csbc{etoclocaltop} has the correct level for usage in first
+% argument of \csbc{etocsettocstyle}), or if the emptiness check was not done.
+% For the latter case \csbc{etoclocaltop} has setting |-\@m|.
% \begin{macrocode}
\edef\etoc@startlocaltoc##1%
{\noexpand\etoc@@startlocaltoc{##1}{\Etoc@tocid}}%
@@ -8442,15 +8992,15 @@ paragraphs which may prove vaguely useful to people not the author.
\etocaftertochook % 1.07g
% \end{macrocode}
% |1.09| hesitates about putting this before of after the
-% \cs{etocaftertochook}. The information of the used tocdepth is lost if
-% puuting it first. The usage of \cs{etocaftertochook} may be broken if
+% \csbc{etocaftertochook}. The information of the used tocdepth is lost if
+% puuting it first. The usage of \csbc{etocaftertochook} may be broken if
% unexpected tokens follows.
% \begin{macrocode}
\let\Etoc@localtocdepth\c@tocdepth % 1.09
}% \Etoc@localtableofcontents
% \end{macrocode}
% |2013/03/07|: I discover a \csa{@namedef} trick to construct the
-% \csa{Etoc@again} space delimited macro:\\
+% \csbc{Etoc@again} space delimited macro:\\
% | \@namedef {Etoc@again} {...stuff...}|\\
% Original version was (copied from analogous stuff in |source2e|):\\
% | {\def\1{\Etoc@again}\expandafter\gdef\1 {...stuff...}}|\\
@@ -8468,9 +9018,9 @@ paragraphs which may prove vaguely useful to people not the author.
%
% Also, |\ref{foo}| expects |foo| to be a label to a \emph{local} TOC. Earlier
% versions accepted a reference to a global TOC, I have removed the support
-% from \csa{Etoc@tableofcontents}.
+% from \csbc{Etoc@tableofcontents}.
%
-% The syntax \csa{localtableofcontents}|\ref{foo}| is now accepted.
+% The syntax \csbc{localtableofcontents}|\ref{foo}| is now accepted.
% \begin{macrocode}
\def\Etoc@dothis #1#2\etoc@ {\fi #1}
\def\Etoc@t@bleofcontents{%
@@ -8478,23 +9028,23 @@ paragraphs which may prove vaguely useful to people not the author.
\ifx\Etoc@nexttoken\label\Etoc@dothis{\expandafter\Etoc@label\@gobble}\fi
\ifx\Etoc@nexttoken\@sptoken\Etoc@dothis{\Etoc@again}\fi
% \end{macrocode}
-% |\Etoc@ref| will hand over directly to |\Etoc@localtableofcontents|.
+% \csbc{Etoc@ref} will hand over directly to \csbc{Etoc@localtableofcontents}.
% Argument will be (or rather expand to) zero if the reference is non-existent
-% yet. There was an |\Etoc@tocwithidfalse| flag which |1.08i| suppresses as it
+% yet. There was an \csa{Etoc@tocwithidfalse} flag which |1.08i| suppresses as it
% is not used afterwards (since |1.08e| I think.)
% \begin{macrocode}
\ifx\Etoc@nexttoken\ref\Etoc@dothis{\expandafter\Etoc@ref\@gobble}\fi
% \end{macrocode}
-% Flag to check if we were called from a |\localtableofcontents|.
+% Flag to check if we were called from a \csbc{localtableofcontents}.
% \begin{macrocode}
\ifEtoc@tocwithid\Etoc@dothis{\Etoc@localtableofcontents{\c@etoc@tocid}}\fi
% \end{macrocode}
% From now on we are handling a global TOC. Earlier, I used the trick of
-% setting |\Etoc@tocid| to |\z@| for compatibility with expansion of
-% |\etoc@startlocaltoc|. But since |1.08i| |\etoc@startlocaltoc| is left to be
-% |\@gobble|, and |\Etoc@tocid| is never tested. We don't need to set the
-% |notactive| flag as now |\Etoc@testingcontentsline| tests first the
-% |localtoc| flag (was already the case of |\Etoc@etoccontentsline|). I change
+% setting \csbc{Etoc@tocid} to |\z@| for compatibility with expansion of
+% \csbc{etoc@startlocaltoc}. But since |1.08i| \csbc{etoc@startlocaltoc} is left to be
+% |\@gobble|, and \csbc{Etoc@tocid} is never tested. We don't need to set the
+% \csbc{ifEtoc@notactive} flag as now \csbc{Etoc@testingcontentsline} tests first the
+% \csbc{ifEtoc@localtoc} flag (was already the case of \csbc{Etoc@etoccontentsline}). I change
% a bit the style of conditionals here for clarity of code.
% \begin{macrocode}
\global\Etoc@emptytocfalse\ifEtoc@checksemptiness\Etoc@setemptytocbool\fi
@@ -8518,9 +9068,9 @@ paragraphs which may prove vaguely useful to people not the author.
% definition. As the number written here will be used later in an \csa{ifnum}, I
% should not have used it in the first place (done |2015/03/30|).
%
-% |1.08i| moves elsewhere definition of |\etoc@startlocaltoc|. In
-% |\Etoc@table@fcontents| case it remains to be seen if a |\ref| follows which
-% could turn the TOC into a local one. Handled by |\Etoc@t@bleofcontents|.
+% |1.08i| moves elsewhere definition of \csbc{etoc@startlocaltoc}. In
+% \csbc{Etoc@table@fcontents} case it remains to be seen if a |\ref| follows which
+% could turn the TOC into a local one. Handled by \csbc{Etoc@t@bleofcontents}.
% \begin{macrocode}
\def\Etoc@table@fcontents{%
\refstepcounter{etoc@tocid}%
@@ -8532,10 +9082,10 @@ paragraphs which may prove vaguely useful to people not the author.
\Etoc@tocwithidtrue
\futurelet\Etoc@nexttoken\Etoc@t@bleofcontents}
% \end{macrocode}
-% |1.07g| defines |\etoctableofcontents| to be able to undo the evil and
+% |1.07g| defines \csbc{etoctableofcontents} to be able to undo the evil and
% brutal doings of some packages with |\tableofcontents|.
%
-% |1.08| patches |tableof|'s influence. Version |1.4a| or later of |tableof|
+% |1.08| patches \ctanpkg{tableof}'s influence. Version |1.4a| or later of \ctanpkg{tableof}
% is needed.
% \begin{macrocode}
\let\etocaftertitlehook \@empty
@@ -8544,25 +9094,25 @@ paragraphs which may prove vaguely useful to people not the author.
% Attention that there could be a |\ref| following, thus we don't yet know
% whether this is a local or global table of contents.
%
-% The \cs{Etoc@tocdepthset} is for \cs{etocsetnexttocdepth} mechanism.
+% The \csbc{Etoc@tocdepthset} is for \csbc{etocsetnexttocdepth} mechanism.
% \begin{macrocode}
\def\etoctableofcontents{%
\Etoc@openouttoc
\Etoc@tocdepthset % new with 1.08h (\etocsetnexttocdepth)
\begingroup % closed in \Etoc@t@bleofcontents or \Etoc@localtableofcontents
% \end{macrocode}
-% Prior to its release |1.4c|, |tableof| added a group pair via |\tof@begin|
+% Prior to its release |1.4c|, \ctanpkg{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
+% inserted only in the \ctanpkg{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|.
+% |1.08i| removes definition of \csbc{etoc@startlocaltoc} from here. It is done
+% in \csbc{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.
+% user definition of \csbc{etocaftertitlehook} may be.
% \begin{macrocode}
\@ifstar
{\let\Etoc@aftertitlehook\@empty\Etoc@table@fcontents}
@@ -8579,7 +9129,7 @@ paragraphs which may prove vaguely useful to people not the author.
\Etoc@tocdepthset % new with 1.08h (\etocsetnexttocdepth)
\begingroup % closed in \Etoc@t@bleofcontents or \Etoc@localtableofcontents
% \end{macrocode}
-% Same comment relative to |tableof|. No need to do anything here.
+% Same comment relative to \ctanpkg{tableof}. No need to do anything here.
% \begin{macrocode}
\@ifstar
{\let\Etoc@aftertitlehook\@empty\Etoc@localtable@fcontents}
@@ -8588,11 +9138,11 @@ paragraphs which may prove vaguely useful to people not the author.
% \end{macrocode}
% |1.09| adds \localtocwrdp. The motivation is that it is impossible to set
% in a completely satisfactory way the tocdepth from the first argument of
-% \cs{etocsettocstyle} because the emptiness check does not execute that
+% \csbc{etocsettocstyle} because the emptiness check does not execute that
% argument. If one does not care about emptiness check, one can of course set
-% the tocdepth from the first argument of \cs{etocsettocstyle}. One can even
-% use \cs{etocsetnexttocdepth} for that since |1.09| but anyway direct usage
-% of \cs{etocsettocdepth} (or |\setcounter{tocdepth}{...}| is easier as its
+% the tocdepth from the first argument of \csbc{etocsettocstyle}. One can even
+% use \csbc{etocsetnexttocdepth} for that since |1.09| but anyway direct usage
+% of \csbc{etocsettocdepth} (or |\setcounter{tocdepth}{...}| is easier as its
% effet when executed there is automatically limited to duration of the TOC.
% \begin{macrocode}
\newcommand*\localtableofcontentswithrelativedepth[1]{%
@@ -8602,33 +9152,33 @@ paragraphs which may prove vaguely useful to people not the author.
}% \localtableofcontentswithrelativedepth
\let\Etoc@localtocdepth\c@tocdepth
% \end{macrocode}
-% |1.08| moves earlier the definitions of |\Etoc@savedcontentsline| as
-% well as |\Etoc@levellist|. It will thus not be operative to do
-% |\etocsetlevel| from inside the title now. But perhaps it will be
+% |1.08| moves earlier the definitions of \csbc{Etoc@savedcontentsline} as
+% well as \csbc{Etoc@levellist}. It will thus not be operative to do
+% \csbc{etocsetlevel} from inside the title now. But perhaps it will be
% easier to deal with tables.
%
% Also I remove a big |\@firstofone|, and use rather
-% |\Etoc@gobbletoetoc@| for the gobbling case.
+% \csbc{Etoc@gobbletoetoc@} for the gobbling case.
%
% Also, |1.08| modifies the code to do only expandable things after
-% |\Etoc@toctoc|, in order to allow opening of an alignment in the first
+% \csbc{Etoc@toctoc}, in order to allow opening of an alignment in the first
% argument and closing in the second. Earlier versions had an
-% |\Etoc@@next| initially set to relax after the first |\Etoc@toctoc|. I
+% |\Etoc@@next| initially set to relax after the first \csbc{Etoc@toctoc}. I
% was in 2012/2013 quite uneasy with the TeX conditionals hence wanted
% for safety to move the things for the second invocation of
-% |\Etoc@toctoc| after the |\fi\fi\fi|. I could define an |\afterfififi|
+% \csbc{Etoc@toctoc} after the |\fi\fi\fi|. I could define an |\afterfififi|
% macro, but it should be ok as it is done here.
%
-% |1.08e| moved the |\Etoc@par| to \csa{Etoc@tableofcontents}. This was needed
+% |1.08e| moved the \csbc{Etoc@par} to \csbc{Etoc@tableofcontents}. This was needed
% for the implementation of the emptiness test. It might have some impact in
% fringe cases as the \csa{refstepcounter} is now done before the |\par| is
% issued.
%
-% |1.08e| suppresses the possibility to do a \csa{tableofcontents}|\ref{foo}|
-% with |foo| the label of a global TOC: issueing \csa{tableofcontents} alone
+% |1.08e| suppresses the possibility to do a \csbc{tableofcontents}|\ref{foo}|
+% with |foo| the label of a global TOC: issueing \csbc{tableofcontents} alone
% suffices. Allowed to simplify some code.
%
-% |1.08g| moves |\Etoc@par| to before |\etocbeforetitlehook|, not after.
+% |1.08g| moves \csbc{Etoc@par} to before \csbc{etocbeforetitlehook}, not after.
% \begin{macrocode}
\long\def\Etoc@gobbletoetoc@ #1\etoc@ {}
\newcommand\etocsettocstyle[2]{%
@@ -8646,7 +9196,7 @@ paragraphs which may prove vaguely useful to people not the author.
\ifEtoc@standard
\else % moved here from \Etoc@toctoc (1.08)
% \end{macrocode}
-% Prior to |1.08|, this was done in |\Etoc@toctoc|
+% Prior to |1.08|, this was done in \csbc{Etoc@toctoc}
%
% |1.08k| defines here |\etocsavedchaptertocline|, |\etocsavedsectiontocline|,
% and so on for all declared level names, again at each TOC and for the
@@ -8662,10 +9212,10 @@ paragraphs which may prove vaguely useful to people not the author.
% \begin{macrocode}
\fi
% \end{macrocode}
-% |1.09| makes \cs{etocsetnexttocdepth} usable in |#1| (but this is not 100\%
+% |1.09| makes \csbc{etocsetnexttocdepth} usable in |#1| (but this is not 100\%
% compatible with the emptiness check).
%
-% |1.09| makes an \cs{etoclocaltop} usable in |#1| if under checksemptiness
+% |1.09| makes an \csbc{etoclocaltop} usable in |#1| if under checksemptiness
% regime.
% \begin{macrocode}
#1%
@@ -8673,8 +9223,8 @@ paragraphs which may prove vaguely useful to people not the author.
\ifEtoc@parskip\parskip\z@skip\fi %1.07d
\Etoc@aftertitlehook
% \end{macrocode}
-% |1.09| has replaced former \cs{Etoc@localtop} (\emph{minus one}) by
-% \cs{etoclocaltop}. Under checksemptinesstrue regime its value is already
+% |1.09| has replaced former \csa{Etoc@localtop} (\emph{minus one}) by
+% \csbc{etoclocaltop}. Under checksemptinesstrue regime its value is already
% known, but it will be obtained again from the toc file execution. As it is
% used only if TOC is active, resetting it here this way is decorative and
% could be removed.
@@ -8685,26 +9235,26 @@ paragraphs which may prove vaguely useful to people not the author.
#2\@nobreakfalse % 1.07d: \@nobreakfalse moved here
\Etoc@restoretocdepth % 1.07g. moved here from before #2 by 1.08
% \end{macrocode}
-% |\contentsline| was set to |\Etoc@etoccontentsline| by a non-global |\let|,
+% |\contentsline| was set to \csbc{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
+% But \ctanpkg{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
+% package \ctanpkg{tableof}) or |\@empty|. Prior to \ctanpkg{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|.
+% was done systematically in case of absence of package \ctanpkg{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
+% \ctanpkg{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
@@ -8720,10 +9270,10 @@ paragraphs which may prove vaguely useful to people not the author.
}% end of \Etoc@tableofcontents definition by \etocsettocstyle
}
% \end{macrocode}
-% |1.08| hacks the begin parts to update therein the |\ifEtoc@isfirst| flag
+% |1.08| hacks the begin parts to update therein the \csbc{ifEtoc@isfirst} flag
% (|2015/03/09|).
%
-% |1.08c| removes unneeded |\long| from the |\def|'s inside |\etoc@setstyle|
+% |1.08c| removes unneeded |\long| from the |\def|'s inside \csbc{etoc@setstyle}
% (|2015/03/29|).
% \begin{macrocode}
\def\etocsetstyle{\Etoc@standardfalse\etoc@setstyle}
@@ -8738,13 +9288,6 @@ paragraphs which may prove vaguely useful to people not the author.
\expandafter\def
\csname Etoc@end@\csname Etoc@#1@\endcsname\endcsname {#5}%
}
-% \end{macrocode}
-% Since the |1.09f 2022/08/30| release, some syntax highlighting is
-% done ; but for some reason the \cs{etocfontone} below is colorized
-% not like others. For |1.09g 2022/11/17| hotfix release due to
-% breaking change in |hyperref 7.00u 2022-11-13| I simply do not have time to
-% investigate the matter... will be for next time. If there is one!
-% \begin{macrocode}
\def\etocfontminustwo {\normalfont \LARGE \bfseries}
\def\etocfontminusone {\normalfont \large \bfseries}
\def\etocfontzero {\normalfont \large \bfseries}
@@ -8781,14 +9324,14 @@ paragraphs which may prove vaguely useful to people not the author.
\def\etocabbrevpagename {p.~}
% \end{macrocode}
% Versions earlier than |1.08b| (and since |1.05 2012/12/01|) defined
-% \csa{etocpartname} (for use by \etoc's own line styles) to expand to
+% \csbc{etocpartname} (for use by \etoc's own line styles) to expand to
% \csa{partname}. But this didn't make sense in the context for example of
-% |babel| and |frenchb|, because \csa{frenchpartname} does things depending on
-% the current value of the counter |part|. The code in recent |frenchb| (but
-% not yet |v2.5a| when |\etocpartname| was introduced) constructs control
+% \ctanpkg{babel} and \ctanpkg{babel-french}, because \csa{frenchpartname} does things depending on
+% the current value of the counter |part|. The code in recent \ctanpkg{babel-french} (but
+% not yet |v2.5a| when \csbc{etocpartname} was introduced) constructs control
% sequences |\ordinali|, etc... If the part counter is zero, this gives
% |\ordinal|. Usually this is not defined, hence no error happens (as it is
-% constructed via |\csname|), but under class |memoir| the bug showed up. All
+% constructed via |\csname|), but under class \ctanpkg{memoir} the bug showed up. All
% this to explain that I found out about this long lasting problem only on
% |2015/03/14|. Probably a sign that \etoc's own line styles are rarely
% used...
@@ -8797,15 +9340,15 @@ paragraphs which may prove vaguely useful to people not the author.
\def\etocbookname {Book}
% \end{macrocode}
% placeholder for comments
-% The macro \csa{etocdefaultlines} was initially called \csa{etoctoclines}. Now
-% \csa{etoctoclines} just does \csa{Etoc@standardfalse}.
+% The macro \csbc{etocdefaultlines} was initially called \csbc{etoctoclines}. Now
+% \csbc{etoctoclines} just does \csa{Etoc@standardfalse}.
% Version |1.07e| has rewritten entirely the stuff related to penalties and
% \csa{addvspace}, as this was not satisfactory in the earlier versions, which
% were written at a early stage in the development of the
% package. Actually I am not fully satisfied with these line styles.
%
-% Version |1.09f| wraps \csa{etocbookname}, respectively
-% \csa{etocpartname}, in the book, resp. part, line styles inside a
+% Version |1.09f| wraps \csbc{etocbookname}, respectively
+% \csbc{etocpartname}, in the book, resp. part, line styles inside a
% (potential) hyperlink together with the number.
% \begin{macrocode}
\def\etocdefaultlines{\Etoc@standardfalse %
@@ -8945,8 +9488,8 @@ paragraphs which may prove vaguely useful to people not the author.
\etoc@setstyle{@five}{}{}{}{}%
} % end of \etocdefaultlines!
% \end{macrocode}
-% The |\etocinnertopsep| default value is too big as well as |\etocbelowtocskip|
-% and |\etocabovetocskip|, I guess, but if I am remember correctly I chose them
+% The \csbc{etocinnertopsep} default value is too big as well as \csbc{etocbelowtocskip}
+% and \csbc{etocabovetocskip}, I guess, but if I am remember correctly I chose them
% to mimick the standard TOC spacings in |article| class.
% \begin{macrocode}
\def\etocabovetocskip{3.5ex \@plus 1ex \@minus .2ex}
@@ -8958,7 +9501,7 @@ paragraphs which may prove vaguely useful to people not the author.
\def\etocdefaultnbcol{2}
\def\etocinnertopsep{2ex}
% \end{macrocode}
-% |1.07i| adds a |\nobreak| before the |\etocinnertopsep| and a test of vertical
+% |1.07i| adds a |\nobreak| before the \csbc{etocinnertopsep} and a test of vertical
% mode to see if truly adding a |\par| is a reasonable idea, in the
% case of single-column mode.
%
@@ -9038,11 +9581,11 @@ paragraphs which may prove vaguely useful to people not the author.
{\end{multicols}}%
\addvspace{\etocbelowtocskip}}}
% \end{macrocode}
-% |1.07k| defines |\Etoc@relax| and |\etocbkgcolorcmd| as |\long|: the user
+% |1.07k| defines \csbc{Etoc@relax} and \csbc{etocbkgcolorcmd} as |\long|: the user
% manual says to use |\renewcommand\etocbkgcolorcmd|, and an |\ifx| test is used
% in the framed style. It was thus a bug to have non-long definitions before. Or
% I could have said in the user manual to use |\renewcommand*|, or in
-% |\etocframedstyle| I should test for the two, or I should pause to try to
+% \csbc{etocframedstyle} I should test for the two, or I should pause to try to
% remember about this code and think about it.
% \begin{macrocode}
\def\etocframedmphook{\relax}
@@ -9244,16 +9787,16 @@ paragraphs which may prove vaguely useful to people not the author.
\let\etocreportstyle\etocbookstyle
\let\etocreportstylenomarks\etocbookstylenomarks
% \end{macrocode}
-% |v3.7i| of memoir has moved the \cs{phantomsection} to a better location,
+% |v3.7i| of memoir has moved the \csa{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
+% at |1.09b|. Formerly \etoc used \csbc{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
+% title... and this also had the defect of making \csbc{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
+% \csbc{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.
+% \csa{phantomsection} is always defined by memoir, empty if hyperref absent.
% \begin{macrocode}
\def\etocmemoirtoctotocfmt #1#2{%
\def\Etoc@addsuitablecontentsline{\addcontentsline {toc}{#1}{#2}}%
@@ -9273,9 +9816,9 @@ paragraphs which may prove vaguely useful to people not the author.
\ifx\Etoc@aftertitlehook\@empty
\else
% \end{macrocode}
-% Execute etoc hook before the \cs{cfttocbeforelisthook} and keep distinction
+% Execute etoc hook before the \csa{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
+% memoir class way of implementing \csbc{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}
@@ -9284,7 +9827,7 @@ paragraphs which may prove vaguely useful to people not the author.
\parskip \cftparskip \@nameuse {cfttocbeforelisthook}}
{\@nameuse {cfttocafterlisthook}\endgroup\restorefromonecol}}
% \end{macrocode}
-% |1.09c| (|2020/05/15|) does an update as KOMA-script has deprecated
+% |1.09c| (|2020/05/15|) does an update as \ctanpkg{KOMA-script} has deprecated
% |\iftocfeature|. Thanks to Bilel Omrani for report. I did not check
% if cloning of KOMA code required some further updates.
%
@@ -9305,7 +9848,7 @@ paragraphs which may prove vaguely useful to people not the author.
% \end{macrocode}
% |1.09f| adds this \csa{list@fname} definition hunk although
% \csa{listoftocname} is presumably always defined. Only to match
-% closely KOMA-script code.
+% closely \ctanpkg{KOMA-script} code.
% \begin{macrocode}
\@ifundefined{listoftocname}%
{\def\list@fname{\listofname~toc}}%
@@ -9347,7 +9890,7 @@ paragraphs which may prove vaguely useful to people not the author.
{%
% \end{macrocode}
% At |1.09f| I considered adding this \csa{BeforeClosingMainAux} hunk
-% to the second argument of \csa{etocsettocstyle}-emulation of KOMA-script.
+% to the second argument of \csbc{etocsettocstyle}-emulation of \ctanpkg{KOMA-script}.
% But:
% \begin{itemize}
% \item there seems to be no interface to \csa{tocbasic@end@toc@file},
@@ -9360,7 +9903,7 @@ paragraphs which may prove vaguely useful to people not the author.
%
% \item
% the whole thing appears to me to be ill-conceived in so far as it
-% sort of implies the \csa{tableofcontents} is used only once, as each
+% sort of implies the \csbc{tableofcontents} is used only once, as each
% instance will again add this \csa{tocbasic@end@toc@file} to end of
% toc file, which may thus end up being executed multiple times.
% \end{itemize}
@@ -9423,7 +9966,7 @@ paragraphs which may prove vaguely useful to people not the author.
\Etoc@redefetocstyle{chapter}}{}
% \end{macrocode}
%|1.07k (2014/03/06)| adds the |appendix| to the list of known levels if class
-%|memoir| is detected.
+%\ctanpkg{memoir} is detected.
% \begin{macrocode}
\@ifclassloaded{memoir}
{\etocsetlevel{appendix}{0}%
@@ -9432,12 +9975,12 @@ paragraphs which may prove vaguely useful to people not the author.
\renewcommand*\etocstandarddisplaystyle{\etocmemoirstyle}
\Etoc@redefetocstyle{chapter}}{}
% \end{macrocode}
-%|1.07k (2014/03/06)| adds the compatibility with the |tocloft| package; in
-% compatibility mode etoc will obey the |tocloft| customisation for the division
+%|1.07k (2014/03/06)| adds the compatibility with the \ctanpkg{tocloft} package; in
+% compatibility mode etoc will obey the \ctanpkg{tocloft} customisation for the division
% headings as well as for the toc title.
%
-%|1.07l (2014/04/02)| fixes the bug from the |tocloft| compatibility layer which
-%was |memoir| incompatible: |memoir| has its version of |tocloft| which doesn't
+%|1.07l (2014/04/02)| fixes the bug from the \ctanpkg{tocloft} compatibility layer which
+%was \ctanpkg{memoir} incompatible: \ctanpkg{memoir} has its version of \ctanpkg{tocloft} which doesn't
%have the |\if@cftnctoc| boolean.
% \begin{macrocode}
\def\etoctocloftstyle {%
@@ -9502,7 +10045,7 @@ paragraphs which may prove vaguely useful to people not the author.
\DeclareRobustCommand*{\etoctoccontentsline}
{\@ifstar{\Etoc@addcontentsline@}{\Etoc@addtocontents}}
% \end{macrocode}
-% |1.09f| adds \csa{etocimmediatetoccontentsline}.
+% |1.09f| adds \csbc{etocimmediatetoccontentsline}.
% \begin{macrocode}
\def\Etoc@addtocontents@immediately#1#2{%
\begingroup
@@ -9522,31 +10065,31 @@ paragraphs which may prove vaguely useful to people not the author.
{\@ifstar{\Etoc@addcontentsline@@immediately}{\Etoc@addtocontents@immediately}}
% \end{macrocode}
% All the following added for version |1.07g [2013/10/13]|. Motivated by
-% a demand about |tovsec2|. But it is impossible to make |tocvsec2|
-% compatible, if not re-doing all `toc' macros in |tocvsec2|
+% a demand about |tovsec2|. But it is impossible to make \ctanpkg{tocvsec2}
+% compatible, if not re-doing all `toc' macros in \ctanpkg{tocvsec2}
% (|1.3, 2011/08/07|). I do not retain the stack idea, which does not convince
% me as useful. The empty line in the |.toc| file is put there by
-% |tocvsec2| (see its code line 143).
+% \ctanpkg{tocvsec2} (see its code line 143).
%
% I take this opportunity to add to the start of the toc file
-% |\let\etoc@startlocaltoc\@gobble| in case |etoc| is not detected, I should
-% possibly have done that long ago (like I did in |tableof|).
+% |\let\etoc@startlocaltoc\@gobble| in case \etoc is not detected, I should
+% possibly have done that long ago (like I did in \ctanpkg{tableof}).
%
% In |1.07h| I decide that I should not have used |\Etoc@| but |\etoc@| for
-% |\Etoc@settocdepth|. So I now use lowercase and add a temporary line for
+% \csa{Etoc@settocdepth}. So I now use lowercase and add a temporary line for
% transition in the very improbable situation that someone actually did already
% use the just released |1.07g|.
%
-% In |1.07i| the deactivation of |\etoc@settocdepth| done at the start
+% In |1.07i| the deactivation of \csbc{etoc@settocdepth} done at the start
% of the |.toc| file (for the case this file is used after having
-% removed |etoc| from the document, or imported in another document) is
+% removed \etoc from the document, or imported in another document) is
% done via letting it to |\@gobble| rather than |\count@| (which would
% not be ok, as what follows would be undefined too). The reason for the
-% |\count@| also used originally in |\etocignoretoctocdepth| is that
+% |\count@| also used originally in \csbc{etocignoretoctocdepth} is that
% when I first worked on |1.07g| I possibly had more than one token
-% after |\etoc@settocdepth|, but I changed that later.
+% after \csbc{etoc@settocdepth}, but I changed that later.
%
-% |1.09| renames \cs{Etoc@resettocdepth} to \cs{Etoc@restoretocdepth}.
+% |1.09| renames \csa{Etoc@resettocdepth} to \csbc{Etoc@restoretocdepth}.
% \begin{macrocode}
\def\Etoc@storetocdepth {\global\c@etoc@tocdepth\c@tocdepth }
\def\Etoc@restoretocdepth {\global\c@tocdepth\c@etoc@tocdepth }
@@ -9574,7 +10117,7 @@ paragraphs which may prove vaguely useful to people not the author.
{\protect\etoc@settocdepth\expandafter\protect\csname Etoc@#1@@\endcsname}}%
}
% \end{macrocode}
-% |1.09f| adds \csa{etocimmediatesettocdepth.toc}.
+% |1.09f| adds \csbc{etocimmediatesettocdepth.toc}.
% \begin{macrocode}
\def\etocimmediatesettocdepth #1#{\Etoc@set@toctocdepth@immediately}
\def\Etoc@set@toctocdepth@immediately #1{%
@@ -9594,16 +10137,16 @@ paragraphs which may prove vaguely useful to people not the author.
% |1.07h| adds the depth tags, and an even more general mechanism could be added
% at some point: we could insert `action' tags and have the user map them to
% arbitrary commands. For the time being we just provide
-% |\etocdepthtag.toc {name}| and |\etocsettagdepth {tag_name}{level}| where
+% \csbc{etocdepthtag.toc}\marg{name} and \csbc{etocsettagdepth}\marg{tag\_name}\marg{level} where
% level is numeric or
% alphabetical. The numeric
-% level |-3| is now again not accepted by |\etocsetlevel|, it can be used with
-% |\etocsettagdepth| (which accepts equivalently |none|).
+% level |-3| is now again not accepted by \csbc{etocsetlevel}, it can be used with
+% \csbc{etocsettagdepth} (which accepts equivalently |none|).
% \begin{macrocode}
\def\etocdepthtag #1#{\Etoc@depthtag } % \etocdepthtag.toc {name}
\def\Etoc@depthtag #1{\addtocontents {toc}{\protect\etoc@depthtag {#1}}}
% \end{macrocode}
-% |1.09f| adds \csa{etocimmediatedepthtag.toc}. This can serve in some
+% |1.09f| adds \csbc{etocimmediatedepthtag.toc}. This can serve in some
% circumstances, see user documentation. Apologies for long delay to Norman
% Ramsey who reported problem and his fix in July... 2016!
% \begin{macrocode}
@@ -9628,8 +10171,8 @@ paragraphs which may prove vaguely useful to people not the author.
{\@namedef{Etoc@depthof@#1}{\@nameuse{Etoc@#2@@}}}%
}
% \end{macrocode}
-% We must cancel all |tocvsec2| toc-related actions. But a check must be done
-% for the memoir class, as its |tocvsec2| emulation does not have the
+% We must cancel all \ctanpkg{tocvsec2} toc-related actions. But a check must be done
+% for the memoir class, as its \ctanpkg{tocvsec2} emulation does not have the
% incompatible things etoc needs to revert. This extra check added with etoc
% |1.07l|. Release |1.08g| modifies the info message under class memoir (and
% downgrades it from warning to info).
@@ -9665,22 +10208,22 @@ paragraphs which may prove vaguely useful to people not the author.
}%
}%
% \end{macrocode}
-% |1.07g|. Initial version of \csa{etocsetnexttocdepth}.
+% |1.07g|. Initial version of \csbc{etocsetnexttocdepth}.
%
-% |1.08h|: avoid after-effect of consecutive uses of \csa{etocsetnexttocdepth}
+% |1.08h|: avoid after-effect of consecutive uses of \csbc{etocsetnexttocdepth}
% with no intervening TOC, due to the fact that the command did an immediate
% modification of the |tocdepth counter|. This is now delayed until
% the actual TOC typesetting.
%
-% |1.09|: slight refactoring of \cs{etocsetnexttocdepth} to let it be usable
-% from first argument of \cs{etocsettocstyle} although it is even simpler to
-% use \cs{etocsettocdepth} there, because the setting is automatically undone
+% |1.09|: slight refactoring of \csbc{etocsetnexttocdepth} to let it be usable
+% from first argument of \csbc{etocsettocstyle} although it is even simpler to
+% use \csbc{etocsettocdepth} there, because the setting is automatically undone
% at end of TOC.
%
% Recall that etoc allows to change all numeric
% levels assigned to sectioning names, and the one used by
-% \cs{etocsetnexttocdepth} is determined at time of next toc only, when
-% \cs{Etoc@tocdepthset} will expand.
+% \csbc{etocsetnexttocdepth} is determined at time of next toc only, when
+% \csbc{Etoc@tocdepthset} will expand.
% \begin{macrocode}
\def\invisibletableofcontents {\etocsetnexttocdepth {-3}\tableofcontents }%
\def\invisiblelocaltableofcontents
@@ -9718,7 +10261,7 @@ paragraphs which may prove vaguely useful to people not the author.
{\protect\etoc@setlocaltop\expandafter\protect\csname Etoc@#1@@\endcsname}}%
}%
% \end{macrocode}
-% |1.09f| adds \csa{etocimmediatesetlocaltop.toc}.
+% |1.09f| adds \csbc{etocimmediatesetlocaltop.toc}.
% \begin{macrocode}
\def\etocimmediatesetlocaltop #1#{\Etoc@set@localtop@immediately}%
\def\Etoc@set@localtop@immediately #1{%
@@ -9734,6 +10277,10 @@ paragraphs which may prove vaguely useful to people not the author.
\endgroup
}%
}%
+% \end{macrocode}
+% |1.09i| would like to rename this to \csa{Etoc@setlocaltop}, for
+% consistency with internal macros, but too late it is already in user |.toc| files.
+% \begin{macrocode}
\def\etoc@setlocaltop #1{%
\global\let\Etoc@level #1%
\Etoc@skipthisonefalse
@@ -9748,7 +10295,7 @@ paragraphs which may prove vaguely useful to people not the author.
\Etoc@skipthisonetrue
\else
% \end{macrocode}
-% Attention, |1.09| has \cs{etoclocaltop} which is former \cs{Etoc@localtop}
+% Attention, |1.09| has \csbc{etoclocaltop} which is former \csa{Etoc@localtop}
% \emph{minus one}. Hence the shape of the conditional. Memo: it makes sense
% only for code executed under "active" status of the TOC.
% \begin{macrocode}
@@ -9760,24 +10307,24 @@ paragraphs which may prove vaguely useful to people not the author.
\fi
\fi
\fi
- \let\Etoc@next\@gobble
+ \let\Etoc@next\@empty
\ifEtoc@skipthisone
\else
\ifnum\c@tocdepth<\Etoc@level
\else
\ifEtoc@standard
\else
- \let\Etoc@next\@firstofone
+ \let\Etoc@next\Etoc@setlocaltop@doends@dobegins
\fi
\fi
\fi
% \end{macrocode}
% At |1.09f| the |\global\Etoc@skipprefixfalse| is added. This fixes a
-% weird problem that an |\etocskipfirstprefix| from this level (which a priori
+% weird problem that an \csbc{etocskipfirstprefix} from this level (which a priori
% only serves to delimit the local contents) impacted (in the global TOC for
% example) the rendering of the first finer subsequent heading. Not resetting
% the boolean was an oversight, and it shows in context of the package
-% built-in level styles as they do use |\etocskipfirstprefix|. But this also
+% built-in level styles as they do use \csbc{etocskipfirstprefix}. But this also
% stresses that the name of the macro is a bit of a misnomer, yes it serves to
% delimit local table of contents, but really it is implemented as a ghost of
% a sectioning unit which does have an impact (on the global TOC or local TOCs
@@ -9786,12 +10333,23 @@ paragraphs which may prove vaguely useful to people not the author.
% level will be executed sooner or later), and the \marg{start} code of
% subsequent finer levels (as well as its own \marg{start} code at least once,
% depending on how levels are nested).
+%
+% |1.09i| fixes a bad behaviour of \etoc in \csbc{etocchecksemptiness} regime
+% when \csbc{etocsetlocaltop.toc} has been made use of in the document. Indeed
+% the execution of \csbc{Etoc@toctoks} for the emptiness check thus triggered
+% execution of \marg{start} and \marg{finish} parts of the line styles. So
+% we abstract an \csbc{Etoc@setlocaltop@doends@dobegins} which will be made a no-op
+% in emptiness-checking contexts. Also, the code lines above have been edited
+% now that \csa{Etoc@next} here is not followed by tokens within a brace pair.
% \begin{macrocode}
- \Etoc@next{\Etoc@doends\Etoc@dobegins\global\Etoc@skipprefixfalse}%
+ \Etoc@next
}%
+\def\Etoc@setlocaltop@doends@dobegins
+ {\Etoc@doends\Etoc@dobegins\global\Etoc@skipprefixfalse}%
% \end{macrocode}
+% \begin{macrocode}
% |1.07h|. In order for the |.toc| file to be usable without error even
-% without etoc. In |1.07i| use of |\@gobble| for |\etoc@settocdepth|.
+% without etoc. In |1.07i| use of |\@gobble| for \csbc{etoc@settocdepth}.
% \begin{macrocode}
\addtocontents {toc}{\protect\@ifundefined{etoctocstyle}%
{\let\protect\etoc@startlocaltoc\protect\@gobble
diff --git a/Master/texmf-dist/tex/latex/etoc/etoc.sty b/Master/texmf-dist/tex/latex/etoc/etoc.sty
index c74591487a1..9aa95139231 100644
--- a/Master/texmf-dist/tex/latex/etoc/etoc.sty
+++ b/Master/texmf-dist/tex/latex/etoc/etoc.sty
@@ -22,13 +22,13 @@
%% in the same archive or directory.)
%%
%% Package: etoc
-%% Version: 1.09g (DEVELOPMENT)
+%% Version: 1.09i
%% License: LPPL 1.3c
%% Copyright (C) 2012-2022 Jean-Francois Burnol
%% <jfbu at free dot fr>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{etoc}
-[2022/11/17 v1.09g Completely customisable TOCs (JFB)]
+[2022/11/21 v1.09i Completely customisable TOCs (JFB)]
\RequirePackage{multicol}
\DeclareOption*{\PackageWarning{etoc}{Option `\CurrentOption' is unknown.}}
\ProcessOptions\relax
@@ -205,7 +205,7 @@
\def\Etoc@et@hop#1#2#3#4{#2{#3}{#4}#1}%
\long\def\Etoc@gobblefourorthree#1#2#3{}%
}%
-\@ifl@t@r\fmtversion{2021/11/15}%
+\@ifl@t@r\fmtversion{2020/10/01}%
{%
\def\Etoc@et@hop#1#2#3#4#5{#2{#3}{#4}{#5}#1}%
\let\Etoc@gobblefourorthree\@gobblefour
@@ -488,7 +488,7 @@
\fi
\Etoc@global\let\etocthelinkedname \etocthename
}
-\def\Etoc@getnb@hyp #1#2#3#4#5#6\etoc@ {%
+\def\Etoc@getnb@hyp #1#2#3#4#5\etoc@ {%
\edef\Etoc@tmp {{#3}}%
\Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
\Etoc@global\def\etocthename {#4}% temporary definition
@@ -571,7 +571,7 @@
\fi
\Etoc@global\let\etocthelinkedname\etocthename
}
-\def\Etoc@getit@hyp #1#2#3#4#5#6\etoc@ {%
+\def\Etoc@getit@hyp #1#2#3#4#5\etoc@ {%
\edef\Etoc@tmp {{#3}}%
\Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink \Etoc@tmp{##1}}%
\Etoc@global\def\etocthename {#4}% temporary definition
@@ -710,6 +710,7 @@
\let\contentsline\Etoc@testingcontentsline
\fi
\Etoc@storetocdepth
+ \let\Etoc@setlocaltop@doends@dobegins\@empty
\the\Etoc@toctoks
\Etoc@restoretocdepth
\endgroup
@@ -1646,19 +1647,21 @@
\fi
\fi
\fi
- \let\Etoc@next\@gobble
+ \let\Etoc@next\@empty
\ifEtoc@skipthisone
\else
\ifnum\c@tocdepth<\Etoc@level
\else
\ifEtoc@standard
\else
- \let\Etoc@next\@firstofone
+ \let\Etoc@next\Etoc@setlocaltop@doends@dobegins
\fi
\fi
\fi
- \Etoc@next{\Etoc@doends\Etoc@dobegins\global\Etoc@skipprefixfalse}%
+ \Etoc@next
}%
+\def\Etoc@setlocaltop@doends@dobegins
+ {\Etoc@doends\Etoc@dobegins\global\Etoc@skipprefixfalse}%
\addtocontents {toc}{\protect\@ifundefined{etoctocstyle}%
{\let\protect\etoc@startlocaltoc\protect\@gobble
\let\protect\etoc@settocdepth\protect\@gobble