texlive[65068] Master/texmf-dist: etoc (21nov22)
commits+karl at tug.org
commits+karl at tug.org
Mon Nov 21 21:49:15 CET 2022
Revision: 65068
http://tug.org/svn/texlive?view=revision&revision=65068
Author: karl
Date: 2022-11-21 21:49:15 +0100 (Mon, 21 Nov 2022)
Log Message:
-----------
etoc (21nov22)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/etoc/README.md
trunk/Master/texmf-dist/doc/latex/etoc/etoc.pdf
trunk/Master/texmf-dist/doc/latex/etoc/etoc.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex
trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx
trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty
Added Paths:
-----------
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex
Removed Paths:
-------------
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-A.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-B.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-A.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-B.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22-A.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-28.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-29.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-A.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-B.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-31.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-32.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-40.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-46.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-48.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-5.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-A.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-B.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-53.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-6.tex
trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-7.tex
Modified: trunk/Master/texmf-dist/doc/latex/etoc/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/README.md 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/README.md 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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 @@
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 @@
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`.
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etoc.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etoc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etoc.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etoc.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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>
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,30 @@
+%% LaTeX2e file `etocsnippet-01.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\begingroup\parindent 0pt \parfillskip 0pt \leftskip 0cm \rightskip 1cm
+\etocsetstyle {section}
+ {}
+ {\leavevmode\leftskip 0cm\relax}
+ {\bfseries\normalsize\makebox[.5cm][l]{\etocnumber.}%
+ \etocname\nobreak\hfill\nobreak
+ \rlap{\makebox[1cm]{\mdseries\etocpage}}\par}
+ {}
+\etocsetstyle {subsection}
+ {}
+ {\leavevmode\leftskip .5cm\relax }
+ {\mdseries\normalsize\makebox[1cm][l]{\etocnumber}%
+ \etocname\nobreak\hfill\nobreak
+ \rlap{\makebox[1cm]{\etocpage}}\par}
+ {}
+\etocsetstyle {subsubsection}
+ {}
+ {\leavevmode\leftskip 1.5cm\relax }
+ {\mdseries\normalsize\makebox[1cm][l]{\etocnumber}%
+ \etocname\nobreak\hfill\nobreak
+ \rlap{\makebox[1cm]{\etocpage}}\par}
+ {}
+\etocruledstyle[1]{\bfseries \Large My first \etoc: TOC of
+ \autoref{part:overview} (\nameref{part:overview})}
+\tableofcontents \ref {toc:overview}
+\endgroup
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,53 @@
+%% LaTeX2e file `etocsnippet-02.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\begingroup
+\newcommand*{\DotsAndPage}
+{\nobreak\leaders\hbox{\bfseries\normalsize\hbox to .75ex {\hss.\hss}}%
+ \hfill\nobreak
+ \makebox[\rightskip][r]{\bfseries\normalsize\etocpage}\par}
+
+\etocsetstyle {part}
+{\parindent 0pt
+ \nobreak
+ \etocskipfirstprefix}
+{\pagebreak[3]\bigskip}
+{\large\rmfamily\bfseries\scshape\centering
+ \etocifnumbered{Part \etocnumber{} -- }{}\etocname\par}
+{}
+
+\etocsetstyle {section}
+{\leftskip 0pt \rightskip .75cm \parfillskip-\rightskip
+ \nobreak\medskip
+ \etocskipfirstprefix}
+{\leftskip 0pt \rightskip .75cm \parfillskip-\rightskip
+ \pagebreak[1]\smallskip}
+{\normalsize\rmfamily\bfseries\scshape
+ \etocnumber. \etocname\DotsAndPage }
+{\parfillskip 0pt plus 1fil\relax }
+
+\etocsetstyle {subsection}
+{\leftskip1cm\rightskip .75cm \parfillskip 0pt plus 1fil\relax
+ \nobreak\smallskip}
+{}
+{\footnotesize\sffamily\mdseries\itshape
+ \etocname{} (\etocnumber, p. \etocpage). }
+{\par\medskip}
+
+\etocsettagdepth {preamble} {none}
+%\etocsettagdepth {overview} {none}% not needed explicitely, keeps value
+%\etocsettagdepth {arbitrarily}{none}
+%\etocsettagdepth {examples} {none}
+%\etocsettagdepth {surprising} {none}
+\etocsettagdepth {linestyles} {subsection}
+\etocsettagdepth {globalcmds} {subsection}
+\etocsettagdepth {custom} {none}
+%\etocsettagdepth {tips} {none}
+%\etocsettagdepth {etocandworld}{none}
+%\etocsettagdepth {code} {none}
+
+\etocsettocstyle {\centering\LARGE\textsc{\contentsname}\par\nobreak\medskip}{}
+\etocsetnexttocdepth {subsection}
+\tableofcontents
+\endgroup
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,32 @@
+%% LaTeX2e file `etocsnippet-03.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\begingroup % we start a group to keep the style changes local
+\newlength{\tocleftmargin} \setlength{\tocleftmargin}{5cm}
+\newlength{\tocrightmargin} \setlength{\tocrightmargin}{1cm}
+
+\etocsetstyle{section} % will pretend to be a Chapter
+{\addvspace{1ex}\parfillskip0pt
+ \leftskip\tocleftmargin % (already done in title)
+ \rightskip\the\tocrightmargin plus 1fil
+ \parindent0pt\color{cyan}} % (already done)
+{\bfseries\LARGE\upshape\addvspace{1ex}\leavevmode}
+{\llap{Chapter\hspace{.5em}{\etocnumber}\hspace{.75cm}}\etocname
+ \hfill\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par}
+{}
+
+\etocsetstyle{subsection} % will pretend to be a Section
+{}
+{\mdseries\large\addvspace{.5ex}\leavevmode}
+{\llap{\etocnumber\hspace{.75cm}}\textit{\etocname}%
+ \hfill\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par}
+{}
+
+\def\tmptitle{My Beautiful Thesis}
+\etocsettocstyle{\color{cyan}\parindent0pt \leftskip\tocleftmargin
+ \leavevmode\leaders\hrule height 1pt\hfill\
+ \huge\textit{\tmptitle}\par}{\bigskip}
+
+\tableofcontents \ref{toc:overview}
+\endgroup
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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}
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,25 @@
+%% LaTeX2e file `etocsnippet-05.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\makeatletter
+\newcommand{\MyStandardTOC}{%
+ \begingroup
+ % for the book or article classes:
+ %\etocsetstyle{part}{}{}
+ % {\etocsavedparttocline{\etocnumber\hspace{1em}\etocname}{\etocpage}}{}%
+ % for the scrbook or scrartcl classes:
+ \etocsetstyle{part}{}{}
+ {\etocsavedparttocline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ % following is identical in book/article/scrbook/scrartcl classes:
+ \etocsetstyle{chapter}{}{} %%% only for book and scrbook
+ {\etocsavedchaptertocline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ \etocsetstyle{section}{}{}
+ {\etocsavedsectiontocline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ \etocsetstyle{subsection}{}{}
+ {\etocsavedsubsectiontocline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
+ % etc... if further sectioning units are used
+ \etocstandarddisplaystyle % this is for the title, page-marks, etc...
+ \tableofcontents
+ \endgroup}
+\makeatother
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,26 @@
+%% LaTeX2e file `etocsnippet-06.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\etocsetstyle{section}{}
+ {\ifnum\etocthenumber=4
+ \etocsetstyle{subsection}
+ {\par\nopagebreak\begingroup
+ \leftskip1.5em \rightskip\@tocrmarg \parfillskip\@flushglue
+ \parindent 0pt \normalfont\normalsize\rmfamily\itshape
+ % \columnsep1em
+ % \begin{minipage}{\dimexpr\linewidth-\leftskip-\rightskip\relax}%
+ % \begin{multicols}{2}%
+ \etocskipfirstprefix}
+ {\allowbreak\,--\,}
+ {\etocname\ \textup{(\etocnumber)}}
+ {.\par\endgroup}%
+ % {.\par\end{multicols}\end{minipage}\par\endgroup}%
+ \else
+ \etocsetstyle{subsection}
+ {}{}
+ {\etocsavedsubsectiontocline{\numberline{\etocnumber}\etocname}{\etocpage}}
+ {}%
+ \fi}
+ {\etocsavedsectiontocline{\numberline{{\color{cyan}\etocthenumber}}\etocname}{\etocpage}}
+ {}%
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,100 @@
+%% LaTeX2e file `etocsnippet-07.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+% it will be easy to globally shift the TOC horizontally if needed
+\def\TOCleftmargin {0pt}
+\def\TOCrightmargin {2.55em}% like LaTeX's \@tocrmarg
+
+% this is for dotted leaders
+\newbox\TOCleaderbox
+\def\TOCleaderboxwidth {0.7777em}% about like what standard classes do
+
+% vertical spacing
+\def\TOCverysmallvskip {0pt plus .2pt}
+\def\TOCmedvskip {1em plus 1pt}
+\def\TOCbigvskip {2.25em plus 1pt}
+
+% the ``numwidths'' for typesetting the numbering of division units.
+% I don't recall exactly how (and for which fonts) these figures were chosen.
+% They quickly prove too small if using Roman numerals (as do too the book
+% class defaults even though they are a bit larger).
+\def\TOCnumwidthB {1.5em} % chapter
+\def\TOCnumwidthC {2.278em}% section, I think default is 2.3em
+\def\TOCnumwidthD {3.056em}% analog in standard class is 3.2em
+\def\TOCnumwidthE {3.833em}% analog in standard class is 4.1em
+\def\TOCnumwidthF {4.611em}% analog in standard class is 5em
+\def\TOCnumwidthG {5.389em}% analog in standard class is 6em
+
+% The code for the ``global toc style''.
+
+\newcommand*\TOCglobalstyle {%
+\etocsettocstyle
+ {\if at twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi
+ \parindent\z@ \leftskip\z at skip \rightskip \z at skip
+ \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}%
+ \chapter *{\noindent\kern\TOCleftmargin\relax % uses "pt"...
+ \contentsname
+ \@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}}%
+ \rightskip \TOCrightmargin\relax
+ \parfillskip -\rightskip % or a smaller value if desired
+ \leftskip \TOCleftmargin \relax }
+ {\if at restonecol \twocolumn \fi\cleardoublepage}%
+%
+\etocsetstyle{part}
+ {}
+ {\addpenalty {-\@highpenalty}%
+ \addvspace \TOCbigvskip
+ \leavevmode
+ {\large \bfseries % use a group to limit font change
+ \interlinepenalty\@M
+ \etocifnumbered{\etocnumber\hspace{1em}}{}%
+ \etocname
+ \nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}}\par
+ \nobreak
+ }
+ {}
+ {}%
+%
+\etocsetstyle{chapter}
+ {\advance\leftskip\TOCnumwidthB\relax}
+ {\addpenalty {-\@highpenalty }%
+ \vskip \TOCmedvskip\relax
+ \leavevmode
+ {\interlinepenalty\@M
+ \etocifnumbered
+ {\llap{\makebox[\TOCnumwidthB][l]{\bfseries\etocnumber}}}
+ {\advance\leftskip-\TOCnumwidthB\relax}%
+ \bfseries\etocname
+ \nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }%
+ \penalty \@highpenalty
+ }
+ {}
+ {\advance\leftskip-\TOCnumwidthB\relax}%
+%
+ \TOCsetlinestyle {section} {\TOCnumwidthC}%
+ \TOCsetlinestyle {subsection} {\TOCnumwidthD}%
+ \TOCsetlinestyle {subsubsection}{\TOCnumwidthE}%
+ \TOCsetlinestyle {paragraph} {\TOCnumwidthF}%
+ \TOCsetlinestyle {subparagraph} {\TOCnumwidthG}%
+}% end of \TOCglobalstyle
+
+%The common code for line styles is abstracted into a macro:
+
+\newcommand\TOCsetlinestyle [2]{% #1= unit, #2= numwidth as macro
+\etocsetstyle{#1}
+ {\advance\leftskip#2\relax}
+ {\vskip \TOCverysmallvskip\relax
+ \leavevmode
+ {\interlinepenalty\@M
+ \etocifnumbered
+ {\llap{\makebox[#2][l]{\etocnumber}}}{\advance\leftskip-#2\relax}%
+ \etocname
+ \nobreak\leaders \copy\TOCleaderbox
+ \hfil\makebox[-\parfillskip][r]{\etocpage}%
+ \par }%
+ }
+ {}
+ {\advance\leftskip-#2\relax}%
+}
+\makeatother
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,49 @@
+%% LaTeX2e file `etocsnippet-08.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\makeatletter
+\newcommand*\TOClocalstyle {%
+\etocsettocstyle
+ {\if at twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi
+ \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}%
+ \parindent\z@
+ \dimen@ 2.25em % for left indenting
+ \section *{\kern\dimen@ % use of \dimen@ works here by sheer luck
+ \contentsname
+ % un-comment this if marks are wanted:
+ %\@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}%
+ }% end of \section
+ \parskip \z at skip
+ \vspace{-1.25\baselineskip}% somewhat ad hoc
+ \leftskip 2.25em
+ \rightskip 4.5em
+ \advance\rightskip-\TOCrightmargin\relax
+ \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par
+ \rightskip 4.5em
+ \parfillskip -\TOCrightmargin\relax }
+ {\nobreak\vskip-.5\baselineskip
+ \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par
+ \bigskip
+ \if at restonecol \twocolumn \fi }%
+%
+\etocsetstyle{section}
+ {\advance\leftskip\TOCnumwidthC\relax}
+ {\addpenalty \@secpenalty
+ \etociffirst{}{\addvspace{\TOCmedvskip}}%
+ \leavevmode
+ {\interlinepenalty\@M
+ \bfseries\etocifnumbered
+ {\llap{\makebox[\TOCnumwidthC][l]{\etocnumber}}}
+ {\advance\leftskip-\TOCnumwidthC}%
+ \etocname\nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }%
+ \penalty \@highpenalty }
+ {}
+ {\advance\leftskip-\TOCnumwidthC\relax}%
+% the rest is identical with code for global tocs:
+ \TOCsetlinestyle {subsection} {\TOCnumwidthD}%
+ \TOCsetlinestyle {subsubsection}{\TOCnumwidthE}%
+ \TOCsetlinestyle {paragraph} {\TOCnumwidthF}%
+ \TOCsetlinestyle {subparagraph} {\TOCnumwidthG}%
+}% end of \TOClocalstyle
+\makeatother
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,35 @@
+%% LaTeX2e file `etocsnippet-09.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\etocdefaultlines
+\begingroup
+\renewcommand{\etoccolumnsep}{2em}
+\renewcommand{\etocinnerleftsep}{1.5em}
+\renewcommand{\etocinnerrightsep}{1.5em}
+% specify a background color for the toc contents
+\renewcommand{\etocbkgcolorcmd}{\color{yellow!10}}
+% set up the top and bottom rules
+\renewcommand{\etoctoprule}{\hrule height 1pt}
+\renewcommand{\etoctoprulecolorcmd}{\color{red!25}}
+\renewcommand{\etocbottomrule}{\hrule height 1pt}
+\renewcommand{\etocbottomrulecolorcmd}{\color{red!25}}
+% set up the left and right rules
+\renewcommand{\etocleftrule}{\vrule width 5pt}
+\renewcommand{\etocrightrule}{\vrule width 5pt}
+\renewcommand{\etocleftrulecolorcmd}{\color{red!25}}
+\renewcommand{\etocrightrulecolorcmd}{\color{red!25}}
+% use \fcolorbox to set up a colored frame for the title
+\fboxrule1pt
+\renewcommand{\etocbelowtocskip}{0pt\relax}
+\etocframedstyle {\normalsize\rmfamily\itshape
+ \fcolorbox{red}{white}{\parbox{.8\linewidth}{\centering
+ This is a table of contents \`a la \etoc, but just for
+ the sections and subsections in this part. As it is put
+ in a frame, it has to be small enough to fit on
+ one page. It has the label |toc:b|.}}}
+\begin{figure}[ht!]
+ \centering
+\tableofcontents \label{toc:b} \ref{toc:globalcmds}
+\end{figure}
+\endgroup
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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}
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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}
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,48 @@
+%% LaTeX2e file `etocsnippet-15.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+% \newtoks\treetok % put this (uncommented) preferably in the preamble
+% \newtoks\sectiontok
+% \newtoks\subsectiontok
+\newcommand*{\treenode}{}
+
+\newcommand*{\appendchildtree}[2]{% token list t1 becomes: t1 child {t2}
+ \edef\tmp{\the#1 child {\the#2}}%
+ #1\expandafter{\tmp}%
+}
+\newcommand*{\preparetreenode}{%
+ \tmptok\expandafter{\etocthelinkednumber}% expanded one time (mandatory)
+ \edef\treenode{node {\the\tmptok}}%
+}
+
+\etocsetstyle{section}
+ {\etocskipfirstprefix}
+ {\appendchildtree\treetok\sectiontok}
+ {\preparetreenode \sectiontok\expandafter{\treenode}}
+ {\appendchildtree\treetok\sectiontok}
+
+\etocsetstyle{subsection}
+ {\etocskipfirstprefix}
+ {\appendchildtree\sectiontok\subsectiontok}
+ {\preparetreenode \subsectiontok\expandafter{\treenode}}
+ {\appendchildtree\sectiontok\subsectiontok}
+
+\etocsettocstyle
+ {\treetok{\node {\hyperref[part:overview]{Overview}}}}
+ {\global\appendtotok\treetok{ ;}}
+
+\begin{figure}[thbp!]\centering
+ \etocsetnexttocdepth{subsection}
+ \tableofcontents \label{toc:molecule} \ref{toc:overview}
+ \hypersetup{hidelinks}%
+ \begin{tikzpicture}
+ [grow cyclic,
+ level 1/.style={level distance=4cm,sibling angle=72},
+ level 2/.style={level distance=2cm,sibling angle=60},
+ every node/.style={ball color=red,circle,text=SkyBlue},
+ edge from parent path={[dashed,very thick,color=cyan]
+ (\tikzparentnode) --(\tikzchildnode)}]
+ \the\treetok
+ \end{tikzpicture}
+\end{figure}
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,120 @@
+%% LaTeX2e file `etocsnippet-16.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\begingroup
+% \newtoks\treetok % done in preamble
+% \newtoks\parttok
+
+\newcommand*\partnode {} % just to check we don't overwrite something
+\newcommand*\childnode {}
+
+\newcommand*\tmprotate {} % just to check we don't overwrite something
+\newcommand*\tmpoption {} % just to check we don't overwrite something
+\newcommand*\tmpstuff {} % just to check we don't overwrite something
+
+\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2
+ #1\expandafter\expandafter\expandafter{\expandafter\the\expandafter #1#2}}
+
+\newcommand*{\appendchildtree}[3]{%
+% this is to construct "t1 child [#3]{t2}" from #1=t1 and #2=t2
+% t1 and t2 are two toks variable (not macros)
+% #3 = for example teal!60
+ \edef\tmpstuff {\the#1 child [#3]{\the#2}}%
+ #1\expandafter {\tmpstuff }%
+}
+
+\newcounter{partco}
+
+% 1,2,3,4,5,... -> 1,2,3,1,2,3,1,2,3
+\def\pseudomodthree #1{\numexpr #1 + 3 - 3*((#1+1)/3)\relax}
+
+\etocsetstyle{part}
+ {\etocskipfirstprefix}
+% This updates the global tree with the data from the previous
+% part and all its children sections. Moved here because for some parts the
+% sections are not displayed due to depth tags.
+ {\ifnum\value{partco}=3
+ \appendchildtree\treetok\parttok {branch color= green!50,level distance=10cm}%
+ \else
+\ifcase\pseudomodthree{\value{partco}}%
+ \or \appendchildtree\treetok\parttok {branch color= teal!60}% first
+ \or \appendchildtree\treetok\parttok {branch color= yellow!80}% second
+ \else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ...
+ \fi\fi
+ }
+ {\stepcounter{partco}%
+% customize manually some TikZ set-up (should be done inside the TikZ thing I guess)
+ \def\tmpoption {}%
+ \def\tmprotate {}% first
+ %\ifnum\value{partco}=5 \def\tmprotate {[counterclockwise from =-40]}\fi
+ %\ifnum\value{partco}=8 \def\tmprotate {[counterclockwise from =-50]}\fi
+% define the part node
+ \edef\partnode{node \tmpoption
+ {\unexpanded\expandafter{\etocthelinkednumber}.
+ \unexpanded\expandafter{\etocthelinkedname}}\tmprotate }%
+% this is a starting point which will be filled it by the section children
+ \parttok\expandafter{\partnode}}
+ {\ifcase\pseudomodthree{\value{partco}}%
+ \or \appendchildtree\treetok\parttok {branch color= teal!60}% first
+ \or \appendchildtree\treetok\parttok {branch color= yellow!80}% second
+ \else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ...
+ \fi
+ }
+
+\etocsetstyle{section}
+ {}
+ {}
+ {% define the section node
+ \edef\childnode{child {node {\unexpanded\expandafter{\etocthelinkednumber}
+ \unexpanded\expandafter{\etocthelinkedname}}}}%
+ % append it to the current \parttok
+ \appendtotok\parttok\childnode
+ }
+ {}
+
+\etocsettocstyle
+ {\setcounter{partco}{0}%
+ \treetok{\node [root concept]{\textbf{The \etoc documentation}}}}
+ {\global\appendtotok\treetok{ ;}}
+% The \global above is mandatory because etoc always typesets TOC inside a group
+
+\etocsetnexttocdepth{section}
+% use of depth tags to cut out some sections.
+\etocsettagdepth {preamble} {none}
+\etocsettagdepth {overview} {part}
+\etocsettagdepth {arbitrarily}{part}
+\etocsettagdepth {examples} {section}
+\etocsettagdepth {surprising} {part}
+\etocsettagdepth {linestyles} {part}
+\etocsettagdepth {globalcmds} {part}
+\etocsettagdepth {custom} {section}
+\etocsettagdepth {tips} {part}
+\etocsettagdepth {etocandworld}{part}
+\etocsettagdepth {code} {section}
+
+\tikzset{
+ branch color/.style={
+ concept color=#1!white,
+ every child/.append style={concept color=#1!white!30!white, font=\normalsize},
+ }
+}%
+
+\begin{figure}[thp!]
+\tableofcontents\label{toc:mindmap}%
+\centeredline{\resizebox{.85\paperwidth}{!}%
+{\begin{tikzpicture}[mindmap,
+ grow cyclic,
+ text width=2cm,
+ align=flush center,
+ nodes={concept},
+ concept color=orange!60,
+ root concept/.append style={text width=4cm, font=\Large},
+ level 1/.append style={level distance=5cm,sibling angle=40, text width=3cm},
+ level 2/.append style={level distance=7cm,sibling angle=30, text width=3cm},
+ level 1 concept/.append style={font=\normalsize},
+ ]
+\the\treetok
+\end{tikzpicture}}}
+\end{figure}
+\endgroup
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,64 @@
+%% LaTeX2e file `etocsnippet-17.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\begingroup
+\etocglobaldefs % necessary for \etocname etc... to survive &
+\makeatletter
+% hack into longtable \hline to avoid annoying (here) stray lines at top
+\def\LT@@hline{%
+ \ifx\@let at token\hline
+ \global\let\@gtempa\@gobble
+ \global\let\@gtempb\@firstofone %%% ADDED
+ \gdef\LT at sep{\penalty-\@medpenalty\vskip\doublerulesep}%
+ \else
+ \global\let\@gtempa\@empty
+ \global\let\@gtempb\@gobble %%% ADDED
+ \gdef\LT at sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}%
+ \fi
+ \ifnum0=`{\fi}%
+ \multispan\LT at cols
+ \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
+ \@gtempb{% %%% ADDED
+ \noalign{\LT at sep}%
+ \multispan\LT at cols
+ \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
+ \noalign{\penalty\@M}%
+ }% %%% ADDED
+ \@gtempa}
+\makeatother
+
+% observe the locations of the \\
+\etocsetstyle{part}
+ {}
+ {}
+ {\\\hline\multicolumn{3}{c}{\bfseries\vrule height6ex depth3ex width0pt
+ \etocifnumbered{\etocnumber. }{}\etocname}}
+ {}
+
+\etocsetstyle{section}
+ {}
+ {\etociffirst{\\\hline}{\\}}
+ {\etocnumber&\etocname &\etocpage }
+ {}
+
+\etocsetstyle{subsection}
+ {}
+ {\\}
+ {&\makebox[1cm][c]{\etocnumber}%
+ \parbox[t]{\dimexpr6cm-\tabcolsep\relax}{\sloppy\itshape\etocname\strut}%
+ &\itshape\etocpage }
+ {}
+
+\etocsettocstyle
+ {\hypersetup{hidelinks}%
+ \begin{longtable}{|>{\bfseries}c|p{7cm}|r|}
+ \hline
+ \multicolumn{3}{|c|}{\Large\bfseries\strut\strut TABLE OF CONTENTS}%
+ }
+ {\\\hline\end{longtable}}
+
+\etocsetnexttocdepth {subsection}
+
+\tableofcontents
+\endgroup
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,23 @@
+%% LaTeX2e file `etocsnippet-18.tex'
+%% generated by the `filecontentsdef' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\begin{center}
+\etocsetstyle{section}
+ {}
+ {\etociffirst{\\\hline\hline}{\\\hline}}
+ {\etocname & \etocnumber & \etocpage }
+ {}
+
+\etocsettocstyle
+ {\hypersetup{hidelinks}\begin{tabular}{|p{4cm}|c|c|}\hline
+ \multicolumn{1}{|c|}{\bfseries Section}&
+ \bfseries number&
+ \bfseries page}
+ {\\\hline\end{tabular}}
+
+\etocglobaldefs % MANDATORY !!
+\etocsetnexttocdepth{1}
+
+\tableofcontents\ref{toc:overview}
+\end{center}
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,57 @@
+%% LaTeX2e file `etocsnippet-19.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\makeatletter
+\newcommand*\TOCcompute at numwidths [2]{% #1=empty/"local", #2=minimal indent
+ \begingroup
+ \def\TOCnumwidthB {0pt}%
+ \def\TOCnumwidthC {0pt}%
+ \def\TOCnumwidthD {0pt}%
+ \def\TOCnumwidthE {0pt}%
+ \def\TOCnumwidthF {0pt}%
+ \def\TOCnumwidthG {0pt}%
+ \etocsetstyle{part}{}{}{}{}%
+ \etocsetstyle{chapter}{}
+ {\setbox0\hbox{\bfseries\etocthenumber\kern#2}}
+ {\ifdim\wd0>\TOCnumwidthB\edef\TOCnumwidthB{\the\wd0}\fi}{}%
+ \etocsetstyle{section}{}
+ {\setbox0\hbox{\bfseries\etocthenumber\kern#2}}
+ {\ifdim\wd0>\TOCnumwidthC\edef\TOCnumwidthC{\the\wd0}\fi}{}%
+ \etocsetstyle{subsection}{}
+ {\setbox0\hbox{\etocthenumber\kern#2}}
+ {\ifdim\wd0>\TOCnumwidthD\edef\TOCnumwidthD{\the\wd0}\fi}{}%
+ \etocsetstyle{subsubsection}{}
+ {\setbox0\hbox{\etocthenumber\kern#2}}
+ {\ifdim\wd0>\TOCnumwidthE\edef\TOCnumwidthE{\the\wd0}\fi}{}%
+ \etocsetstyle{paragraph}{}
+ {\setbox0\hbox{\etocthenumber\kern#2}}
+ {\ifdim\wd0>\TOCnumwidthF\edef\TOCnumwidthF{\the\wd0}\fi}{}%
+ \etocsetstyle{subparagraph}{}
+ {\setbox0\hbox{\etocthenumber\kern#2}}
+ {\ifdim\wd0>\TOCnumwidthG\edef\TOCnumwidthG{\the\wd0}\fi}{}%
+ %
+ \etocsettocstyle{}
+ {\global\let\TOCnumwidthB\TOCnumwidthB
+ \global\let\TOCnumwidthC\TOCnumwidthC
+ \global\let\TOCnumwidthD\TOCnumwidthD
+ \global\let\TOCnumwidthE\TOCnumwidthE
+ \global\let\TOCnumwidthF\TOCnumwidthF
+ \global\let\TOCnumwidthG\TOCnumwidthG}%
+ \etocnopar
+ \csname #1tableofcontents\endcsname
+\typeout{Next TOCs will use \TOCnumwidthB\space for chapter number width}%
+\typeout{Next TOCs will use \TOCnumwidthC\space for section number width}%
+\typeout{Next TOCs will use \TOCnumwidthD\space for subsection number width}%
+\typeout{Next TOCs will use \TOCnumwidthE\space for subsubsection number width}%
+\typeout{Next TOCs will use \TOCnumwidthF\space for paragraph number width}%
+\typeout{Next TOCs will use \TOCnumwidthG\space for subparagraph number width}%
+ \endgroup
+}%
+\newcommand*\TOCcomputenumwidths [1][0.5em]{%
+ \TOCcompute at numwidths {}{#1}%
+}%
+\newcommand*\TOCcomputelocalnumwidths [1][0.5em]{%
+ \TOCcompute at numwidths {local}{#1}%
+}%
+\makeatother
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-A.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-A.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-A.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,25 +0,0 @@
-%% LaTeX2e file `etocsnippet-20-A.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\makeatletter
-\newcommand{\MyStandardTOC}{%
- \begingroup
- % for the book or article classes:
- %\etocsetstyle{part}{}{}
- % {\etocsavedparttocline{\etocnumber\hspace{1em}\etocname}{\etocpage}}{}%
- % for the scrbook or scrartcl classes:
- \etocsetstyle{part}{}{}
- {\etocsavedparttocline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
- % following is identical in book/article/scrbook/scrartcl classes:
- \etocsetstyle{chapter}{}{} %%% only for book and scrbook
- {\etocsavedchaptertocline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
- \etocsetstyle{section}{}{}
- {\etocsavedsectiontocline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
- \etocsetstyle{subsection}{}{}
- {\etocsavedsubsectiontocline{\numberline{\etocnumber}\etocname}{\etocpage}}{}%
- % etc... if further sectioning units are used
- \etocstandarddisplaystyle % this is for the title, page-marks, etc...
- \tableofcontents
- \endgroup}
-\makeatother
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-B.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-B.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20-B.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,26 +0,0 @@
-%% LaTeX2e file `etocsnippet-20-B.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\etocsetstyle{section}{}
- {\ifnum\etocthenumber=4
- \etocsetstyle{subsection}
- {\par\nopagebreak\begingroup
- \leftskip1.5em \rightskip\@tocrmarg \parfillskip\@flushglue
- \parindent 0pt \normalfont\normalsize\rmfamily\itshape
- % \columnsep1em
- % \begin{minipage}{\dimexpr\linewidth-\leftskip-\rightskip\relax}%
- % \begin{multicols}{2}%
- \etocskipfirstprefix}
- {\allowbreak\,--\,}
- {\etocname\ \textup{(\etocnumber)}}
- {.\par\endgroup}%
- % {.\par\end{multicols}\end{minipage}\par\endgroup}%
- \else
- \etocsetstyle{subsection}
- {}{}
- {\etocsavedsubsectiontocline{\numberline{\etocnumber}\etocname}{\etocpage}}
- {}%
- \fi}
- {\etocsavedsectiontocline{\numberline{{\color{cyan}\etocthenumber}}\etocname}{\etocpage}}
- {}%
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,22 @@
+%% LaTeX2e file `etocsnippet-20.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\etocsetstyle{section}
+{\begin{enumerate}}
+{\normalsize\bfseries\rmfamily\item}
+{\etocname{} (page \etocpage)}
+{\end{enumerate}}
+
+\etocsetstyle{subsection}
+{\begin{enumerate}}
+{\normalfont\item}
+{\etocname{} (p.~\etocpage)}
+{\end{enumerate}}
+
+\etocsetstyle{subsubsection}
+{\par\nobreak\begingroup\normalfont
+ \footnotesize\itshape\etocskipfirstprefix}
+{\allowbreak\,--\,}
+{\etocname}
+{.\hfil\par\endgroup\pagebreak[3]}
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-A.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-A.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-A.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,100 +0,0 @@
-%% LaTeX2e file `etocsnippet-21-A.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-% it will be easy to globally shift the TOC horizontally if needed
-\def\TOCleftmargin {0pt}
-\def\TOCrightmargin {2.55em}% like LaTeX's \@tocrmarg
-
-% this is for dotted leaders
-\newbox\TOCleaderbox
-\def\TOCleaderboxwidth {0.7777em}% about like what standard classes do
-
-% vertical spacing
-\def\TOCverysmallvskip {0pt plus .2pt}
-\def\TOCmedvskip {1em plus 1pt}
-\def\TOCbigvskip {2.25em plus 1pt}
-
-% the ``numwidths'' for typesetting the numbering of division units.
-% I don't recall exactly how (and for which fonts) these figures were chosen.
-% They quickly prove too small if using Roman numerals (as do too the book
-% class defaults even though they are a bit larger).
-\def\TOCnumwidthB {1.5em} % chapter
-\def\TOCnumwidthC {2.278em}% section, I think default is 2.3em
-\def\TOCnumwidthD {3.056em}% analog in standard class is 3.2em
-\def\TOCnumwidthE {3.833em}% analog in standard class is 4.1em
-\def\TOCnumwidthF {4.611em}% analog in standard class is 5em
-\def\TOCnumwidthG {5.389em}% analog in standard class is 6em
-
-% The code for the ``global toc style''.
-
-\newcommand*\TOCglobalstyle {%
-\etocsettocstyle
- {\if at twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi
- \parindent\z@ \leftskip\z at skip \rightskip \z at skip
- \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}%
- \chapter *{\noindent\kern\TOCleftmargin\relax % uses "pt"...
- \contentsname
- \@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}}%
- \rightskip \TOCrightmargin\relax
- \parfillskip -\rightskip % or a smaller value if desired
- \leftskip \TOCleftmargin \relax }
- {\if at restonecol \twocolumn \fi\cleardoublepage}%
-%
-\etocsetstyle{part}
- {}
- {\addpenalty {-\@highpenalty}%
- \addvspace \TOCbigvskip
- \leavevmode
- {\large \bfseries % use a group to limit font change
- \interlinepenalty\@M
- \etocifnumbered{\etocnumber\hspace{1em}}{}%
- \etocname
- \nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}}\par
- \nobreak
- }
- {}
- {}%
-%
-\etocsetstyle{chapter}
- {\advance\leftskip\TOCnumwidthB\relax}
- {\addpenalty {-\@highpenalty }%
- \vskip \TOCmedvskip\relax
- \leavevmode
- {\interlinepenalty\@M
- \etocifnumbered
- {\llap{\makebox[\TOCnumwidthB][l]{\bfseries\etocnumber}}}
- {\advance\leftskip-\TOCnumwidthB\relax}%
- \bfseries\etocname
- \nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }%
- \penalty \@highpenalty
- }
- {}
- {\advance\leftskip-\TOCnumwidthB\relax}%
-%
- \TOCsetlinestyle {section} {\TOCnumwidthC}%
- \TOCsetlinestyle {subsection} {\TOCnumwidthD}%
- \TOCsetlinestyle {subsubsection}{\TOCnumwidthE}%
- \TOCsetlinestyle {paragraph} {\TOCnumwidthF}%
- \TOCsetlinestyle {subparagraph} {\TOCnumwidthG}%
-}% end of \TOCglobalstyle
-
-%The common code for line styles is abstracted into a macro:
-
-\newcommand\TOCsetlinestyle [2]{% #1= unit, #2= numwidth as macro
-\etocsetstyle{#1}
- {\advance\leftskip#2\relax}
- {\vskip \TOCverysmallvskip\relax
- \leavevmode
- {\interlinepenalty\@M
- \etocifnumbered
- {\llap{\makebox[#2][l]{\etocnumber}}}{\advance\leftskip-#2\relax}%
- \etocname
- \nobreak\leaders \copy\TOCleaderbox
- \hfil\makebox[-\parfillskip][r]{\etocpage}%
- \par }%
- }
- {}
- {\advance\leftskip-#2\relax}%
-}
-\makeatother
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-B.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-B.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21-B.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,49 +0,0 @@
-%% LaTeX2e file `etocsnippet-21-B.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\makeatletter
-\newcommand*\TOClocalstyle {%
-\etocsettocstyle
- {\if at twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi
- \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}%
- \parindent\z@
- \dimen@ 2.25em % for left indenting
- \section *{\kern\dimen@ % use of \dimen@ works here by sheer luck
- \contentsname
- % un-comment this if marks are wanted:
- %\@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}%
- }% end of \section
- \parskip \z at skip
- \vspace{-1.25\baselineskip}% somewhat ad hoc
- \leftskip 2.25em
- \rightskip 4.5em
- \advance\rightskip-\TOCrightmargin\relax
- \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par
- \rightskip 4.5em
- \parfillskip -\TOCrightmargin\relax }
- {\nobreak\vskip-.5\baselineskip
- \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par
- \bigskip
- \if at restonecol \twocolumn \fi }%
-%
-\etocsetstyle{section}
- {\advance\leftskip\TOCnumwidthC\relax}
- {\addpenalty \@secpenalty
- \etociffirst{}{\addvspace{\TOCmedvskip}}%
- \leavevmode
- {\interlinepenalty\@M
- \bfseries\etocifnumbered
- {\llap{\makebox[\TOCnumwidthC][l]{\etocnumber}}}
- {\advance\leftskip-\TOCnumwidthC}%
- \etocname\nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }%
- \penalty \@highpenalty }
- {}
- {\advance\leftskip-\TOCnumwidthC\relax}%
-% the rest is identical with code for global tocs:
- \TOCsetlinestyle {subsection} {\TOCnumwidthD}%
- \TOCsetlinestyle {subsubsection}{\TOCnumwidthE}%
- \TOCsetlinestyle {paragraph} {\TOCnumwidthF}%
- \TOCsetlinestyle {subparagraph} {\TOCnumwidthG}%
-}% end of \TOClocalstyle
-\makeatother
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,19 @@
+%% LaTeX2e file `etocsnippet-21.tex'
+%% generated by the `filecontentshere' environment
+%% 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
+ % the document they had not yet been modified by \etocsetstyle
+ % commands, so \etoctoclines could have been used, too.
+\etocmarkboth\contentsname
+\etocmulticolstyle[1] % one-column display
+ {\pdfbookmark[1]{Table of contents}{MAINTOC}% create a bookmark in the pdf
+ \noindent\bfseries\Large
+ \leaders\hrule height1pt\hfill
+ \MakeUppercase{Table of Contents}}
+\begingroup % use a group to limit the scope of the
+ \etocsetlevel{subsection}{3} % subsection level change.
+ \etocsetlevel{subsubsection}{4} % anything > tocdepth=3.
+ \tableofcontents \label{toc:main}
+\endgroup
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22-A.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22-A.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22-A.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,35 +0,0 @@
-%% LaTeX2e file `etocsnippet-22-A.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\etocdefaultlines
-\begingroup
-\renewcommand{\etoccolumnsep}{2em}
-\renewcommand{\etocinnerleftsep}{1.5em}
-\renewcommand{\etocinnerrightsep}{1.5em}
-% specify a background color for the toc contents
-\renewcommand{\etocbkgcolorcmd}{\color{yellow!10}}
-% set up the top and bottom rules
-\renewcommand{\etoctoprule}{\hrule height 1pt}
-\renewcommand{\etoctoprulecolorcmd}{\color{red!25}}
-\renewcommand{\etocbottomrule}{\hrule height 1pt}
-\renewcommand{\etocbottomrulecolorcmd}{\color{red!25}}
-% set up the left and right rules
-\renewcommand{\etocleftrule}{\vrule width 5pt}
-\renewcommand{\etocrightrule}{\vrule width 5pt}
-\renewcommand{\etocleftrulecolorcmd}{\color{red!25}}
-\renewcommand{\etocrightrulecolorcmd}{\color{red!25}}
-% use \fcolorbox to set up a colored frame for the title
-\fboxrule1pt
-\renewcommand{\etocbelowtocskip}{0pt\relax}
-\etocframedstyle {\normalsize\rmfamily\itshape
- \fcolorbox{red}{white}{\parbox{.8\linewidth}{\centering
- This is a table of contents \`a la \etoc, but just for
- the sections and subsections in this part. As it is put
- in a frame, it has to be small enough to fit on
- one page. It has the label |toc:b|.}}}
-\begin{figure}[ht!]
- \centering
-\tableofcontents \label{toc:b} \ref{toc:globalcmds}
-\end{figure}
-\endgroup
Added: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -0,0 +1,23 @@
+%% LaTeX2e file `etocsnippet-22.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2022/11/21.
+%%
+\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape
+ \fbox{\parbox{.6\linewidth}{
+ \leftskip 0pt plus .5fil
+ \rightskip 0pt plus -.5fil
+ \parfillskip 0pt plus 1fil This is the global table of
+ contents on two columns, using \etoc default line styles, but with
+ sections as chapters, and subsections as sections.
+ }}}
+\etocdefaultlines
+\etocsetnexttocdepth{1}
+\begingroup
+\etocsetlevel{section}{0}
+\etocsetlevel{subsection}{1}
+\renewcommand*{\etocfontone}{\normalfont \normalsize}
+\renewcommand*{\etoctoclineleaders}
+ {\hbox{\normalfont\normalsize\hbox to 1ex {\hss.\hss}}}
+\sloppy
+\tableofcontents
+\endgroup
Property changes on: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
+}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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}}
+ #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*\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{ ]}}
+\begingroup
+\etocsetstyle{part}{}{}{\PreparePart \appendtotok\toctabletok\toctablepiece}{}
-\etocsetstyle{subsection}
- {\etocskipfirstprefix}
- {\appendtotok\treetok{ ]}}
- {\PrepareSubsectionNode \appendtotok\treetok\foresttreenode}
- {\appendtotok\treetok{ ]}}
+\etocsetstyle{section}{}{}{\PrepareSection \appendtotok\toctabletok\toctablepiece}{}
+\etocsetstyle{subsection}{}{}{\PrepareSubsection\appendtotok\toctabletok\toctablepiece}{}
+
\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}
+ {\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
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-28.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-28.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-28.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,48 +0,0 @@
-%% LaTeX2e file `etocsnippet-28.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-% \newtoks\treetok % put this (uncommented) preferably in the preamble
-% \newtoks\sectiontok
-% \newtoks\subsectiontok
-\newcommand*{\treenode}{}
-
-\newcommand*{\appendchildtree}[2]{% token list t1 becomes: t1 child {t2}
- \edef\tmp{\the#1 child {\the#2}}%
- #1\expandafter{\tmp}%
-}
-\newcommand*{\preparetreenode}{%
- \tmptok\expandafter{\etocthelinkednumber}% expanded one time (mandatory)
- \edef\treenode{node {\the\tmptok}}%
-}
-
-\etocsetstyle{section}
- {\etocskipfirstprefix}
- {\appendchildtree\treetok\sectiontok}
- {\preparetreenode \sectiontok\expandafter{\treenode}}
- {\appendchildtree\treetok\sectiontok}
-
-\etocsetstyle{subsection}
- {\etocskipfirstprefix}
- {\appendchildtree\sectiontok\subsectiontok}
- {\preparetreenode \subsectiontok\expandafter{\treenode}}
- {\appendchildtree\sectiontok\subsectiontok}
-
-\etocsettocstyle
- {\treetok{\node {\hyperref[part:overview]{Overview}}}}
- {\global\appendtotok\treetok{ ;}}
-
-\begin{figure}[thbp!]\centering
- \etocsetnexttocdepth{subsection}
- \tableofcontents \label{toc:molecule} \ref{toc:overview}
- \hypersetup{hidelinks}%
- \begin{tikzpicture}
- [grow cyclic,
- level 1/.style={level distance=4cm,sibling angle=72},
- level 2/.style={level distance=2cm,sibling angle=60},
- every node/.style={ball color=red,circle,text=SkyBlue},
- edge from parent path={[dashed,very thick,color=cyan]
- (\tikzparentnode) --(\tikzchildnode)}]
- \the\treetok
- \end{tikzpicture}
-\end{figure}
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-29.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-29.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-29.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,120 +0,0 @@
-%% LaTeX2e file `etocsnippet-29.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\begingroup
-% \newtoks\treetok % done in preamble
-% \newtoks\parttok
-
-\newcommand*\partnode {} % just to check we don't overwrite something
-\newcommand*\childnode {}
-
-\newcommand*\tmprotate {} % just to check we don't overwrite something
-\newcommand*\tmpoption {} % just to check we don't overwrite something
-\newcommand*\tmpstuff {} % just to check we don't overwrite something
-
-\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2
- #1\expandafter\expandafter\expandafter{\expandafter\the\expandafter #1#2}}
-
-\newcommand*{\appendchildtree}[3]{%
-% this is to construct "t1 child [#3]{t2}" from #1=t1 and #2=t2
-% t1 and t2 are two toks variable (not macros)
-% #3 = for example teal!60
- \edef\tmpstuff {\the#1 child [#3]{\the#2}}%
- #1\expandafter {\tmpstuff }%
-}
-
-\newcounter{partco}
-
-% 1,2,3,4,5,... -> 1,2,3,1,2,3,1,2,3
-\def\pseudomodthree #1{\numexpr #1 + 3 - 3*((#1+1)/3)\relax}
-
-\etocsetstyle{part}
- {\etocskipfirstprefix}
-% This updates the global tree with the data from the previous
-% part and all its children sections. Moved here because for some parts the
-% sections are not displayed due to depth tags.
- {\ifnum\value{partco}=3
- \appendchildtree\treetok\parttok {branch color= green!50,level distance=10cm}%
- \else
-\ifcase\pseudomodthree{\value{partco}}%
- \or \appendchildtree\treetok\parttok {branch color= teal!60}% first
- \or \appendchildtree\treetok\parttok {branch color= yellow!80}% second
- \else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ...
- \fi\fi
- }
- {\stepcounter{partco}%
-% customize manually some TikZ set-up (should be done inside the TikZ thing I guess)
- \def\tmpoption {}%
- \def\tmprotate {}% first
- %\ifnum\value{partco}=5 \def\tmprotate {[counterclockwise from =-40]}\fi
- %\ifnum\value{partco}=8 \def\tmprotate {[counterclockwise from =-50]}\fi
-% define the part node
- \edef\partnode{node \tmpoption
- {\unexpanded\expandafter{\etocthelinkednumber}.
- \unexpanded\expandafter{\etocthelinkedname}}\tmprotate }%
-% this is a starting point which will be filled it by the section children
- \parttok\expandafter{\partnode}}
- {\ifcase\pseudomodthree{\value{partco}}%
- \or \appendchildtree\treetok\parttok {branch color= teal!60}% first
- \or \appendchildtree\treetok\parttok {branch color= yellow!80}% second
- \else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ...
- \fi
- }
-
-\etocsetstyle{section}
- {}
- {}
- {% define the section node
- \edef\childnode{child {node {\unexpanded\expandafter{\etocthelinkednumber}
- \unexpanded\expandafter{\etocthelinkedname}}}}%
- % append it to the current \parttok
- \appendtotok\parttok\childnode
- }
- {}
-
-\etocsettocstyle
- {\setcounter{partco}{0}%
- \treetok{\node [root concept]{\textbf{The \etoc documentation}}}}
- {\global\appendtotok\treetok{ ;}}
-% The \global above is mandatory because etoc always typesets TOC inside a group
-
-\etocsetnexttocdepth{section}
-% use of depth tags to cut out some sections.
-\etocsettagdepth {preamble} {none}
-\etocsettagdepth {overview} {part}
-\etocsettagdepth {arbitrarily}{part}
-\etocsettagdepth {examples} {section}
-\etocsettagdepth {surprising} {part}
-\etocsettagdepth {linestyles} {part}
-\etocsettagdepth {globalcmds} {part}
-\etocsettagdepth {custom} {section}
-\etocsettagdepth {tips} {part}
-\etocsettagdepth {etocandworld}{part}
-\etocsettagdepth {code} {section}
-
-\tikzset{
- branch color/.style={
- concept color=#1!white,
- every child/.append style={concept color=#1!white!30!white, font=\normalsize},
- }
-}%
-
-\begin{figure}[thp!]
-\tableofcontents\label{toc:mindmap}%
-\centeredline{\resizebox{.85\paperwidth}{!}%
-{\begin{tikzpicture}[mindmap,
- grow cyclic,
- text width=2cm,
- align=flush center,
- nodes={concept},
- concept color=orange!60,
- root concept/.append style={text width=4cm, font=\Large},
- level 1/.append style={level distance=5cm,sibling angle=40, text width=3cm},
- level 2/.append style={level distance=7cm,sibling angle=30, text width=3cm},
- level 1 concept/.append style={font=\normalsize},
- ]
-\the\treetok
-\end{tikzpicture}}}
-\end{figure}
-\endgroup
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-A.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-A.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-A.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,64 +0,0 @@
-%% LaTeX2e file `etocsnippet-30-A.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\begingroup
-\etocglobaldefs % necessary for \etocname etc... to survive &
-\makeatletter
-% hack into longtable \hline to avoid annoying (here) stray lines at top
-\def\LT@@hline{%
- \ifx\@let at token\hline
- \global\let\@gtempa\@gobble
- \global\let\@gtempb\@firstofone %%% ADDED
- \gdef\LT at sep{\penalty-\@medpenalty\vskip\doublerulesep}%
- \else
- \global\let\@gtempa\@empty
- \global\let\@gtempb\@gobble %%% ADDED
- \gdef\LT at sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}%
- \fi
- \ifnum0=`{\fi}%
- \multispan\LT at cols
- \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
- \@gtempb{% %%% ADDED
- \noalign{\LT at sep}%
- \multispan\LT at cols
- \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr
- \noalign{\penalty\@M}%
- }% %%% ADDED
- \@gtempa}
-\makeatother
-
-% observe the locations of the \\
-\etocsetstyle{part}
- {}
- {}
- {\\\hline\multicolumn{3}{c}{\bfseries\vrule height6ex depth3ex width0pt
- \etocifnumbered{\etocnumber. }{}\etocname}}
- {}
-
-\etocsetstyle{section}
- {}
- {\etociffirst{\\\hline}{\\}}
- {\etocnumber&\etocname &\etocpage }
- {}
-
-\etocsetstyle{subsection}
- {}
- {\\}
- {&\makebox[1cm][c]{\etocnumber}%
- \parbox[t]{\dimexpr6cm-\tabcolsep\relax}{\sloppy\itshape\etocname\strut}%
- &\itshape\etocpage }
- {}
-
-\etocsettocstyle
- {\hypersetup{hidelinks}%
- \begin{longtable}{|>{\bfseries}c|p{7cm}|r|}
- \hline
- \multicolumn{3}{|c|}{\Large\bfseries\strut\strut TABLE OF CONTENTS}%
- }
- {\\\hline\end{longtable}}
-
-\etocsetnexttocdepth {subsection}
-
-\tableofcontents
-\endgroup
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-B.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-B.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-30-B.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,23 +0,0 @@
-%% LaTeX2e file `etocsnippet-30-B.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\begin{center}
-\etocsetstyle{section}
- {}
- {\etociffirst{\\\hline\hline}{\\\hline}}
- {\etocname & \etocnumber & \etocpage }
- {}
-
-\etocsettocstyle
- {\hypersetup{hidelinks}\begin{tabular}{|p{4cm}|c|c|}\hline
- \multicolumn{1}{|c|}{\bfseries Section}&
- \bfseries number&
- \bfseries page}
- {\\\hline\end{tabular}}
-
-\etocglobaldefs % MANDATORY !!
-\etocsetnexttocdepth{1}
-
-\tableofcontents\ref{toc:overview}
-\end{center}
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-31.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-31.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-31.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,57 +0,0 @@
-%% LaTeX2e file `etocsnippet-31.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\makeatletter
-\newcommand*\TOCcompute at numwidths [2]{% #1=empty/"local", #2=minimal indent
- \begingroup
- \def\TOCnumwidthB {0pt}%
- \def\TOCnumwidthC {0pt}%
- \def\TOCnumwidthD {0pt}%
- \def\TOCnumwidthE {0pt}%
- \def\TOCnumwidthF {0pt}%
- \def\TOCnumwidthG {0pt}%
- \etocsetstyle{part}{}{}{}{}%
- \etocsetstyle{chapter}{}
- {\setbox0\hbox{\bfseries\etocthenumber\kern#2}}
- {\ifdim\wd0>\TOCnumwidthB\edef\TOCnumwidthB{\the\wd0}\fi}{}%
- \etocsetstyle{section}{}
- {\setbox0\hbox{\bfseries\etocthenumber\kern#2}}
- {\ifdim\wd0>\TOCnumwidthC\edef\TOCnumwidthC{\the\wd0}\fi}{}%
- \etocsetstyle{subsection}{}
- {\setbox0\hbox{\etocthenumber\kern#2}}
- {\ifdim\wd0>\TOCnumwidthD\edef\TOCnumwidthD{\the\wd0}\fi}{}%
- \etocsetstyle{subsubsection}{}
- {\setbox0\hbox{\etocthenumber\kern#2}}
- {\ifdim\wd0>\TOCnumwidthE\edef\TOCnumwidthE{\the\wd0}\fi}{}%
- \etocsetstyle{paragraph}{}
- {\setbox0\hbox{\etocthenumber\kern#2}}
- {\ifdim\wd0>\TOCnumwidthF\edef\TOCnumwidthF{\the\wd0}\fi}{}%
- \etocsetstyle{subparagraph}{}
- {\setbox0\hbox{\etocthenumber\kern#2}}
- {\ifdim\wd0>\TOCnumwidthG\edef\TOCnumwidthG{\the\wd0}\fi}{}%
- %
- \etocsettocstyle{}
- {\global\let\TOCnumwidthB\TOCnumwidthB
- \global\let\TOCnumwidthC\TOCnumwidthC
- \global\let\TOCnumwidthD\TOCnumwidthD
- \global\let\TOCnumwidthE\TOCnumwidthE
- \global\let\TOCnumwidthF\TOCnumwidthF
- \global\let\TOCnumwidthG\TOCnumwidthG}%
- \etocnopar
- \csname #1tableofcontents\endcsname
-\typeout{Next TOCs will use \TOCnumwidthB\space for chapter number width}%
-\typeout{Next TOCs will use \TOCnumwidthC\space for section number width}%
-\typeout{Next TOCs will use \TOCnumwidthD\space for subsection number width}%
-\typeout{Next TOCs will use \TOCnumwidthE\space for subsubsection number width}%
-\typeout{Next TOCs will use \TOCnumwidthF\space for paragraph number width}%
-\typeout{Next TOCs will use \TOCnumwidthG\space for subparagraph number width}%
- \endgroup
-}%
-\newcommand*\TOCcomputenumwidths [1][0.5em]{%
- \TOCcompute at numwidths {}{#1}%
-}%
-\newcommand*\TOCcomputelocalnumwidths [1][0.5em]{%
- \TOCcompute at numwidths {local}{#1}%
-}%
-\makeatother
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-32.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-32.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-32.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,22 +0,0 @@
-%% LaTeX2e file `etocsnippet-32.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\etocsetstyle{section}
-{\begin{enumerate}}
-{\normalsize\bfseries\rmfamily\item}
-{\etocname{} (page \etocpage)}
-{\end{enumerate}}
-
-\etocsetstyle{subsection}
-{\begin{enumerate}}
-{\normalfont\item}
-{\etocname{} (p.~\etocpage)}
-{\end{enumerate}}
-
-\etocsetstyle{subsubsection}
-{\par\nobreak\begingroup\normalfont
- \footnotesize\itshape\etocskipfirstprefix}
-{\allowbreak\,--\,}
-{\etocname}
-{.\hfil\par\endgroup\pagebreak[3]}
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-40.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-40.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-40.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,19 +0,0 @@
-%% LaTeX2e file `etocsnippet-40.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\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
- % commands, so \etoctoclines could have been used, too.
-\etocmarkboth\contentsname
-\etocmulticolstyle[1] % one-column display
- {\pdfbookmark[1]{Table of contents}{MAINTOC}% create a bookmark in the pdf
- \noindent\bfseries\Large
- \leaders\hrule height1pt\hfill
- \MakeUppercase{Table of Contents}}
-\begingroup % use a group to limit the scope of the
- \etocsetlevel{subsection}{3} % subsection level change.
- \etocsetlevel{subsubsection}{4} % anything > tocdepth=3.
- \tableofcontents \label{toc:main}
-\endgroup
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-46.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-46.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-46.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,23 +0,0 @@
-%% LaTeX2e file `etocsnippet-46.tex'
-%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape
- \fbox{\parbox{.6\linewidth}{
- \leftskip 0pt plus .5fil
- \rightskip 0pt plus -.5fil
- \parfillskip 0pt plus 1fil This is the global table of
- contents on two columns, using \etoc default line styles, but with
- sections as chapters, and subsections as sections.
- }}}
-\etocdefaultlines
-\etocsetnexttocdepth{1}
-\begingroup
-\etocsetlevel{section}{0}
-\etocsetlevel{subsection}{1}
-\renewcommand*{\etocfontone}{\normalfont \normalsize}
-\renewcommand*{\etoctoclineleaders}
- {\hbox{\normalfont\normalsize\hbox to 1ex {\hss.\hss}}}
-\sloppy
-\tableofcontents
-\endgroup
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-48.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-48.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-48.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-5.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-5.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-5.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,30 +0,0 @@
-%% LaTeX2e file `etocsnippet-5.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\begingroup\parindent 0pt \parfillskip 0pt \leftskip 0cm \rightskip 1cm
-\etocsetstyle {section}
- {}
- {\leavevmode\leftskip 0cm\relax}
- {\bfseries\normalsize\makebox[.5cm][l]{\etocnumber.}%
- \etocname\nobreak\hfill\nobreak
- \rlap{\makebox[1cm]{\mdseries\etocpage}}\par}
- {}
-\etocsetstyle {subsection}
- {}
- {\leavevmode\leftskip .5cm\relax }
- {\mdseries\normalsize\makebox[1cm][l]{\etocnumber}%
- \etocname\nobreak\hfill\nobreak
- \rlap{\makebox[1cm]{\etocpage}}\par}
- {}
-\etocsetstyle {subsubsection}
- {}
- {\leavevmode\leftskip 1.5cm\relax }
- {\mdseries\normalsize\makebox[1cm][l]{\etocnumber}%
- \etocname\nobreak\hfill\nobreak
- \rlap{\makebox[1cm]{\etocpage}}\par}
- {}
-\etocruledstyle[1]{\bfseries \Large My first \etoc: TOC of
- \autoref{part:overview} (\nameref{part:overview})}
-\tableofcontents \ref {toc:overview}
-\endgroup
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-A.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-A.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-A.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
-}
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-B.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-B.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-52-B.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-53.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-53.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-53.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-6.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-6.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-6.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,53 +0,0 @@
-%% LaTeX2e file `etocsnippet-6.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\begingroup
-\newcommand*{\DotsAndPage}
-{\nobreak\leaders\hbox{\bfseries\normalsize\hbox to .75ex {\hss.\hss}}%
- \hfill\nobreak
- \makebox[\rightskip][r]{\bfseries\normalsize\etocpage}\par}
-
-\etocsetstyle {part}
-{\parindent 0pt
- \nobreak
- \etocskipfirstprefix}
-{\pagebreak[3]\bigskip}
-{\large\rmfamily\bfseries\scshape\centering
- \etocifnumbered{Part \etocnumber{} -- }{}\etocname\par}
-{}
-
-\etocsetstyle {section}
-{\leftskip 0pt \rightskip .75cm \parfillskip-\rightskip
- \nobreak\medskip
- \etocskipfirstprefix}
-{\leftskip 0pt \rightskip .75cm \parfillskip-\rightskip
- \pagebreak[1]\smallskip}
-{\normalsize\rmfamily\bfseries\scshape
- \etocnumber. \etocname\DotsAndPage }
-{\parfillskip 0pt plus 1fil\relax }
-
-\etocsetstyle {subsection}
-{\leftskip1cm\rightskip .75cm \parfillskip 0pt plus 1fil\relax
- \nobreak\smallskip}
-{}
-{\footnotesize\sffamily\mdseries\itshape
- \etocname{} (\etocnumber, p. \etocpage). }
-{\par\medskip}
-
-\etocsettagdepth {preamble} {none}
-%\etocsettagdepth {overview} {none}% not needed explicitely, keeps value
-%\etocsettagdepth {arbitrarily}{none}
-%\etocsettagdepth {examples} {none}
-%\etocsettagdepth {surprising} {none}
-\etocsettagdepth {linestyles} {subsection}
-\etocsettagdepth {globalcmds} {subsection}
-\etocsettagdepth {custom} {none}
-%\etocsettagdepth {tips} {none}
-%\etocsettagdepth {etocandworld}{none}
-%\etocsettagdepth {code} {none}
-
-\etocsettocstyle {\centering\LARGE\textsc{\contentsname}\par\nobreak\medskip}{}
-\etocsetnexttocdepth {subsection}
-\tableofcontents
-\endgroup
Deleted: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-7.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-7.tex 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-7.tex 2022-11-21 20:49:15 UTC (rev 65068)
@@ -1,32 +0,0 @@
-%% LaTeX2e file `etocsnippet-7.tex'
-%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2022/11/18.
-%%
-\begingroup % we start a group to keep the style changes local
-\newlength{\tocleftmargin} \setlength{\tocleftmargin}{5cm}
-\newlength{\tocrightmargin} \setlength{\tocrightmargin}{1cm}
-
-\etocsetstyle{section} % will pretend to be a Chapter
-{\addvspace{1ex}\parfillskip0pt
- \leftskip\tocleftmargin % (already done in title)
- \rightskip\the\tocrightmargin plus 1fil
- \parindent0pt\color{cyan}} % (already done)
-{\bfseries\LARGE\upshape\addvspace{1ex}\leavevmode}
-{\llap{Chapter\hspace{.5em}{\etocnumber}\hspace{.75cm}}\etocname
- \hfill\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par}
-{}
-
-\etocsetstyle{subsection} % will pretend to be a Section
-{}
-{\mdseries\large\addvspace{.5ex}\leavevmode}
-{\llap{\etocnumber\hspace{.75cm}}\textit{\etocname}%
- \hfill\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par}
-{}
-
-\def\tmptitle{My Beautiful Thesis}
-\etocsettocstyle{\color{cyan}\parindent0pt \leftskip\tocleftmargin
- \leavevmode\leaders\hrule height 1pt\hfill\
- \huge\textit{\tmptitle}\par}{\bigskip}
-
-\tableofcontents \ref{toc:overview}
-\endgroup
Modified: trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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 @@
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 @@
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 @@
\usepackage[utf8]{inputenc}
\usepackage[hscale=0.66,vscale=0.75]{geometry}
\pagestyle{headings}
-% \usepackage{layout}
+% \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
+% \newwrite\out
+% \immediate\openout\out=\jobname.headings
+% \immediate\write\out{\meaning\ps at headings}
+% \immediate\closeout\out
+% from \ps at headings:
+% \renewcommand *{\sectionmark }[1]{\if at twoside \expandafter \markboth
+% \else \expandafter \markright \fi {\MakeMarkcase {\Ifnumbered
+% {section}{\sectionmarkformat }{}##1}}{}}
+% \renewcommand *{\subsectionmark }[1]{\if at twoside \markright {\MakeMarkcase
+% {\Ifnumbered {subsection}{\subsectionmarkformat }{}##1}}\fi }
-% January 2014. work-around a bug in KOMA 3.12 (December 2013):
-\makeatletter
-\def\buggysectionmark #1{% KOMA 3.12 as released to CTAN December 2013
- \if at twoside\expandafter\markboth\else\expandafter\markright\fi
- {\MakeMarkcase{\ifnumbered{section}{\sectionmarkformat\fi}{}#1}}{}}
-\ifx\buggysectionmark\sectionmark
-\def\sectionmark #1{%
- \if at twoside\expandafter\markboth\else\expandafter\markright\fi
- {\MakeMarkcase{\ifnumbered{section}{\sectionmarkformat}{}#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 at 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 at mypartheadings{%
+ \ps at 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 at startpart {part}}
+
\makeatother
+\usepackage{centeredline}% replaces the 2013/03/07 original code
+
\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 at skip}%
- \else
- \def\centeredline@{\hss\egroup}%
- \fi
- \afterassignment\@centeredline
- \let\next=}
-
% pour maintenir les % en début de ligne dans les blocs verbatim
%
@@ -723,7 +743,8 @@
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 @@
\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,8 +861,8 @@
{}
{\thispartstatsauxii
\stepcounter{mycountii}%
- \sbox{\lastnameii}{\etocname}%
- \sbox{\lastnumberii}{\etocnumber}}
+ \sbox{\lastnameii}{\footnotesize\etocname}%
+ \sbox{\lastnumberii}{\footnotesize\etocnumber}}
{}
\etocsetstyle{section}
{}
@@ -848,9 +869,10 @@
{}
{\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 @@
``\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,19 +925,74 @@
\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 at 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 at etocmacro-#1\endcsname
+ \hyperref[etocmacro-#1]{\ttfamily\hyphenchar\font45 \xintTrim{\nbmoitie}{#1}}%
+ \else
+ % for .toc suffixed macros
+ \ifcsname r at 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}}
\newcommand\staritb[1]{\csb{#1}\lowast}
@@ -1070,11 +1148,76 @@
\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
+ }%
-\begin{document}%\layout
+\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.
+
+\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 @@
\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,12 +1290,14 @@
%\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}%
@@ -1155,11 +1304,11 @@
\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
@@ -1166,7 +1315,7 @@
\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 @@
% 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 @@
% 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 @@
}% 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,7 +1484,7 @@
{\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}%
}
@@ -1343,23 +1491,51 @@
\pdfbookmark[1]{Table of contents}{MAINTOC}%
-\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}.
+%\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.
- PDF viewers unable to make these attachments accessible to the
- user may replace the clickable icons by some blank space.
-\end{framed}
+ 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}
+ 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
+
\begingroup
\etocsetlevel{subsection}{3}
\etocsetlevel{subsubsection}{6}
@@ -1391,14 +1567,14 @@
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 @@
\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 @@
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 @@
\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 @@
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 @@
\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 @@
\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 @@
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 @@
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 @@
\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 @@
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,9 +1937,34 @@
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 at reversemargin=\iftrue.
+% l.1765 \makeatletter\show\if at 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 @@
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 @@
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 @@
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 @@
\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 @@
\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 @@
\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 @@
\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 @@
\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 @@
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 @@
\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 @@
\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 @@
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 @@
\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 @@
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 @@
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 @@
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 @@
\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 @@
% \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 @@
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 @@
\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 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 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 @@
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 @@
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 @@
etc... the meaning of the \LaTeX\ |\l at section|, |\l at 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 @@
\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 @@
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 @@
\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 @@
{\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 @@
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 @@
\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 @@
}
\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 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 @@
}% 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 @@
% 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 @@
\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 @@
% 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 @@
(\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 @@
%%%% 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 @@
The code used:
\filecontentsprint\foo
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\clearpage
@@ -3264,10 +3445,10 @@
\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 @@
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 @@
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 @@
\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 @@
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 @@
\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 @@
\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 @@
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 @@
\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 @@
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 @@
|\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 @@
\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 @@
\end{tikzpicture}
\end{figure}
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\filecontentsexec\filecontentsheremacro
@@ -3709,7 +3890,7 @@
\let\appendtotok\relax
\expandafter\let\csname c at 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 @@
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 @@
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 @@
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 @@
\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 @@
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 @@
\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 @@
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 at numwidths [2]{% #1=empty/"local", #2=minimal indent
\begingroup
@@ -4084,7 +4265,7 @@
}%
\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 @@
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 @@
% 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 @@
\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 @@
{\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 @@
\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 @@
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 @@
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 @@
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 @@
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,13 +4562,35 @@
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 at 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 at 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 at 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
@@ -4394,8 +4597,8 @@
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 @@
{\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 @@
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,7 +4665,7 @@
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 })}
@@ -4469,7 +4672,7 @@
{\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 @@
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 @@
\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 @@
\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 @@
\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 @@
\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 @@
\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 @@
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 @@
\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 @@
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 @@
\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 @@
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 @@
\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 @@
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 @@
\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 @@
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,7 +5330,7 @@
\tableofcontents
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\filecontentsexec\filecontentsheremacro
@@ -5130,7 +5337,34 @@
\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
\csa{renewcommand}s:
@@ -5176,7 +5410,7 @@
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 @@
\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 @@
\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 @@
\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 @@
\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 @@
%\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,7 +5881,7 @@
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
@@ -5581,11 +5888,11 @@
% 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,25 +5904,26 @@
\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.
@@ -5622,7 +5930,7 @@
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 @@
\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 @@
}
\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 @@
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 @@
\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 @@
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,7 +6157,7 @@
\the\toctabletok
\endgroup
\end{filecontentshere}
-\attachfile[description={demo \the\value{section}}]{etocsnippet-\the\value{section}.tex}
+\marginattach{}
\clearpage
\etocdepthtag.toc {etocandworld}
@@ -5856,13 +6164,11 @@
\part{\etoc and the outside world}
-\section{Compatibility with other packages}
+\section{Constraints on the \texttt{.toc} file constitution}
-\subsection{Generalities}
-
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 @@
\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,81 +6219,42 @@
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}}
+\section{Compatibility with document classes}
-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.
+\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 \texttt{Babel}}
+\subsection{Compatibility with the \ctanpkg{KOMA-script} classes}
+\label{etocscrartclstyle}
+\label{etocscrbookstyle}
+\label{etocscrreprtstyle}
-\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}
+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 \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 at section},
-\csa{l at 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 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
@@ -5993,11 +6261,11 @@
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 @@
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 @@
\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 @@
\csa{section}, you should modify \csb{etocaftertitlehook} to assign
|subsection| level to the \localtoc own styling.
+\subsection{Compatibility with \ctanpkg{beamer}}
-\subsection{Compatibility with package \texttt{tocvsec2}}
+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 \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 at section},
+\csa{l at 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 @@
\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 @@
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 @@
\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 at 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 @@
\renewcommand\lowast{{\normalsize\raisebox{-.4\height}{*}}}
\small
- \section{Change history}
+ \section{Change history}\label{changelog}
\setlength{\columnsep}{\etoccolumnsep}
@@ -6199,8 +6576,23 @@
\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,8 +7084,62 @@
\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 at 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
% paragraphe de texte de toute façon avant le premier macrocode.
@@ -6772,16 +7218,16 @@
%%% \catcode`^ 11 \catcode`_ 11 }
%%% \def\xintexprMakePrivateLetters{\xintMakePrivateLetters \catcode`! 11 }
%%% \let\MakePrivateLetters\xintMakePrivateLetters
-\definecolor{xintnamecolor}{RGB}{228,57,0}
-\colorlet{verbcolor}{Maroon}
+% \definecolor{etocnamecolor}{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}
+% \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 at crossref{\init at crossref%
\everypar{\refstepcounter{CodelineNo}%
@@ -6851,11 +7297,11 @@
{\xintdocMacrocodeFallbackColorCmd\special at escape@char\macro at namepart}%
\else
\ifcsname alreadydefined-\macro at namepart\endcsname
- \hyperref[xintmacro-\macro at namepart]{\special at escape@char\macro at namepart}%
+ \hyperref[etocmacro-\macro at namepart]{\special at escape@char\macro at namepart}%
\else
% this will make a rather large number of macro names in the string pool...
\global\expandafter\let\csname alreadydefined-\macro at namepart\endcsname\@empty
- \label{xintmacro-\macro at namepart}%
+ \label{etocmacro-\macro at namepart}%
\stepcounter{xintMacroCnt}%
% try to link to a labeled reference in the user documentation (xint-all.pdf)
\ifcsname r@\xintdoclabelprefix\macro at namepart\endcsname
@@ -6885,11 +7331,11 @@
\if0\ifx\next\scan at macro0\else\ifx\next\lowast0\else1\fi\fi
\expandafter\in@\expandafter{\expandafter.\macro at namepart,}%
{.def,.edef,.let,.gdef,.xdef,%
- .chardef,.newif,.newtoks,.newcommand,}%.odef,.oodef,.fdef,}%
+ .chardef,.newif,.newtoks,.newcommand,.DeclareRobustCommand,}%.odef,.oodef,.fdef,}%
\ifin@\labelmacro at allowedtrue\fi
\fi
- \ifcsname r at xintmacro-\macro at namepart\endcsname
- \hyperref[xintmacro-\macro at namepart]{\special at escape@char\macro at namepart}%
+ \ifcsname r at etocmacro-\macro at namepart\endcsname
+ \hyperref[etocmacro-\macro at namepart]{\special at escape@char\macro at namepart}%
\else
{\xintdocMacrocodeFallbackColorCmd\special at escape@char\macro at namepart}%
\fi
@@ -6933,27 +7379,103 @@
\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.
+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.
-Warning: the code author's brain reboots frequently, and more and more often.
+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 at etocmacro-#1\endcsname
+ \hyperref[etocmacro-#1]{\ttfamily\hyphenchar\font45 \char`\\ #1}%
+ \else
+ % for .toc suffixed macros
+ \ifcsname r at 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 at chapter},
+\csa{l at section} etc..., but use \csbc{Etoc at 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 at chapter}, \csa{l at 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,
% mais vraiment pas envie d'investiguer.
@@ -6972,6 +7494,8 @@
% \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 @@
% \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 at part| and defines |\ifEtoc at skipprefix|. It
-% also defines |\etocglobaldefs|, |\etoclocaldefs| and |\Etoc at global|.
+% also defines \csbc{etocglobaldefs}, \csbc{etoclocaldefs} and \csbc{Etoc at global}.
% \begin{macrocode}
\newtoks\Etoc at toctoks
\def\Etoc at par{\par}
@@ -7010,9 +7534,9 @@
\let\etocnopar\etocinline
\def\etocdisplay{\def\Etoc at 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 at global\@empty % 1.08 2015/03/10
\def\etocglobaldefs{\let\Etoc at global\global\let\tof at global\global}
@@ -7093,17 +7617,17 @@
\let\Etoc at all@@ \Etoc@@five@@
\let\Etoc at none@@ \Etoc at minf
% \end{macrocode}
-% Versions earlier than |1.08| did |\Etoc at newlevel| in a quite
+% Versions earlier than |1.08| did \csbc{Etoc at 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 at levellist} list.
+% |1.08f|'s \csbc{etocsetlevel} avoids multiple insertions of the same level
+% in the \csbc{Etoc at levellist} list.
%
-% |1.08k| modified \csa{Etoc at newlevel}: formerly a token |\l@#1| was stored in
+% |1.08k| modified \csbc{Etoc at 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 at levellist\@empty
\def\Etoc at newlevel #1{\expandafter\def\expandafter\Etoc at levellist\expandafter
@@ -7156,14 +7680,14 @@
\etocsetlevel{paragraph}{4}
\etocsetlevel{subparagraph}{5}
% \end{macrocode}
-% The first two parameters of |\Etoc at et@hop| are exchanged in |1.08|
+% The first two parameters of \csbc{Etoc at et@hop} are exchanged in |1.08|
% compared to earlier versions; this is in relation to changes done in
-% |\Etoc at etoccontentsline|.
+% \csbc{Etoc at 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 at et@hop| et al., else usage of \etoc
+% arguments. So we must adjust \csbc{Etoc at 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
@@ -7170,9 +7694,9 @@
%^^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 @@
\def\Etoc at et@hop#1#2#3#4{#2{#3}{#4}#1}%
\long\def\Etoc at gobblefourorthree#1#2#3{}%
}%
-\@ifl at 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 at t@r\fmtversion{2020/10/01}%
{%
\def\Etoc at et@hop#1#2#3#4#5{#2{#3}{#4}{#5}#1}%
\let\Etoc at gobblefourorthree\@gobblefour
@@ -7242,11 +7773,11 @@
% defined macros which may close groups. This has always been the reason
% for the |\global|'s here and elsewhere.
%
-% |1.08| uses |\Etoc at level| rather than a |#1| which used to be anyhow always
-% the |\Etoc at tmp|. Now |\Etoc at level| is what was called formerly |\Etoc at tmp|
-% in |\Etoc at etoccontentsline|.
+% |1.08| uses \csbc{Etoc at level} rather than a |#1| which used to be anyhow always
+% the |\Etoc at tmp|. Now \csbc{Etoc at level} is what was called formerly |\Etoc at tmp|
+% in \csbc{Etoc at etoccontentsline}.
%
-% Attention that |\Etoc at setflags| must not modify |\Etoc at next|!
+% Attention that \csbc{Etoc at setflags} must not modify |\Etoc at next|!
% \begin{macrocode}
\def\Etoc at setflags {%
\ifcase \Etoc at level
@@ -7292,10 +7823,10 @@
\fi
}
% \end{macrocode}
-% |1.08| This was originally in |\Etoc at etoccontentsline|, intermixed
-% with the definitions of |\Etoc at contents| and |\Etoc at prefix|. Separated
+% |1.08| This was originally in \csbc{Etoc at etoccontentsline}, intermixed
+% with the definitions of \csbc{Etoc at contents} and \csbc{Etoc at prefix}. Separated
% here for clarity of code. One has to be careful that this may close
-% groups. The conditionals are all global. The |\Etoc at level| has been
+% groups. The conditionals are all global. The \csbc{Etoc at level} has been
% |\global\let| to a |\chardef| variable. The final |\else| of the
% |\ifcase| assumes none of the |\Etoc at end@..| routines modify it,
% naturally.
@@ -7336,15 +7867,15 @@
}
% \end{macrocode}
% |1.08| the |\Etoc at next| will (possibly) execute the |begin| code,
-% \emph{before} |\Etoc at contents| and |\Etoc at prefix| get defined,
+% \emph{before} \csbc{Etoc at contents} and \csbc{Etoc at 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 at isfirsttrue|.
+% Also the \meta{begin} code does \csa{Etoc at isfirsttrue}.
%
-% |1.08k| This was originally in |\Etoc at etoccontentsline|. Extracted for
-% re-use by |\etocsetlocaltop.toc|. Calls |\Etoc at setflags| which must not
+% |1.08k| This was originally in \csbc{Etoc at etoccontentsline}. Extracted for
+% re-use by \csbc{etocsetlocaltop.toc}. Calls \csbc{Etoc at setflags} which must not
% modify |\Etoc at next|.
% \begin{macrocode}
\def\Etoc at dobegins{%
@@ -7406,17 +7937,17 @@
% |\contentsline {<unit>}...| instructions, with
% the standard meaning of executing |\l at unit| (the hyperref
% modifications are taken into account). It is the various |\l at unit|'s
-% which are (locally) |\let| to |\Etoc at lxyz| and it is |\Etoc at lxyz|
+% which are (locally) |\let| to \csbc{Etoc at lxyz} and it is \csbc{Etoc at 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 at prefix| and |\Etoc at contents| corresponding to that unit level,
-% according to the user |\etocsetstyle| declarations. Before that the
+% \csbc{Etoc at prefix} and \csbc{Etoc at 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 at swa{#1}}{\Etoc at swb{#1}}|
% line. But this made it impossible for me to execute things after the
@@ -7425,53 +7956,53 @@
% 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 at contents| and |\Etoc at prefix|). Thus I am not so free now to define
+% \csbc{Etoc at contents} and \csbc{Etoc at 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 at swa| and |\Etoc at swb| which did the |\Etoc at et@hop| thing have
+% Macros |\Etoc at swa| and |\Etoc at swb| which did the \csbc{Etoc at et@hop} thing have
% been suppressed, their effect is incorporated to the end of
-% |\Etoc at etoccontentsline|.
+% \csbc{Etoc at etoccontentsline}.
% \begin{macrocode}
\def\etocskipfirstprefix {\global\Etoc at skipprefixtrue }
% \end{macrocode}
-% |2015/03/08| let's record that |\Etoc at level| used to be called
+% |2015/03/08| let's record that \csbc{Etoc at level} used to be called
% |\Etoc at tmp| in versions earlier than |1.08| (and |\Etoc at tmp| is used
-% in the completely different ulterior |\Etoc at lxyz| context). The code
-% sets it for example to be |\Etoc at section@@| which has been let by
-% |\etocsetlevel| to |\@ne|, thus is always self-terminating in
+% in the completely different ulterior \csbc{Etoc at lxyz} context). The code
+% sets it for example to be \csa{Etoc at 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 at localtableofcontents| which is executed after the test
-% of emptiness) that |\Etoc at localtop| was still undefined. Earlier version of
+% that part in \csbc{Etoc at localtableofcontents} which is executed after the test
+% of emptiness) that \csa{Etoc at localtop} was still undefined. Earlier version of
% the code was a bit lazy and did not avoid some unneeded |\ifnum| with
-% |\Etoc at localtop| in context where the flag |\ifEtoc at stoptoc| was |\iftrue|;
-% this was not an issue when code was first written, |\Etoc at localtop| was
-% always initialized back then. But the code in |\Etoc at localtableofcontents|
+% \csa{Etoc at localtop} in context where the flag \csbc{ifEtoc at stoptoc} was |\iftrue|;
+% this was not an issue when code was first written, \csa{Etoc at localtop} was
+% always initialized back then. But the code in \csbc{Etoc at localtableofcontents}
% handling local TOCs with unrecognized ids would call execution of the |.toc|
-% file under some special context with flag |\ifEtoc at stoptoc| artificially set
-% to true. If |\Etoc at localtop| had not been initialized an undefined control
+% file under some special context with flag \csbc{ifEtoc at stoptoc} artificially set
+% to true. If \csa{Etoc at localtop} had not been initialized an undefined control
% sequence error would occur. Furthermore as |\ifEtoc at notactive| was also set
-% to true, the case of no error leads then to unneededly expand |\Etoc at setflags|
+% to true, the case of no error leads then to unneededly expand \csbc{Etoc at 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 at next|
-% for the |\Etoc at setflags| rather than leaving it like here deep inside
+% for the \csbc{Etoc at setflags} rather than leaving it like here deep inside
% conditional branches.
%
-% Attention! |1.09|'s \cs{etoclocaltop} is the former \cs{Etoc at localtop}
+% Attention! |1.09|'s \csbc{etoclocaltop} is the former \csa{Etoc at localtop}
% \emph{minus one}. Hence some slight change in conditional here.
% \begin{macrocode}
\def\Etoc at etoccontentsline #1{%
@@ -7512,7 +8043,7 @@
% |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 at setflags| was done above already. Earlier method proceeded with
+% \csbc{Etoc at 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 @@
% close groups. This is the reason why some assignments have to be done
% globally. The |\let\Etoc at next\Etoc at gobblesixorfive| above could be
% local, because it is used only in case the stuff below is skipped,
-% inclusive of |\Etoc at doends| which may close groups. (code has changed since,
+% inclusive of \csbc{Etoc at doends} which may close groups. (code has changed since,
% slightly).
%
-% |1.08| extracts to a separate macro |\Etoc at doends|. Earlier code
+% |1.08| extracts to a separate macro \csbc{Etoc at doends}. Earlier code
% did |\global\let\Etoc at next\relax| but we can now give a default |\relax|
% value to |\Etoc at next| with no need of a |\global| prefix.
%
-% |1.08k| extracts |\Etoc at dobegins|.
+% |1.08k| extracts \csbc{Etoc at dobegins}.
% \begin{macrocode}
\def\Etoc at etoccontentsline@ #1{%
\Etoc at doends % separated since 1.08
@@ -7535,20 +8066,20 @@
% \end{macrocode}
% |1.08|:
% \begin{enumerate}
-% \item separates the definition of |\Etoc at prefix| and
-% |\Etoc at contents| from the execution of the |end| parts. And it does
+% \item separates the definition of \csbc{Etoc at prefix} and
+% \csbc{Etoc at 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 at level| rather than |\Etoc at tmp| and thus we can dispense
+% \item has \csbc{Etoc at level} rather than |\Etoc at tmp| and thus we can dispense
% with the |\ifEtoc at part| switch as we will be able to test the equality
-% |\Etoc at level=-1| inside of |\Etoc at lxyz|.
+% |\Etoc at level=-1| inside of \csbc{Etoc at lxyz}.
%
-% \item adds the |\Etoc at global| prefix.
+% \item adds the \csbc{Etoc at global} prefix.
% \end{enumerate}
% |1.08i| uses an |\edef| rather than |\def| with a chain of |\expandafter|.
% \begin{macrocode}
@@ -7567,11 +8098,11 @@
% For the record we don't do |\csname l@#1\endcsname| mainly because
% hyperref patches |\contentsline|.
%
-% The location where |\Etoc at savedcontentsline| is |\let| to
+% The location where \csbc{Etoc at 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 at 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 @@
%
% |1.09e| prepares for LaTeX November 2021 upcoming release
% whose |\contentsline| will always grab four arguments whether or
-% not hyperref is loaded. The |\Etoc at et@hop| definition done at
+% not hyperref is loaded. The \csbc{Etoc at 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,18 +8120,18 @@
% \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 at 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
@@ -7607,41 +8138,41 @@
% |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 at tocdestname}. So |1.07f| adds \csa{etocthelinkedname},
-% \csa{etocthelinkednumber}, \csa{etocthelinkedpage}, \csa{etocthelink}: they
+% \csa{Hy at tocdestname}. So |1.07f| adds \csbc{etocthelinkedname},
+% \csbc{etocthelinkednumber}, \csbc{etocthelinkedpage}, \csbc{etocthelink}: they
% use \csa{hyperlink} with an expanded \csa{Hy at 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 at again} (which appears later in the
+% token in the paramaters. For \csbc{Etoc at again} (which appears later in the
% code), a \csa{@firstofone} construct is however the simplest of all.
%
% END OF MAINLY OBSOLETE COMMENTS
%
-% |1.08| adds |\Etoc at global| prefix (|2015/03/09|).
+% |1.08| adds \csbc{Etoc at 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 at 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 at 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 @@
\Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
}
% \end{macrocode}
-% |1.08| adds the |\Etoc at global|'s.
+% |1.08| adds the \csbc{Etoc at global}'s.
%
% |1.08j| fixes an old |\ifx #1\hyperlink at start| bug.
%
% Potential (but rather exotic) brace removal problems avoided at |1.08n|.
%
-% |1.09g| delays definition of \cs{Etoc at getthepage} to \cs{AtBeginDocument} to
-% check if |hyperref| is at version |7.00u 2022-11-13| or later, as that
-% version replaced \cs{hyper at linkstart} with \cs{protected} macro
-% \cs{Hy at toclinkstart} which furthermore requires one more expansion step.
-% Formerly, the \cs{ifEtoc at hyperref} test was executed via the expansion of
-% \cs{Etoc at getthepage} but now this test is tacitly done only once at begin
-% document to define appropriately \cs{Etoc at getthepage}. Falls back to
-% \cs{Etoc at getthepage@nohyp}.
+% |1.09g| delays definition of \csbc{Etoc at 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 at linkstart} with \csa{protected} macro
+% \csa{Hy at toclinkstart} which furthermore requires one more expansion step.
+% Formerly, the \csbc{ifEtoc at hyperref} test was executed via the expansion of
+% \csbc{Etoc at getthepage} but now this test is tacitly done only once at begin
+% document to define appropriately \csbc{Etoc at getthepage}. Falls back to
+% \csbc{Etoc at getthepage@nohyp}.
% \begin{macrocode}
\def\Etoc at getthepage@nohyp #1\etoc@ {%
\Etoc at global\def\etocthepage {#1}%
@@ -7695,9 +8226,9 @@
% store information whose scope extends beyond the execution of each
% |\contentsline|.
%
-% |1.08| adds the |\Etoc at global|'s.
+% |1.08| adds the \csbc{Etoc at 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 at tocdestname| already expanded.
% \begin{macrocode}
\def\Etoc at getthepage@hyp #1#2#3#4#5\etoc@ {%
@@ -7721,8 +8252,8 @@
%
% |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 at getnb@nohyp at nonbr}, so
-% \csa{etocthename} is certainly not redefined and there is no risk of space
+% numbered entry. We thus jump directly to \csbc{Etoc at getnb@nohyp at 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 @@
\futurelet\Etoc at getnb@token\Etoc at getnb
}
% \end{macrocode}
-% |1.09g| adds an \cs{Etoc at getnb@a} which defaults to \cs{Etoc at 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 at 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 at getnb@nohyp}.
% \begin{macrocode}
\def\Etoc at getnb {%
\ifx\Etoc at getnb@token\bgroup
@@ -7761,7 +8293,7 @@
\fi
}
% \end{macrocode}
-% |1.08| adds the |\Etoc at global|'s.
+% |1.08| adds the \csbc{Etoc at global}'s.
%
% |1.08j| corrects an old |\ifx#1\numberline| into |\ifx\numberline#1|.
%
@@ -7768,7 +8300,7 @@
% |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 at tableofcontents}. Currently \etoc does not yet use \eTeX.
+% in \csbc{Etoc at 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 @@
% |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 at getnb| so here |#1| is guaranteed not braced now.
+% \csbc{Etoc at 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 at getnb@nohyp #1{%
@@ -7815,8 +8347,8 @@
\Etoc at global\let\etocthelinkedname \etocthename
}
% \end{macrocode}
-% \csa{etocthename} and \csa{etocthelinkedname} already defined in
-% \csa{Etoc at lxyz}, no need to update.
+% \csbc{etocthename} and \csbc{etocthelinkedname} already defined in
+% \csbc{Etoc at lxyz}, no need to update.
% \begin{macrocode}
\def\Etoc at getnb@nohyp at nonbr #1\etoc@ {%
\Etoc at global\Etoc at numberfalse
@@ -7826,7 +8358,7 @@
% \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 at getnb@nohyp at nonumberline #1\relax\relax\etoc@ {%
@@ -7843,7 +8375,7 @@
}
% \end{macrocode}
% |1.07n| replaces use of |\toks@| by macro |\Etoc at tmp|. |1.08| adds
-% the |\Etoc at global|'s.
+% the \csbc{Etoc at global}'s.
%
% |1.08j| corrects the old |\ifx#1\numberline| into |\ifx\numberline#1|.
%
@@ -7860,10 +8392,21 @@
% in this branch (hyperref does not brace the hyperlink). So we ignore
% the |\ifEtoc at 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 at getnb@a}
+% defined at begin document has caused the expansion of \csa{Hy at toclinkstart}
+% so we are back to the |<7.00u| situation; and \csa{Hy at toclinkend} is anyhow
+% gobbled as part of |#5| as was formerly \csa{hyper at linkend} so we don't have
+% to worry about that \ctanpkg{hyperref} change.
% \begin{macrocode}
-\def\Etoc at getnb@hyp #1#2#3#4#5#6\etoc@ {%
+\def\Etoc at getnb@hyp #1#2#3#4#5\etoc@ {%
\edef\Etoc at tmp {{#3}}%
\Etoc at global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
\Etoc at global\def\etocthename {#4}% temporary definition
@@ -7874,7 +8417,7 @@
% \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 at getnb@hyp at a {%
@@ -7891,7 +8434,7 @@
\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 at next\Etoc at getnb@nohyp at nonbr
\in@{#1}{\nonumberline}%
@@ -7899,8 +8442,8 @@
% \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 at next\Etoc at getnb@hyp at nonumberline
@@ -7941,7 +8484,7 @@
\expandafter\Etoc at tmp\expandafter{\etocthename}}%
}
% \end{macrocode}
-% |1.08| adds the |\Etoc at global|'s.
+% |1.08| adds the \csbc{Etoc at global}'s.
%
% |1.08n| refactors this but it is still not extremely robust.
%
@@ -7960,8 +8503,8 @@
}
\def\Etoc at getit@nameisbraced {\futurelet\Etoc at getit@token\Etoc at getit }
% \end{macrocode}
-% |1.09g| delays defining \cs{Etoc at 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 at 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 at getit@nohyp #1\hspace#2#3\etoc@ {%
\ifx\relax#2%
@@ -7982,13 +8525,13 @@
}
% \end{macrocode}
% |1.07n| replaces use of |\toks@| by macro |\Etoc at tmp|. |1.08| adds
-% the |\Etoc at global|'s.
+% the \csbc{Etoc at 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 at getnb| also fixed at |1.08j|, and this would have
+% |\ifx| bug in \csbc{Etoc at getnb} also fixed at |1.08j|, and this would have
% overshadowed this one by a real compilation error rather than a missing link
% in the procuced PDF.
%
@@ -7995,11 +8538,14 @@
% |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 at 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 at getit@hyp #1#2#3#4#5#6\etoc@ {%
+\def\Etoc at getit@hyp #1#2#3#4#5\etoc@ {%
\edef\Etoc at tmp {{#3}}%
\Etoc at global\edef\etocthelink ##1{\noexpand\hyperlink \Etoc at tmp{##1}}%
\Etoc at global\def\etocthename {#4}% temporary definition
@@ -8023,8 +8569,8 @@
\expandafter{\expandafter\hyperlink \Etoc at 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 @@
{\ifEtoc at 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 at isfirst\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}
\expandafter\let\expandafter\etocxiffirst\csname etociffirst \endcsname
% \end{macrocode}
-% |1.07j| modifies |\Etoc at readtoc|.
+% |1.07j| modifies \csbc{Etoc at readtoc}.
% \begin{macrocode}
\def\Etoc at readtoc {%
\ifeof \Etoc at tf
@@ -8073,7 +8619,7 @@
\closein\Etoc at tf}}
{\typeout{No file \jobname.toc.}}}
% \end{macrocode}
-% 1.07d: parskip and |\@nobreakfalse| stuff moved to |\Etoc at tableofcontents|
+% 1.07d: parskip and |\@nobreakfalse| stuff moved to \csbc{Etoc at tableofcontents}
% \begin{macrocode}
\def\Etoc at openouttoc{%
\ifEtoc at hyperref
@@ -8095,11 +8641,11 @@
% \end{macrocode}
% |1.08| has a new way to handle |\Etoc at standardtrue|.
%
-% Also the expansion of |\Etoc at levelist| is moved to inside
-% |\Etoc at tableofcontents| as set-up by |\etocsettocstyle|. This opens up
+% Also the expansion of \csbc{Etoc at levellist} is moved to inside
+% \csbc{Etoc at 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 at toctoc{%
@@ -8128,19 +8674,19 @@
% 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 at notactive} test as |\ifnum| can
-% be positive only once anyhow; although the \csa{ifEtoc at notactive} boolean
+% |2015/04/16|: |1.08e| removes a \csbc{ifEtoc at notactive} test as |\ifnum| can
+% be positive only once anyhow; although the \csbc{ifEtoc at 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 at global|'s for |\Etoc at localtop| by
+% I replace (|1.08e|) the \csbc{Etoc at global}'s for \csa{Etoc at 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 at localtop} \emph{minus one}. Memo: \cs{etoclocaltop} has only
+% Attention! |1.09| defines a public \csbc{etoclocaltop} in replacement of old
+% \csa{Etoc at 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 @@
% \end{macrocode}
% |2015/03/16|: |1.08e| tests if a local table of contents turns out empty.
% The \csa{Etoc at 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 at 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 at 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 at tableofcontents} as well. And it also allowed
-% improvements to \csa{Etoc at localtableofcontents}.
+% tokens from \csbc{Etoc at tableofcontents} as well. And it also allowed
+% improvements to \csbc{Etoc at localtableofcontents}.
%
% Note: (|1.08i 2016/09/29|) the code has to handle both local and total toc.
-% Hence the flag |\ifEtoc at notactive| has to be set prior to it. For a global
-% toc, the |\Etoc at tocid| was set to |\z@|, and the |\ifnum| in
-% |\etoc at startlocaltoc| did always fail, but I now prefer to simply nullify
-% the |\etoc at startlocaltoc|. As its default fallback is |\@gobble| I simply
-% test here for the |localtoc| flag. The |\Etoc at tocid| will be undefined for a
+% Hence the flag \csbc{ifEtoc at notactive} has to be set prior to it. For a global
+% toc, the \csbc{Etoc at tocid} was set to |\z@|, and the |\ifnum| in
+% \csbc{etoc at startlocaltoc} did always fail, but I now prefer to simply nullify
+% the \csbc{etoc at startlocaltoc}. As its default fallback is |\@gobble| I simply
+% test here for the \csbc{ifEtoc at localtoc} flag. The \csbc{Etoc at 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 at 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 at level} where we last stood.
% The initialization |\global\let\Etoc at level\Etoc at minf| is thus needed in case
-% the |.toc| file contains an |\etoc at startlocaltoc| before any
+% the |.toc| file contains an \csbc{etoc at startlocaltoc} before any
% |\contentsline|.
%
% |1.08i| has two |testingcontentsline| macros, one for local, one for global.
%
-% |1.09| renames the \cs{Etoc at localtop} which was used here to a public
-% \cs{etoclocaltop} to make it usable in \cs{etocsettocstyle}.
+% |1.09| renames the \csa{Etoc at localtop} which was used here to a public
+% \csbc{etoclocaltop} to make it usable in \csbc{etocsettocstyle}.
% \begin{macrocode}
\def\Etoc at setemptytocbool {%
\global\Etoc at emptytoctrue
@@ -8240,6 +8786,10 @@
\let\contentsline\Etoc at testingcontentsline
\fi
\Etoc at storetocdepth
+% \end{macrocode}
+% |1.09i| fixes a bug arising when document has used \csbc{etocsetlocaltop.toc}.
+% \begin{macrocode}
+ \let\Etoc at setlocaltop@doends at dobegins\@empty
\the\Etoc at toctoks
\Etoc at restoretocdepth
\endgroup
@@ -8255,13 +8805,13 @@
\else
\global\expandafter\let\expandafter\Etoc at level\csname Etoc@#1@@\endcsname
% \end{macrocode}
-% |\ifEtoc at notactive| set to False by |\etoc at startlocaltoc| with right id. It
+% |\ifEtoc at notactive| set to False by \csbc{etoc at 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 at localtop| will have been
-% initialized by |\etoc@@startlocaltoc| as |\ifEtoc at notactive| flag can be
+% Set \csbc{ifEtoc at stoptoc} flag afterwards in all cases. \csa{Etoc at localtop} will have been
+% initialized by \csbc{etoc@@startlocaltoc} as \csbc{ifEtoc at notactive} flag can be
% false only then.
%
-% |1.09| renamed the \cs{Etoc at localtop} as formerly here to \cs{etoclocaltop}
+% |1.09| renamed the \csa{Etoc at localtop} as formerly here to \csbc{etoclocaltop}
% and adds support for \localtocwrdp.
% \begin{macrocode}
\ifEtoc at notactive
@@ -8294,43 +8844,43 @@
}
% \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 at startlocaltoc} (bug
+% line at the end after the replacement text of \csbc{etoc at startlocaltoc} (bug
% dating back to |1.03 2012/11/23|). I didn't see it due to the originally
% badly formatted source of |\Etoc at next|.
%
-% |2015/03/16|: |1.08e| lets \csa{localtableofcontents} do a first scan of the
-% |.toc| file (as stored in |\Etoc at 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 at 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 at startlocaltoc}. Notice though that if
+% for \csa{contentsline} and \csbc{etoc at 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 at testingcontentsline}) are made globally, I think this is the best
+% \csbc{Etoc at 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 at tocwithid| discriminates between a \localtoc and a
+% The flag \csbc{ifEtoc at 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 at tocwithid| is
+% now be with |foo| a label of a local TOC. As a result \csbc{ifEtoc at 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 at tocid| is |0|. \etoc used to issue a warning to
+% in the |.aux| file, \csbc{Etoc at 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
@@ -8337,7 +8887,7 @@
% 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,15 +8902,15 @@
% |1.08i-2016/09/29| now does |\Etoc at 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 at tocid|, but simply leaves |\etoc at startlocaltoc| to its
-% default |\@gobble|. The |\Etoc at 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 at tocid}, but simply leaves \csbc{etoc at startlocaltoc} to its
+% default |\@gobble|. The \csa{Etoc at 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 at etoccontentsline| is more efficient now.
+% \csa{Etoc at stoptoctrue} flag, the \csbc{Etoc at etoccontentsline} is more efficient now.
%
-% The |\Etoc at notactive| flag needs to be set before calling
-% |\Etoc at setemptytocbool|.
+% The \csbc{ifEtoc at notactive} flag needs to be set before calling
+% \csbc{Etoc at 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
@@ -8367,7 +8917,7 @@
% |\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 @@
\fi
\global\Etoc at notactivetrue
% \end{macrocode}
-% |1.08i|'s |\Etoc at setemptytocbool| now checks |localtoc| flag.
+% |1.08i|'s \csbc{Etoc at setemptytocbool} now checks |localtoc| flag.
% \begin{macrocode}
\ifEtoc at checksemptiness
\Etoc at setemptytocbool
@@ -8422,15 +8972,15 @@
\global\Etoc at stoptocfalse
\global\Etoc at notactivetrue
% \end{macrocode}
-% Prior to |1.09| a \cs{Etoc at localtop} was reset here. This has now been
-% moved to \cs{Etoc at tableofcontents} and \cs{Etoc at localtop} replaced by a
-% public \cs{etoclocaltop} usable in line styles, and in \cs{etocsettocstyle}
+% Prior to |1.09| a \csa{Etoc at localtop} was reset here. This has now been
+% moved to \csbc{Etoc at tableofcontents} and \csa{Etoc at 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 at startlocaltoc##1%
{\noexpand\etoc@@startlocaltoc{##1}{\Etoc at tocid}}%
@@ -8442,8 +8992,8 @@
\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 at localtocdepth\c at tocdepth % 1.09
@@ -8450,7 +9000,7 @@
}% \Etoc at localtableofcontents
% \end{macrocode}
% |2013/03/07|: I discover a \csa{@namedef} trick to construct the
-% \csa{Etoc at again} space delimited macro:\\
+% \csbc{Etoc at again} space delimited macro:\\
% | \@namedef {Etoc at again} {...stuff...}|\\
% Original version was (copied from analogous stuff in |source2e|):\\
% | {\def\1{\Etoc at again}\expandafter\gdef\1 {...stuff...}}|\\
@@ -8468,9 +9018,9 @@
%
% 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 at tableofcontents}.
+% from \csbc{Etoc at tableofcontents}.
%
-% The syntax \csa{localtableofcontents}|\ref{foo}| is now accepted.
+% The syntax \csbc{localtableofcontents}|\ref{foo}| is now accepted.
% \begin{macrocode}
\def\Etoc at dothis #1#2\etoc@ {\fi #1}
\def\Etoc at t@bleofcontents{%
@@ -8478,23 +9028,23 @@
\ifx\Etoc at nexttoken\label\Etoc at dothis{\expandafter\Etoc at label\@gobble}\fi
\ifx\Etoc at nexttoken\@sptoken\Etoc at dothis{\Etoc at again}\fi
% \end{macrocode}
-% |\Etoc at ref| will hand over directly to |\Etoc at localtableofcontents|.
+% \csbc{Etoc at ref} will hand over directly to \csbc{Etoc at localtableofcontents}.
% Argument will be (or rather expand to) zero if the reference is non-existent
-% yet. There was an |\Etoc at tocwithidfalse| flag which |1.08i| suppresses as it
+% yet. There was an \csa{Etoc at tocwithidfalse} flag which |1.08i| suppresses as it
% is not used afterwards (since |1.08e| I think.)
% \begin{macrocode}
\ifx\Etoc at nexttoken\ref\Etoc at dothis{\expandafter\Etoc at 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 at tocwithid\Etoc at dothis{\Etoc at localtableofcontents{\c at etoc@tocid}}\fi
% \end{macrocode}
% From now on we are handling a global TOC. Earlier, I used the trick of
-% setting |\Etoc at tocid| to |\z@| for compatibility with expansion of
-% |\etoc at startlocaltoc|. But since |1.08i| |\etoc at startlocaltoc| is left to be
-% |\@gobble|, and |\Etoc at tocid| is never tested. We don't need to set the
-% |notactive| flag as now |\Etoc at testingcontentsline| tests first the
-% |localtoc| flag (was already the case of |\Etoc at etoccontentsline|). I change
+% setting \csbc{Etoc at tocid} to |\z@| for compatibility with expansion of
+% \csbc{etoc at startlocaltoc}. But since |1.08i| \csbc{etoc at startlocaltoc} is left to be
+% |\@gobble|, and \csbc{Etoc at tocid} is never tested. We don't need to set the
+% \csbc{ifEtoc at notactive} flag as now \csbc{Etoc at testingcontentsline} tests first the
+% \csbc{ifEtoc at localtoc} flag (was already the case of \csbc{Etoc at etoccontentsline}). I change
% a bit the style of conditionals here for clarity of code.
% \begin{macrocode}
\global\Etoc at emptytocfalse\ifEtoc at checksemptiness\Etoc at setemptytocbool\fi
@@ -8518,9 +9068,9 @@
% 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 at startlocaltoc|. In
-% |\Etoc at table@fcontents| case it remains to be seen if a |\ref| follows which
-% could turn the TOC into a local one. Handled by |\Etoc at t@bleofcontents|.
+% |1.08i| moves elsewhere definition of \csbc{etoc at startlocaltoc}. In
+% \csbc{Etoc at 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 at t@bleofcontents}.
% \begin{macrocode}
\def\Etoc at table@fcontents{%
\refstepcounter{etoc at tocid}%
@@ -8532,10 +9082,10 @@
\Etoc at tocwithidtrue
\futurelet\Etoc at nexttoken\Etoc at 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,7 +9094,7 @@
% 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 at tocdepthset} is for \cs{etocsetnexttocdepth} mechanism.
+% The \csbc{Etoc at tocdepthset} is for \csbc{etocsetnexttocdepth} mechanism.
% \begin{macrocode}
\def\etoctableofcontents{%
\Etoc at openouttoc
@@ -8551,18 +9101,18 @@
\Etoc at tocdepthset % new with 1.08h (\etocsetnexttocdepth)
\begingroup % closed in \Etoc at t@bleofcontents or \Etoc at localtableofcontents
% \end{macrocode}
-% Prior to its release |1.4c|, |tableof| added a group pair via |\tof at begin|
+% Prior to its release |1.4c|, \ctanpkg{tableof} added a group pair via |\tof at begin|
% and |\tof at finish|. This was removed at |1.4c|. So no need to do anything now
% here about silencing |\tof at begingroup| and |\tof at 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 at startlocaltoc| from here. It is done
-% in |\Etoc at localtableofcontents| or uses its default of |\@gobble|.
+% |1.08i| removes definition of \csbc{etoc at startlocaltoc} from here. It is done
+% in \csbc{Etoc at 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 at aftertitlehook\@empty\Etoc at table@fcontents}
@@ -8579,7 +9129,7 @@
\Etoc at tocdepthset % new with 1.08h (\etocsetnexttocdepth)
\begingroup % closed in \Etoc at t@bleofcontents or \Etoc at 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 at aftertitlehook\@empty\Etoc at localtable@fcontents}
@@ -8588,11 +9138,11 @@
% \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 @@
}% \localtableofcontentswithrelativedepth
\let\Etoc at localtocdepth\c at tocdepth
% \end{macrocode}
-% |1.08| moves earlier the definitions of |\Etoc at savedcontentsline| as
-% well as |\Etoc at 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 at savedcontentsline} as
+% well as \csbc{Etoc at 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 at gobbletoetoc@| for the gobbling case.
+% \csbc{Etoc at gobbletoetoc@} for the gobbling case.
%
% Also, |1.08| modifies the code to do only expandable things after
-% |\Etoc at toctoc|, in order to allow opening of an alignment in the first
+% \csbc{Etoc at 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 at toctoc|. I
+% |\Etoc@@next| initially set to relax after the first \csbc{Etoc at 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 at toctoc| after the |\fi\fi\fi|. I could define an |\afterfififi|
+% \csbc{Etoc at 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 at par| to \csa{Etoc at tableofcontents}. This was needed
+% |1.08e| moved the \csbc{Etoc at par} to \csbc{Etoc at 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 at par| to before |\etocbeforetitlehook|, not after.
+% |1.08g| moves \csbc{Etoc at par} to before \csbc{etocbeforetitlehook}, not after.
% \begin{macrocode}
\long\def\Etoc at gobbletoetoc@ #1\etoc@ {}
\newcommand\etocsettocstyle[2]{%
@@ -8646,7 +9196,7 @@
\ifEtoc at standard
\else % moved here from \Etoc at toctoc (1.08)
% \end{macrocode}
-% Prior to |1.08|, this was done in |\Etoc at toctoc|
+% Prior to |1.08|, this was done in \csbc{Etoc at 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 @@
% \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 @@
\ifEtoc at parskip\parskip\z at skip\fi %1.07d
\Etoc at aftertitlehook
% \end{macrocode}
-% |1.09| has replaced former \cs{Etoc at localtop} (\emph{minus one}) by
-% \cs{etoclocaltop}. Under checksemptinesstrue regime its value is already
+% |1.09| has replaced former \csa{Etoc at 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 @@
#2\@nobreakfalse % 1.07d: \@nobreakfalse moved here
\Etoc at restoretocdepth % 1.07g. moved here from before #2 by 1.08
% \end{macrocode}
-% |\contentsline| was set to |\Etoc at etoccontentsline| by a non-global |\let|,
+% |\contentsline| was set to \csbc{Etoc at 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 at finish| then does a global
% restore of |\contentsline|, but it will be to the \etoc set
% value. |\tof at 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 at 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 at 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 at global\global
@@ -8720,10 +9270,10 @@
}% end of \Etoc at tableofcontents definition by \etocsettocstyle
}
% \end{macrocode}
-% |1.08| hacks the begin parts to update therein the |\ifEtoc at isfirst| flag
+% |1.08| hacks the begin parts to update therein the \csbc{ifEtoc at isfirst} flag
% (|2015/03/09|).
%
-% |1.08c| removes unneeded |\long| from the |\def|'s inside |\etoc at setstyle|
+% |1.08c| removes unneeded |\long| from the |\def|'s inside \csbc{etoc at setstyle}
% (|2015/03/29|).
% \begin{macrocode}
\def\etocsetstyle{\Etoc at standardfalse\etoc at setstyle}
@@ -8738,13 +9288,6 @@
\expandafter\def
\csname Etoc at 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 @@
\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 @@
\def\etocbookname {Book}
% \end{macrocode}
% placeholder for comments
-% The macro \csa{etocdefaultlines} was initially called \csa{etoctoclines}. Now
-% \csa{etoctoclines} just does \csa{Etoc at standardfalse}.
+% The macro \csbc{etocdefaultlines} was initially called \csbc{etoctoclines}. Now
+% \csbc{etoctoclines} just does \csa{Etoc at 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 at standardfalse %
@@ -8945,8 +9488,8 @@
\etoc at 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 @@
\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 @@
{\end{multicols}}%
\addvspace{\etocbelowtocskip}}}
% \end{macrocode}
-% |1.07k| defines |\Etoc at relax| and |\etocbkgcolorcmd| as |\long|: the user
+% |1.07k| defines \csbc{Etoc at 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 @@
\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 at aftertitlehook} internal mechanism to help recognize if we are
+% \csbc{Etoc at 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 at addsuitablecontentsline{\addcontentsline {toc}{#1}{#2}}%
@@ -9273,9 +9816,9 @@
\ifx\Etoc at 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 @@
\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 @@
% \end{macrocode}
% |1.09f| adds this \csa{list at 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 at fname{\listofname~toc}}%
@@ -9347,7 +9890,7 @@
{%
% \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 at end@toc at file},
@@ -9360,7 +9903,7 @@
%
% \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 at end@toc at file} to end of
% toc file, which may thus end up being executed multiple times.
% \end{itemize}
@@ -9423,7 +9966,7 @@
\Etoc at 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 @@
\renewcommand*\etocstandarddisplaystyle{\etocmemoirstyle}
\Etoc at 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 at cftnctoc| boolean.
% \begin{macrocode}
\def\etoctocloftstyle {%
@@ -9502,7 +10045,7 @@
\DeclareRobustCommand*{\etoctoccontentsline}
{\@ifstar{\Etoc at addcontentsline@}{\Etoc at addtocontents}}
% \end{macrocode}
-% |1.09f| adds \csa{etocimmediatetoccontentsline}.
+% |1.09f| adds \csbc{etocimmediatetoccontentsline}.
% \begin{macrocode}
\def\Etoc at addtocontents@immediately#1#2{%
\begingroup
@@ -9522,31 +10065,31 @@
{\@ifstar{\Etoc at addcontentsline@@immediately}{\Etoc at 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 at startlocaltoc\@gobble| in case |etoc| is not detected, I should
-% possibly have done that long ago (like I did in |tableof|).
+% |\let\etoc at 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 at settocdepth|. So I now use lowercase and add a temporary line for
+% \csa{Etoc at 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 at settocdepth| done at the start
+% In |1.07i| the deactivation of \csbc{etoc at 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 at settocdepth|, but I changed that later.
+% after \csbc{etoc at settocdepth}, but I changed that later.
%
-% |1.09| renames \cs{Etoc at resettocdepth} to \cs{Etoc at restoretocdepth}.
+% |1.09| renames \csa{Etoc at resettocdepth} to \csbc{Etoc at restoretocdepth}.
% \begin{macrocode}
\def\Etoc at storetocdepth {\global\c at etoc@tocdepth\c at tocdepth }
\def\Etoc at restoretocdepth {\global\c at tocdepth\c at etoc@tocdepth }
@@ -9574,7 +10117,7 @@
{\protect\etoc at 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 at set@toctocdepth at immediately}
\def\Etoc at set@toctocdepth at immediately #1{%
@@ -9594,16 +10137,16 @@
% |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 at depthtag } % \etocdepthtag.toc {name}
\def\Etoc at depthtag #1{\addtocontents {toc}{\protect\etoc at 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 @@
{\@namedef{Etoc at 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 @@
}%
}%
% \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 at tocdepthset} will expand.
+% \csbc{etocsetnexttocdepth} is determined at time of next toc only, when
+% \csbc{Etoc at tocdepthset} will expand.
% \begin{macrocode}
\def\invisibletableofcontents {\etocsetnexttocdepth {-3}\tableofcontents }%
\def\invisiblelocaltableofcontents
@@ -9718,7 +10261,7 @@
{\protect\etoc at 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 at set@localtop at immediately}%
\def\Etoc at set@localtop at immediately #1{%
@@ -9734,6 +10277,10 @@
\endgroup
}%
}%
+% \end{macrocode}
+% |1.09i| would like to rename this to \csa{Etoc at setlocaltop}, for
+% consistency with internal macros, but too late it is already in user |.toc| files.
+% \begin{macrocode}
\def\etoc at setlocaltop #1{%
\global\let\Etoc at level #1%
\Etoc at skipthisonefalse
@@ -9748,7 +10295,7 @@
\Etoc at skipthisonetrue
\else
% \end{macrocode}
-% Attention, |1.09| has \cs{etoclocaltop} which is former \cs{Etoc at localtop}
+% Attention, |1.09| has \csbc{etoclocaltop} which is former \csa{Etoc at 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,7 +10307,7 @@
\fi
\fi
\fi
- \let\Etoc at next\@gobble
+ \let\Etoc at next\@empty
\ifEtoc at skipthisone
\else
\ifnum\c at tocdepth<\Etoc at level
@@ -9767,17 +10314,17 @@
\else
\ifEtoc at standard
\else
- \let\Etoc at next\@firstofone
+ \let\Etoc at next\Etoc at setlocaltop@doends at dobegins
\fi
\fi
\fi
% \end{macrocode}
% At |1.09f| the |\global\Etoc at 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 @@
% 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 at 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 at setlocaltop@doends at dobegins} which will be made a no-op
+% in emptiness-checking contexts. Also, the code lines above have been edited
+% now that \csa{Etoc at next} here is not followed by tokens within a brace pair.
% \begin{macrocode}
- \Etoc at next{\Etoc at doends\Etoc at dobegins\global\Etoc at skipprefixfalse}%
+ \Etoc at next
}%
+\def\Etoc at setlocaltop@doends at dobegins
+ {\Etoc at doends\Etoc at dobegins\global\Etoc at 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 at settocdepth|.
+% without etoc. In |1.07i| use of |\@gobble| for \csbc{etoc at settocdepth}.
% \begin{macrocode}
\addtocontents {toc}{\protect\@ifundefined{etoctocstyle}%
{\let\protect\etoc at startlocaltoc\protect\@gobble
Modified: trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty 2022-11-21 20:48:35 UTC (rev 65067)
+++ trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty 2022-11-21 20:49:15 UTC (rev 65068)
@@ -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 at et@hop#1#2#3#4{#2{#3}{#4}#1}%
\long\def\Etoc at gobblefourorthree#1#2#3{}%
}%
-\@ifl at t@r\fmtversion{2021/11/15}%
+\@ifl at t@r\fmtversion{2020/10/01}%
{%
\def\Etoc at et@hop#1#2#3#4#5{#2{#3}{#4}{#5}#1}%
\let\Etoc at gobblefourorthree\@gobblefour
@@ -488,7 +488,7 @@
\fi
\Etoc at global\let\etocthelinkedname \etocthename
}
-\def\Etoc at getnb@hyp #1#2#3#4#5#6\etoc@ {%
+\def\Etoc at getnb@hyp #1#2#3#4#5\etoc@ {%
\edef\Etoc at tmp {{#3}}%
\Etoc at global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
\Etoc at global\def\etocthename {#4}% temporary definition
@@ -571,7 +571,7 @@
\fi
\Etoc at global\let\etocthelinkedname\etocthename
}
-\def\Etoc at getit@hyp #1#2#3#4#5#6\etoc@ {%
+\def\Etoc at getit@hyp #1#2#3#4#5\etoc@ {%
\edef\Etoc at tmp {{#3}}%
\Etoc at global\edef\etocthelink ##1{\noexpand\hyperlink \Etoc at tmp{##1}}%
\Etoc at global\def\etocthename {#4}% temporary definition
@@ -710,6 +710,7 @@
\let\contentsline\Etoc at testingcontentsline
\fi
\Etoc at storetocdepth
+ \let\Etoc at setlocaltop@doends at dobegins\@empty
\the\Etoc at toctoks
\Etoc at restoretocdepth
\endgroup
@@ -1646,7 +1647,7 @@
\fi
\fi
\fi
- \let\Etoc at next\@gobble
+ \let\Etoc at next\@empty
\ifEtoc at skipthisone
\else
\ifnum\c at tocdepth<\Etoc at level
@@ -1653,12 +1654,14 @@
\else
\ifEtoc at standard
\else
- \let\Etoc at next\@firstofone
+ \let\Etoc at next\Etoc at setlocaltop@doends at dobegins
\fi
\fi
\fi
- \Etoc at next{\Etoc at doends\Etoc at dobegins\global\Etoc at skipprefixfalse}%
+ \Etoc at next
}%
+\def\Etoc at setlocaltop@doends at dobegins
+ {\Etoc at doends\Etoc at dobegins\global\Etoc at skipprefixfalse}%
\addtocontents {toc}{\protect\@ifundefined{etoctocstyle}%
{\let\protect\etoc at startlocaltoc\protect\@gobble
\let\protect\etoc at settocdepth\protect\@gobble
More information about the tex-live-commits
mailing list.