From cf7010cece3857384bdd19324eef056cf764385b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 23 Oct 2017 22:21:41 +0000 Subject: etoc (23oct17) git-svn-id: svn://tug.org/texlive/trunk@45586 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/etoc/etoc.dtx | 158 +++++++++++++++++++-------- Master/texmf-dist/source/latex/etoc/etoc.ins | 8 +- 2 files changed, 114 insertions(+), 52 deletions(-) (limited to 'Master/texmf-dist/source/latex/etoc') diff --git a/Master/texmf-dist/source/latex/etoc/etoc.dtx b/Master/texmf-dist/source/latex/etoc/etoc.dtx index a1ab3297a6d..faf51197861 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: <28-09-2017 at 16:19:24 CEST>}% +\def\etocdtxtimestamp {Time-stamp: <23-10-2017 at 12:03:59 CEST>}% % %<*!readme> %% %% Package: etoc -%% Version: 1.08k-2017/09/28 +%% Version: 1.08l-2017/10/23 %% License: LPPL 1.3c %% Copyright (C) 2012-2017 Jean-Francois Burnol %% @@ -17,14 +17,14 @@ %% % %<*insfile> -\def\etocpkgdate {2017/09/28} -\def\etocdocdate {2017/09/28} -\def\etocpkgversion {v1.08k} +\def\etocpkgdate {2017/10/23} +\def\etocdocdate {2017/10/23} +\def\etocpkgversion {v1.08l} \def\etocpkgdescription {Completely customisable TOCs (JFB)} % %<*none> -\def\etocDEpkgdate {28.09.2017}% METTRE À JOUR À CHAQUE BUMP! -\def\etocDEdocdate {28.09.2017} +\def\etocDEpkgdate {23.10.2017}% METTRE À JOUR À CHAQUE BUMP! +\def\etocDEdocdate {23.10.2017} \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.08k-2017/09/28 +% Version: 1.08l-2017/10/23 % License: LPPL 1.3c % Copyright (C) 2012-2017 Jean-Francois Burnol % Copyright (C) 2014-2017 Christine Roemer @@ -69,7 +69,7 @@ %<*readme> - Source: etoc.dtx (v1.08k-2017/09/28) + Source: etoc.dtx (v1.08l-2017/10/23) Author: Jean-Francois Burnol Author: Christine Roemer et al. (German tranlation) Info: Completely customisable TOCs @@ -185,6 +185,15 @@ etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi. RECENT CHANGES ============== +v1.08l \[2017/10/23\] +--------------------- + +Workaround an issue with `Emacs/AUCTeX` wrongly reporting about +actually non-existent LaTeX errors, which was triggered by some +strings written (indirectly) to log file by etoc under some +circumstances. + + v1.08k \[2017/09/28\] --------------------- @@ -10891,7 +10900,14 @@ Dokumentation erzeugt von der Quelldatei mit dem Stempel \begin{multicols}{2} \begin{jfverbatim} -v1.08k [2017/09/28]^ +v1.08l [2017/10/23]^ + + Workaround an issue with Emacs/AUCTeX wrongly reporting about + actually non-existent LaTeX errors, which was triggered by some + strings written (indirectly) to log file by etoc under some + circumstances. + +~v1.08k [2017/09/28]^ Adds \etocsetlocaltop.toc. See corresponding manual section for details. @@ -11492,6 +11508,12 @@ v1.08k [2017/09/28]^ % % |1.08f|'s \csa{etocsetlevel} avoids multiple insertions of the same level % in the \csa{Etoc@levellist} list. +% +% |1.08k| modified \csa{Etoc@newlevel}: formerly a token |\l@#1| was stored in +% place of braced name |{#1}|. This changed is to facilitate creation of the +% |\etocsavedsectiontocline| etc... macros later on, at each TOC. But the +% stored |#1| is not expanded immediately, although it is in other parts of +% \csa{etocsetlevel}, which may cause timing problems if |#1| is a macro. % \begin{macrocode} \let\Etoc@levellist\@empty \def\Etoc@newlevel #1{\expandafter\def\expandafter\Etoc@levellist\expandafter @@ -11795,10 +11817,12 @@ v1.08k [2017/09/28]^ \def\Etoc@etoccontentsline #1{% \global\expandafter\let\expandafter\Etoc@level\csname Etoc@#1@@\endcsname \Etoc@skipthisonefalse - \ifnum\Etoc@level=\Etoc@@six@@\Etoc@skipthisonetrue + \ifnum\Etoc@level=\Etoc@@six@@ + \Etoc@skipthisonetrue \else \ifEtoc@localtoc - \ifEtoc@stoptoc\Etoc@skipthisonetrue + \ifEtoc@stoptoc + \Etoc@skipthisonetrue \else \ifEtoc@notactive\Etoc@setflags \Etoc@skipthisonetrue @@ -11954,10 +11978,11 @@ v1.08k [2017/09/28]^ \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 - \ifEtoc@number\else - \ifnum\Etoc@level=\m@ne - \Etoc@getit #1\hspace\relax\etoc@ % additional job for parts - \fi + \ifEtoc@number + \else + \ifnum\Etoc@level=\m@ne + \Etoc@getit #1\hspace\relax\etoc@ % additional job for parts + \fi \fi \Etoc@global\expandafter\let\csname etoclink \endcsname\etocthelink \Etoc@global\expandafter\let\csname etocname \endcsname\etocthelinkedname @@ -11971,9 +11996,11 @@ v1.08k [2017/09/28]^ % \begin{macrocode} \def\Etoc@getthepage #1{% \let\Etoc@next\Etoc@getthepage@nohyp - \ifEtoc@hyperref\ifx\hyper@linkstart#1% + \ifEtoc@hyperref + \ifx\hyper@linkstart#1% \let\Etoc@next\Etoc@getthepage@hyp - \fi\fi + \fi + \fi \Etoc@next #1% } \def\Etoc@getthepage@nohyp #1\etoc@ {% @@ -12010,16 +12037,20 @@ v1.08k [2017/09/28]^ % \begin{macrocode} \def\Etoc@getnb #1{% \let\Etoc@next\Etoc@getnb@nohyp - \ifEtoc@hyperref\ifx\hyper@linkstart#1% + \ifEtoc@hyperref + \ifx\hyper@linkstart#1% \let\Etoc@next\Etoc@getnb@hyp - \fi\fi + \fi + \fi \Etoc@next #1% } \def\Etoc@getit #1{% \let\Etoc@next\Etoc@getit@nohyp - \ifEtoc@hyperref\ifx\hyper@linkstart#1% + \ifEtoc@hyperref + \ifx\hyper@linkstart#1% \let\Etoc@next\Etoc@getit@hyp - \fi\fi + \fi + \fi \Etoc@next #1% } % \end{macrocode} @@ -12060,7 +12091,7 @@ v1.08k [2017/09/28]^ % |1.08j| corrects the old |\ifx#1\numberline| into |\ifx\numberline#1|. % % |1.08k| uses a delimited macro to identify \csa{numberline}, -% \csa{chapternumberline} etc... in one go, avoiding +% \csa{chapternumberline} etc... in one go. % \begin{macrocode} \def\Etoc@getnb@hyp #1#2#3#4#5#6\etoc@ {% \def\Etoc@getname ##1\relax\relax\etoc@ {% @@ -12193,14 +12224,14 @@ v1.08k [2017/09/28]^ % \begin{macrocode} \def\Etoc@openouttoc{% \ifEtoc@hyperref - \ifx\hyper@last\@undefined + \ifx\hyper@last\@undefined \IfFileExists{\jobname .toc} {\Hy@WarningNoLine {old toc file detected, not used; run LaTeX again (cheers from etoc)}% \global\Etoc@toctoks={}% } {}% - \fi + \fi \fi \if@filesw \newwrite \tf@toc @@ -12257,7 +12288,7 @@ v1.08k [2017/09/28]^ % \begin{macrocode} \def\etoc@@startlocaltoc#1#2{% \ifEtoc@localtoc - \ifnum #1=#2\relax + \ifnum #1=#2\relax \ifEtoc@jj \global\let\Etoc@localtop\Etoc@@minusone@@ \fi \ifEtoc@j \global\let\Etoc@localtop\Etoc@@zero@@ \fi \ifEtoc@ \global\let\Etoc@localtop\Etoc@@one@@ \fi @@ -12275,7 +12306,7 @@ v1.08k [2017/09/28]^ \global\Etoc@false \global\Etoc@jfalse \global\Etoc@jjfalse - \fi + \fi \fi } \let\etoc@startlocaltoc\@gobble @@ -12463,13 +12494,24 @@ v1.08k [2017/09/28]^ % I hesitated with |1.08i| to write something to aux file in order to let % \LaTeX\ prompt the user for extra pass, after insertion of some new % |\localtableofcontents|, but finally I prefer to only trick \LaTeX\ into -% telling about undefined references. The first solution has the advantage +% telling about undefined references. +% +% The \cs{PackageWarning} approach has the advantage % that at least in Emacs/AUCTeX the |C-cC-c| will propose |LaTeX|, not |View|. % But perhaps some automated scripts checking |aux| file will not like the % extra line which is then removed in next pass, and could possibly do one % extra unneeded compilation to check |aux| file remains identical. Hence the -% second approach. Earlier I did only a |\PackageWarning| but this does not -% output a message near the end of the log file or console output. +% second approach. (edit |2017/10/23|: good thing I documented that! I had +% completely forgotten that rationale, but I wonder if it is correct.) +% +% Also the |\PackageWarning| does not trigger a visible message +% near the end of the log file or console output, contrarily to a +% \centeredline{|LaTeX Warning: There were undefined references.|} +% followed by a +% \centeredline{|LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.|} +% +% Method used here seems to work fine also with |latexmk|: it does not seem to +% induce it into making too many runs. % \begin{macrocode} \def\Etoc@localtableofcontents#1{% \Etoc@localtoctrue @@ -12477,7 +12519,7 @@ v1.08k [2017/09/28]^ \edef\Etoc@tocid{#1}% \ifnum\Etoc@tocid<\@ne %\PackageWarning{etoc}{Unknown toc reference \@secondoftwo#1. Run LaTeX again}% - \setbox0\hbox{\ref{etoc-ref \@secondoftwo#1: run LaTeX again!}}% + \setbox0\hbox{\ref{Unknown toc ref \@secondoftwo#1. Rerun LaTeX}}% %\if@filesw\immediate\write\@mainaux{\noexpand\@tempswatrue}\fi \global\Etoc@stoptoctrue % do only heading \Etoc@tableofcontents @@ -12491,7 +12533,7 @@ v1.08k [2017/09/28]^ \ifEtoc@emptytoc \ifEtoc@notactive %\PackageWarning{etoc}{Unknown toc ID \number\Etoc@tocid. Run LaTeX again}% - \setbox0\hbox{\ref{etoc-id \number\Etoc@tocid: run LaTeX again!}}% + \setbox0\hbox{\ref{Unknown toc ID \number\Etoc@tocid. Rerun LaTeX}}% %\if@filesw\immediate\write\@mainaux{\noexpand\@tempswatrue}\fi \global\Etoc@emptytocfalse % assume real one will be non-empty \global\Etoc@stoptoctrue % and print only heading for this pass @@ -12561,9 +12603,11 @@ v1.08k [2017/09/28]^ % a bit the style of conditionals here for clarity of code. % \begin{macrocode} \global\Etoc@emptytocfalse\ifEtoc@checksemptiness\Etoc@setemptytocbool\fi - \ifEtoc@emptytoc\ifEtoc@notocifnotoc - \expandafter\expandafter\expandafter\@gobble - \fi\fi + \ifEtoc@emptytoc + \ifEtoc@notocifnotoc + \expandafter\expandafter\expandafter\@gobble + \fi + \fi \Etoc@tableofcontents \endgroup\ifEtoc@mustclosegroup\endgroup\fi \Etoc@tocdepthreset % 1.07h, renamed 1.08h @@ -12669,8 +12713,8 @@ v1.08k [2017/09/28]^ \def\Etoc@tableofcontents {% \ifnum\c@tocdepth>\Etoc@minf - \else\expandafter - \Etoc@gobbletoetoc@ + \else + \expandafter\Etoc@gobbletoetoc@ \fi \Etoc@par \etocbeforetitlehook % 1.07m @@ -12679,6 +12723,13 @@ v1.08k [2017/09/28]^ \let\contentsline\Etoc@etoccontentsline \ifEtoc@standard \else % moved here from \Etoc@toctoc (1.08) +% \end{macrocode} +% Prior to |1.08|, this was done in |\Etoc@toctoc| +% +% |1.08k| defines here |\etocsavedchaptertocline|, |\etocsavedsectiontocline|, +% and so on for all declared level names, again at each TOC and for the +% duration of it. +% \begin{macrocode} \def\Etoc@levellist@elt####1{% \expandafter\let\csname etocsaved####1tocline\expandafter\endcsname \csname l@####1\endcsname @@ -12700,9 +12751,12 @@ v1.08k [2017/09/28]^ % was forced to modify globally |\contentsline|. The collateral effect is that % \etoc is now forced to reset globally |\contentsline|. % \begin{macrocode} - \ifx\Etoc@global\global\ifx\tof@finish\@empty\else - \global\let\contentsline\Etoc@savedcontentsline - \fi\fi + \ifx\Etoc@global\global + \ifx\tof@finish\@empty + \else + \global\let\contentsline\Etoc@savedcontentsline + \fi + \fi \@gobble\etoc@ }% end of \Etoc@tableofcontents definition by \etocsettocstyle } @@ -12998,8 +13052,9 @@ v1.08k [2017/09/28]^ \newcommand*\etocruledstyle[2][\etocdefaultnbcol]{% \etocsettocstyle {\addvspace{\etocabovetocskip}% - \ifnum #1>\@ne\expandafter\@firstoftwo - \else \expandafter\@secondoftwo + \ifnum #1>\@ne + \expandafter\@firstoftwo + \else \expandafter\@secondoftwo \fi {\multicolpretolerance\etocmulticolpretolerance \multicoltolerance\etocmulticoltolerance @@ -13035,10 +13090,11 @@ v1.08k [2017/09/28]^ \addvspace{\etocabovetocskip}% \sbox\z@{#2}% \dimen\z@\dp\z@ - \ifdim\wd\z@<\linewidth \dp\z@\z@ \else \dimen\z@\z@ \fi + \ifdim\wd\z@<\linewidth \dp\z@\z@ \else \dimen\z@\z@ \fi \setbox\etoc@framed@titlebox=\hb@xt@\linewidth{\color@begingroup \hss - \ifx\etocbkgcolorcmd\Etoc@relax\else + \ifx\etocbkgcolorcmd\Etoc@relax + \else \sbox\tw@{\color{white}% \vrule\@width\wd\z@\@height\ht\z@\@depth\dimen\z@}% \ifdim\wd\z@<\linewidth \dp\tw@\z@\fi @@ -13048,7 +13104,7 @@ v1.08k [2017/09/28]^ \copy\z@ \hss \hskip-\linewidth - \etoctoprulecolorcmd\leaders\etoctoprule\hss% + \etoctoprulecolorcmd\leaders\etoctoprule\hss \hskip\wd\z@ \etoctoprulecolorcmd\leaders\etoctoprule\hss\color@endgroup}% \setbox\z@\hbox{\etocleftrule\etocrightrule}% @@ -13062,7 +13118,8 @@ v1.08k [2017/09/28]^ \hbox\bgroup \begin{minipage}{\hsize}% \etocframedmphook - \ifnum #1>\@ne\expandafter\@firstoftwo + \ifnum #1>\@ne + \expandafter\@firstoftwo \else \expandafter\@secondoftwo \fi {\multicolpretolerance\etocmulticolpretolerance @@ -13081,7 +13138,8 @@ v1.08k [2017/09/28]^ \vskip\etocinnerbottomsep \egroup \vbox{\hsize\linewidth - \ifx\etocbkgcolorcmd\Etoc@relax\else + \ifx\etocbkgcolorcmd\Etoc@relax + \else \kern\ht\etoc@framed@titlebox \kern\dp\etoc@framed@titlebox \hb@xt@\linewidth{\color@begingroup @@ -13221,7 +13279,11 @@ v1.08k [2017/09/28]^ \def\Etoc@addsuitablecontentsline{\addcontentsline {toc}{#1}{#2}}% \renewcommand*\etocaftertitlehook{% \ifmem@em@starred@listof - \else\phantomsection\aftergroup\Etoc@addsuitablecontentsline\fi}} + \else + \phantomsection + \aftergroup\Etoc@addsuitablecontentsline + \fi}% +} \def\etocmemoirstyle{% \etocsettocstyle {\ensureonecol \par \begingroup \@nameuse {@tocmaketitle} diff --git a/Master/texmf-dist/source/latex/etoc/etoc.ins b/Master/texmf-dist/source/latex/etoc/etoc.ins index cd2365c107c..080b845ee24 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.08k-2017/09/28 +%% Version: 1.08l-2017/10/23 %% License: LPPL 1.3c %% Copyright (C) 2012-2017 Jean-Francois Burnol %% @@ -8,9 +8,9 @@ %% %% and collaborators for the translation into German of the documentation %% -\def\etocpkgdate {2017/09/28} -\def\etocdocdate {2017/09/28} -\def\etocpkgversion {v1.08k} +\def\etocpkgdate {2017/10/23} +\def\etocdocdate {2017/10/23} +\def\etocpkgversion {v1.08l} \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 -- cgit v1.2.3