summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/etoc/README.md7
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etoc-DE.pdfbin580062 -> 580068 bytes
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etoc.pdfbin623871 -> 624860 bytes
-rw-r--r--Master/texmf-dist/source/latex/etoc/etoc.dtx298
-rw-r--r--Master/texmf-dist/source/latex/etoc/etoc.ins8
-rw-r--r--Master/texmf-dist/tex/latex/etoc/etoc.sty241
6 files changed, 322 insertions, 232 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/README.md b/Master/texmf-dist/doc/latex/etoc/README.md
index c4b007a013c..7e6e3f32667 100644
--- a/Master/texmf-dist/doc/latex/etoc/README.md
+++ b/Master/texmf-dist/doc/latex/etoc/README.md
@@ -1,6 +1,6 @@
<!-- -->
- Source: etoc.dtx (v1.08m-2018/02/07)
+ Source: etoc.dtx (v1.08n-2018/02/23)
Author: Jean-Francois Burnol
Author: Christine Roemer et al. (German tranlation)
Info: Completely customisable TOCs
@@ -116,6 +116,11 @@ etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi.
RECENT CHANGES
==============
+v1.08n \[2018/02/23\]
+---------------------
+
+Refactoring of core macros detecting `\numberline` and its variants.
+
v1.08m \[2018/02/07\]
---------------------
diff --git a/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf b/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf
index 06580b98695..6b49a2096e8 100644
--- a/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf
+++ b/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/etoc/etoc.pdf b/Master/texmf-dist/doc/latex/etoc/etoc.pdf
index c79add291c7..51ac2eb3aaa 100644
--- a/Master/texmf-dist/doc/latex/etoc/etoc.pdf
+++ b/Master/texmf-dist/doc/latex/etoc/etoc.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/etoc/etoc.dtx b/Master/texmf-dist/source/latex/etoc/etoc.dtx
index 9758bea510d..ecc72095dad 100644
--- a/Master/texmf-dist/source/latex/etoc/etoc.dtx
+++ b/Master/texmf-dist/source/latex/etoc/etoc.dtx
@@ -2,12 +2,12 @@
% N.B.: this dtx file is NOT for use with \DocInput. The latex source of the
% user manual is not prefixed with percent signs.
%<*none>
-\def\etocdtxtimestamp {Time-stamp: <07-02-2018 at 23:54:39 CET>}%
+\def\etocdtxtimestamp {Time-stamp: <23-02-2018 at 22:07:11 CET>}%
%</none>
%<*!readme>
%%
%% Package: etoc
-%% Version: 1.08m-2018/02/07
+%% Version: 1.08n-2018/02/23
%% License: LPPL 1.3c
%% Copyright (C) 2012-2018 Jean-Francois Burnol
%% <jfbu at free dot fr>
@@ -17,14 +17,14 @@
%%
%</!readme>
%<*insfile>
-\def\etocpkgdate {2018/02/07}
-\def\etocdocdate {2018/02/07}
-\def\etocpkgversion {v1.08m}
+\def\etocpkgdate {2018/02/23}
+\def\etocdocdate {2018/02/23}
+\def\etocpkgversion {v1.08n}
\def\etocpkgdescription {Completely customisable TOCs (JFB)}
%</insfile>
%<*none>
-\def\etocDEpkgdate {23.10.2017}% METTRE À JOUR À CHAQUE BUMP!
-\def\etocDEdocdate {23.10.2017}
+\def\etocDEpkgdate {23.02.2018}% METTRE À JOUR À CHAQUE BUMP!
+\def\etocDEdocdate {23.02.2018}
\def\etocDEDEdocdate {09.04.2015}%
\def\etocDEDEpkgversion {v1.08d}%
% Definition of \etocLicense
@@ -35,7 +35,7 @@
\catcode32=13\catcode`\\=12^^Brelax^^A
^^Bfirstofone{^^Bendgroup^^Bdef^^BetocLicense^^A
{% Package: etoc
-% Version: 1.08m-2018/02/07
+% Version: 1.08n-2018/02/23
% License: LPPL 1.3c
% Copyright (C) 2012-2018 Jean-Francois Burnol <jfbu at free dot fr>
% Copyright (C) 2014-2018 Christine Roemer <Christine_Roemer at t-online dot de>
@@ -69,7 +69,7 @@
%<*readme>
<!-- -->
- Source: etoc.dtx (v1.08m-2018/02/07)
+ Source: etoc.dtx (v1.08n-2018/02/23)
Author: Jean-Francois Burnol
Author: Christine Roemer et al. (German tranlation)
Info: Completely customisable TOCs
@@ -185,6 +185,11 @@ etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi.
RECENT CHANGES
==============
+v1.08n \[2018/02/23\]
+---------------------
+
+Refactoring of core macros detecting `\numberline` and its variants.
+
v1.08m \[2018/02/07\]
---------------------
@@ -10907,7 +10912,11 @@ Dokumentation erzeugt von der Quelldatei mit dem Stempel
\begin{multicols}{2}
\begin{jfverbatim}
-v1.08m [2018/02/07]^
+v1.08n [2018/02/23]^
+
+ Refactoring of core macros detecting \numberline and its variants.
+
+~v1.08m [2018/02/07]^
Fix to 1.08k's introduced incompatibility with KOMA-script
and tocbasic's \nonumberline.
@@ -11984,17 +11993,22 @@ v1.08m [2018/02/07]^
% \csa{etoclink} did not, and thus it could not be used after a group was
% closed for example by a |&| from the sectioning style, even if having used
% |\etocglobaldefs|.
+%
+% |1.08n| adds |\futurelet|-based methods to avoid unbracing things.
% \begin{macrocode}
\def\Etoc@lxyz #1#2{%
\Etoc@global\let\etocthelink\@firstofone % fall-back, was let \@empty up to 1.08i (inc.)
\Etoc@global\def\etocthename {#1}% (if linked, will be removed later)
\Etoc@global\def\etocthelinkedname {#1}% (probably redefined later)
- \Etoc@getthepage #2\etoc@ % defines \etocthelinkedpage
- \Etoc@getnb #1\relax\relax\etoc@ % sets number, name, and \etocthelink
+ \futurelet\Etoc@getthepage@token
+ \Etoc@getthepage #2\etoc@ % defines \etocthelinkedpage
+ \futurelet\Etoc@getnb@token
+ \Etoc@getnb #1\relax\relax\etoc@ % sets number, name, and \etocthelink
\ifEtoc@number
\else
\ifnum\Etoc@level=\m@ne
- \Etoc@getit #1\hspace\relax\etoc@ % additional job for parts
+ \futurelet\Etoc@getit@token
+ \Etoc@getit #1\hspace\relax\etoc@ % additional job for parts
\fi
\fi
\Etoc@global\expandafter\let\csname etoclink \endcsname\etocthelink
@@ -12005,16 +12019,18 @@ v1.08m [2018/02/07]^
% \end{macrocode}
% |1.08| adds the |\Etoc@global|'s.
%
-% |1.08j| fixes old |\ifx #1\hyperlink@start| bug.
+% |1.08j| fixes an old |\ifx #1\hyperlink@start| bug.
+%
+% Potential (but rather exotic) brace removal problems wiped away at |1.08n|.
% \begin{macrocode}
-\def\Etoc@getthepage #1{%
- \let\Etoc@next\Etoc@getthepage@nohyp
- \ifEtoc@hyperref
- \ifx\hyper@linkstart#1%
- \let\Etoc@next\Etoc@getthepage@hyp
- \fi
- \fi
- \Etoc@next #1%
+\def\Etoc@getthepage {%
+ \if1\ifEtoc@hyperref
+ \ifx\hyper@linkstart\Etoc@getthepage@token1\else0\fi
+ \else0\fi
+ \expandafter\Etoc@getthepage@hyp
+ \else
+ \expandafter\Etoc@getthepage@nohyp
+ \fi
}
\def\Etoc@getthepage@nohyp #1\etoc@ {%
\Etoc@global\def\etocthepage {#1}%
@@ -12036,35 +12052,32 @@ v1.08m [2018/02/07]^
% which contains the |\Hy@tocdestname| already expanded.
% \begin{macrocode}
\def\Etoc@getthepage@hyp #1#2#3#4#5\etoc@ {%
- \Etoc@global\def\etocthepage {#4}%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkedpage\expandafter
- {\expandafter\hyperlink \Etoc@tmp{#4}}%
- \Etoc@global\edef\etocthelink##1{\noexpand\hyperlink\Etoc@tmp{##1}}%
+ \Etoc@global\def\etocthepage {#4}%
+ \edef\Etoc@tmp {{#3}}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedpage\expandafter
+ {\expandafter\hyperlink \Etoc@tmp{#4}}%
+ \Etoc@global\edef\etocthelink##1{\noexpand\hyperlink\Etoc@tmp{##1}}%
}
% \end{macrocode}
% |1.08j| fixes an old buggy |\ifx #1\hyper@linkstart|. This could show if
% hyperref was present with |linktoc=page| option for example, because in that
-% case |#1| could be braced tokens. As this is rare condition, it had not been
-% reported so far by my single user user-base.
+% case |#1| could be some tokens within braces. As this is rare case though,
+% no bug was reported.
+%
+% Anyway I refactored the whole thing at |1.08n|.
% \begin{macrocode}
-\def\Etoc@getnb #1{%
- \let\Etoc@next\Etoc@getnb@nohyp
- \ifEtoc@hyperref
- \ifx\hyper@linkstart#1%
- \let\Etoc@next\Etoc@getnb@hyp
- \fi
- \fi
- \Etoc@next #1%
-}
-\def\Etoc@getit #1{%
- \let\Etoc@next\Etoc@getit@nohyp
- \ifEtoc@hyperref
- \ifx\hyper@linkstart#1%
- \let\Etoc@next\Etoc@getit@hyp
- \fi
- \fi
- \Etoc@next #1%
+\def\Etoc@getnb {%
+ \ifx\Etoc@getnb@token\bgroup
+ \expandafter\Etoc@getnb@nohyp@nonbr
+ \else
+ \if1\ifEtoc@hyperref
+ \ifx\hyper@linkstart\Etoc@getnb@token1\else0\fi
+ \else0\fi
+ \expandafter\expandafter\expandafter\Etoc@getnb@hyp
+ \else
+ \expandafter\expandafter\expandafter\Etoc@getnb@nohyp
+ \fi
+ \fi
}
% \end{macrocode}
% |1.08| adds the |\Etoc@global|'s.
@@ -12078,28 +12091,44 @@ v1.08m [2018/02/07]^
%
% |1.08m| fixes incompatibility of |1.08k|'s delimited macro method with KOMA's
% \csa{nonumberline}.
+%
+% Both |1.08k| and
+% |1.08m| actually would have needed some |\detokenize| for complete safety
+% and so far \etoc does not use e-\TeX. So here at |1.08n| I refactored the
+% whole thing. And I added a |\futurelet|-based brace detection in
+% |\Etoc@getnb| so here |#1| is guaranteed not braced now.
+%
+% |1.08n| tries to handle reasonably the |\nonumberline| of KOMA-script.
+% If it expands to |\numberline{}|, \etoc will thus consider the line
+% numbered with an empty number.
% \begin{macrocode}
-\begingroup\@tfor\x:=NUMBZRLINZ\do{\catcode\expandafter`\x=12 }\lccode`Z `e
-\lowercase{\endgroup
-\long\def\Etoc@oneifnumberline #1NUMBZRLINZ#2#3\Etoc@next#4{%
- \ifx\etoc@#20\else\ifx\nonumberline#40\else1\fi\fi
-}%
-\def\Etoc@getnb@nohyp #1#2#3\etoc@ {%
- \def\Etoc@getname ##1\relax\relax\etoc@ {%
- \Etoc@global\def\etocthename {##1}%
- \Etoc@global\def\etocthelinkedname {##1}%
- }%
- \if1\expandafter\Etoc@oneifnumberline\string#1NUMBZRLINZ\etoc@\Etoc@next{#1}%
+\def\Etoc@getnb@nohyp #1{%
+ \in@{#1}{\numberline\chapternumberline\partnumberline\booknumberline}%
+ \ifin@
+ \let\Etoc@next\Etoc@getnb@nohyp@nmbrd
+ \else
+ \let\Etoc@next\Etoc@getnb@nohyp@nonbr
+ \in@{#1}{\nonumberline}%
+ \ifin@
+ \ifx\nonumberline\empty\else\let\Etoc@next\Etoc@getnb@nohyp@nmbrd\fi
+ \expandafter\expandafter\expandafter\expandafter
+ \fi
+ \fi
+ \Etoc@next #1%
+}
+\def\Etoc@getnb@nohyp@nmbrd #1#2#3\relax\relax\etoc@ {%
+ \Etoc@global\Etoc@numbertrue
\Etoc@global\def\etocthenumber {#2}%
\Etoc@global\def\etocthelinkednumber {#2}%
- \Etoc@global\Etoc@numbertrue
- \Etoc@getname #3\etoc@
- \else % \etocthename and \etocthelinkedname already defined
+ \Etoc@global\def\etocthename {#3}%
+ \Etoc@global\def\etocthelinkedname {#3}%
+}
+\def\Etoc@getnb@nohyp@nonbr #1\etoc@ {%
+ % \etocthename and \etocthelinkedname already defined in \Etoc@lxyz
+ \Etoc@global\Etoc@numberfalse
\Etoc@global\let\etocthenumber \@empty
\Etoc@global\let\etocthelinkednumber \@empty
- \Etoc@global\Etoc@numberfalse
- \fi
-}%
+}
% \end{macrocode}
% |1.07n| replaces use of |\toks@| by macro |\Etoc@tmp|. |1.08| adds
% the |\Etoc@global|'s.
@@ -12108,50 +12137,74 @@ v1.08m [2018/02/07]^
%
% |1.08k| uses a delimited macro to identify \csa{numberline},
% \csa{chapternumberline} etc... in one go.
+%
+% But anyway this was completely refactored at |1.08n|.
% \begin{macrocode}
\def\Etoc@getnb@hyp #1#2#3#4#5#6\etoc@ {%
- \def\Etoc@getname ##1\relax\relax\etoc@ {%
- \Etoc@global\def\etocthename {##1}%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkedname\expandafter
- {\expandafter\hyperlink \Etoc@tmp{##1}}%
- }%
- \def\Etoc@getnbr ##1##2##3\etoc@ {%
- \if1\expandafter\Etoc@oneifnumberline\string##1NUMBZRLINZ\etoc@\Etoc@next{##1}%
- \Etoc@global\def\etocthenumber {##2}%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkednumber
- \expandafter{\expandafter\hyperlink \Etoc@tmp{##2}}%
- \Etoc@global\Etoc@numbertrue
- \Etoc@getname ##3\etoc@
- \else
- \Etoc@global\let\etocthenumber \@empty
- \Etoc@global\let\etocthelinkednumber \@empty
- \Etoc@global\Etoc@numberfalse
- \Etoc@global\def\etocthename {#4}%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkedname
- \expandafter {\expandafter\hyperlink \Etoc@tmp{#4}}%
- \fi
- }%
- \Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
- \Etoc@getnbr #4\relax\relax\etoc@
-}}
+ \edef\Etoc@tmp {{#3}}%
+ \Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
+ \Etoc@global\def\etocthename {#4}% temporary definition
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedname
+ \expandafter {\expandafter\hyperlink \Etoc@tmp{#4}}%
+ \futurelet\Etoc@hyp@getnb@token\Etoc@hyp@getnb #4\relax\relax\etoc@
+}
+\def\Etoc@hyp@getnb {%
+ \ifx\Etoc@hyp@getnb@token\bgroup
+ \expandafter\Etoc@hyp@getnb@nonbr
+ \else
+ \expandafter\Etoc@getnb@hyp@a
+ \fi
+}
+\def\Etoc@getnb@hyp@a #1{%
+ \in@{#1}{\numberline\chapternumberline\partnumberline\booknumberline}%
+ \ifin@
+ \let\Etoc@next\Etoc@getnb@hyp@nmbrd
+ \else
+ \let\Etoc@next\Etoc@getnb@hyp@nonbr
+ \in@{#1}{\nonumberline}%
+ \ifin@
+ \ifx\nonumberline\empty\else\let\Etoc@next\Etoc@getnb@hyp@nmbrd\fi
+ \expandafter\expandafter\expandafter\expandafter
+ \fi
+ \fi
+ \Etoc@next #1%
+}
+\def\Etoc@getnb@hyp@nmbrd #1#2#3\relax\relax\etoc@ {%
+ \Etoc@global\Etoc@numbertrue
+ \Etoc@global\def\etocthenumber {#2}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkednumber
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#2}}%
+ \Etoc@global\def\etocthename {#3}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedname
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#3}}%
+}
+\let\Etoc@getnb@hyp@nonbr\Etoc@getnb@nohyp@nonbr
% \end{macrocode}
% |1.08| adds the |\Etoc@global|'s.
+%
+% |1.08n| refactors this but it is still not extremely robust.
% \begin{macrocode}
+\def\Etoc@getit {%
+ \if1\ifEtoc@hyperref
+ \ifx\hyper@linkstart\Etoc@getit@token1\else0\fi
+ \else0\fi
+ \expandafter\Etoc@getit@hyp
+ \else
+ \expandafter\Etoc@getit@nohyp
+ \fi
+}
\def\Etoc@getit@nohyp #1\hspace#2#3\etoc@ {%
- \def\Etoc@getname ##1\hspace\relax\etoc@ {%
- \Etoc@global\def\etocthename {##1}%
- \Etoc@global\def\etocthelinkedname {##1}%
- }%
- \ifx\relax#2%
- \else
- \Etoc@global\def\etocthenumber {#1}%
- \Etoc@global\def\etocthelinkednumber {#1}%
- \Etoc@global\Etoc@numbertrue
- \Etoc@getname #3\etoc@
- \fi
+ \ifx\relax#2%
+ \else
+ \Etoc@global\def\etocthenumber {#1}%
+ \Etoc@global\def\etocthelinkednumber {#1}%
+ \Etoc@global\Etoc@numbertrue
+ \Etoc@getit@nohyp@getname #3\etoc@
+ \fi
+}
+\def\Etoc@getit@nohyp@getname #1\hspace\relax\etoc@ {%
+ \Etoc@global\def\etocthename {#1}%
+ \Etoc@global\def\etocthelinkedname {#1}%
}
% \end{macrocode}
% |1.07n| replaces use of |\toks@| by macro |\Etoc@tmp|. |1.08| adds
@@ -12164,27 +12217,32 @@ v1.08m [2018/02/07]^
% |\ifx| bug in |\Etoc@getnb| also fixed at |1.08j|, and this would have
% overshadowed this one by a real compilation error rather than a missing link
% in the procuced PDF.
+%
+% |1.08n| refactors the whole thing.
% \begin{macrocode}
\def\Etoc@getit@hyp #1#2#3#4#5#6\etoc@ {%
- \def\Etoc@getname ##1\hspace\relax\etoc@ {%
- \Etoc@global\def\etocthename {##1}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkedname
- \expandafter{\expandafter\hyperlink \Etoc@tmp{##1}}%
- }%
- \def\Etoc@getnbr ##1\hspace##2##3\etoc@ {%
- \ifx\relax##2%
- \else
- \Etoc@global\def\etocthenumber {##1}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkednumber
- \expandafter{\expandafter\hyperlink \Etoc@tmp{##1}}%
- \Etoc@global\Etoc@numbertrue
- \Etoc@getname ##3\etoc@
- \fi
- }%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@getnbr #4\hspace\relax\etoc@
- \Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink\Etoc@tmp{##1}}%
+ \edef\Etoc@tmp {{#3}}%
+ \Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink \Etoc@tmp{##1}}%
+ \Etoc@global\def\etocthename {#4}% temporary definition
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedname
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#4}}%
+ \Etoc@hyp@getit #4\hspace\relax\etoc@
}
+\def\Etoc@hyp@getit #1\hspace#2#3\etoc@ {%
+ \ifx\relax#2% not extremely safe
+ \else
+ \Etoc@global\Etoc@numbertrue
+ \Etoc@global\def\etocthenumber {#1}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkednumber
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#1}}%
+ \Etoc@getit@hyp@getname #3\etoc@
+ \fi
+}
+\def\Etoc@getit@hyp@getname #1\hspace\relax\etoc@ {%
+ \Etoc@global\def\etocthename {#1}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedname
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#1}}%
+}%
% \end{macrocode}
% |1.08a| of |2015/03/12| does the long-postponed thing to let |\etocname|
% etc.. be simply the robust variant of |\etocthelinkedname| etc...
@@ -13674,7 +13732,7 @@ v1.08m [2018/02/07]^
Grave accent \` Left brace \{ Vertical bar \|
Right brace \} Tilde \~}
-\CheckSum{3313}%
+\CheckSum{3375}%
\csname check@checksum\endcsname
\Finale
diff --git a/Master/texmf-dist/source/latex/etoc/etoc.ins b/Master/texmf-dist/source/latex/etoc/etoc.ins
index c715eadcfde..a8c5f6da0f3 100644
--- a/Master/texmf-dist/source/latex/etoc/etoc.ins
+++ b/Master/texmf-dist/source/latex/etoc/etoc.ins
@@ -1,6 +1,6 @@
%%
%% Package: etoc
-%% Version: 1.08m-2018/02/07
+%% Version: 1.08n-2018/02/23
%% License: LPPL 1.3c
%% Copyright (C) 2012-2018 Jean-Francois Burnol
%% <jfbu at free dot fr>
@@ -8,9 +8,9 @@
%% <Christine_Roemer at t-online dot de>
%% and collaborators for the translation into German of the documentation
%%
-\def\etocpkgdate {2018/02/07}
-\def\etocdocdate {2018/02/07}
-\def\etocpkgversion {v1.08m}
+\def\etocpkgdate {2018/02/23}
+\def\etocdocdate {2018/02/23}
+\def\etocpkgversion {v1.08n}
\def\etocpkgdescription {Completely customisable TOCs (JFB)}
%% Run etex on this file to extract from etoc.dtx:
%% etoc.sty, etoc.tex, etoc-DE.tex and README.md
diff --git a/Master/texmf-dist/tex/latex/etoc/etoc.sty b/Master/texmf-dist/tex/latex/etoc/etoc.sty
index 1a1f7ab901d..1dec7ee47be 100644
--- a/Master/texmf-dist/tex/latex/etoc/etoc.sty
+++ b/Master/texmf-dist/tex/latex/etoc/etoc.sty
@@ -23,10 +23,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{etoc}
- [2018/02/07 v1.08m Completely customisable TOCs (JFB)]
+ [2018/02/23 v1.08n Completely customisable TOCs (JFB)]
%%
%% Package: etoc
-%% Version: 1.08m-2018/02/07
+%% Version: 1.08n-2018/02/23
%% License: LPPL 1.3c
%% Copyright (C) 2012-2018 Jean-Francois Burnol
%% <jfbu at free dot fr>
@@ -340,12 +340,15 @@
\Etoc@global\let\etocthelink\@firstofone % fall-back, was let \@empty up to 1.08i (inc.)
\Etoc@global\def\etocthename {#1}% (if linked, will be removed later)
\Etoc@global\def\etocthelinkedname {#1}% (probably redefined later)
- \Etoc@getthepage #2\etoc@ % defines \etocthelinkedpage
- \Etoc@getnb #1\relax\relax\etoc@ % sets number, name, and \etocthelink
+ \futurelet\Etoc@getthepage@token
+ \Etoc@getthepage #2\etoc@ % defines \etocthelinkedpage
+ \futurelet\Etoc@getnb@token
+ \Etoc@getnb #1\relax\relax\etoc@ % sets number, name, and \etocthelink
\ifEtoc@number
\else
\ifnum\Etoc@level=\m@ne
- \Etoc@getit #1\hspace\relax\etoc@ % additional job for parts
+ \futurelet\Etoc@getit@token
+ \Etoc@getit #1\hspace\relax\etoc@ % additional job for parts
\fi
\fi
\Etoc@global\expandafter\let\csname etoclink \endcsname\etocthelink
@@ -353,126 +356,150 @@
\Etoc@global\expandafter\let\csname etocnumber \endcsname\etocthelinkednumber
\Etoc@global\expandafter\let\csname etocpage \endcsname\etocthelinkedpage
}
-\def\Etoc@getthepage #1{%
- \let\Etoc@next\Etoc@getthepage@nohyp
- \ifEtoc@hyperref
- \ifx\hyper@linkstart#1%
- \let\Etoc@next\Etoc@getthepage@hyp
- \fi
- \fi
- \Etoc@next #1%
+\def\Etoc@getthepage {%
+ \if1\ifEtoc@hyperref
+ \ifx\hyper@linkstart\Etoc@getthepage@token1\else0\fi
+ \else0\fi
+ \expandafter\Etoc@getthepage@hyp
+ \else
+ \expandafter\Etoc@getthepage@nohyp
+ \fi
}
\def\Etoc@getthepage@nohyp #1\etoc@ {%
\Etoc@global\def\etocthepage {#1}%
\Etoc@global\def\etocthelinkedpage {#1}%
}
\def\Etoc@getthepage@hyp #1#2#3#4#5\etoc@ {%
- \Etoc@global\def\etocthepage {#4}%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkedpage\expandafter
- {\expandafter\hyperlink \Etoc@tmp{#4}}%
- \Etoc@global\edef\etocthelink##1{\noexpand\hyperlink\Etoc@tmp{##1}}%
+ \Etoc@global\def\etocthepage {#4}%
+ \edef\Etoc@tmp {{#3}}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedpage\expandafter
+ {\expandafter\hyperlink \Etoc@tmp{#4}}%
+ \Etoc@global\edef\etocthelink##1{\noexpand\hyperlink\Etoc@tmp{##1}}%
}
-\def\Etoc@getnb #1{%
- \let\Etoc@next\Etoc@getnb@nohyp
- \ifEtoc@hyperref
- \ifx\hyper@linkstart#1%
- \let\Etoc@next\Etoc@getnb@hyp
- \fi
- \fi
- \Etoc@next #1%
+\def\Etoc@getnb {%
+ \ifx\Etoc@getnb@token\bgroup
+ \expandafter\Etoc@getnb@nohyp@nonbr
+ \else
+ \if1\ifEtoc@hyperref
+ \ifx\hyper@linkstart\Etoc@getnb@token1\else0\fi
+ \else0\fi
+ \expandafter\expandafter\expandafter\Etoc@getnb@hyp
+ \else
+ \expandafter\expandafter\expandafter\Etoc@getnb@nohyp
+ \fi
+ \fi
}
-\def\Etoc@getit #1{%
- \let\Etoc@next\Etoc@getit@nohyp
- \ifEtoc@hyperref
- \ifx\hyper@linkstart#1%
- \let\Etoc@next\Etoc@getit@hyp
- \fi
- \fi
- \Etoc@next #1%
+\def\Etoc@getnb@nohyp #1{%
+ \in@{#1}{\numberline\chapternumberline\partnumberline\booknumberline}%
+ \ifin@
+ \let\Etoc@next\Etoc@getnb@nohyp@nmbrd
+ \else
+ \let\Etoc@next\Etoc@getnb@nohyp@nonbr
+ \in@{#1}{\nonumberline}%
+ \ifin@
+ \ifx\nonumberline\empty\else\let\Etoc@next\Etoc@getnb@nohyp@nmbrd\fi
+ \expandafter\expandafter\expandafter\expandafter
+ \fi
+ \fi
+ \Etoc@next #1%
}
-\begingroup\@tfor\x:=NUMBZRLINZ\do{\catcode\expandafter`\x=12 }\lccode`Z `e
-\lowercase{\endgroup
-\long\def\Etoc@oneifnumberline #1NUMBZRLINZ#2#3\Etoc@next#4{%
- \ifx\etoc@#20\else\ifx\nonumberline#40\else1\fi\fi
-}%
-\def\Etoc@getnb@nohyp #1#2#3\etoc@ {%
- \def\Etoc@getname ##1\relax\relax\etoc@ {%
- \Etoc@global\def\etocthename {##1}%
- \Etoc@global\def\etocthelinkedname {##1}%
- }%
- \if1\expandafter\Etoc@oneifnumberline\string#1NUMBZRLINZ\etoc@\Etoc@next{#1}%
+\def\Etoc@getnb@nohyp@nmbrd #1#2#3\relax\relax\etoc@ {%
+ \Etoc@global\Etoc@numbertrue
\Etoc@global\def\etocthenumber {#2}%
\Etoc@global\def\etocthelinkednumber {#2}%
- \Etoc@global\Etoc@numbertrue
- \Etoc@getname #3\etoc@
- \else % \etocthename and \etocthelinkedname already defined
+ \Etoc@global\def\etocthename {#3}%
+ \Etoc@global\def\etocthelinkedname {#3}%
+}
+\def\Etoc@getnb@nohyp@nonbr #1\etoc@ {%
+ % \etocthename and \etocthelinkedname already defined in \Etoc@lxyz
+ \Etoc@global\Etoc@numberfalse
\Etoc@global\let\etocthenumber \@empty
\Etoc@global\let\etocthelinkednumber \@empty
- \Etoc@global\Etoc@numberfalse
- \fi
-}%
+}
\def\Etoc@getnb@hyp #1#2#3#4#5#6\etoc@ {%
- \def\Etoc@getname ##1\relax\relax\etoc@ {%
- \Etoc@global\def\etocthename {##1}%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkedname\expandafter
- {\expandafter\hyperlink \Etoc@tmp{##1}}%
- }%
- \def\Etoc@getnbr ##1##2##3\etoc@ {%
- \if1\expandafter\Etoc@oneifnumberline\string##1NUMBZRLINZ\etoc@\Etoc@next{##1}%
- \Etoc@global\def\etocthenumber {##2}%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkednumber
- \expandafter{\expandafter\hyperlink \Etoc@tmp{##2}}%
- \Etoc@global\Etoc@numbertrue
- \Etoc@getname ##3\etoc@
- \else
- \Etoc@global\let\etocthenumber \@empty
- \Etoc@global\let\etocthelinkednumber \@empty
- \Etoc@global\Etoc@numberfalse
- \Etoc@global\def\etocthename {#4}%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkedname
- \expandafter {\expandafter\hyperlink \Etoc@tmp{#4}}%
- \fi
- }%
- \Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
- \Etoc@getnbr #4\relax\relax\etoc@
-}}
+ \edef\Etoc@tmp {{#3}}%
+ \Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}%
+ \Etoc@global\def\etocthename {#4}% temporary definition
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedname
+ \expandafter {\expandafter\hyperlink \Etoc@tmp{#4}}%
+ \futurelet\Etoc@hyp@getnb@token\Etoc@hyp@getnb #4\relax\relax\etoc@
+}
+\def\Etoc@hyp@getnb {%
+ \ifx\Etoc@hyp@getnb@token\bgroup
+ \expandafter\Etoc@hyp@getnb@nonbr
+ \else
+ \expandafter\Etoc@getnb@hyp@a
+ \fi
+}
+\def\Etoc@getnb@hyp@a #1{%
+ \in@{#1}{\numberline\chapternumberline\partnumberline\booknumberline}%
+ \ifin@
+ \let\Etoc@next\Etoc@getnb@hyp@nmbrd
+ \else
+ \let\Etoc@next\Etoc@getnb@hyp@nonbr
+ \in@{#1}{\nonumberline}%
+ \ifin@
+ \ifx\nonumberline\empty\else\let\Etoc@next\Etoc@getnb@hyp@nmbrd\fi
+ \expandafter\expandafter\expandafter\expandafter
+ \fi
+ \fi
+ \Etoc@next #1%
+}
+\def\Etoc@getnb@hyp@nmbrd #1#2#3\relax\relax\etoc@ {%
+ \Etoc@global\Etoc@numbertrue
+ \Etoc@global\def\etocthenumber {#2}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkednumber
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#2}}%
+ \Etoc@global\def\etocthename {#3}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedname
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#3}}%
+}
+\let\Etoc@getnb@hyp@nonbr\Etoc@getnb@nohyp@nonbr
+\def\Etoc@getit {%
+ \if1\ifEtoc@hyperref
+ \ifx\hyper@linkstart\Etoc@getit@token1\else0\fi
+ \else0\fi
+ \expandafter\Etoc@getit@hyp
+ \else
+ \expandafter\Etoc@getit@nohyp
+ \fi
+}
\def\Etoc@getit@nohyp #1\hspace#2#3\etoc@ {%
- \def\Etoc@getname ##1\hspace\relax\etoc@ {%
- \Etoc@global\def\etocthename {##1}%
- \Etoc@global\def\etocthelinkedname {##1}%
- }%
- \ifx\relax#2%
- \else
- \Etoc@global\def\etocthenumber {#1}%
- \Etoc@global\def\etocthelinkednumber {#1}%
- \Etoc@global\Etoc@numbertrue
- \Etoc@getname #3\etoc@
- \fi
+ \ifx\relax#2%
+ \else
+ \Etoc@global\def\etocthenumber {#1}%
+ \Etoc@global\def\etocthelinkednumber {#1}%
+ \Etoc@global\Etoc@numbertrue
+ \Etoc@getit@nohyp@getname #3\etoc@
+ \fi
+}
+\def\Etoc@getit@nohyp@getname #1\hspace\relax\etoc@ {%
+ \Etoc@global\def\etocthename {#1}%
+ \Etoc@global\def\etocthelinkedname {#1}%
}
\def\Etoc@getit@hyp #1#2#3#4#5#6\etoc@ {%
- \def\Etoc@getname ##1\hspace\relax\etoc@ {%
- \Etoc@global\def\etocthename {##1}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkedname
- \expandafter{\expandafter\hyperlink \Etoc@tmp{##1}}%
- }%
- \def\Etoc@getnbr ##1\hspace##2##3\etoc@ {%
- \ifx\relax##2%
- \else
- \Etoc@global\def\etocthenumber {##1}%
- \Etoc@global\expandafter\def\expandafter\etocthelinkednumber
- \expandafter{\expandafter\hyperlink \Etoc@tmp{##1}}%
- \Etoc@global\Etoc@numbertrue
- \Etoc@getname ##3\etoc@
- \fi
- }%
- \edef\Etoc@tmp {{#3}}%
- \Etoc@getnbr #4\hspace\relax\etoc@
- \Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink\Etoc@tmp{##1}}%
+ \edef\Etoc@tmp {{#3}}%
+ \Etoc@global\edef\etocthelink ##1{\noexpand\hyperlink \Etoc@tmp{##1}}%
+ \Etoc@global\def\etocthename {#4}% temporary definition
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedname
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#4}}%
+ \Etoc@hyp@getit #4\hspace\relax\etoc@
+}
+\def\Etoc@hyp@getit #1\hspace#2#3\etoc@ {%
+ \ifx\relax#2% not extremely safe
+ \else
+ \Etoc@global\Etoc@numbertrue
+ \Etoc@global\def\etocthenumber {#1}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkednumber
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#1}}%
+ \Etoc@getit@hyp@getname #3\etoc@
+ \fi
}
+\def\Etoc@getit@hyp@getname #1\hspace\relax\etoc@ {%
+ \Etoc@global\def\etocthename {#1}%
+ \Etoc@global\expandafter\def\expandafter\etocthelinkedname
+ \expandafter{\expandafter\hyperlink \Etoc@tmp{#1}}%
+}%
\let\etocthename \@empty
\let\etocthenumber \@empty
\let\etocthepage \@empty