texlive[65603] Master/texmf-dist: etoc (21jan23)
commits+karl at tug.org
commits+karl at tug.org
Sat Jan 21 21:59:29 CET 2023
Revision: 65603
http://tug.org/svn/texlive?view=revision&revision=65603
Author: karl
Date: 2023-01-21 21:59:28 +0100 (Sat, 21 Jan 2023)
Log Message:
-----------
etoc (21jan23)
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-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-10.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
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
Modified: trunk/Master/texmf-dist/doc/latex/etoc/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/README.md 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/README.md 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
<!-- -->
- Source: etoc.dtx (1.1b)
+ Source: etoc.dtx (1.1c)
Author: Jean-Francois Burnol
Info: Completely customisable TOCs
License: LPPL 1.3c
@@ -97,6 +97,31 @@
RECENT CHANGES
==============
+1.1c \[2023/01/20\]
+-------------------
+
+Fix a brace removal bug in the construction of `\etocname`. It
+remained without visible effects in documents using `hyperref` and
+default settings, thanks to the hyperlink wrapper, but e.g.
+`\section{{\color{blue}Blue}}` in a document not using `hyperref`,
+and not using etoc only in "compatibility mode", could cause a
+color leak in the table of contents.
+
+With the KOMA-script numberline toc feature, unnumbered entries in
+TOCs typeset via etoc user-defined or package provided line styles
+but using compatibility mode for the global display style were
+(knowingly) considered to be numbered with an empty number. They
+are now considered by `\etocifnumbered` to be not numbered and the
+empty `\etocnumber` will carry no hyperlink.
+
+Fix a 1.1a regression in the context of KOMA-script unnumbered TOC
+entries: `\etocthelinkedname` could lose its hyperlink.
+
+Continue internal trimming of old code branches which became
+un-needed after the 1.1a refactoring. Add relatively decent
+code comments to accompany the 1.1a-c refactoring. Update
+warning messages to use more consistently LaTeX's templates.
+
1.1b \[2023/01/15\]
-------------------
@@ -117,7 +142,7 @@
With this release etoc decides earlier according to
[hyperref](https://ctan.org/pkg/hyperref)
linktoc status whether section names and page numbers
-should be hyperlinked, and add links itself via `\hyperlink`.
+should be hyperlinked, and adds links itself via `\hyperlink`.
etoc is thus now immune to the details of how hyperref patches
the `\contentsline` command, which is not executed anymore.
Overall, the code is greatly simplified.
@@ -130,7 +155,9 @@
commands. They are not needed as `\l at section` et al. are with this
release left unmodified during the table of contents typesetting.
-LaTeX kernel from `2020/10/01` or later is required.
+LaTeX kernel from `2020/10/01` or later is required (to allow
+assuming the `\contentsline` entries in the TOC file always have
+four arguments).
1.09i \[2022/11/21\]
--------------------
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 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etoc.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,12 +1,14 @@
%%
%% Package: etoc
-%% Version: 1.1b
+%% Version: 1.1c
%% License: LPPL 1.3c
%% Copyright (C) 2012-2023 Jean-Francois Burnol
%% <jfbu at free dot fr>
-%% run pdflatex thrice on this file etoc.tex to produce the documentation
-%% etoc.pdf, with source code included.
-%%
+%% To produce the documentation etoc.pdf with source code included:
+%% latexmk -pdf etoc.tex
+%% Or
+%% pdflatex etoc.tex
+%% enough times. For customizations see comments and classe options below.
\chardef\Withdvipdfmx 0 % replace 0 by 1 for using latex+dvipdfmx
\chardef\NoSourceCode 0 % replace 0 by 1 for the doc *without* the source code
\NeedsTeXFormat{LaTeX2e}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-01.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begingroup\parindent 0pt \parfillskip 0pt \leftskip 0cm \rightskip 1cm
\etocsetstyle {section}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-02.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begingroup
\newcommand*{\DotsAndPage}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-03.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begingroup % we start a group to keep the style changes local
\newlength{\tocleftmargin} \setlength{\tocleftmargin}{5cm}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-04.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begin{figure}[ht!]
\centering
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-05.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\makeatletter
\newcommand{\MyStandardTOC}{%
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-06.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\makeatletter
\newcommand*{\MyQuasiStandardTOC}[1]{%
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-07.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
% it will be easy to globally shift the TOC horizontally if needed
\def\TOCleftmargin {0pt}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-08.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\makeatletter
\newcommand*\TOClocalstyle {%
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-09.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\etocdefaultlines
\begingroup
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-10.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begin{figure}[htbp!]\centering
\colorlet{subsecnum}{black}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-11.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begingroup
\newsavebox{\forsubsections}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-12.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
< in the preamble >
\newcounter{visibletoc}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-13.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\etocsetnexttocdepth{2} % sections are at level 1 and will show up
\begingroup
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-14.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
% \newtoks\treetok % put this (uncommented) preferably in the preamble
% \newtoks\tmptok % (idem)
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-15.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
% \newtoks\treetok % put this (uncommented) preferably in the preamble
% \newtoks\sectiontok
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-16.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begingroup
% \newtoks\treetok % done in preamble
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-17.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begingroup
\etocglobaldefs % necessary for \etocname etc... to survive &
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-18.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begin{center}
\etocsetstyle{section}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-19.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\makeatletter
\newcommand*\TOCcompute at numwidths [2]{% #1=empty/"local", #2=minimal indent
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-20.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\etocsetstyle{section}
{\begin{enumerate}}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-21.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\etocsettocdepth {subsubsection} % set the initial tocdepth
\etocdefaultlines % use the package default line styles. At this early stage in
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-22.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape
\fbox{\parbox{.6\linewidth}{
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-23.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\begingroup
\definecolor{subsecnum}{RGB}{13,151,225}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-24.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\newsavebox\firstnamei \newsavebox\firstnumberi
\newsavebox\lastnamei \newsavebox\lastnumberi
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-25.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\makeatletter
\newcommand*\firstsubname {} \newcommand*\lastsubname {}
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-26.tex'
%% generated by the `filecontentsdef' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\etocsetnexttocdepth {all}
\begingroup
Modified: trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex 2023-01-21 20:59:28 UTC (rev 65603)
@@ -1,6 +1,6 @@
%% LaTeX2e file `etocsnippet-27.tex'
%% generated by the `filecontentshere' environment
-%% from source `etoc' on 2023/01/16.
+%% from source `etoc' on 2023/01/21.
%%
\newtoks\toctabletok
\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2
Modified: trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/source/latex/etoc/etoc.dtx 2023-01-21 20:59:28 UTC (rev 65603)
@@ -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: <15-01-2023 at 11:56:19 CET>}%
+\def\etocdtxtimestamp {Time-stamp: <20-01-2023 at 21:03:03 CET>}%
%</none>
%<*!readme>
%%
%% Package: etoc
-%% Version: 1.1b
+%% Version: 1.1c
%% License: LPPL 1.3c
%% Copyright (C) 2012-2023 Jean-Francois Burnol
%% <jfbu at free dot fr>
%</!readme>
%<*none>
-\def\etocpkgdate {2023/01/15}
-\def\etocdocdate {2023/01/15}
-\def\etocpkgversion {1.1b}
+\def\etocpkgdate {2023/01/20}
+\def\etocdocdate {2023/01/20}
+\def\etocpkgversion {1.1c}
\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.1b
+% Version: 1.1c
% License: LPPL 1.3c
% Copyright (C) 2012-2023 Jean-Francois Burnol <jfbu at free dot fr>
%
@@ -60,7 +60,7 @@
%<*readme>
<!-- -->
- Source: etoc.dtx (1.1b)
+ Source: etoc.dtx (1.1c)
Author: Jean-Francois Burnol
Info: Completely customisable TOCs
License: LPPL 1.3c
@@ -157,6 +157,31 @@
RECENT CHANGES
==============
+1.1c \[2023/01/20\]
+-------------------
+
+Fix a brace removal bug in the construction of `\etocname`. It
+remained without visible effects in documents using `hyperref` and
+default settings, thanks to the hyperlink wrapper, but e.g.
+`\section{{\color{blue}Blue}}` in a document not using `hyperref`,
+and not using etoc only in "compatibility mode", could cause a
+color leak in the table of contents.
+
+With the KOMA-script numberline toc feature, unnumbered entries in
+TOCs typeset via etoc user-defined or package provided line styles
+but using compatibility mode for the global display style were
+(knowingly) considered to be numbered with an empty number. They
+are now considered by `\etocifnumbered` to be not numbered and the
+empty `\etocnumber` will carry no hyperlink.
+
+Fix a 1.1a regression in the context of KOMA-script unnumbered TOC
+entries: `\etocthelinkedname` could lose its hyperlink.
+
+Continue internal trimming of old code branches which became
+un-needed after the 1.1a refactoring. Add relatively decent
+code comments to accompany the 1.1a-c refactoring. Update
+warning messages to use more consistently LaTeX's templates.
+
1.1b \[2023/01/15\]
-------------------
@@ -177,7 +202,7 @@
With this release etoc decides earlier according to
[hyperref](https://ctan.org/pkg/hyperref)
linktoc status whether section names and page numbers
-should be hyperlinked, and add links itself via `\hyperlink`.
+should be hyperlinked, and adds links itself via `\hyperlink`.
etoc is thus now immune to the details of how hyperref patches
the `\contentsline` command, which is not executed anymore.
Overall, the code is greatly simplified.
@@ -190,7 +215,9 @@
commands. They are not needed as `\l at section` et al. are with this
release left unmodified during the table of contents typesetting.
-LaTeX kernel from `2020/10/01` or later is required.
+LaTeX kernel from `2020/10/01` or later is required (to allow
+assuming the `\contentsline` entries in the TOC file always have
+four arguments).
1.09i \[2022/11/21\]
--------------------
@@ -252,9 +279,11 @@
mechanism.
%</readme>
%<*tex>-------------------------------------------------------------------------
-%% run pdflatex thrice on this file etoc.tex to produce the documentation
-%% etoc.pdf, with source code included.
-%%
+%% To produce the documentation etoc.pdf with source code included:
+%% latexmk -pdf etoc.tex
+%% Or
+%% pdflatex etoc.tex
+%% enough times. For customizations see comments and classe options below.
\chardef\Withdvipdfmx 0 % replace 0 by 1 for using latex+dvipdfmx
\chardef\NoSourceCode 0 % replace 0 by 1 for the doc *without* the source code
\NeedsTeXFormat{LaTeX2e}
@@ -433,17 +462,6 @@
\pdfstringdefDisableCommands{\def\cs#1{\textbackslash\detokenize{#1}}}%
}%
% As I have not loaded hyperref yet I must delay it to AtBeginDocument.
-%%%%%%%%
-%% This is xint.dtx only stuff, not used here
-%% % Late May, early June 2022 I added to my custom \verb automated detection
-%% % of potential hyperlinks. So I decided to replace \cs ltxdoc definition
-%% % by suitable \verb usage. It is not important to be efficient here,
-%% % I can leave some \expandafter, in fact there are a handful of uses.
-%% \DeclareRobustCommand\cs[1]{\expandafter\verb\expandafter~\bslash#1~}
-%% % As my \verb does a verbatimizing \scantokens I don't need to worry
-%% % here about active characters but I need in the PDF string, hence
-%% % the \detokenize above.
-%%%%%%%%
\providecommand\marg[1]{%
{\ttfamily\char`\{}\meta{#1}{\ttfamily\char`\}}}
\providecommand\oarg[1]{%
@@ -503,16 +521,6 @@
% 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 }
% Some custom \sectionmark to get headers more to my taste.
% But it is hard to find algorithm giving satisfaction in all cases.
@@ -571,18 +579,6 @@
% uniformisé finalement, avec quelques exceptions, pour dtx du 3 déc 2013
\def\MacroFont{\ttfamily\small\hyphenchar\font45 \baselineskip11pt\relax}
-% ATTENTION: (avec doc.sty ou les classes scrdoc ou ltxdoc)
-%
-% - l'environnement macrocode se fait avec \macro at font qui est le
-% \MacroFont du \begin{document}.
-%
-% - les environnements verbatim utilisent le \MacroFont courant.
-%
-% - \verb utilise un \ttfamily !! et non pas \verbatim at font que l'on
-% peut customiser.
-%
-% - (9 mars 2015) il ne faut PAS commencer des macrocode directement après
-% un \section, il faut un paragraphe (par exemple un \indent\par)
%----
% better \verb pour doc.
@@ -641,21 +637,12 @@
%
\usepackage{txfonts}
-% m'occuper de la taille de txtt:
-% au passage je supprime le \hyphenchar \font\m at ne
-% avril 2013
-% ATTENTION ATTENTION ATTENTION Un changement de taille comme \small semble
-% déclencher (peut-être) la relecture de t1txtt.fd et quoi qu'il en soit le
-% \hyphenchar est REMIS à -1 !
+% -start- font adjustment 2013
-% update: 13 octobre 2013
-% et pourtant tailles sont ok, donc au moins cette information est
-% maintenue je ne sais donc pas exactement ce qui se passe.
-% (2015/11/12: je soupçonne presque un bug de conception de NFSS mais je n'ai
-% jamais eu ni le temps ni l'envie de regarder de plus près)
+
\DeclareFontFamily{T1}{txtt}{\hyphenchar\font 45\relax}
\DeclareFontShape{T1}{txtt}{m}{n}{ %medium
<->s*[.96] t1xtt%
@@ -672,15 +659,18 @@
\DeclareFontShape{T1}{txtt}{m}{ui}{ %unslanted italic
<->ssub * txtt/m/sl%
}{}
+% ---- /added scale factor 2023
\DeclareFontShape{T1}{txtt}{bx}{n}{ %bold extended
- <->t1xbtt%
+ <->s*[.96] t1xbtt%
}{}
+% The above s*[.96] added 2023/01/18, next two untested
\DeclareFontShape{T1}{txtt}{bx}{sc}{ %bold extended cap & small cap
- <->t1xbttsc%
+ <->s*[.96] t1xbttsc%
}{}
\DeclareFontShape{T1}{txtt}{bx}{sl}{ %bold extended slanted
- <->t1xbttsl%
+ <->s*[.96] t1xbttsl%
}{}
+% ---- /end of 2023 change
\DeclareFontShape{T1}{txtt}{bx}{it}{ %bold extended italic
<->ssub * txtt/bx/sl%
}{}
@@ -702,6 +692,55 @@
\DeclareFontShape{T1}{txtt}{b}{ui}{ %bold unslanted italic
<->ssub * txtt/bx/ui%
}{}
+% -end- font adjustment 2013
+% -start- font adjustment 2023
+\DeclareFontFamily{T1}{txss}{}
+\DeclareFontShape{T1}{txss}{m}{n}{ %medium
+ <->s * [0.89]t1xss%
+}{}
+\DeclareFontShape{T1}{txss}{m}{sc}{ %cap & small cap
+ <->s * [0.89]t1xsssc%
+}{}
+\DeclareFontShape{T1}{txss}{m}{sl}{ %slanted
+ <->s * [0.89]t1xsssl%
+}{}
+\DeclareFontShape{T1}{txss}{m}{it}{ %italic
+ <->ssub * txss/m/sl%
+}{}
+\DeclareFontShape{T1}{txss}{m}{ui}{ %unslanted italic
+ <->ssub * txss/m/sl%
+}{}
+\DeclareFontShape{T1}{txss}{bx}{n}{ %bold extended
+ <->s * [0.89]t1xbss%
+}{}
+\DeclareFontShape{T1}{txss}{bx}{sc}{ %bold extended cap & small cap
+ <->s * [0.89]t1xbsssc%
+}{}
+\DeclareFontShape{T1}{txss}{bx}{sl}{ %bold extended slanted
+ <->s * [0.89]t1xbsssl%
+}{}
+\DeclareFontShape{T1}{txss}{bx}{it}{ %bold extended italic
+ <->ssub * txss/bx/sl%
+}{}
+\DeclareFontShape{T1}{txss}{bx}{ui}{ %bold extended unslanted italic
+ <->ssub * txss/bx/sl%
+}{}
+\DeclareFontShape{T1}{txss}{b}{n}{ %bold
+ <->ssub * txss/bx/n%
+}{}
+\DeclareFontShape{T1}{txss}{b}{sc}{ %bold cap & small cap
+ <->ssub * txss/bx/sc%
+}{}
+\DeclareFontShape{T1}{txss}{b}{sl}{ %bold slanted
+ <->ssub * txss/bx/sl%
+}{}
+\DeclareFontShape{T1}{txss}{b}{it}{ %bold italic
+ <->ssub * txss/bx/it%
+}{}
+\DeclareFontShape{T1}{txss}{b}{ui}{ %bold unslanted italic
+ <->ssub * txss/bx/ui%
+}{}
+% -end- font adjustment 2023
\usepackage{xspace}
% added svgnames 2022/08/26 on occasion of transfer from xint colouring scheme
@@ -718,11 +757,6 @@
\usepackage {babel} % ngerman and english options have been passed to babel
\AtBeginDocument {
-%% ATTENTION à ce que fait la classe scrdoc: File/Datei pour \partname !!!
-%% Je l'avais oublié pour 1.08 lorsque je suis passé à ngerman. (obsolète)
-%% Attention aussi au fait qu'il faut faire le \renewcommand\partname
-%% ET le mettre dans les \captions...
-%%
\renewcommand\partname{Part}%
\addto\captionsenglish {\renewcommand\partname{Part}}
}
@@ -730,37 +764,9 @@
\usepackage{tikz}
\usetikzlibrary{trees} % added for "cyclic" grow function 2013/03/02
-% Temporaire 16 avril 2015 pour release etoc 1.08e :
-%
-% \usepackage{etex}
-%
-% car erreur de compilation avec la pre-release 2015 de TeXLive à cause d'un
-% missing \locbox avec forest 2014/03/07 1.05.
-%
-% Dû au fait que etoolbox 2015/03/19 v2.1d ne charge plus etex lorsqu'il
-% détecte le nouveau format LaTeX 2015/01/01 qui a été diffusé sur CTAN aux
-% alentours de 2015/03/31 et qui est intégré à TeXLive 2015.
-%
-% Note 12 mai 2015: la version 2015/05/04 1.06 de forest fait maintenant
-% explicitement \RequirePackage {etex}. Il y a un nouveau package elocalloc de
-% David Carlisle, donc forest devrait plutôt tester si \locbox est défini
-% après avoir chargé etoolbox et sinon faire \RequirePackage {elocalloc}.
\usepackage{forest}[2015/05/04]
-%
-% switched from tikz-qtree to forest 2013/09/09
-% No problem with hyperlinks then, contrarily to tikz-qtree.
-% NOTE: (12 octobre 2013)
-% - si compilation pour dvipdfmx, les arbres dans le dvi visualisés par xdvi
-% montrent correctement les textes, mais rien au point de vue graphique,
-% - si compilation pour dvips, l'arbre fait par forest est tout empilé, celui
-% fait par tikz sans forest est presque correct, les labels débordent.
-% Dans les deux cas, le résultat final dans le pdf est bon.
-% grosso modo dans l'état actuel le pdf fait 250K (dvipdfmx), 340K (pdflatex) et
-% 1M pour dvips+ps2pdf.
-% 9 octobre 2013, je me décide à ne plus utiliser hidelinks, mais il est tout de
-% même ajouté au .toc
% 12 mars 2015, pour 1.08a, see http://tex.stackexchange.com/a/232584/4686
\usetikzlibrary{mindmap}
@@ -800,9 +806,6 @@
%--------
% 10 octobre 2013:
\AtBeginDocument{\addtocontents{toc}{\protect\hypersetup{hidelinks}}}
-% mieux que de passer hidelinks comme option à hyperref.
-% Comme toutes les tocs sont faites dans un groupe, c'est très
-% bien. (et j'utilise \etocaftertitlehook pour autre chose)
%--------
% add-ons for the new section `surprising uses of etoc' (2013/01/24)
@@ -812,25 +815,6 @@
\phantomsection
\etoctoccontentsline{visibletoc}{\thevisibletoc}}
\etocsetlevel{visibletoc}{6}
-%--------
-% add-ons for the `fancy TOC' (2013/01/25)
-% supprimé 2019/03/09
- % \newcounter{dummypart}
- % \newcounter{dummychapter}
- % \newcounter{dummysection}
- % \etocsetlevel{dummypart}{6}
- % \etocsetlevel{dummychapter}{6}
- % \etocsetlevel{dummysection}{6}
-%--------
-% for "Another compatibility mode" (2013/02/21):
-% attention au 5 qui est hard-coded
-% (pour 1.07f c'était 3, maintenant 5 pour 1.07g; et 4 maintenant pour 1.07h...)
-% (et pour 1.07i.. à nouveau 3 faudra vraiment que je change cela)
-% et maintenant =4 pour version de la doc du 28 avril 2014... faudra vraiment qu
-% je mette un mécanisme plus robuste pour cette TOC.
-% ATTENTION AUSSI AUX CODES VERBATIM
-% màj pour 1.08k: \etocsavedsectiontocline etc...
-% màj pour 1.1-deev: emploi de \l at section etc...
\makeatletter
\newcommand*{\MyQuasiStandardTOC}[1]{%
\begingroup
@@ -979,26 +963,6 @@
% 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.
@@ -1257,9 +1221,6 @@
\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}
@@ -1393,10 +1354,6 @@
\edef\treenode{node
{\noexpand\textbf{\etocifnumbered{\unexpanded\expandafter{\etocthelinkednumber}.}{}
\unexpanded\expandafter{\etocthelinkedname}}}}%
-%**** Cette remarque est obsolète depuis 1.09f et la partie pour le foreword
-% grosse astuce: la première Partie ne sera pas embêtée par les trois sections
-% avant car ce qu'elles auront mis dans \parttok va être effacé.
-%****
\parttok\expandafter{\treenode}}
{% 1.09f prepends...
\ifcase\pseudomodthree{\value{partco}}%
@@ -1424,8 +1381,6 @@
% 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
@@ -1980,32 +1935,6 @@
Here is how it was produced:
\filecontentsprint\foo
-% 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}
@@ -2125,16 +2054,8 @@
\section{Linked list of the main package commands}
-% 2022/08/29
-% bataille avec multicols et LaTeX (j'ai essayé quote
-% avec un \leftmargin négatif mais n'a pas donné résultat
-% espéré)
-% mais comme il se trouve qu'il y a la place on va passer en deux, pas
-% trois colonnes, donc je laisse tomber le parshape!
-% 2022/08/30
-% Je sépare les macros les plus essentielles pour les mettre en avant
\begin{framed}\multicolsep0pt\relax
\begin{multicols}{3}\parindent0pt\relax
@@ -2531,29 +2452,7 @@
\label{etocimmediatedepthtag.toc}
\label{etocsettagdepth}
-% As mentioned above, when the argument to \csb{etocsettocdepth.toc} isn't
-% numeric but a named level the actual numeric level used is decided at the time
-% the TOC gets typeset, thus with the \emph{shuffling abilities of \etoc}, one may
-% obtain a very flexible control in the following way: one first declares with
-% \csb{etocsetlevel} some
-% dummy named level, say |partIII|, assigning it the invisible numeric level |6|.
-% Then before the actual third |\part| command in the source one inserts
-% \csb{etocsettocdepth.toc}|{partIII}|. At the location where the effect should
-% cease one inserts in the source \csb{etocsettocdepth.toc}|{all}|. It is now
-% possible to specify, each time one wants to typeset a TOC, what will be the
-% finest level for the entries originating in the third part: one just has to do
-% \csb{etocsetlevel}|{partIII}{1}| for example. This will limit to sections
-% (if |tocdepth| was at least at that level at the time \toc is encountered).
-% This method has some limitations:
-% \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 \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}.
-% \end{enumerate*}
Release |1.07h| has a command \csb{etocdepthtag.toc} which
allows to control dynamically the which contents end up included in the
@@ -3212,14 +3111,6 @@
line styles and some colors added (it has been put in a float which appears
\vpageref{toc:b}).
-%
-% (13 octobre 2013)
-% \footnote{inside the |figure| environment and before the
-% framed toc, which uses |multicols|, we added \csa{normalcolor} as work-around
-% to an interaction bug (related to the \csa{color\{red\}} command we added to
-% the |.toc| file) between |multicols|, |color| and the |figure|
-% environment. This bug has nothing to do with \etoc.}
-% RETIRÉ le 28 avril 2015 pour 1.08f
\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\etocdefaultlines
@@ -3258,27 +3149,8 @@
\filecontentsexec\filecontentsheremacro
-%\begin{figure}[ht!]
-% \centering
-% plus nécessaire ?
-%\normalcolor % work-around to a bug involving color and multicols (and figure)
-% \tableofcontents \label{toc:b} \ref{toc:globalcmds}
-% \end{figure}
-% \endgroup
-% Il y a un color leak du framed mais uniquement lorsqu'il est mis dans le
-% float. 2013/10/13, qui révèle un bug (?? NON) du style framed je vais regarder
-% mais bon. Le leak apparaît avec ruled aussi, et même avec juste multicolstyle
-% MAIS PAS EN UNE SEULE COLONNE (même framed ou ruled). il semble qu'il y aie
-% donc un problème d'interaction avec multicol là. à voir. Pas le temps
-% maintenant.
-% 2013/10/14
-% il s'agit en fait d'un bug de color+multicols+figure qui n'a rien à voir avec
-% etoc:
-% http://tex.stackexchange.com/questions/138783/color-leak-from-multicols-within-a-figure
-% J'ai trouvé le work-around qui consiste simplement à ajouter un \normalcolor
-% _avant_ le multicols à l'intérieur de figure
\section{Another TOC with a background color}\label{ssec:again}
@@ -3299,13 +3171,6 @@
slightly revised to use more \LaTeX-commands and less \TeX-primitives. Similar
code is used also for \hyperref[toc:clone]{this other toc}.
-% archivage de commentaires
-% 1.07l on the occasion of traduction into German documentation:
- % APRIL 26, 2014 Improvement in the section style for better placement of
- % page number when the section name is more than one line long. Use of
- % \makebox rather than \hbox, to be more LaTeX like.
-% attention car \ref{toc:floating} fera référence au compteur de
-% toutes les toc, pas visibletoc.
\begin{filecontentshere}{etocsnippet-\snippetno.tex}
\begin{figure}[htbp!]\centering
@@ -3389,10 +3254,6 @@
\filecontentsexec\filecontentsheremacro
-% , and the
-% reader is referred to its \hyperref[ssec:tocclone]{subsection} for the
-% coding used.
-
\section{A (crazy) inline display}
Let us finally make some crazy inline display of the table of
@@ -3690,27 +3551,7 @@
which will be given the contents of |\treetok|.
-% anciens commentaires extraits du code avant incorporation à filecontentsdef
-% 7 mars: j'utilise \etocthelinkedname défini à partir de 1.07f
-% mais bien sûr je sais que ça ne marche pas (sauf dans l'arbre pour le lien de
-% la section du bas) dans un QTree. Mais ça marche parfaitement dans un arbre
-% TikZ natif.
-
-% 9 septembre 2013: je remplace QTree par Forest, et il n'y a pas de problème
-% avec les hyperliens, ça marche out of the box (une fois que j'ai appris un peu
-% de sa syntaxe et de celle de TikZ).
-
-% 7 mars: j'utilise maintenant \etocthelinkedname
-
-% 11 octobre
-% forest ne veut pas @\the\treetok avec un \treetok vide, donc
-% il faut lui donner une valeur par défaut.
-
-% 12 octobre
-% pour que varioref fonctionne bien, je dois mettre la \tableofcontents
-% au plus près de l'environnement forest
-
\let\appendtotok\relax
\begin{filecontentsdef}{etocsnippet-\snippetno.tex}{\foo}
@@ -3880,8 +3721,6 @@
\filecontentsexec\filecontentsheremacro
-% Pour que \pageref fonctionne correctement, je dois mettre
-% le \tableofcontents dans la figure.
The |\tableofcontents| command appears just above the
|tikzpicture| environment in a figure float (to make sure that the label of the
@@ -3949,9 +3788,6 @@
\url{http://tex.stackexchange.com/q/232816/4686} and this led to the
\hyperref[toc:mindmaptitlepage]{title page} which is a further example.}
-% car dans le filecontentsdef je dois faire comme si pour verbatim
-% mais aussi l'exécuter, donc il me faut annuler définitions précédents pour
-% contourner messages d'erreurs de LaTeX.
\let\appendchildtree\relax
\let\childnode\relax
@@ -4229,12 +4065,6 @@
(this is done with the help of the \csb{etociffirst}
conditional).
-% obsolète avec la nouvelle \part* "\etoc" avant l'abstract (1.09f)
-% The attentive reader will notice one last subtlety: the title was
-% supposed to be followed not by one, but by two |\hline|'s. To
-% solve this we could have used a one-time macro redefining itself,
-% but we noticed that the title was followed by the unnumbered
-% Abstract, thus the \csb{etocifnumbered} switch came to the rescue.
Last technical note: because we put the |\\\hline| inside the branches, there
was no need to employ the expandable variants \csb{etocxiffirst} and
@@ -4376,14 +4206,6 @@
\etocsetstyle{section}
{\begin{enumerate}[leftmargin=.75cm, label=\etocifnumbered
{{\fboxrule1pt\fcolorbox{green}{white}{\etocnumber}}}{}]}
-% Dec 7, 2012. I hit upon a problem whose origin I found was
-% 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 \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.
{\normalsize\bfseries\rmfamily\item}
{\etocname{} (page \etocpage)}
{\end{enumerate}}
@@ -4635,20 +4457,8 @@
% a |&| in a tabular construction, if \csb{etocglobaldefs} was issued.
-% 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
@@ -4703,9 +4513,6 @@
arbitrary text \meta{foo} to the target sectioning unit in the document.
The command \csb{etoclink} is its robust variant.
-% They too
-% contain the hyperlink destination in already expanded form since |1.08a| for
-% the first three, since |1.08j| for \csb{etoclink}.
Obsolete example of \begingroup
\etocsetstyle {section}
@@ -5358,9 +5165,6 @@
\localtoc \csa{ref}|{toc:far}| acts the same as \toc
\csa{ref}|{toc:far}|.
-% (obsolète depuis 1.08e)
-% The commands for local tables of
-% contents do \emph{not} react to a \csa{ref} following them.
When re-displaying another toc, only its contents are transferred:
both the line styles and the toc display style are the ones
@@ -6689,8 +6493,32 @@
\def {\ifvmode\advance\jfverbadim.5em\relax\else\expandafter\jfverbaspace\fi}}\x
\makeatother
\begin{jfverbatim}
-1.1b [2023/01/15]^
+1.1c [2023/01/20]^
+ Fix a brace removal bug in the construction of \etocname. It
+ remained without visible effects in documents using hyperref and
+ default settings, thanks to the hyperlink wrapper, but e.g.
+ \section{{\color{blue}Blue}} in a document not using hyperref,
+ and not using etoc only in "compatibility mode", could cause a
+ color leak in the table of contents.
+
+ With the KOMA-script numberline toc feature, unnumbered entries in
+ TOCs typeset via etoc user-defined or package provided line styles
+ but using compatibility mode for the global display style were
+ (knowingly) considered to be numbered with an empty number. They
+ are now considered by \etocifnumbered to be not numbered and the
+ empty \etocnumber will carry no hyperlink.
+
+ Fix a 1.1a regression in the context of KOMA-script unnumbered TOC
+ entries: \etocthelinkedname could lose its hyperlink.
+
+ Continue internal trimming of old code branches which became
+ un-needed after the 1.1a refactoring. Add relatively decent
+ code comments to accompany the 1.1a-c refactoring. Update
+ warning messages to use more consistently LaTeX's templates.
+
+~1.1b [2023/01/15]^
+
Documentation fix, 1.1a forgot to mention the following change:
\etocthelinkedname, \etocthelinkednumber, \etocthelinkedpage
are now always hyperlinks independently of linktoc status.
@@ -6705,7 +6533,7 @@
hyperlinking information, if any.
With this release etoc decides earlier according to
~2hyperref. linktoc status whether section names and page numbers
- should be hyperlinked, and add links itself via \hyperlink. etoc
+ should be hyperlinked, and adds links itself via \hyperlink. etoc
is thus now immune to the details of how ~2hyperref. patches the
\contentsline command, which is not executed anymore.
Overall, the code is greatly simplified.
@@ -6718,7 +6546,9 @@
commands. They are not needed as \l at section et al. are with this
release left unmodified during the table of contents typesetting.
- ~LaTeX kernel from 2020/10/01 or later is required.
+ ~LaTeX kernel from 2020/10/01 or later is required (to allow
+ assuming the \contentsline entries in the TOC file always have
+ four arguments).
~1.09i [2022/11/21]^
@@ -7358,6 +7188,8 @@
\def\theCodelineNo{\reset at font\scriptsize\arabic{CodelineNo}}
\def\theHCodelineNo{\the\value{section}.\the\value{CodelineNo}}
%%% not needed for etoc.dtx
+%%%%%%% attention j'utilise plus bas \MakePrivateLetters pour
+%%%%%%% problème de straight quotes depuis 2023/01/18 (1.1c)
%%% \def\xintMakePrivateLetters{\catcode`: 11 \catcode`? 11 \catcode`@ 11
%%% \catcode`^ 11 \catcode`_ 11 }
%%% \def\xintexprMakePrivateLetters{\xintMakePrivateLetters \catcode`! 11 }
@@ -7436,7 +7268,7 @@
%.t,.w,.x,.y,.z,.XINT_x,.XINT_y,%
%.XINT_tmpa,.XINT_tmpb,.XINT_tmpc,.XINT_tmpd,.XINT_tmpe,% _ is letter here
%.XINT_expr_defbin_b,.XINT_expr_defbin_c,.XINT_expr_defbin_d,%
- .empty,.space,}%
+ .empty,.space,.protect,}%
\ifin@
{\xintdocMacrocodeFallbackColorCmd\special at escape@char\macro at namepart}%
\else
@@ -7474,8 +7306,9 @@
%%% etoc.dtx adds complications to handle \newcommand*
\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,.DeclareRobustCommand,}%.odef,.oodef,.fdef,}%
+ {.def,.edef,.let,.gdef,.xdef,%.odef,.oodef,.fdef,
+ .chardef,.newif,.newtoks,.newcommand,.DeclareRobustCommand,%
+ .newread,.newwrite,}%
\ifin@\labelmacro at allowedtrue\fi
\fi
\ifcsname r at etocmacro-\macro at namepart\endcsname
@@ -7523,33 +7356,17 @@
\makeatother
-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.
+% 18 janvier 2023 fix d'un problème de guillements courbes et d'inutilité de upquote,
+% import de mon code de lgrmath de novembre 2022
+% useless with doc.sty as \verb, verbatim and macrocode do not use \@noligs
+% \usepackage{upquote}
+%
+\begingroup
+\catcode`\'\active\catcode`\`\active
+\gdef\MakePrivateLetters{\makeatletter\def`{\textasciigrave}\def'{\textquotesingle}}
+\endgroup
+% https://github.com/latex3/latex2e/issues/953, for the record
-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
@@ -7567,25 +7384,61 @@
\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 who are not the author.
-Apology: the code comments served mainly as a record for the author's benefit
+\setcounter{secnumdepth}{3}
+
+\paragraph{About the syntax highlighting of the code:}
+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 inside the code lines.
+Package macros with no user level documentation hyperlink to their first
+place of definition in the code.
+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}} (it is not
+an hyperlink then). Comments located \emph{inside} the code source (very little are
+left at |1.1a|) 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.
+A package macro mentioned in code comments also hyperlinks
+to the location of its first definition using
+{\textcolor{macrocodelinktocodelinecolor}{this colour}}.
+
+Known limitations:
+\begin{enumerate}[nosep]
+\item The location of first definition may be disappointing as it may be a
+ provisory definition.
+\item Macros such as \csbc{Etoc at next} are there for matters of code branching
+ only, and the first encountered definition has no relevant significance.
+\item Macros defined using |\csname...\endcsname| or alike constructs are not
+ detected by the syntax highlighting automatization. Apart from manual
+ intervention, this appears complex to solve as moreover the macro name may be
+ there indirectly as an argument such as |#1|.
+%%%% This was caused by a ... 2013 oversight in my way of customizing txtt,
+%%%% see in preamble near loading of txfonts... fixed 2023/01/18
+%%%% \item Bold face has an increased character width, somewhat offsetting the
+%%%% codelines alignment.
+\end{enumerate}
+
+\paragraph{An apology:}
+the code comments served mainly as a record for the author's benefit
of the historical evolution of the package and rarely as a description of what
the macros do. At |1.1a| I have removed almost all code comments which had
accumulated as in a palimpsest. As a result, very few comments actually
-remain.
+remain. |1.1c| re-added comments to those parts of the code which
+got refactored at and since |1.1a|, revigorating the palimpsest stratification.
-
+\paragraph{About \etoc and the processing of \texttt{.toc} file data:}
\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}
+ package, at 1.09h and later.\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 rather to
@@ -7597,15 +7450,7 @@
The
\etoc maneuvers to disentangle \emph{name} and \emph{number} are somewhat
fragile as they expect the |.toc| file to contain the
-\csa{contentsline} arguments to be arranged in a certain manner.%
-%
-\normalmarginpar\marginpar{\footnotesize\rmfamily\itshape\RaggedRight
-Prior to \texttt{1.1a}, \etoc aliased \csa{l at chapter}, \csa{l at section},
-etc... (at the time of TOC typesetting only) to its own \csbc{Etoc at lxyz} in order to leave time to
-\ctanpkg{hyperref} to add its marks-up. Thus the disentangling was
-more complex than it is now. With \texttt{1.1a}, \etoc leaves
-\csa{l at chapter} etc... unmodified and inserts itself hyperlinks via \csa{hyperlink}.}
-%
+\csa{contentsline} arguments to be arranged in a certain manner.
Of course \etoc can be easily broken if changes happen to how data is stored
there. Things would have been much easier for \etoc in 2012 if the
\csa{contentsline} arguments had considered the section titles (aka
@@ -7614,6 +7459,17 @@
an argument to \csa{contentsline}. But some mix is prepared, which may depend
on the document class also, and besides usually handles \csa{part} levels very
differently. Fortunately upstream changes happen rarely.
+%
+\normalmarginpar\marginpar{\footnotesize\rmfamily\itshape\RaggedRight
+ Prior to \texttt{1.1a}, \etoc aliased \csa{l at chapter},
+ \csa{l at section}, etc... (at the time of TOC typesetting only)
+ to its own \csbc{Etoc at lxyz} in order to leave time to
+ \ctanpkg{hyperref} to add its mark-up. Thus the disentangling
+ of name from number
+ was more complex than it is now. With \texttt{1.1a}, \etoc
+ leaves \csa{l at chapter} etc... unmodified (and unused) and
+ only hijacks \csa{contentsline}.}
+%
The other core part of \etoc present from day one of the package is that it
creates a tree-like structure of the sectioning levels present in the |.toc|
@@ -7681,17 +7537,19 @@
%
%</none>
%<*package>
-% |1.1a| implements a radical change to all internals for compatibility
-% with (attow future) \ctanpkg{hyperref}. In order to facilitate this
+% |1.1a| implements a radical change to legacy core internals for compatibility
+% with some (future) \ctanpkg{hyperref} changes. In order to facilitate this
% overhaul, we require \LaTeX{} 2020/10/01 for the fourth argument to
% \cs{contentsline} lines in the |.toc| file to be always present.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\ProvidesPackage{etoc}
-[2023/01/15 v1.1b Completely customisable TOCs (JFB)]
+[2023/01/20 v1.1c Completely customisable TOCs (JFB)]
\RequirePackage{multicol}
\DeclareOption*{\PackageWarning{etoc}{Option `\CurrentOption' is unknown.}}
\ProcessOptions\relax
+\def\etoc@{\etoc@}
+\long\def\Etoc at gobtoetoc@ #1\etoc@{}
\newtoks\Etoc at toctoks
\def\Etoc at par{\par}
\def\etocinline{\def\Etoc at par{}}
@@ -7731,8 +7589,6 @@
\def\etocdoesnotcheckemptiness {\Etoc at checksemptinessfalse }
\newif\ifEtoc at notocifnotoc
\def\etocnotocifnotoc {\Etoc at checksemptinesstrue\Etoc at notocifnotoctrue }
-\def\etoc@{\etoc@}
-\newif\ifEtoc at bracedname
\newcounter{etoc at tocid}
\newcounter{etoc at tocdepth}
\@ifclassloaded{memoir}{\def\Etoc at minf{-\thr@@}}{\def\Etoc at minf{-\tw@}}
@@ -7805,8 +7661,10 @@
\expandafter\let \csname Etoc@#1@\endcsname\Etoc@@minustwo@
\else
\PackageWarning{etoc}
- {unexpected value `#2' in \string\etocsetlevel.^^J%
- Should be -2,-1, 0, 1, 2, 3, 4, 5, or 6. Set to 6 (=ignored)}%
+ {Unexpected value `#2' in \string\etocsetlevel.\MessageBreak
+ It must be one of -2,-1, 0, 1, 2, 3, 4, 5, or 6 and\MessageBreak
+ will be set to 6: the \string\contentsline\space entries of type\MessageBreak
+ `#1' will be ignored by `etoc'.\MessageBreak Reported}%
\expandafter\let\csname Etoc@#1@@\endcsname\Etoc@@six@@
\fi
\fi
@@ -7826,8 +7684,9 @@
% \ctanpkg{hyperref} at |7.00u| broke \etoc. Thanks to Denis~\textsc{Bitouzé} for
% reporting the issue.
%
-% But |1.1a| radically simplifies matters at \etoc core, and with it the
-% breakage induced from \ctanpkg{hyperref} |7.00u| would not have happened.
+% |1.1a| radically simplifies matters at \etoc core, and with this in
+% place there would have been no incompatibility with the \ctanpkg{hyperref}
+% |7.00u| internal changes.
% \begin{macrocode}
\AtBeginDocument{%
\@ifpackageloaded{parskip}{\Etoc at parskiptrue}{}%
@@ -7978,7 +7837,7 @@
}
\def\etocskipfirstprefix {\global\Etoc at skipprefixtrue }
% \end{macrocode}
-% Heart of \etoc hack into execution of |.toc| file.
+% Heart of \etoc's hacks into the execution of the |.toc| file commands.
% \begin{macrocode}
\def\Etoc at etoccontentsline #1{%
\global\expandafter\let\expandafter\Etoc at level\csname Etoc@#1@@\endcsname
@@ -8015,35 +7874,25 @@
\Etoc at next{#1}%
}
% \end{macrocode}
-% |2015/03/08| Ever since the first release of \etoc, the code has
+% Ever since the first release of \etoc, the code has
% to be careful that the |\Etoc at end@<level>| user defined macros may
% close groups. This is the reason why some assignments have to be done
-% globally
+% globally (|2015/03/08|).
%
-% |1.1a| implements a radical change to all internals for compatibility
-% with (attow future) \ctanpkg{hyperref}. Formerly this macro fetched only
-% the first argument. It now also fetches all four (the fourth argument of
-% \csa{contentsline} is always present since \LaTeX{} |2020/10/01|). The
-% \csbc{Etoc at lxyz} used to receive only two arguments like \csa{l at chapter},
-% \csa{l at section}, etc... which were formerly |\let| to it. It now also
-% receives the fourth argument of \csa{contentsline}.
-% \begin{macrocode}
-\def\Etoc at etoccontentsline@ #1#2#3#4{%
- \Etoc at doends
- \Etoc at dobegins
- \Etoc at global\edef\Etoc at prefix {\expandafter\noexpand
- \csname Etoc at prefix@\csname Etoc@#1@\endcsname\endcsname }%
- \Etoc at global\edef\Etoc at contents{\expandafter\noexpand
- \csname Etoc at contents@\csname Etoc@#1@\endcsname\endcsname }%
- \ifEtoc at skipprefix \Etoc at global\let\Etoc at prefix\@empty\fi
- \global\Etoc at skipprefixfalse
-% \end{macrocode}
-% |1.1a| made core rewrites for \ctanpkg{hyperref} compatibility, and
-% simplified the logic. The code does not execute the original
-% \csa{contentsline} in a custom wrapper, which needed to have aliased all
-% \csa{l at section} etc... to \csbc{Etoc at lxyz}. Now the \etoc custom
-% \csa{contentsline} passes over directly to \csbc{Etoc at lxyz} which will do
-% itself the job of adding hyperlinking according to the status of
+% |1.1a| of |2023/01/14| implements a radical change to legacy core internals for
+% compatibility with (attow future) \ctanpkg{hyperref}. Formerly
+% \csbc{Etoc at etoccontentsline@} fetched only the first argument.
+% It now also fetches all four (the fourth argument of
+% \csa{contentsline} is always present since \LaTeX{}
+% |2020/10/01|). The \csbc{Etoc at lxyz} used to receive only the two
+% arguments (possibly hacked by \ctanpkg{hyperref})
+% of \csa{l at chapter}, \csa{l at section}, etc..., (these macros had
+% been |\let| to \csbc{Etoc at lxyz}), and examined them to see if they
+% were carrying hyperlinking data. The |1.1a| and later
+% version receives as third
+% argument the fourth one of \csa{contentsline}, i.e.\@ the
+% hyperlinking target, and
+% adds the hyperlinking according to the status of
% \ctanpkg{hyperref}'s \csa{Hy at linktoc}.
%
% This is a breaking change if a user hacked \csa{contentsline} to do some
@@ -8067,21 +7916,24 @@
%
% All \ctanpkg{hyperref} specific branches are now gone, replaced by extra
% code added depending on the status of the \csbc{ifEtoc at hyperref} boolean.
-% We also check the \csa{Hy at linktoc} \csa{chardef} status and (imitating
-% \ctanpkg{hyperref} do not hyperlink the page number argument if it turns out
+% We also check the \csa{Hy at linktoc} \csa{chardef} status and, imitating
+% \ctanpkg{hyperref}, do not hyperlink the page number argument if it turns out
% empty. This maintains backwards-compatibility with earlier releases of
% \etoc.
% \begin{macrocode}
+\def\Etoc at etoccontentsline@ #1#2#3#4{%
+ \Etoc at doends
+ \Etoc at dobegins
+ \Etoc at global\edef\Etoc at prefix {\expandafter\noexpand
+ \csname Etoc at prefix@\csname Etoc@#1@\endcsname\endcsname }%
+ \Etoc at global\edef\Etoc at contents{\expandafter\noexpand
+ \csname Etoc at contents@\csname Etoc@#1@\endcsname\endcsname }%
+ \ifEtoc at skipprefix \Etoc at global\let\Etoc at prefix\@empty\fi
+ \global\Etoc at skipprefixfalse
\Etoc at lxyz{#2}{#3}{#4}%
\Etoc at prefix\Etoc at contents
}
% \end{macrocode}
-% |1.1a| makes a core rewrite for compatibility with \ctanpkg{hyperref}.
-% In particular \csbc{Etoc at lxyz} now has a third argument which was the
-% fourth argument of \csa{contentsline}. All various ``|@hyp|'' code
-% branches have been removed. We only check the \csbc{ifEtoc at hyperref}
-% boolean here.
-%
% A \textbf{breaking change} is made at |1.1a|: \csbc{etoclink} will always
% create an hyperlink, even in case of \ctanpkg{hyperref} being (possibly
% locally) configured to obey |linktoc=none|. Formerly, in such case,
@@ -8102,6 +7954,15 @@
% by the macro names, and refactored the code in two steps separated by months
% so in second step I forgot I had only provisory code. And I decided finally
% to keep the breaking change.
+%
+% Under |linktoc=page| option, \ctanpkg{hyperref} has a ``feature'' to
+% add one level of bracing to first argument of the \csa{l at section} etc
+% macros. So for \etoc |<1.1a| this meant some extra work to dig into such a
+% possible brace pair to check if the entry was numbered. At |1.1a|, the
+% \ctanpkg{hyperref} modified \csa{contentsline} is not executed, hence there
+% is no such complication. But the trimming of the now unneeded branches
+% was not yet done at |1.1a/b| and got completed only at |1.1c|, together
+% with some renamings and refactoring.
% \begin{macrocode}
\def\Etoc at lxyz #1#2#3{%
\ifEtoc at hyperref
@@ -8110,9 +7971,15 @@
\Etoc at global\let\etocthelink\@firstofone
\fi
\Etoc at global\def\etocthepage {#2}%
+% \end{macrocode}
+% Prior to |1.1a| an hyperlink was incorporated into \csbc{etocthelinkedpage}
+% only if \ctanpkg{hyperref} added an hyperlink to the page number, i.e.\@
+% under |linktoc=page| or |linktoc=all| (and a non empty page number). With
+% |1.1a|, the hyperlink is always added (if a non empty page number).
+% \begin{macrocode}
\ifEtoc at hyperref
- \ifx\etocthepage\ltx at empty
- \Etoc at global\let\etocthelinkedpage\etocthepage
+ \ifx\etocthepage\@empty
+ \Etoc at global\let\etocthelinkedpage\@empty
\else
\Etoc at global\def\etocthelinkedpage{\hyperlink {#3}{#2}}%
\fi
@@ -8120,215 +7987,263 @@
\Etoc at global\let\etocthelinkedpage\etocthepage
\fi
% \end{macrocode}
-% Define \cs{etocthename} and \cs{etocthelinkedname}, but this will
-% perhaps be redone later if it is found out that the entry was numbered.
+% Define \csbc{etocthename} but this will perhaps be adjusted later if it is found
+% out that the entry was numbered.
% \begin{macrocode}
\Etoc at global\def\etocthename{#1}%
- \ifEtoc at hyperref
- \Etoc at global\def\etocthelinkedname{\hyperlink{#3}{#1}}%
- \else
- \Etoc at global\let\etocthelinkedname\etocthename
- \fi
% \end{macrocode}
-% Now we check if the entry was numbered and then disentangle the number from the name.
+% Now we check if the entry is numbered and disentangle the number from the
+% name to define correctly \csbc{etocthename} and \csbc{etocthenumber}.
+% The delimiter tokens were modified at |1.1c| for a slight optimization.
+% And secondary macros have less to do since the |1.1a| initiated refactoring.
% \begin{macrocode}
- \futurelet\Etoc at getnb@token
- \Etoc@@getnb #1\relax\relax\etoc@
+ \futurelet\Etoc at getnb@token\Etoc@@getnb #1\hspace\etoc@
% \end{macrocode}
-% We may believe the entry was not numbered due it being a \cs{part} entry
-% which has a specific format. So we need to do some additional job in
-% such cases.
+% Even if \csbc{etocthenumber} was let to \csa{@empty}, it may happen in
+% special circumstances (related to KOMA-script, see below) that
+% \csbc{etocthename} got redefined. We will thus use its current contents to
+% define appropriately \csbc{etocthelinkedname}.
+%
+% In presence of \ctanpkg{hyperref} we let always \csbc{etocthelinkedname} and
+% \csbc{etocthelinkednumber} (for a numbered entry) carry an hyperlink. This
+% is a \textbf{breaking change} at |1.1a|: formerly if the TOC (or the
+% specific entry in the |.toc| file, as it is always possibly to inject
+% \csa{hypersetup}) was typeset under |linktoc=none| or |linktoc=page| status,
+% then no hyperlinks were incorporated. This is how \csbc{etocthename} and
+% \csbc{etocthenumber} are configured, but \csbc{etocthelinkedname} and
+% \csbc{etocthelinkednumber} will since |1.1a| always be hyperlinked in
+% presence of \ctanpkg{hyperref}.
% \begin{macrocode}
- \ifEtoc at number
- \else
- \ifnum\Etoc at level=\m at ne
- \futurelet\Etoc at getit@token
- \Etoc@@getit #1\hspace\relax\etoc@
- \fi
- \fi
-% \end{macrocode}
-% If there was a number the \csbc{etocthename} and \csbc{etocthenumber} got
-% redefined. We know need to give proper definition to \csbc{etocthelinkedname}
-% and \csbc{etocthelinkednumber}.
-% \begin{macrocode}
- \ifEtoc at number
- \ifEtoc at hyperref
- \def\Etoc at tmp##1##2{\Etoc at global\def##2{\hyperlink{#3}{##1}}}%
- \expandafter\Etoc at tmp\expandafter{\etocthename}\etocthelinkedname
+ \ifEtoc at hyperref
+ \def\Etoc at tmp##1##2{\Etoc at global\def##2{\hyperlink{#3}{##1}}}%
+ \expandafter\Etoc at tmp\expandafter{\etocthename}\etocthelinkedname
+ \ifEtoc at number
\expandafter\Etoc at tmp\expandafter{\etocthenumber}\etocthelinkednumber
\else
- \Etoc at global\let\etocthelinkedname\etocthename
- \Etoc at global\let\etocthelinkednumber\etocthenumber
+ \Etoc at global\let\etocthelinkednumber\@empty
\fi
\else
- \Etoc at global\let\etocthenumber\@empty
- \Etoc at global\let\etocthelinkednumber\@empty
+ \Etoc at global\let\etocthelinkedname \etocthename
+ \Etoc at global\let\etocthelinkednumber\etocthenumber
\fi
- \Etoc at global\expandafter\let\csname etoclink \endcsname\etocthelink
- \Etoc at global\expandafter\let\csname etocname \endcsname\etocthename
+% \end{macrocode}
+% Defaults in absence of \ctanpkg{hyperref}. We externalize to another
+% macro the \ctanpkg{hyperref} case switch.
+% \begin{macrocode}
+ \Etoc at global\expandafter\let\csname etoclink \endcsname \etocthelink
+ \Etoc at global\expandafter\let\csname etocname \endcsname \etocthename
\Etoc at global\expandafter\let\csname etocnumber \endcsname\etocthenumber
- \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthepage
+ \Etoc at global\expandafter\let\csname etocpage \endcsname \etocthepage
\ifEtoc at hyperref
- \Etoc at lxyz@hyper
+ \Etoc at lxyz@linktoc
\fi
}
% \end{macrocode}
-% In presence of \ctanpkg{hyperref}, \etoc |1.1a| adds the hyperlinks
-% itself. For this it imitates the \ctanpkg{hyperref} own logic and tests
-% \csa{Hy at linktoc} and if the page number is empty. This adds a dependency
-% that \csa{Hy at linktoc} should exist and have the expected interpretation.
-%
-% Matters of tagging will have to wait for \LaTeX\ itself to show me what it
-% does in \csa{l at section} etc... so that I can imitate.
+% In presence of \ctanpkg{hyperref}, \etoc |1.1a| imports the
+% \ctanpkg{hyperref} own logic and tests \csa{Hy at linktoc} to decide if
+% \emph{name}, \emph{number} and \emph{page} get hyperlinks. This adds a
+% dependency that \csa{Hy at linktoc} should exist and have the expected
+% interpretation.
+% \begin{framed}
+% \textbf{MEMO:} \emph{Matters of tagging will have to wait for \LaTeX\ itself
+% to show me what it does in \csa{l at section} etc... so that I can imitate.}
+% \end{framed}
% \begin{macrocode}
-\def\Etoc at lxyz@hyper{%
+\def\Etoc at lxyz@linktoc{%
\ifcase\Hy at linktoc
% none: nothing to do
\or % section (aka name for etoc): link name and number
- \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
+ \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
\Etoc at global\expandafter\let\csname etocnumber \endcsname\etocthelinkednumber
- \or % page. Do as hyperref: add a link only if page number isn't empty.
- \ifx\etocthepage\ltx at empty
- \else
- \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
- \fi
+ \or % page
+ \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
\else % all
- \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
+ \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
\Etoc at global\expandafter\let\csname etocnumber \endcsname\etocthelinkednumber
- \ifx\etocthepage\ltx at empty
- \else
- \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
- \fi
+ \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
\fi
}
+% \end{macrocode}
+% Now for the disentangling of the ``number'' from the ``name''.
+%
+% At some point we will pick up the first token and check if it is
+% \csa{numberline} or like token to identify a numbered entry.
+% But this step can cause brace removal so we \csa{futurelet} to
+% peek ahead.
+%
+% Prior to |1.1a| it could be possible that the first token following
+% \csbc{Etoc@@getnb} was an opening brace and nevertheless the entry was
+% numbered, because of a \ctanpkg{hyperref} ``feature'' in case of
+% |linktoc=page| option. But at |1.1a|, \etoc handles directly the argument
+% of \csa{contentsline} so the presence of an opening brace implies the entry
+% is not numbered. For some reason |1.1a| kept the extra code to check in
+% case the next token was an opening brace whether the whole entry was braced,
+% which would have been indicative in the past (but not at |1.1a|) of a
+% |linktoc=page| context (\etoc prior to |1.1a| never tested the value of
+% \csa{Hy at linktoc} as it did not want to be dependent on details of
+% \ctanpkg{hyperref} handling of options). This legacy, now superfluous, code
+% branch is removed at |1.1c|, bringing some simplification here, in
+% particular the removal of an \csa{ifEtoc at bracedname} boolean. Also, when
+% branching from here to the \csbc{Etoc at getnb@nonbr}, we won't need to check
+% if the entry had a special ``Part'' syntax, which is another simplification.
+%
+% The |@nonbr| means ``no number'', and is not to be misinterpreted as
+% ``non braced''... (this was more confusing to the author on return to
+% \etoc code, when it still had branches
+% handling issues described above with an extra brace pair).
+% \begin{macrocode}
\def\Etoc@@getnb {%
- \Etoc at bracednamefalse
\let\Etoc at next\Etoc at getnb
- \ifx\Etoc at getnb@token\@sptoken\let\Etoc at next\Etoc at getnb@nohyp at nonbr\fi
- \ifx\Etoc at getnb@token\bgroup \let\Etoc at next\Etoc at getnb@checkifbraced\fi
+ \ifx\Etoc at getnb@token\@sptoken\let\Etoc at next\Etoc at getnb@nonbr\fi
+ \ifx\Etoc at getnb@token\bgroup \let\Etoc at next\Etoc at getnb@nonbr\fi
\Etoc at next
}
-\def\Etoc at tworelax{\relax\relax}
-\def\Etoc at getnb@checkifbraced #1#2\etoc@ {%
- \def\Etoc at tmp{#2}%
- \ifx\Etoc at tmp\Etoc at tworelax
- \expandafter\expandafter\expandafter\Etoc at getnb@nameisbraced
- \expandafter\@firstofone
- \else
- \expandafter\Etoc at getnb
- \fi {#1}#2\etoc@
-}
-\def\Etoc at getnb@nameisbraced {%
- \Etoc at bracednametrue
- \futurelet\Etoc at getnb@token\Etoc at getnb
-}
% \end{macrocode}
-% The |@nohyp| in the macro names is a legacy of pre-|1.1a| code.
-% \begin{macrocode}
-\def\Etoc at getnb {%
- \ifx\Etoc at getnb@token\bgroup
- \expandafter\Etoc at getnb@nohyp at nonbr
- \else
- \expandafter\Etoc at getnb@nohyp
- \fi
-}
-% \end{macrocode}
-% |1.08n| tries to handle reasonably the \csa{nonumberline} of \ctanpkg{KOMA-script}.
-% If it expands to |\numberline{}|, \etoc will thus consider the line
-% numbered with an empty number.
+% |1.08n| tries to handle reasonably the \csa{nonumberline} of
+% \ctanpkg{KOMA-script}. If it expands to |\numberline{}|, \etoc will
+% consider the line numbered with an empty number (afaict, the meaning of
+% \csa{nonumberline} is either empty or \csa{numberline}|{}|). This got
+% modified at |1.1c| (see below).
%
-% At |1.09f| complications to get rid of a \ctanpkg{KOMA-script} \csa{nonumberline}
-% even though its meaning is \csa{empty} then, but let's get rid of it in case
-% the tokens are stored by the user section styles for delayed use.
+% At |1.09f| we get rid of the \csa{nonumberline} from inside
+% \csbc{etocthename} when it has empty meaning, so the expansion of the latter
+% can safely be delayed by custom section styles (for example if the build up
+% some token list to be executed later not immediately). |1.1c| fixes a
+% regression committed at |1.1a|: for a \csa{nonumberline} with empty
+% meaning the \csbc{etocthelinkedname} did not end up hyperlinked.
+%
+% A change, almost a bug fix, but the former behavior was actually
+% deliberate, at |1.1c| regarding the KOMA-script \csa{nonumberline}
+% token: formerly, when it expanded to \csa{numberline}|{}| (this
+% can happen only when the TOC is typeset in compatibility mode for
+% the global display) then \csbc{ifEtoc at number} was set to true.
+% But this is only a KOMA-script typesetting thing, and should not
+% have influenced \etoc's decisions when its (user or package) own
+% line styles are used: at |1.1c| it is thus decided that in such
+% circumstances the \csbc{etocifnumbered} will pick the false
+% branch, and the empty \csbc{etocthelinkednumber} will not be
+% hyperlinked.
+%
+% No brace removal of the |#1| here a priori possible because we took care to
+% check that \csbc{Etoc at getnb} was not followed by either a space or an
+% opening brace.
+%
+% The \csbc{Etoc@@getit} branch for ``Parts'' used to be executed from inside
+% \csbc{Etoc at lxyz}. At |1.1c| we jump directly to it from here.
% \begin{macrocode}
-\def\Etoc at getnb@nohyp #1{%
+\def\Etoc at getnb #1{%
\in@{#1}{\numberline\chapternumberline\partnumberline\booknumberline}%
\ifin@
- \let\Etoc at next\Etoc at getnb@nohyp at nmbrd
+ \let\Etoc at next\Etoc at getnb@nmbrd
\else
- \let\Etoc at next\Etoc at getnb@nohyp at nonbr
+ \ifnum\Etoc at level=\m at ne
+ \let\Etoc at next\Etoc@@getit
+ \else
+ \let\Etoc at next\Etoc at getnb@nonbr
+ \fi
+% \end{macrocode}
+% Remove a KOMA-script \csa{nonumberline} token if present and process the
+% entry always as not numbered (see above comments). Prior to |1.1c|, the
+% code branched according to the meaning of the \csa{nonumberline} token,
+% which was a bit silly.
+% \begin{macrocode}
\in@{#1}{\nonumberline}%
\ifin@
- \ifx\nonumberline\empty
- \let\Etoc at next\Etoc at getnb@nohyp at nonumberline
- \else
- \def\Etoc at next{\expandafter\Etoc at getnb@nohyp at nmbrd}%
- \fi
+ \let\Etoc at next\Etoc at getnb@nonumberline
\fi
\fi
\Etoc at next #1%
}
-\def\Etoc at getnb@nohyp at nmbrd #1#2#3\relax\relax\etoc@ {%
+% \end{macrocode}
+% Prior to |1.1a|, \csbc{etocthelinkedname} and \csbc{etocthelinkednumber}
+% (for a numberd entry) were defined to carry links only if an hyperlink was
+% actually found, now they are defined in \csbc{Etoc at lxyz} to always provide
+% the hyperlinking to the target title in the document.
+%
+% |1.1a| and |1.1b| still had here some superfluous code which was trimmed at
+% |1.1c|.
+%
+% Also, |1.1c| fixes here a brace removal bug (which had always been there I
+% guess): if the numbered heading title was braced one level of bracing was
+% removed. The bug had no effect in a document using \ctanpkg{hyperref} (and
+% its default |linktoc| setting) as the \csa{hyperlink} wrapper limited the
+% scope. But in a document without hyperref it would have been seen with
+% input such as |\section{{\color{blue}Stuff}}|.
+% \begin{macrocode}
+\def\Etoc at getnb@nmbrd #1#2{%
\Etoc at global\Etoc at numbertrue
- \Etoc at global\def\etocthenumber {#2}%
- \Etoc at global\def\etocthelinkednumber {#2}%
- \ifEtoc at bracedname
- \Etoc at global\def\etocthename{{#3}}%
- \else
- \Etoc at global\def\etocthename{#3}%
- \fi
- \Etoc at global\let\etocthelinkedname \etocthename
+ \Etoc at global\def\etocthenumber {#2}%
+ \Etoc at getnb@nmbrd at getname\@empty
+}%
+% \end{macrocode}
+% We added an \csa{@empty} token to prevent brace removal.
+% \begin{macrocode}
+\def\Etoc at getnb@nmbrd at getname #1\hspace\etoc@ {%
+ \Etoc at global\expandafter\def\expandafter\etocthename\expandafter{#1}%
}
% \end{macrocode}
-% \csbc{etocthename} and \csbc{etocthelinkedname} already defined in
-% \csbc{Etoc at lxyz}, no need to update.
+% Not numbered entry.
% \begin{macrocode}
-\def\Etoc at getnb@nohyp at nonbr #1\etoc@ {%
+\def\Etoc at getnb@nonbr #1\etoc@ {%
\Etoc at global\Etoc at numberfalse
- \Etoc at global\let\etocthenumber \@empty
- \Etoc at global\let\etocthelinkednumber \@empty
+ \Etoc at global\let\etocthenumber \@empty
}
% \end{macrocode}
-% Special KOMA branch: |#1| starts with \csa{nonumberline} which has here same
-% meaning as \csa{empty}. It is in the current provisory definition of
-% \csbc{etocthename}. We get rid of this token, in case usage is delayed,
-% to avoid improbable problems.
+% Special KOMA branch: |#1| starts with \csa{nonumberline} (prior to |1.1c|
+% the |#1| would have already lost this token, and this branch was executed
+% only in case \csa{nonumberline} had empty meaning). We need to remove this
+% token from |#1| and redefine \csbc{etocthename}.
+%
+% |1.1a| code still had here some complications with a ``braced name'' branch
+% which was in fact never executed at |1.1a|, as the \ctanpkg{hyperref} hacks
+% into the expansion of \csa{contentsline} were not executed. These now
+% unneeded complications got removed at |1.1c|.
+%
+% |1.1c| also fixes a regression caused by |1.1a| in this branch: the
+% \csbc{etocthelinkedname} had lost its hyperlink.
+%
+% The \csa{nonumberline} extra token guarantees no brace stripping here.
% \begin{macrocode}
-\def\Etoc at getnb@nohyp at nonumberline #1\relax\relax\etoc@ {%
+\def\Etoc at getnb@nonumberline #1\hspace\etoc@ {%
\Etoc at global\Etoc at numberfalse
- \Etoc at global\let\etocthenumber \@empty
- \Etoc at global\let\etocthelinkednumber \@empty
- \ifEtoc at bracedname
- \Etoc at global\expandafter\def\expandafter\etocthename
- \expandafter{\expandafter{#1}}%
- \else
- \Etoc at global\expandafter\def\expandafter\etocthename\expandafter{#1}%
- \fi
- \Etoc at global\let\etocthelinkedname \etocthename
+ \Etoc at global\let\etocthenumber \@empty
+ \Etoc at global\expandafter\def\expandafter\etocthename\expandafter{\@gobble#1}%
}
% \end{macrocode}
-% |1.1a| maps directly to \csbc{Etoc at getit@nohyp}, and the |@nohyp| will
-% perhaps be removed from its name at some later stage.
+% This branch handles the peculiar ``Part'' syntax. No brace stripping
+% possible here when grabbing |#1|, due to previous checks that it does
+% not start by a space token or an opening brace.
+%
+% |1.1c| handles this as a sub-branch from \csbc{Etoc@@getnb} which brings
+% simplifications. Also the code has been somewhat strengthened so as to
+% avoid in later processing a brace removal issue on the name (which was a bug
+% of legacy earlier code), when it turns our we are handling a numbered Part
+% indeed.
+%
+% The whole thing is anyhow quite fragile due to \LaTeX{}'s handling by
+% standard classes of |.toc| file entries for parts being even more already
+% pre-formatted for typesetting than for other levels.
% \begin{macrocode}
-\def\Etoc@@getit{%
- \ifEtoc at bracedname
- \expandafter\expandafter\expandafter\Etoc at getit@nameisbraced
- \expandafter\@firstofone
+\def\Etoc@@getit #1\hspace#2{%
+ \ifx\etoc@#2%
+ \Etoc at global\Etoc at numberfalse
+ \Etoc at global\let\etocthenumber \@empty
\else
- \expandafter\Etoc at getit@nohyp
- \fi
-}
-\def\Etoc at getit@nameisbraced {\futurelet\Etoc at getit@token\Etoc at getit@nohyp }
-\def\Etoc at getit@nohyp #1\hspace#2#3\etoc@ {%
- \ifx\relax#2%
- \else
- \Etoc at global\def\etocthenumber {#1}%
- \Etoc at global\def\etocthelinkednumber {#1}%
\Etoc at global\Etoc at numbertrue
- \Etoc at getit@nohyp at getname #3\etoc@
+ \Etoc at global\def\etocthenumber {#1}%
+ \expandafter\Etoc at getit@getname \expandafter\@empty
\fi
}
-\def\Etoc at getit@nohyp at getname #1\hspace\relax\etoc@ {%
- \ifEtoc at bracedname
- \Etoc at global\def\etocthename {{#1}}%
- \else
- \Etoc at global\def\etocthename {#1}%
- \fi
- \Etoc at global\let\etocthelinkedname\etocthename
+% \end{macrocode}
+% Chain of \csa{expandafter}'s to get rid of the added \csa{@empty} token to
+% avoid a brace removal. And this is the end of the |1.1a| refactoring,
+% completed at |1.1c|.
+% \begin{macrocode}
+\def\Etoc at getit@getname #1\hspace\etoc@ {%
+ \Etoc at global\expandafter\def\expandafter\etocthename\expandafter{#1}%
}
% \end{macrocode}
-% |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...
+% place-holder
% \begin{macrocode}
\let\etocthename \@empty
\let\etocthenumber \@empty
@@ -8375,7 +8290,7 @@
\ifx\hyper at last\@undefined
\IfFileExists{\jobname .toc}
{\Hy at WarningNoLine
- {old toc file detected, not used; run LaTeX again (cheers from etoc)}%
+ {old toc file detected; run LaTeX again (cheers from `etoc')}%
\global\Etoc at toctoks={}%
}
{}%
@@ -8622,7 +8537,7 @@
\global\Etoc at emptytocfalse
\edef\Etoc at tocid{#1}%
\ifnum\Etoc at tocid<\@ne
- \setbox0\hbox{\ref{Unknown toc ref \@secondoftwo#1. Rerun LaTeX}}%
+ \setbox0\hbox{\ref{Unknown toc ref \@secondoftwo#1. \space Rerun LaTeX}}%
% \end{macrocode}
% Do only heading, skip all the rest.
% \begin{macrocode}
@@ -8629,7 +8544,7 @@
\global\Etoc at stoptoctrue
\gdef\etoclocaltop{-\thr@@}%
\Etoc at tableofcontents
- \expandafter\Etoc at gobbletoetoc@
+ \expandafter\Etoc at gobtoetoc@
\fi
\global\Etoc at notactivetrue
\ifEtoc at checksemptiness
@@ -8637,7 +8552,7 @@
\fi
\ifEtoc at emptytoc
\ifEtoc at notactive
- \setbox0\hbox{\ref{Unknown toc ID \number\Etoc at tocid. Rerun LaTeX}}%
+ \setbox0\hbox{\ref{Unknown toc ID \number\Etoc at tocid. \space Rerun LaTeX}}%
% \end{macrocode}
% Assume real one will be non-empty and print only heading for this pass.
% \begin{macrocode}
@@ -8645,7 +8560,7 @@
\global\Etoc at stoptoctrue
\gdef\etoclocaltop{-\thr@@}%
\Etoc at tableofcontents
- \expandafter\expandafter\expandafter\Etoc at gobbletoetoc@
+ \expandafter\expandafter\expandafter\Etoc at gobtoetoc@
\fi
\else
\global\Etoc at stoptocfalse
@@ -8812,13 +8727,12 @@
% \csbc{Etoc at toctoc}, in order to allow opening of an alignment in the first
% argument and closing in the second.
% \begin{macrocode}
-\long\def\Etoc at gobbletoetoc@ #1\etoc@ {}
\newcommand\etocsettocstyle[2]{%
\def\Etoc at tableofcontents
{%
\ifnum\c at tocdepth>\Etoc at minf
\else
- \expandafter\Etoc at gobbletoetoc@
+ \expandafter\Etoc at gobtoetoc@
\fi
\Etoc at par
\etocbeforetitlehook
@@ -8835,10 +8749,12 @@
% \begin{macrocode}
\def\Etoc at levellist@elt####1{%
\expandafter\def\csname etocsaved####1tocline\endcsname
- {\PackageWarning{etoc}{\expandafter\string\csname
- etocsaved####1tocline\endcsname\space is deprecated
- and to be\MessageBreak soon removed from etoc.
- Use directly \expandafter\string\csname l@####1\endcsname\MessageBreak }%
+ {\PackageWarning{etoc}{%
+ \expandafter\string\csname etocsaved####1tocline\endcsname\space
+ has been deprecated at 1.1a.\MessageBreak
+ It will be removed from `etoc' in near feature. \space Use\MessageBreak
+ \expandafter\string\csname l@####1\endcsname\space directly. \space
+ Reported}%
\expandafter\let\csname etocsaved####1tocline\expandafter\endcsname
\csname l@####1\endcsname
\csname l@####1\endcsname
@@ -9586,13 +9502,14 @@
{\AtBeginDocument
{\@ifpackageloaded{tocloft}
{\if at cftnctoc\else
- \PackageWarning {etoc}
- {Package `tocloft' was loaded after `etoc'!^^J%
-**** to prevent it from overwriting \protect\tableofcontents, it will be tricked^^J%
-**** into believing to have been loaded with option `titles'. For better^^J%
-**** compatibility, please load `tocloft' before `etoc'}%
+ \PackageWarningNoLine {etoc}
+ {Package `tocloft' was loaded after `etoc'.\MessageBreak
+ To prevent it from overwriting \protect\tableofcontents, it will\MessageBreak
+ be tricked into believing to have been loaded with its\MessageBreak
+ option `titles'. \space Please load `tocloft' before `etoc'}%
\AtEndDocument{\PackageWarning{etoc}
- {Please load `tocloft' /before/ `etoc'!}}\fi
+ {Please load `tocloft' before `etoc'!\@gobbletwo}}%
+ \fi
\@cftnctoctrue }%
{}%
}%
@@ -9728,18 +9645,19 @@
% incompatible things etoc needs to revert.
% \begin{macrocode}
\def\Etoc at tocvsec@err #1{\PackageError {etoc}
- {the command \protect#1\space is incompatible with etoc}
- {use \protect\etocsettocdepth.toc as replacement (see etoc manual)}%
+ {The command \protect#1\space is incompatible with `etoc'}
+ {Use \protect\etocsettocdepth.toc as replacement}%
}%
\AtBeginDocument {%
\@ifclassloaded{memoir}
{\PackageInfo {etoc}
- {Regarding memoir class command \protect\settocdepth, consider^^J
- \protect\etocsettocdepth.toc as a drop-in replacement with
- more capabilities^^J (see etoc manual). Similarly
- \protect\etocsettocdepth\space and
- \protect\etocsetnexttocdepth^^J should replace
- use of memoir's \protect\maxtocdepth\space command.}}
+ {Regarding `memoir' class command \protect\settocdepth, consider\MessageBreak
+ \protect\etocsettocdepth.toc as a drop-in replacement with more\MessageBreak
+ capabilities (see `etoc' manual). \space
+ Also, \protect\etocsettocdepth\MessageBreak
+ and \protect\etocsetnexttocdepth\space should be used in place of\MessageBreak
+ `memoir' command \protect\maxtocdepth\@gobble}%
+ }%
{\@ifpackageloaded {tocvsec2}
{\def\maxtocdepth #1{\Etoc at tocvsec@err \maxtocdepth }%
\def\settocdepth #1{\Etoc at tocvsec@err \settocdepth }%
@@ -9753,11 +9671,12 @@
\let\reset at tocdepth\relax
\let\remax at tocdepth\relax
\let\tableofcontents\etoctableofcontents
- \PackageWarning {etoc}
- {package tocvsec2 detected and its modification of^^J
- \protect\tableofcontents\space reverted. Use
- \protect\etocsettocdepth.toc as a replacement^^J
- for the tocvsec2 toc-related commands}}{}%
+ \PackageWarningNoLine {etoc}
+ {Package `tocvsec2' detected and its modification of\MessageBreak
+ \protect\tableofcontents\space reverted. \space Use
+ \protect\etocsettocdepth.toc\MessageBreak as a replacement
+ for `tocvsec2' toc-related commands}}% tocvsec2 loaded
+ {}% not loaded
}%
}%
% \end{macrocode}
Modified: trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty 2023-01-21 02:06:30 UTC (rev 65602)
+++ trunk/Master/texmf-dist/tex/latex/etoc/etoc.sty 2023-01-21 20:59:28 UTC (rev 65603)
@@ -22,16 +22,18 @@
%% in the same archive or directory.)
%%
%% Package: etoc
-%% Version: 1.1b
+%% Version: 1.1c
%% License: LPPL 1.3c
%% Copyright (C) 2012-2023 Jean-Francois Burnol
%% <jfbu at free dot fr>
\NeedsTeXFormat{LaTeX2e}[2020/10/01]
\ProvidesPackage{etoc}
-[2023/01/15 v1.1b Completely customisable TOCs (JFB)]
+[2023/01/20 v1.1c Completely customisable TOCs (JFB)]
\RequirePackage{multicol}
\DeclareOption*{\PackageWarning{etoc}{Option `\CurrentOption' is unknown.}}
\ProcessOptions\relax
+\def\etoc@{\etoc@}
+\long\def\Etoc at gobtoetoc@ #1\etoc@{}
\newtoks\Etoc at toctoks
\def\Etoc at par{\par}
\def\etocinline{\def\Etoc at par{}}
@@ -66,8 +68,6 @@
\def\etocdoesnotcheckemptiness {\Etoc at checksemptinessfalse }
\newif\ifEtoc at notocifnotoc
\def\etocnotocifnotoc {\Etoc at checksemptinesstrue\Etoc at notocifnotoctrue }
-\def\etoc@{\etoc@}
-\newif\ifEtoc at bracedname
\newcounter{etoc at tocid}
\newcounter{etoc at tocdepth}
\@ifclassloaded{memoir}{\def\Etoc at minf{-\thr@@}}{\def\Etoc at minf{-\tw@}}
@@ -135,8 +135,10 @@
\expandafter\let \csname Etoc@#1@\endcsname\Etoc@@minustwo@
\else
\PackageWarning{etoc}
- {unexpected value `#2' in \string\etocsetlevel.^^J%
- Should be -2,-1, 0, 1, 2, 3, 4, 5, or 6. Set to 6 (=ignored)}%
+ {Unexpected value `#2' in \string\etocsetlevel.\MessageBreak
+ It must be one of -2,-1, 0, 1, 2, 3, 4, 5, or 6 and\MessageBreak
+ will be set to 6: the \string\contentsline\space entries of type\MessageBreak
+ `#1' will be ignored by `etoc'.\MessageBreak Reported}%
\expandafter\let\csname Etoc@#1@@\endcsname\Etoc@@six@@
\fi
\fi
@@ -335,8 +337,8 @@
\fi
\Etoc at global\def\etocthepage {#2}%
\ifEtoc at hyperref
- \ifx\etocthepage\ltx at empty
- \Etoc at global\let\etocthelinkedpage\etocthepage
+ \ifx\etocthepage\@empty
+ \Etoc at global\let\etocthelinkedpage\@empty
\else
\Etoc at global\def\etocthelinkedpage{\hyperlink {#3}{#2}}%
\fi
@@ -344,159 +346,93 @@
\Etoc at global\let\etocthelinkedpage\etocthepage
\fi
\Etoc at global\def\etocthename{#1}%
+ \futurelet\Etoc at getnb@token\Etoc@@getnb #1\hspace\etoc@
\ifEtoc at hyperref
- \Etoc at global\def\etocthelinkedname{\hyperlink{#3}{#1}}%
- \else
- \Etoc at global\let\etocthelinkedname\etocthename
- \fi
- \futurelet\Etoc at getnb@token
- \Etoc@@getnb #1\relax\relax\etoc@
- \ifEtoc at number
- \else
- \ifnum\Etoc at level=\m at ne
- \futurelet\Etoc at getit@token
- \Etoc@@getit #1\hspace\relax\etoc@
- \fi
- \fi
- \ifEtoc at number
- \ifEtoc at hyperref
- \def\Etoc at tmp##1##2{\Etoc at global\def##2{\hyperlink{#3}{##1}}}%
- \expandafter\Etoc at tmp\expandafter{\etocthename}\etocthelinkedname
+ \def\Etoc at tmp##1##2{\Etoc at global\def##2{\hyperlink{#3}{##1}}}%
+ \expandafter\Etoc at tmp\expandafter{\etocthename}\etocthelinkedname
+ \ifEtoc at number
\expandafter\Etoc at tmp\expandafter{\etocthenumber}\etocthelinkednumber
\else
- \Etoc at global\let\etocthelinkedname\etocthename
- \Etoc at global\let\etocthelinkednumber\etocthenumber
+ \Etoc at global\let\etocthelinkednumber\@empty
\fi
\else
- \Etoc at global\let\etocthenumber\@empty
- \Etoc at global\let\etocthelinkednumber\@empty
+ \Etoc at global\let\etocthelinkedname \etocthename
+ \Etoc at global\let\etocthelinkednumber\etocthenumber
\fi
- \Etoc at global\expandafter\let\csname etoclink \endcsname\etocthelink
- \Etoc at global\expandafter\let\csname etocname \endcsname\etocthename
+ \Etoc at global\expandafter\let\csname etoclink \endcsname \etocthelink
+ \Etoc at global\expandafter\let\csname etocname \endcsname \etocthename
\Etoc at global\expandafter\let\csname etocnumber \endcsname\etocthenumber
- \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthepage
+ \Etoc at global\expandafter\let\csname etocpage \endcsname \etocthepage
\ifEtoc at hyperref
- \Etoc at lxyz@hyper
+ \Etoc at lxyz@linktoc
\fi
}
-\def\Etoc at lxyz@hyper{%
+\def\Etoc at lxyz@linktoc{%
\ifcase\Hy at linktoc
% none: nothing to do
\or % section (aka name for etoc): link name and number
- \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
+ \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
\Etoc at global\expandafter\let\csname etocnumber \endcsname\etocthelinkednumber
- \or % page. Do as hyperref: add a link only if page number isn't empty.
- \ifx\etocthepage\ltx at empty
- \else
- \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
- \fi
+ \or % page
+ \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
\else % all
- \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
+ \Etoc at global\expandafter\let\csname etocname \endcsname\etocthelinkedname
\Etoc at global\expandafter\let\csname etocnumber \endcsname\etocthelinkednumber
- \ifx\etocthepage\ltx at empty
- \else
- \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
- \fi
+ \Etoc at global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
\fi
}
\def\Etoc@@getnb {%
- \Etoc at bracednamefalse
\let\Etoc at next\Etoc at getnb
- \ifx\Etoc at getnb@token\@sptoken\let\Etoc at next\Etoc at getnb@nohyp at nonbr\fi
- \ifx\Etoc at getnb@token\bgroup \let\Etoc at next\Etoc at getnb@checkifbraced\fi
+ \ifx\Etoc at getnb@token\@sptoken\let\Etoc at next\Etoc at getnb@nonbr\fi
+ \ifx\Etoc at getnb@token\bgroup \let\Etoc at next\Etoc at getnb@nonbr\fi
\Etoc at next
}
-\def\Etoc at tworelax{\relax\relax}
-\def\Etoc at getnb@checkifbraced #1#2\etoc@ {%
- \def\Etoc at tmp{#2}%
- \ifx\Etoc at tmp\Etoc at tworelax
- \expandafter\expandafter\expandafter\Etoc at getnb@nameisbraced
- \expandafter\@firstofone
- \else
- \expandafter\Etoc at getnb
- \fi {#1}#2\etoc@
-}
-\def\Etoc at getnb@nameisbraced {%
- \Etoc at bracednametrue
- \futurelet\Etoc at getnb@token\Etoc at getnb
-}
-\def\Etoc at getnb {%
- \ifx\Etoc at getnb@token\bgroup
- \expandafter\Etoc at getnb@nohyp at nonbr
- \else
- \expandafter\Etoc at getnb@nohyp
- \fi
-}
-\def\Etoc at getnb@nohyp #1{%
+\def\Etoc at getnb #1{%
\in@{#1}{\numberline\chapternumberline\partnumberline\booknumberline}%
\ifin@
- \let\Etoc at next\Etoc at getnb@nohyp at nmbrd
+ \let\Etoc at next\Etoc at getnb@nmbrd
\else
- \let\Etoc at next\Etoc at getnb@nohyp at nonbr
+ \ifnum\Etoc at level=\m at ne
+ \let\Etoc at next\Etoc@@getit
+ \else
+ \let\Etoc at next\Etoc at getnb@nonbr
+ \fi
\in@{#1}{\nonumberline}%
\ifin@
- \ifx\nonumberline\empty
- \let\Etoc at next\Etoc at getnb@nohyp at nonumberline
- \else
- \def\Etoc at next{\expandafter\Etoc at getnb@nohyp at nmbrd}%
- \fi
+ \let\Etoc at next\Etoc at getnb@nonumberline
\fi
\fi
\Etoc at next #1%
}
-\def\Etoc at getnb@nohyp at nmbrd #1#2#3\relax\relax\etoc@ {%
+\def\Etoc at getnb@nmbrd #1#2{%
\Etoc at global\Etoc at numbertrue
- \Etoc at global\def\etocthenumber {#2}%
- \Etoc at global\def\etocthelinkednumber {#2}%
- \ifEtoc at bracedname
- \Etoc at global\def\etocthename{{#3}}%
- \else
- \Etoc at global\def\etocthename{#3}%
- \fi
- \Etoc at global\let\etocthelinkedname \etocthename
+ \Etoc at global\def\etocthenumber {#2}%
+ \Etoc at getnb@nmbrd at getname\@empty
+}%
+\def\Etoc at getnb@nmbrd at getname #1\hspace\etoc@ {%
+ \Etoc at global\expandafter\def\expandafter\etocthename\expandafter{#1}%
}
-\def\Etoc at getnb@nohyp at nonbr #1\etoc@ {%
+\def\Etoc at getnb@nonbr #1\etoc@ {%
\Etoc at global\Etoc at numberfalse
- \Etoc at global\let\etocthenumber \@empty
- \Etoc at global\let\etocthelinkednumber \@empty
+ \Etoc at global\let\etocthenumber \@empty
}
-\def\Etoc at getnb@nohyp at nonumberline #1\relax\relax\etoc@ {%
+\def\Etoc at getnb@nonumberline #1\hspace\etoc@ {%
\Etoc at global\Etoc at numberfalse
- \Etoc at global\let\etocthenumber \@empty
- \Etoc at global\let\etocthelinkednumber \@empty
- \ifEtoc at bracedname
- \Etoc at global\expandafter\def\expandafter\etocthename
- \expandafter{\expandafter{#1}}%
- \else
- \Etoc at global\expandafter\def\expandafter\etocthename\expandafter{#1}%
- \fi
- \Etoc at global\let\etocthelinkedname \etocthename
+ \Etoc at global\let\etocthenumber \@empty
+ \Etoc at global\expandafter\def\expandafter\etocthename\expandafter{\@gobble#1}%
}
-\def\Etoc@@getit{%
- \ifEtoc at bracedname
- \expandafter\expandafter\expandafter\Etoc at getit@nameisbraced
- \expandafter\@firstofone
+\def\Etoc@@getit #1\hspace#2{%
+ \ifx\etoc@#2%
+ \Etoc at global\Etoc at numberfalse
+ \Etoc at global\let\etocthenumber \@empty
\else
- \expandafter\Etoc at getit@nohyp
- \fi
-}
-\def\Etoc at getit@nameisbraced {\futurelet\Etoc at getit@token\Etoc at getit@nohyp }
-\def\Etoc at getit@nohyp #1\hspace#2#3\etoc@ {%
- \ifx\relax#2%
- \else
- \Etoc at global\def\etocthenumber {#1}%
- \Etoc at global\def\etocthelinkednumber {#1}%
\Etoc at global\Etoc at numbertrue
- \Etoc at getit@nohyp at getname #3\etoc@
+ \Etoc at global\def\etocthenumber {#1}%
+ \expandafter\Etoc at getit@getname \expandafter\@empty
\fi
}
-\def\Etoc at getit@nohyp at getname #1\hspace\relax\etoc@ {%
- \ifEtoc at bracedname
- \Etoc at global\def\etocthename {{#1}}%
- \else
- \Etoc at global\def\etocthename {#1}%
- \fi
- \Etoc at global\let\etocthelinkedname\etocthename
+\def\Etoc at getit@getname #1\hspace\etoc@ {%
+ \Etoc at global\expandafter\def\expandafter\etocthename\expandafter{#1}%
}
\let\etocthename \@empty
\let\etocthenumber \@empty
@@ -539,7 +475,7 @@
\ifx\hyper at last\@undefined
\IfFileExists{\jobname .toc}
{\Hy at WarningNoLine
- {old toc file detected, not used; run LaTeX again (cheers from etoc)}%
+ {old toc file detected; run LaTeX again (cheers from `etoc')}%
\global\Etoc at toctoks={}%
}
{}%
@@ -663,11 +599,11 @@
\global\Etoc at emptytocfalse
\edef\Etoc at tocid{#1}%
\ifnum\Etoc at tocid<\@ne
- \setbox0\hbox{\ref{Unknown toc ref \@secondoftwo#1. Rerun LaTeX}}%
+ \setbox0\hbox{\ref{Unknown toc ref \@secondoftwo#1. \space Rerun LaTeX}}%
\global\Etoc at stoptoctrue
\gdef\etoclocaltop{-\thr@@}%
\Etoc at tableofcontents
- \expandafter\Etoc at gobbletoetoc@
+ \expandafter\Etoc at gobtoetoc@
\fi
\global\Etoc at notactivetrue
\ifEtoc at checksemptiness
@@ -675,12 +611,12 @@
\fi
\ifEtoc at emptytoc
\ifEtoc at notactive
- \setbox0\hbox{\ref{Unknown toc ID \number\Etoc at tocid. Rerun LaTeX}}%
+ \setbox0\hbox{\ref{Unknown toc ID \number\Etoc at tocid. \space Rerun LaTeX}}%
\global\Etoc at emptytocfalse
\global\Etoc at stoptoctrue
\gdef\etoclocaltop{-\thr@@}%
\Etoc at tableofcontents
- \expandafter\expandafter\expandafter\Etoc at gobbletoetoc@
+ \expandafter\expandafter\expandafter\Etoc at gobtoetoc@
\fi
\else
\global\Etoc at stoptocfalse
@@ -755,13 +691,12 @@
\localtableofcontents
}% \localtableofcontentswithrelativedepth
\let\Etoc at localtocdepth\c at tocdepth
-\long\def\Etoc at gobbletoetoc@ #1\etoc@ {}
\newcommand\etocsettocstyle[2]{%
\def\Etoc at tableofcontents
{%
\ifnum\c at tocdepth>\Etoc at minf
\else
- \expandafter\Etoc at gobbletoetoc@
+ \expandafter\Etoc at gobtoetoc@
\fi
\Etoc at par
\etocbeforetitlehook
@@ -772,10 +707,12 @@
\else
\def\Etoc at levellist@elt####1{%
\expandafter\def\csname etocsaved####1tocline\endcsname
- {\PackageWarning{etoc}{\expandafter\string\csname
- etocsaved####1tocline\endcsname\space is deprecated
- and to be\MessageBreak soon removed from etoc.
- Use directly \expandafter\string\csname l@####1\endcsname\MessageBreak }%
+ {\PackageWarning{etoc}{%
+ \expandafter\string\csname etocsaved####1tocline\endcsname\space
+ has been deprecated at 1.1a.\MessageBreak
+ It will be removed from `etoc' in near feature. \space Use\MessageBreak
+ \expandafter\string\csname l@####1\endcsname\space directly. \space
+ Reported}%
\expandafter\let\csname etocsaved####1tocline\expandafter\endcsname
\csname l@####1\endcsname
\csname l@####1\endcsname
@@ -1349,13 +1286,14 @@
{\AtBeginDocument
{\@ifpackageloaded{tocloft}
{\if at cftnctoc\else
- \PackageWarning {etoc}
- {Package `tocloft' was loaded after `etoc'!^^J%
-**** to prevent it from overwriting \protect\tableofcontents, it will be tricked^^J%
-**** into believing to have been loaded with option `titles'. For better^^J%
-**** compatibility, please load `tocloft' before `etoc'}%
+ \PackageWarningNoLine {etoc}
+ {Package `tocloft' was loaded after `etoc'.\MessageBreak
+ To prevent it from overwriting \protect\tableofcontents, it will\MessageBreak
+ be tricked into believing to have been loaded with its\MessageBreak
+ option `titles'. \space Please load `tocloft' before `etoc'}%
\AtEndDocument{\PackageWarning{etoc}
- {Please load `tocloft' /before/ `etoc'!}}\fi
+ {Please load `tocloft' before `etoc'!\@gobbletwo}}%
+ \fi
\@cftnctoctrue }%
{}%
}%
@@ -1457,18 +1395,19 @@
{\@namedef{Etoc at depthof@#1}{\@nameuse{Etoc@#2@@}}}%
}
\def\Etoc at tocvsec@err #1{\PackageError {etoc}
- {the command \protect#1\space is incompatible with etoc}
- {use \protect\etocsettocdepth.toc as replacement (see etoc manual)}%
+ {The command \protect#1\space is incompatible with `etoc'}
+ {Use \protect\etocsettocdepth.toc as replacement}%
}%
\AtBeginDocument {%
\@ifclassloaded{memoir}
{\PackageInfo {etoc}
- {Regarding memoir class command \protect\settocdepth, consider^^J
- \protect\etocsettocdepth.toc as a drop-in replacement with
- more capabilities^^J (see etoc manual). Similarly
- \protect\etocsettocdepth\space and
- \protect\etocsetnexttocdepth^^J should replace
- use of memoir's \protect\maxtocdepth\space command.}}
+ {Regarding `memoir' class command \protect\settocdepth, consider\MessageBreak
+ \protect\etocsettocdepth.toc as a drop-in replacement with more\MessageBreak
+ capabilities (see `etoc' manual). \space
+ Also, \protect\etocsettocdepth\MessageBreak
+ and \protect\etocsetnexttocdepth\space should be used in place of\MessageBreak
+ `memoir' command \protect\maxtocdepth\@gobble}%
+ }%
{\@ifpackageloaded {tocvsec2}
{\def\maxtocdepth #1{\Etoc at tocvsec@err \maxtocdepth }%
\def\settocdepth #1{\Etoc at tocvsec@err \settocdepth }%
@@ -1479,11 +1418,12 @@
\let\reset at tocdepth\relax
\let\remax at tocdepth\relax
\let\tableofcontents\etoctableofcontents
- \PackageWarning {etoc}
- {package tocvsec2 detected and its modification of^^J
- \protect\tableofcontents\space reverted. Use
- \protect\etocsettocdepth.toc as a replacement^^J
- for the tocvsec2 toc-related commands}}{}%
+ \PackageWarningNoLine {etoc}
+ {Package `tocvsec2' detected and its modification of\MessageBreak
+ \protect\tableofcontents\space reverted. \space Use
+ \protect\etocsettocdepth.toc\MessageBreak as a replacement
+ for `tocvsec2' toc-related commands}}% tocvsec2 loaded
+ {}% not loaded
}%
}%
\def\invisibletableofcontents {\etocsetnexttocdepth {-3}\tableofcontents }%
More information about the tex-live-commits
mailing list.