diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-10 21:00:10 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-10 21:00:10 +0000 |
commit | a72845cd2b20bb3de0abf721035298d0779a7ecd (patch) | |
tree | fcb8eec05141384db5613d7f4f8247f42785b010 /Master/texmf-dist | |
parent | 2120f9138b95149fb0f94b826587f7f22ea1f859 (diff) |
etoc (10mar19)
git-svn-id: svn://tug.org/texlive/trunk@50317 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/README.md | 18 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf | bin | 580451 -> 561953 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/etoc.pdf | bin | 627842 -> 615419 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/etoc/etoc.dtx | 1250 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/etoc/etoc.ins | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/etoc/etoc.sty | 108 |
6 files changed, 631 insertions, 757 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/README.md b/Master/texmf-dist/doc/latex/etoc/README.md index bc09da9f3c3..88f2d05bf88 100644 --- a/Master/texmf-dist/doc/latex/etoc/README.md +++ b/Master/texmf-dist/doc/latex/etoc/README.md @@ -1,12 +1,12 @@ <!-- --> - Source: etoc.dtx (v1.08p-2018/07/04) + Source: etoc.dtx (v1.09-2019/03/09) Author: Jean-Francois Burnol Author: Christine Roemer et al. (German tranlation) Info: Completely customisable TOCs License: LPPL 1.3c - Copyright (C) 2012-2018 Jean-Francois Burnol. - Copyright (C) 2014-2018 Christine Roemer and collaborators for + Copyright (C) 2012-2019 Jean-Francois Burnol. + Copyright (C) 2014-2019 Christine Roemer and collaborators for the translation into German of the documentation. <jfbu at free dot fr> <Christine_Roemer at t-online dot de> @@ -116,7 +116,17 @@ etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi. RECENT CHANGES ============== -v1.08p \[2018/04/07\] +v1.09 \[2019/03/09\] +-------------------- + +New features: `\etoclocaltop`, `\localtableofcontentswithrelativedepth`. +Thanks to Tony Roberts for feature request. + +Note to hackers: internal control sequence `\Etoc@localtop` is gone. + +etoc now requires e-TeX (`\numexpr`, `\unless`). + +v1.08p \[2018/07/04\] --------------------- Fixed bug surfacing in case of `linktoc=page` option of hyperref. diff --git a/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf b/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf Binary files differindex aba48c5922f..7c825409068 100644 --- a/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf +++ b/Master/texmf-dist/doc/latex/etoc/etoc-DE.pdf diff --git a/Master/texmf-dist/doc/latex/etoc/etoc.pdf b/Master/texmf-dist/doc/latex/etoc/etoc.pdf Binary files differindex 3d827b1c525..1b43c65c89e 100644 --- a/Master/texmf-dist/doc/latex/etoc/etoc.pdf +++ b/Master/texmf-dist/doc/latex/etoc/etoc.pdf diff --git a/Master/texmf-dist/source/latex/etoc/etoc.dtx b/Master/texmf-dist/source/latex/etoc/etoc.dtx index b983b532db9..9c997ac56a7 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.dtx +++ b/Master/texmf-dist/source/latex/etoc/etoc.dtx @@ -2,29 +2,29 @@ % 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: <04-07-2018 at 15:13:02 CEST>}% +\def\etocdtxtimestamp {Time-stamp: <10-03-2019 at 09:35:44 CET>}% %</none> %<*!readme> %% %% Package: etoc -%% Version: 1.08p-2018/07/04 +%% Version: 1.09-2019/03/09 %% License: LPPL 1.3c -%% Copyright (C) 2012-2018 Jean-Francois Burnol +%% Copyright (C) 2012-2019 Jean-Francois Burnol %% <jfbu at free dot fr> -%% Copyright (C) 2014-2018 Christine Roemer +%% Copyright (C) 2014-2019 Christine Roemer %% <Christine_Roemer at t-online dot de> %% and collaborators for the translation into German of the documentation %% %</!readme> %<*insfile> -\def\etocpkgdate {2018/07/04} -\def\etocdocdate {2018/07/04} -\def\etocpkgversion {v1.08p} +\def\etocpkgdate {2019/03/09} +\def\etocdocdate {2019/03/09} +\def\etocpkgversion {v1.09} \def\etocpkgdescription {Completely customisable TOCs (JFB)} %</insfile> %<*none> -\def\etocDEpkgdate {04.07.2018}% METTRE À JOUR À CHAQUE BUMP! -\def\etocDEdocdate {04.07.2018} +\def\etocDEpkgdate {09.03.2019}% METTRE À JOUR À CHAQUE BUMP! +\def\etocDEdocdate {09.03.2019} \def\etocDEDEdocdate {09.04.2015}% \def\etocDEDEpkgversion {v1.08d}% % Definition of \etocLicense @@ -35,10 +35,10 @@ \catcode32=13\catcode`\\=12^^Brelax^^A ^^Bfirstofone{^^Bendgroup^^Bdef^^BetocLicense^^A {% Package: etoc -% Version: 1.08p-2018/07/04 +% Version: 1.09-2019/03/09 % 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> +% Copyright (C) 2012-2019 Jean-Francois Burnol <jfbu at free dot fr> +% Copyright (C) 2014-2019 Christine Roemer <Christine_Roemer at t-online dot de> % and collaborators for the translation into German of the documentation % % This Work may be distributed and/or modified under the @@ -69,13 +69,13 @@ %<*readme> <!-- --> - Source: etoc.dtx (v1.08p-2018/07/04) + Source: etoc.dtx (v1.09-2019/03/09) Author: Jean-Francois Burnol Author: Christine Roemer et al. (German tranlation) Info: Completely customisable TOCs License: LPPL 1.3c - Copyright (C) 2012-2018 Jean-Francois Burnol. - Copyright (C) 2014-2018 Christine Roemer and collaborators for + Copyright (C) 2012-2019 Jean-Francois Burnol. + Copyright (C) 2014-2019 Christine Roemer and collaborators for the translation into German of the documentation. <jfbu at free dot fr> <Christine_Roemer at t-online dot de> @@ -185,7 +185,18 @@ etoc.pdf, etoc-DE.pdf, etoc.dvi, etoc-DE.dvi. RECENT CHANGES ============== -v1.08p \[2018/04/07\] +v1.09 \[2019/03/09\] +-------------------- + +New features: `\etoclocaltop`, `\localtableofcontentswithrelativedepth`. +Thanks to Tony Roberts for feature request. + +Note to hackers: internal control sequence `\Etoc@localtop` is gone. + +etoc now requires e-TeX (`\numexpr`, `\unless`). + + +v1.08p \[2018/07/04\] --------------------- Fixed bug surfacing in case of `linktoc=page` option of hyperref. @@ -193,6 +204,7 @@ Thanks to Denis Bitouzé for report (cf. https://github.com/ho-tex/hyperref/issues/65, https://github.com/dbitouze/yathesis/issues/61). + v1.08o \[2018/06/15\] --------------------- @@ -200,11 +212,13 @@ Fixed bug showing up if an unnumbered TOC entry starts with a brace, and document uses hyperref. Caused by a typo in a macro name at previous release. + v1.08n \[2018/02/23\] --------------------- Refactoring of core macros detecting `\numberline` and its variants. + v1.08m \[2018/02/07\] --------------------- @@ -828,12 +842,13 @@ pdfpagemode=UseOutlines} \etocsetlevel{visibletoc}{6} %-------- % add-ons for the `fancy TOC' (2013/01/25) - \newcounter{dummypart} - \newcounter{dummychapter} - \newcounter{dummysection} - \etocsetlevel{dummypart}{6} - \etocsetlevel{dummychapter}{6} - \etocsetlevel{dummysection}{6} +% 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 @@ -999,33 +1014,36 @@ pdfpagemode=UseOutlines} \ifnum\tikztreelevel=1 % \pgftransformrotate{55+((\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild)}% % -90 Dimanche 25 septembre 2016 à 17:18:50. Non finalement zero. Non -36 +% **** +% Bon finalement 1.09 n'utilise plus cette customgrowth +% **** \pgftransformrotate{-36+((\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild)}% \pgftransformxshift{\the\tikzleveldistance}% \fi \ifnum\tikztreelevel=2 -% modif Mercredi 27 septembre 2017 à 17:16:44 \pgfmathsetmacro\tikzoffsetofcurrentchild{(\tikzsiblingdistance)*(6+\tikznumberofcurrentgrandchild)}% - \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight pt + \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight \pgftransformxshift{\tikzlevelwidth/2} \pgftransformyshift{-\tikzlevelheight/2+\tikzoffsetofcurrentchild} \else \pgfmathsetmacro\tikzoffsetofcurrentchild{\tikzoffsetofcurrentchild-\tikzlevelheight}% - \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelwidth pt + \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelwidth \pgftransformxshift{\tikzlevelwidth/2-\tikzoffsetofcurrentchild} \pgftransformyshift{\tikzlevelheight/2} \else \pgfmathsetmacro\tikzoffsetofcurrentchild{\tikzoffsetofcurrentchild-\tikzlevelwidth}% - \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight pt + \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight \pgftransformxshift{-\tikzlevelwidth/2} \pgftransformyshift{\tikzlevelheight/2-\tikzoffsetofcurrentchild} \else \pgfmathsetmacro\tikzoffsetofcurrentchild{\tikzoffsetofcurrentchild-\tikzlevelheight}% - \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelwidth pt + \ifdim\tikzoffsetofcurrentchild pt<\tikzlevelwidth + \pgftransformxshift{-\tikzlevelwidth/2+\tikzoffsetofcurrentchild} \pgftransformyshift{-\tikzlevelheight/2} \else \pgfmathsetmacro\tikzoffsetofcurrentchild{\tikzoffsetofcurrentchild-\tikzlevelwidth}% - %\ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight pt + %\ifdim\tikzoffsetofcurrentchild pt<\tikzlevelheight \pgftransformxshift{\tikzlevelwidth/2} \pgftransformyshift{-\tikzlevelheight/2+\tikzoffsetofcurrentchild} %\fi @@ -1034,18 +1052,18 @@ pdfpagemode=UseOutlines} \fi } -% version circulaire utilisée avec les version 1.08a--1.08f du manuel. -% \def\tikzmycustomgrowth {% -% \pgftransformreset -% \ifnum\tikztreelevel=1 -% \pgftransformrotate {(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild-1)}% -% \fi -% \ifnum\tikztreelevel=2 -% \pgftransformrotate {(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentgrandchild-4)}% -% \global\advance\tikznumberofcurrentgrandchild by 1 -% \fi -% \pgftransformxshift {\the\tikzleveldistance}% -% } +%version circulaire utilisée avec les version 1.08a--1.08f du manuel. +\def\tikzmycustomgrowth {% + \pgftransformreset + \ifnum\tikztreelevel=1 + \pgftransformrotate {126+(\pgfkeysvalueof{/tikz/sibling angle})*(\tikznumberofcurrentchild-1)}% + \fi + \ifnum\tikztreelevel=2 + \pgftransformrotate {(\pgfkeysvalueof{/tikz/sibling angle})*(2+\tikznumberofcurrentgrandchild)}% + \global\advance\tikznumberofcurrentgrandchild by 1 + \fi + \pgftransformxshift {\the\tikzleveldistance}% +} \newcounter{partco} % 1,2,3,4,5,... -> 1,2,3,1,2,3,1,2,3 @@ -1072,12 +1090,21 @@ pdfpagemode=UseOutlines} \newcommand\toc{\csa{table\-of\-con\-tents}\xspace} \newcommand\localtoc{\csa{local\-table\-of\-con\-tents}\xspace} +\newcommand\localtocwrdp + {\csa{local\-table\-of\-con\-tents\-with\-rel\-a\-tive\-depth}\xspace} \newcommand\lowast{\raisebox{-.25\height}{*}} \newcommand\starit[1]{\csa{#1\lowast}} \newcommand\staritb[1]{\csb{#1}\lowast} +\hyphenation{ +table-of-con-tents +local-table-of-con-tents +local-table-of-con-tents-with-rel-a-tive-depth +} + \hyphenation{toc-depth sec-num-depth con-tents-line} + \hyphenation{etoc-stan-dard-lines etoc-de-fault-lines etoc-toc-lines @@ -1133,7 +1160,8 @@ etoc-af-ter-ti-tle-hook etoc-af-ter-con-tents-hook etoc-af-ter-toc-hook etoc-skip-first-pre-fix -etoc-only-on-first} +etoc-only-on-first +} \hyphenation{ etoc-font-mi-nus-two @@ -1279,14 +1307,14 @@ etoc-framed-mp-hook \etocsettagdepth {preamble}{part} \etocsettagdepth {overview}{part} -\etocsettagdepth {arbitrarily}{all} -\etocsettagdepth {examples}{all} -\etocsettagdepth {surprising}{all} +\etocsettagdepth {arbitrarily}{part} +\etocsettagdepth {examples}{part} +\etocsettagdepth {surprising}{part} \etocsettagdepth {linestyles}{part} \etocsettagdepth {globalcmds}{part} \etocsettagdepth {custom}{part} -\etocsettagdepth {tips}{all} -\etocsettagdepth {etocandworld}{all} +\etocsettagdepth {tips}{part}% pour faire de la place pour 1.09 +\etocsettagdepth {etocandworld}{part} \etocsettagdepth {code}{all} \etocinline\tableofcontents\label{toc:mindmaptitlepage} @@ -1294,6 +1322,7 @@ etoc-framed-mp-hook % \immediate\openout\TOCasTree=\jobname.toctree % \immediate\write\TOCasTree{\the\treetok}% + \tikzset {branch color/.style={concept color=#1!white, every child/.append style={concept color=#1!white!30!white}}, % ajout pour version de 1.08g @@ -1302,34 +1331,37 @@ etoc-framed-mp-hook }% \global -\setbox\TitlePageMindmapTOC\hbox {\begingroup -\resizebox!{\dimexpr\paperheight-1cm\relax}{% +\setbox\TitlePageMindmapTOC\hbox {% +%\begingroup +\resizebox{\dimexpr\paperwidth-1cm\relax}!{% \begin{tikzpicture}[mindmap, text width=2cm, align = flush center, +% pour 1.09 je reviens à version circulaire simplifiée growth function=\tikzmycustomgrowth, nodes={concept}, concept color=orange!60, root concept/.append style={font=\huge, text width = 6cm}, - % level 1/.append style={level distance=7cm, sibling - % angle=360/9},% 9 hard-coded mais je pourrais aussi le - % calculer -% je passe de 6 à 7cm pour doc du 2015/12/11, mais je dois aussi écarter un -% peu level2 level 1/.append style={level distance=7cm, sibling - angle=360/10},% passage de 9 à 10 pour 1.08h, je pourrais aussi le calculer - level 1 concept/.append style={font=\Large, text width = - 3cm}, + angle=360/10},% passage de 9 à 10 pour 1.08h, je pourrais aussi le calculer +% level 1 concept/.append style={font=\Large, text width = +% 3cm}, % ancienne version circulaire % level 2/.append style={level distance=12.5cm, sibling angle=360/39},% % % distance par rapport au CENTRE ! (avec le code tel qu'en ce moment) % 39 hard coded mais je pourrais aussi le calculer % pour version rectangulaire, par tâtonnements: - level 2/.append style={level width=21cm,level height=30cm, sibling - distance=3cm},% modif Mercredi 27 septembre 2017 à 17:17:20 + % level 2/.append style={level width=21cm, + % level height=30cm, + % sibling distance=1cm},% + level 2/.append style={level distance=10cm, sibling angle=30},% + level 2 concept/.append style={text width=2cm}, ] \the\treetok -\end{tikzpicture}}\endgroup } +\end{tikzpicture}% +}% +%\endgroup +} \endgroup \noindent\null @@ -1882,6 +1914,7 @@ breaks. Also, they do not worry about potential multi-column use. \csb{etocinline}\par \csb{etoclink}\par \csb{etoclocalframed}\par + \csb{etoclocaltop}\par \csb{etoclocalmulticol}\par \csb{etoclocalruled}\par \csb{etocmulticolstyle}\par @@ -1913,6 +1946,7 @@ breaks. Also, they do not worry about potential multi-column use. \csb{etoctoccontentsline}\par \csb{etoctoclines}\par \csb{localtableofcontents}\par + \csb{localtableofcontentswithrelativedepth}\par \csb{tableofcontents}\par %\vspace{5\baselineskip}\hrule height 0pt \end{multicols} @@ -1932,17 +1966,56 @@ breaks. Also, they do not worry about potential multi-column use. \etocstandardlines \localtableofcontents -\section{Labeling and reusing elsewhere} +\section{The \toc, \localtoc and \localtocwrdp commands} \label{tableofcontents} \label{localtableofcontents} +\label{localtableofcontentswithrelativedepth} -\etoc allows arbitrarily many \csa{tableofcontents} commands in -your document. The line styles and the toc display style may of -course be changed in-between. Furthermore -\csa{localtableofcontents} will print local tables of +\begin{description} +\item[\toc] can be used arbitrarily many times in the document. Styling either + globally the TOC or its individual entries is customizable at any time in the document. +\item[\localtoc] will print local tables of contents: \emph{i.e.} all sections and sub-units inside a given chapter, or all subsubsections and lower inside a given -subsection, etc . . . +subsection, etc... (see also \csb{etocsetnexttocdepth}).% +% +\footnote{As is explained in \autoref{sec:labeling} the syntax allows to + create somewhere a local table of contents and to display it at some other + location either before or after its origin.}% +\textsuperscript{,}% +\footnote{As is explained in \autoref{sec:tocdepth} \etoc allows at anytime to + locally redefine the numeric levels associated to named ones, which brings + great flexibility to achieve special effects, all done using only a single + auxiliary file, the standard |.toc| file.} +% +\item[\localtocwrdp\marg{number}] can be used to override the document or + current tocdepth setting (see \autoref{sec:tocdepth} for a discussion of + tocdepth) to become relative to where the local TOC originates. For example, + assuming the default numeric level assignments to standard sectioning units +\begin{verbatim} +\section{This is a section} +\localtableofcontentswithrelativedepth{+2} +\end{verbatim} + will create a local table of contents taking into account the subsections + and subsubsections inside this section, independently of what is the value + of the |tocdepth| counter at this position in the document. If the numeric + argument had been |3|, the local TOC would have displayed also paragraphs. + If the section had been a chapter, and again for a relative tocdepth of |2|, + the taken into account levels would have been sections and subsections.% +% +\footnote{The situation may be more complex, as the |.toc| file itself may + well contain \texttt{\string\setcounter\{tocdepth\}\{...\}} commands. This + is not recommended pratice with \etoc. See the discussion of + \csb{etocsettocdepth.toc} and \csb{etocdepthtag.toc} for more on this.} +\end{description} + +The macro \localtocwrdp is \textbf{new with |1.09|}.% +% +\footnote{Thanks to Tony \textsc{Roberts} for feature request.} +% + +\section{Labeling and reusing elsewhere} +\label{sec:labeling} \etoc allows the labeling of a TOC with (for example) \csa{label\{toc:A\}} and will redisplay it elsewhere when @@ -1978,6 +2051,7 @@ must use a reference to the original label: \toc|\ref{toc:c}|. \section{A powerful functionality of \etoc: the re-assignment of levels with \csbhyp{etocsetlevel}} +\label{sec:tocdepth} The intrinsic levels manipulated by \etoc are numeric: from |-2| (which corresponds to |book| in the |memoir| class) @@ -2064,14 +2138,24 @@ The simplest course is thus to have after |\begin{document}| and before the where needed, \csb{etocsetnexttocdepth} before |\tableofcontents| or |\localtableofcontents|. -% pas traduit - \csa{etocsetnexttocdepth} used to modify the |tocdepth| counter immediately. - In case two or more such commands were issued in a row with no TOC being - typeset, this could break the correct restoring of the |tocdepth| counter - after the TOC. Starting with |1.08h|, the |tocdepth| counter is modified - only at the time the TOC is typeset, not earlier, thus fixing that - issue.\footnote{Thanks to Denis \textsc{Bitouzé} for signaling the problem.} -% +\begin{framed} + It is possible to use \csb{etocsettocdepth} inside the first argument of + \csb{etocsettocstyle} (possibly in conjunction with checking the + \csb{etoclocaltop} value, \emph{which however will be up-to-date there only if + \csb{etocchecksemptiness} was executed}). There is no worry then about + possible impact on hyperref bookmarks later on, because \etoc always resets + the |tocdepth| counter after typesetting a TOC to the value it had before + it. + + Since |1.09| the macro \csb{etocsetnexttocdepth} works also if located in + first argument of \csb{etocsettocstyle}, but there is no reason to use it + there as \csb{etocsettocdepth} has no durable effet on the |tocdepth| + counter if executed there. + + Check \csb{localtableofcontentswithrelativedepth} for a simpler way to + control the depth of local tables of contents. This has the advantage of + working reliably whether or not the \csb{etocchecksemptiness} is used. +\end{framed} \subsection{The hyperref option \emph{bookmarksdepth}} \label{ssec:bookmarksdepth} @@ -2264,7 +2348,6 @@ For a finalized document compiled with initially no auxiliary files, the first heading (and no contents naturally). The second \LaTeX{} run will then correctly decide which local TOC is empty or not. - \subsection{The \csbhyp{etocnotocifnotoc} command} \label{etocnotocifnotoc} @@ -2295,6 +2378,58 @@ empty, this does mean that \etoc considered the just encountered local table of contents to be empty (for that run) and thus printed nothing (not even a |\par|). +% pas traduit +\section{The \csbhyp{etoclocaltop} command} +\label{etoclocaltop} + +\textbf{New with 1.09 (2019/03/09)}. + +Within either the TOC style +(\csb{etocsettocstyle}) or the local title styles (\csb{etocsetstyle}), the +control sequence \csb{etoclocaltop} is made equivalent for the duration of +\csb{localtableofcontents} to a numeric (self-delimiting) denotation of the +current top level. + +Thus: it will in numeric contexts (|\ifnum|, |\ifcase|, ...) represent zero +for a local TOC corresponding to chapter, or one if in a section, or two if in +a subsection, etc..., assuming of course here that the default levels are +obeyed (see \autoref{sec:tocdepth}). + +\begin{framed} + \csb{etoclocaltop} from inside the TOC heading (first argument of + \csb{etocsettocstyle}) has the correct value \emph{only under + \csb{etocchecksemptiness} regime}. Special circumstances correspond to + some special values: + \begin{description}[nolistsep] + \item[|-3|] (|-\thr@@|)\newline + signals that \etoc considers the local TOC to be + ``unknown''; this happens at the last local TOC, for the first \LaTeX\ run + after adding a new \localtoc to the document. In doubt, \etoc assumes the + TOC will prove non empty, hence it prints (independently of whether the + check for emptiness was activated or not) the heading as specified by + \csb{etocsettocstyle}. Thus, check if \csb{etoclocaltop} gives |-3| as a + a \meta{number} to detect that situation from within the first argument of + \csb{etocsettocstyle}, if desired. + \item[|-1000|](|-\@m|)\newline is in case of a \localtoc + being considered ``known'' (although it may still refer to the data in the + |.toc| file from the previous run) but without the check for emptiness + having been executed. + \item[|-10000|](|-\@M|)\newline is the value when accessed from the title + of a global TOCs. + \end{description} +\end{framed} +\begin{framed} + When executed from within a local table of contents \textbf{line styles} + (\csb{etocsetstyle}), \csb{etoclocaltop} always will hold the correct value, + whether or not the emptiness check was executed. + + For a global table of contents however, it will always keep the value |-3|. +\end{framed} + +Attention! \cs{etoclocaltop} is only to be queried; modifying it is strictly +forbidden and falls under the most rigorous prosecution allowed by federal +law. + \section{Adding commands to the \texorpdfstring{\texttt{.toc}}{.toc} file} \label{sec:addingtotoc} @@ -3177,285 +3312,6 @@ typeset with the following code: \end{filecontentshere} \attachfile{etocsnippet-\the\value{section}.tex} -\section{A TOC with a fancy layout} - -Here is a table of contents where -the sections from a given chapter are to be represented by a number -range (like 18--22 for a given chapter, 42--49 for another one ... -of course to be inserted automatically in the TOC). - -This is not an image inclusion, the TOC is produced from its original -|tex| source inserted in this document after replacement of -|part|, |chapter| or |section| with |dummypart|, |dummychapter| and -|dummysection| (and there is also a dummy page count). We -copied the line styles used in the original and -displayed the table of contents following: -\begin{verbatim} - \etocsetlevel{dummypart} {-1} \etocsetlevel{part} {2} - \etocsetlevel{dummychapter}{0} \etocsetlevel{chapter}{2} - \etocsetlevel{dummysection}{1} \etocsetlevel{section}{2} - \etocsetnexttocdepth{dummysection} -\end{verbatim} -Each chapter displays the numbers of only the first and the last sections it - contains. See the -source file |etoc.dtx| for the details of how this is done. - -Another technique for doing this kind of things is explained in - \autoref{ssec:statistics}. - -\begingroup - - \etocsetlevel{dummypart}{-1} - \etocsetlevel{dummychapter}{0} - \etocsetlevel{dummysection}{1} - \etocsetlevel{part}{2} - \etocsetlevel{chapter}{2} - \etocsetlevel{section}{2} - - \newif\ifextraidone - \newif\ifextraiidone - - \etocsetstyle{dummypart} - {} - {} - {\begin{center}\Large\bfseries PART \etocnumber - \ifextraiidone\\\etocname.\fi\end{center} - \ifextraidone\else - \noindent\hskip.7\linewidth - \hbox to .2\linewidth -% février (ou janvier?) 2013 -% je modifie ici en ajoutant un \hss, pour compenser la plus petite -% taille de txrm. Ok. - {\hss\small\textsc{\bfseries Sections.\hss Page.}}\par\fi - \extraidonetrue - } - {} - - \newcommand\mytocleaders{\hbox to .125\linewidth{...\hss}} - \etocsetstyle{dummychapter} - {} - {\par\noindent\etocifnumbered - {\makebox[.15\linewidth][r]{\bfseries\etocnumber.}} - {\hspace*{.15\linewidth}}} - {\hbox to .65\linewidth - {\hspace{1em}\etocname\leaders\mytocleaders\hss}% - \hskip-.1\linewidth - \hbox to .2\linewidth{\hspace{1.5em}...\hss - \etocifnumbered - {\etocpage} - {\ifextraiidone\else\etocpage\fi}}% - \hskip-.2\linewidth - } - {} - - \newbox\forsectionnumbers - \makeatletter -% 21 février 2013: je rajoute \color@begingroup et \color@endgroup - \etocsetstyle{dummysection} - {\setbox\forsectionnumbers=\hbox to .1\linewidth - \bgroup\color@begingroup\hss\etocskipfirstprefix} - {\@gobble} - {\etocnumber---} - {\etocnumber\color@endgroup\egroup - % for reasons I do not quite understand, in some pdf viewers the dots - % do not completely disappear if here \fboxsep0pt is used. - % (problèmes liés à l'anti-aliasing, sur Mac OS X, Skim, Preview...) - % (j'ai maintenu ici la méthode de mon post sur stackexchange, mais - % sans doute je pourrais réfléchir à une autre façon évitant d'avoir à - % « effacer ») - \fboxsep=.5pt\colorbox{white}{\box\forsectionnumbers}\par - \ifextraiidone\else - \begin{center}\bfseries Concord.\end{center} - \noindent\makebox[.15\linewidth][r]{\textsc{\bfseries Lesson.}}\par - \fi\extraiidonetrue - } - \makeatother - - \renewcommand{\etocinnertopsep}{0pt} - - \etocruledstyle[1]{% - \parbox{\linewidth}{% - \centering - \textsc{\bfseries\LARGE\MakeUppercase{Table of Contents}}\\ - \rule{.2\linewidth}{2pt}}% - } - - \etocsetnexttocdepth{dummysection} - - \tableofcontents - -\makeatletter - \def\adddummysection {\stepcounter{dummysection}% - \addtocontents {toc}{\protect\contentsline - {dummysection}{\protect\numberline{\thedummysection}}% - {\the\dummypage }% - %\ifEtoc@hyperref ou \ifdefined\hyperref si e-TeX - {\@currentHref }% - %\fi - }} - - \def\adddummychapter #1{\stepcounter{dummychapter}% - \advance\dummypage2 - \addtocontents {toc}{\protect\contentsline - {dummychapter}{\protect\numberline{\thedummychapter}#1}% - {\the\dummypage }% - %\ifEtoc@hyperref ou \ifdefined\hyperref si e-TeX - {\@currentHref }% - %\fi - }} - - - \def\adddummychapno #1{\advance\dummypage2 - \addtocontents {toc}{\protect\contentsline - {dummychapter}{#1}{\the\dummypage }% - %\ifEtoc@hyperref ou \ifdefined\hyperref si e-TeX - {\@currentHref }% - %\fi - }} - - \def\adddummypart #1{\stepcounter{dummypart}% - \advance\dummypage4 - \addtocontents {toc}{\protect\contentsline - {dummypart}{\protect\numberline{\Roman{dummypart}}#1}% - {\the\dummypage }% - %\ifEtoc@hyperref ou \ifdefined\hyperref si e-TeX - {\@currentHref }% - %\fi - }} -\makeatother - - \newcount\dummypage \dummypage-1 - - \adddummypart {} - - \adddummychapno {Introductory} - - \newcount\tempcount - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<8 - \repeat - - \adddummychapter {Concord of Subject and Verb} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<17 - \repeat - - \adddummychapter {Concord of Substantive and Adjective} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<22 - \repeat - - \adddummychapno {Concord of Relative and its Antecedent} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<25 - \repeat - - \adddummypart {Government} - - \adddummychapter {The Accusative Case} - - \adddummychapno {General uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<30 - \repeat - - \adddummychapno {Particular uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<37 - \repeat - - \adddummychapter {Verbs governing two Accusatives} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<41 - \repeat - - \adddummychapter {The Causal} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<49 - \repeat - - \adddummychapter {The Instrumental Case} - - \adddummychapno {General uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<54 - \repeat - - \adddummychapno {Particular uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<59 - \repeat - - \adddummychapter {The Dative Case} - - \adddummychapno {General uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<65 - \repeat - - \adddummychapno {Particular uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<71 - \repeat - - \adddummychapter {The Ablative Case} - - \adddummychapno {General uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<75 - \repeat - - \adddummychapno {Particular uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<86 - \repeat - - \adddummychapter {The Locative Case} - - \adddummychapno {General uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<92 - \repeat - - \adddummychapno {Particular uses} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<100 - \repeat -\endgroup - - \section{The TOC as a tree}\label{tocastree} Using |tikz|\footnote{\url{http://ctan.org/pkg/pgf}} and the package @@ -4688,6 +4544,29 @@ it could check (book class) to see if two-column mode is on, and switch to one-column style, and the \meta{after\_toc} part would then reenact the two-column mode. +\textbf{\TeX\ hacker note:} We have seen in the previous chapter some examples +of using |\begin{enumerate}| and |\end{enumerate}| within TOC line styles. +There is a real difficulty with doing however something like this: +\begin{verbatim} +\etocsettocstyle{\begin{enumerate}}{\end{enumerate}} +\etocsetstyle{section}{}{\item \sectionname}{}{} +\end{verbatim} +Indeed for example on first compilation of a document, the |.toc| file is +empty and there will be the typical ``Something's wrong--perhaps a missing +\string\item''. Using \csb{etocchecksemptiness} does not help, because as is +explained there, on first encountering a new TOC added at end of a document, +\etoc considers it non-empty, hence querying \csb{etocifwasempty} serves +nothing. No, one must do something like this: +\begin{verbatim} +\makeatletter +\etocsettocstyle + {\begin{enumerate}} + {\if@newlist\item Please run \LaTeX\ again\fi + \end{enumerate}} +\makeatother +\etocsetstyle{section}{}{\item \sectionname}{}{} +\end{verbatim} + The commands to be described next \csb{etocmulticolstyle}, \csb{etocruledstyle}, and \csb{etocframedstyle} all call \csa{etocsettocstyle} as a lower-level routine, to start a @@ -6110,14 +5989,14 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}. \etocsettagdepth {preamble}{part} \etocsettagdepth {overview}{part} -\etocsettagdepth {arbitrarily}{all} -\etocsettagdepth {examples}{all} -\etocsettagdepth {surprising}{all} +\etocsettagdepth {arbitrarily}{part} +\etocsettagdepth {examples}{part} +\etocsettagdepth {surprising}{part} \etocsettagdepth {linestyles}{part} \etocsettagdepth {globalcmds}{part} \etocsettagdepth {custom}{part} -\etocsettagdepth {tips}{all} -\etocsettagdepth {etocandworld}{all} +\etocsettagdepth {tips}{part} +\etocsettagdepth {etocandworld}{part} \etocsettagdepth {code}{all} \etocinline\tableofcontents\label{toc:mindmaptitlepage} @@ -6130,8 +6009,9 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}. }% \global -\setbox\TitlePageMindmapTOC\hbox {\begingroup -\resizebox!{\dimexpr\paperheight-1cm\relax}{% +\setbox\TitlePageMindmapTOC\hbox {% +%\begingroup +\resizebox{\dimexpr\paperwidth-1cm\relax}!{% \begin{tikzpicture}[mindmap, text width=2cm, align = flush center, @@ -6139,15 +6019,16 @@ version is \texttt{\etocpkgversion}, of \texttt{\etocpkgdate}. nodes={concept}, concept color=orange!60, root concept/.append style={font=\huge, text width = 6cm}, -% geändert 2015/11/12 6cm->7cm - level 1/.append style={level distance=7cm, sibling angle=360/10}, - level 1 concept/.append style={font=\Large, text width = 3cm}, -% geändert 2015/11/12 20cm->21cm - level 2/.append style={level width=21cm,level height=30cm, sibling - distance=3cm},% + level 1/.append style={level distance=7cm, sibling + angle=360/10},% passage de 9 à 10 pour 1.08h, je pourrais aussi le calculer + level 2/.append style={level distance=10cm, sibling angle=30},% + level 2 concept/.append style={text width=2cm}, ] \the\treetok -\end{tikzpicture}}\endgroup } +\end{tikzpicture}% +}% +%\endgroup +} \endgroup \noindent\null @@ -6703,6 +6584,7 @@ Auch sind sie nicht besorgt über die potentielle mehrspaltige Nutzung. \csb{etocignoretoctocdepth}\par \csb{etocinline}\par \csb{etoclink}\par + \csb{etoclocaltop}\par \csb{etoclocalframed}\par \csb{etoclocalmulticol}\par \csb{etoclocalruled}\par @@ -6735,6 +6617,7 @@ Auch sind sie nicht besorgt über die potentielle mehrspaltige Nutzung. \csb{etoctoccontentsline}\par \csb{etoctoclines}\par \csb{localtableofcontents}\par + \csb{localtableofcontentswithrelativedepth}\par \csb{tableofcontents}\par %\vspace{5\baselineskip}\hrule height 0pt \end{multicols} @@ -6754,17 +6637,59 @@ Auch sind sie nicht besorgt über die potentielle mehrspaltige Nutzung. \etocstandardlines \localtableofcontents -\section{Beschriften und anderswo wieder benutzen} +\section{Die \toc-, \localtoc- und \localtocwrdp"=Befehle} \label{tableofcontents} \label{localtableofcontents} +\label{localtableofcontentswithrelativedepth} -\etoc erlaubt beliebig viele \csa{tableofcontents}"=Befehle in +\begin{description} +\item[\toc] \etoc erlaubt beliebig viele \csa{tableofcontents}"=Befehle in ihrem Dokument. Die Zeilen- und Inhaltsangabenstile können -natürlich dazwischen geändert werden. Außerdem setzt +natürlich dazwischen geändert werden. +\item[\localtoc] Außerdem setzt \csa{localtableofcontents} lokale Inhaltsangaben: \emph{z.\,B.} alle Abschnitte und Unterabschnitte innerhalb eines bestimmten Kapitels oder alle Unterabschnitte und tiefer innerhalb eines gegebenen -Unterabschnitt usw. +Unterabschnitt usw.% +\begin{otherlanguage}{english} +\footnote{As is explained in \autoref{sec:labeling} the syntax allows to + create somewhere a local table of contents and to display it at some other + location either before or after its origin.}% +% +\footnote{As is explained in \autoref{sec:tocdepth} \etoc allows at anytime to + locally redefine the numeric levels associated to named ones, which brings + great flexibility to achieve special effects, all done using only a single + auxiliary file, the standard |.toc| file.} +% +\item[\localtocwrdp\marg{number}] can be used to override the document or + current tocdepth setting (see \autoref{sec:tocdepth} for a discussion of + tocdepth) to become relative to where the local TOC originates. For example, + assuming the default numeric level assignments to standard sectioning units +\begin{verbatim} +\section{This is a section} +\localtableofcontentswithrelativedepth{+2} +\end{verbatim} + will create a local table of contents taking into account the subsections + and subsubsections inside this section, independently of what is the value + of the |tocdepth| counter at this position in the document. If the numeric + argument had been |3|, the local TOC would have displayed also paragraphs. + If the section had been a chapter, and again for a relative tocdepth of |2|, + the taken into account levels would have been sections and subsections.% +% +\footnote{The situation may be more complex, as the |.toc| file itself may + well contain \texttt{\string\setcounter\{tocdepth\}\{...\}} commands. This + is not recommended pratice with \etoc. See the discussion of + \csb{etocsettocdepth.toc} and \csb{etocdepthtag.toc} for more on this.} +\end{otherlanguage} +\end{description} + +The macro \localtocwrdp is \textbf{new with |1.09|}.% +% +\footnote{Thanks to Tony \textsc{Roberts} for feature request.} +% + +\section{Beschriften und anderswo wieder benutzen} +\label{sec:labeling} \etoc erlaubt das Labeln von Inhaltsangaben, beispielsweise mit \csa{label\{toc:A\}}, und wird es woanders @@ -6799,6 +6724,7 @@ Klonen, muss man eine Refernz zum Original"=Label benutzen: \toc|\ref{toc:c}|. \section{Eine mächtige Funktionsweise von \etoc: Die Wieder\-zuweisung von Levels mit von \csbhyp{etocsetlevel}} +\label{sec:tocdepth} Die intrinsischen Level, die durch \etoc manipuliert wurden, sind numerisch: von |-2| (welches |book| aus der |memoir|-Klasse entspricht) bis hinab zu |5| @@ -6885,12 +6811,25 @@ Der einfachste Weg ist also, eine einfache Instanz des % \begin{otherlanguage}{english} - \csa{etocsetnexttocdepth} used to modify the |tocdepth| counter immediately. - In case two or more such commands were issued in a row with no TOC being - typeset, this could break the correct restoring of the |tocdepth| counter - after the TOC. Starting with |1.08h|, the |tocdepth| counter is modified - only at the time the TOC is typeset, not earlier, thus fixing that - issue.\footnote{Thanks to Denis \textsc{Bitouzé} for signaling the problem.} + +\begin{framed} + It is possible to use \csb{etocsettocdepth} inside the first argument of + \csb{etocsettocstyle} (possibly in conjunction with checking the + \csb{etoclocaltop} value, \emph{which however will be up-to-date there only if + \csb{etocchecksemptiness} was executed}). There is no worry then about + possible impact on hyperref bookmarks later on, because \etoc always resets + the |tocdepth| counter after typesetting a TOC to the value it had before + it. + + Since |1.09| the macro \csb{etocsetnexttocdepth} works also if located in + first argument of \csb{etocsettocstyle}, but there is no reason to use it + there as \csb{etocsettocdepth} has no durable effet on the |tocdepth| + counter if executed there. + + Check \csb{localtableofcontentswithrelativedepth} for a simpler way to + control the depth of local tables of contents. This has the advantage of + working reliably whether or not the \csb{etocchecksemptiness} is used. +\end{framed} \end{otherlanguage} \subsection{Die hyperref"=Option \emph{bookmarksdepth}} @@ -7093,7 +7032,6 @@ For a finalized document compiled with initially no auxiliary files, the first heading (and no contents naturally). The second \LaTeX{} run will then correctly decide which local TOC is empty or not. - \subsection{The \csbhyp{etocnotocifnotoc} command} \label{etocnotocifnotoc} @@ -7124,8 +7062,58 @@ empty, this does mean that \etoc considered the just encountered local table of contents to be empty (for that run) and thus printed nothing (not even a |\par|). -\end{otherlanguage} +% pas traduit +\section{The \csbhyp{etoclocaltop} command} +\label{etoclocaltop} + +\textbf{New with 1.09 (2019/03/09)}. +Within either the TOC style +(\csb{etocsettocstyle}) or the local title styles (\csb{etocsetstyle}), the +control sequence \csb{etoclocaltop} is made equivalent for the duration of +\csb{localtableofcontents} to a numeric (self-delimiting) denotation of the +current top level. + +Thus: it will in numeric contexts (|\ifnum|, |\ifcase|, ...) represent zero +for a local TOC corresponding to chapter, or one if in a section, or two if in +a subsection, etc..., assuming of course here that the default levels are +obeyed (see \autoref{sec:tocdepth}). + +\begin{framed} + \csb{etoclocaltop} from inside the TOC heading (first argument of + \csb{etocsettocstyle}) has the correct value \emph{only under + \csb{etocchecksemptiness} regime}. Special circumstances correspond to + some special values: + \begin{description}[nolistsep] + \item[|-3|] (|-\thr@@|)\newline + signals that \etoc considers the local TOC to be + ``unknown''; this happens at the last local TOC, for the first \LaTeX\ run + after adding a new \localtoc to the document. In doubt, \etoc assumes the + TOC will prove non empty, hence it prints (independently of whether the + check for emptiness was activated or not) the heading as specified by + \csb{etocsettocstyle}. Thus, check if \csb{etoclocaltop} gives |-3| as a + a \meta{number} to detect that situation from within the first argument of + \csb{etocsettocstyle}, if desired. + \item[|-1000|](|-\@m|)\newline is in case of a \localtoc + being considered ``known'' (although it may still refer to the data in the + |.toc| file from the previous run) but without the check for emptiness + having been executed. + \item[|-10000|](|-\@M|)\newline is the value when accessed from the title + of a global TOCs. + \end{description} +\end{framed} +\begin{framed} + When executed from within a local table of contents \textbf{line styles} + (\csb{etocsetstyle}), \csb{etoclocaltop} always will hold the correct value, + whether or not the emptiness check was executed. + + For a global table of contents however, it will always keep the value |-3|. +\end{framed} + +Attention! \cs{etoclocaltop} is only to be queried; modifying it is strictly +forbidden and falls under the most rigorous prosecution allowed by federal +law. +\end{otherlanguage} \section{Befehle zur \texorpdfstring{\texttt{.toc}}{.toc}-Datei hinzufügen} \label{sec:addingtotoc} @@ -7978,285 +7966,6 @@ Vier"=Säulen"=Liste, einschließlich der Abschnitte, kann dann erreichen mit \end{filecontentshere} \attachfile{etocsnippet-\the\value{section}.tex} -\section{Ein TOC mit einem extravagantem Layout} - -Hier ist ein Inhaltsverzeichnis, wo die Abschnitte aus einem bestimmten Kapitel -durch einen Zahlenbereich dargestellt werden sollen -(wie 18--22 bei einem bestimmten Kapitel, 42--49 für ein anderes \ldots\ -natürlich in das Inhaltsverzeichnis automatisch eingefügt wurden). - -Dies ist kein Abbildungseinschluss, das Inhaltsverzeichnis wird von seiner -ursprünglichen -|tex|-Quelle in dieses Dokument nach dem Austausch des -|Teils|, |Kapitels| oder |Abschnitts| mit |Dummy-Teil|, |Dummy-Kapitel| und -|Dummy-Abschnitt| (und da ist auch eine Dummy-Seitenzahl) produziert. Wir -kopierten die Linienstile, wie im Original verwendet, und -das Inhaltsverzeichnis zeigt folgende Situation an: -\begin{verbatim} - \etocsetlevel{dummypart} {-1} \etocsetlevel{part} {2} - \etocsetlevel{dummychapter}{0} \etocsetlevel{chapter}{2} - \etocsetlevel{dummysection}{1} \etocsetlevel{section}{2} - \etocsetnexttocdepth{dummysection} -\end{verbatim} - -Jedes Kapitel zeigt die Zahl nur von dem ersten und dem letzten Abschnitt an. -Siehe in der Quelldatei |etoc.dtx| für die Details nach, wie das gemacht wird. - -Eine andere Technik für diese Art der Dinge erläutert - \autoref{ssec:statistics}. - -\begingroup - - \etocsetlevel{dummypart}{-1} - \etocsetlevel{dummychapter}{0} - \etocsetlevel{dummysection}{1} - \etocsetlevel{part}{2} - \etocsetlevel{chapter}{2} - \etocsetlevel{section}{2} - - \newif\ifextraidone - \newif\ifextraiidone - - \etocsetstyle{dummypart} - {} - {} - {\begin{center}\Large\bfseries TEIL \etocnumber - \ifextraiidone\\\etocname.\fi\end{center} - \ifextraidone\else - \noindent\hskip.7\linewidth - \hbox to .2\linewidth -% février (ou janvier?) 2013 -% je modifie ici en ajoutant un \hss, pour compenser la plus petite -% taille de txrm. Ok. - {\hss\small\textsc{\bfseries Kapitel.\hss Seite.}}\par\fi - \extraidonetrue - } - {} - - \newcommand\mytocleaders{\hbox to .125\linewidth{...\hss}} - \etocsetstyle{dummychapter} - {} - {\par\noindent\etocifnumbered - {\makebox[.15\linewidth][r]{\bfseries\etocnumber.}} - {\hspace*{.15\linewidth}}} - {\hbox to .65\linewidth - {\hspace{1em}\etocname\leaders\mytocleaders\hss}% - \hskip-.1\linewidth - \hbox to .2\linewidth{\hspace{1.5em}...\hss - \etocifnumbered - {\etocpage} - {\ifextraiidone\else\etocpage\fi}}% - \hskip-.2\linewidth - } - {} - - \newbox\forsectionnumbers - \makeatletter -% 21 février 2013: je rajoute \color@begingroup et \color@endgroup - \etocsetstyle{dummysection} - {\setbox\forsectionnumbers=\hbox to .1\linewidth - \bgroup\color@begingroup\hss\etocskipfirstprefix} - {\@gobble} - {\etocnumber---} - {\etocnumber\color@endgroup\egroup - % for reasons I do not quite understand, in some pdf viewers the dots - % do not completely disappear if here \fboxsep0pt is used. - % (problèmes liés à l'anti-aliasing, sur Mac OS X, Skim, Preview...) - % (j'ai maintenu ici la méthode de mon post sur stackexchange, mais - % sans doute je pourrais réfléchir à une autre façon évitant d'avoir à - % « effacer ») - \fboxsep=.5pt\colorbox{white}{\box\forsectionnumbers}\par - \ifextraiidone\else - \begin{center}\bfseries Kongruenz.\end{center} - \noindent\makebox[.15\linewidth][r]{\textsc{\bfseries Übung.}}\par - \fi\extraiidonetrue - } - \makeatother - - \renewcommand{\etocinnertopsep}{0pt} - - \etocruledstyle[1]{% - \parbox{\linewidth}{% - \centering - \textsc{\bfseries\LARGE\MakeUppercase{Inhaltsverzeichnis}}\\ - \rule{.2\linewidth}{2pt}}% - } - - \etocsetnexttocdepth{dummysection} - - \tableofcontents - -\makeatletter - \def\adddummysection {\stepcounter{dummysection}% - \addtocontents {toc}{\protect\contentsline - {dummysection}{\protect\numberline{\thedummysection}}% - {\the\dummypage }% - %\ifEtoc@hyperref ou \ifdefined\hyperref si e-TeX - {\@currentHref }% - %\fi - }} - - \def\adddummychapter #1{\stepcounter{dummychapter}% - \advance\dummypage2 - \addtocontents {toc}{\protect\contentsline - {dummychapter}{\protect\numberline{\thedummychapter}#1}% - {\the\dummypage }% - %\ifEtoc@hyperref ou \ifdefined\hyperref si e-TeX - {\@currentHref }% - %\fi - }} - - \def\adddummychapno #1{\advance\dummypage2 - \addtocontents {toc}{\protect\contentsline - {dummychapter}{#1}{\the\dummypage }% - %\ifEtoc@hyperref ou \ifdefined\hyperref si e-TeX - {\@currentHref }% - %\fi - }} - - \def\adddummypart #1{\stepcounter{dummypart}% - \advance\dummypage4 - \addtocontents {toc}{\protect\contentsline - {dummypart}{\protect\numberline{\Roman{dummypart}}#1}% - {\the\dummypage }% - %\ifEtoc@hyperref ou \ifdefined\hyperref si e-TeX - {\@currentHref }% - %\fi - }} -\makeatother - - \newcount\dummypage \dummypage-1 - - \adddummypart {} - - \adddummychapno {Einleitung} - - \newcount\tempcount - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<8 - \repeat - - \adddummychapter {Kongruenz von Subjekt und Verb} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<17 - \repeat - - \adddummychapter {Kongruenz von Substantiven und Adjektiven} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<22 - \repeat - - \adddummychapno {Kongruenz von Relativen und Antezendenten} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<25 - \repeat - - \adddummypart {Government} - - \adddummychapter {Der Akkusativ} - - \adddummychapno {Allgemeine Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<30 - \repeat - - \adddummychapno {Besondere Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<37 - \repeat - - \adddummychapter {Verbrektion über zwei Akkusative} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<41 - \repeat - - \adddummychapter {Der Kausativ} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<49 - \repeat - - \adddummychapter {Der Instrumental} - - \adddummychapno {Allgemeine Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<54 - \repeat - - \adddummychapno {Besondere Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<59 - \repeat - - \adddummychapter {Der Dativ} - - \adddummychapno {Allgemeine Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<65 - \repeat - - \adddummychapno {Besondere Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<71 - \repeat - - \adddummychapter {Der Ablativ} - - \adddummychapno {Allgemeine Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<75 - \repeat - - \adddummychapno {Besondere Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<86 - \repeat - - \adddummychapter {Der Lokativ} - - \adddummychapno {Allgemeine Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<92 - \repeat - - \adddummychapno {Besondere Anwendungen} - - \loop\advance\tempcount by 1 - \adddummysection - \ifnum\tempcount<100 - \repeat -\endgroup - - \section{Das TOC als ein Baum}\label{tocastree} Mit |tikz|\footnote{\url{http://ctan.org/pkg/pgf}} und dem Paket @@ -9501,6 +9210,31 @@ als Subroutine auf, um eine \texttt{Mehr\-spalten}-Umgebung mit Hilfe von \marg{before\_toc} zu starten, welche mit \marg{after\_toc} wieder geschlossen wird. +\begin{otherlanguage}{english} + \textbf{\TeX\ hacker note:} We have seen in the previous chapter some examples +of using |\begin{enumerate}| and |\end{enumerate}| within TOC line styles. +There is a real difficulty with doing however something like this: +\begin{verbatim} +\etocsettocstyle{\begin{enumerate}}{\end{enumerate}} +\etocsetstyle{section}{}{\item \sectionname}{}{} +\end{verbatim} +Indeed for example on first compilation of a document, the |.toc| file is +empty and there will be the typical ``Something's wrong--perhaps a missing +\string\item''. Using \csb{etocchecksemptiness} does not help, because as is +explained there, on first encountering a new TOC added at end of a document, +\etoc considers it non-empty, hence querying \csb{etocifwasempty} serves +nothing. No, one must do something like this: +\begin{verbatim} +\makeatletter +\etocsettocstyle + {\begin{enumerate}} + {\if@newlist\item Please run \LaTeX\ again\fi + \end{enumerate}} +\makeatother +\etocsetstyle{section}{}{\item \sectionname}{}{} +\end{verbatim} +\end{otherlanguage} + \subsection{Die Befehle \csbhyp{etocmulticolstyle}, \csbhyp{etocmulticol} und \csbhyp{etoclocalmulticol}} \label{etocmulticolstyle} @@ -10927,7 +10661,16 @@ Dokumentation erzeugt von der Quelldatei mit dem Stempel \begin{multicols}{2} \begin{jfverbatim} -v1.08p [2018/07/04]^ +v1.09 [2019/03/09]^ + + New features: \etoclocaltop, \localtableofcontentswithrelativedepth. Thanks + to Tony Roberts for feature request. + + Note to hackers: internal control sequence \Etoc@localtop is gone. + + etoc now requires e-TeX (\numexpr, \unless). + +~v1.08p [2018/07/04]^ Fixed bug surfacing in case of linktoc=page option of hyperref. Thanks to Denis Bitouzé for report (cf. @@ -11534,7 +11277,6 @@ v1.08p [2018/07/04]^ \chardef\Etoc@@four@@ 4 \chardef\Etoc@@five@@ 5 \chardef\Etoc@@six@@ 6 -%%\let\Etoc@localtop\Etoc@@minustwo@@ % 1.08e does it at each local TOC. \def\Etoc@@minustwo@{minustwo} \def\Etoc@@minusone@{minusone} \def\Etoc@@zero@ {zero} @@ -11869,6 +11611,9 @@ v1.08p [2018/07/04]^ % 2011/12 that I got excessively cautious then, and was using an |\Etoc@next| % for the |\Etoc@setflags| rather than leaving it like here deep inside % conditional branches. +% +% Attention! |1.09|'s \cs{etoclocaltop} is the former \cs{Etoc@localtop} +% \emph{minus one}. Hence some slight change in conditional here. % \begin{macrocode} \def\Etoc@etoccontentsline #1{% \global\expandafter\let\expandafter\Etoc@level\csname Etoc@#1@@\endcsname @@ -11883,7 +11628,7 @@ v1.08p [2018/07/04]^ \ifEtoc@notactive\Etoc@setflags \Etoc@skipthisonetrue \else - \ifnum\Etoc@level<\Etoc@localtop + \unless\ifnum\Etoc@level>\etoclocaltop \Etoc@skipthisonetrue \global\Etoc@stoptoctrue \fi @@ -11894,8 +11639,7 @@ v1.08p [2018/07/04]^ \let\Etoc@next\Etoc@gobblefourorthree \ifEtoc@skipthisone \else - \ifnum\c@tocdepth<\Etoc@level - \else + \unless\ifnum\c@tocdepth<\Etoc@level \ifEtoc@standard \let\Etoc@next\Etoc@savedcontentsline \else @@ -12460,18 +12204,30 @@ v1.08p [2018/07/04]^ % I replace (|1.08e|) the |\Etoc@global|'s for |\Etoc@localtop| by % |\global|'s. The |\relax| is needed because |#2| may sometimes be a count, % sometimes tokens. +% +% Attention! |1.09| defines a public \cs{etoclocaltop} in replacement of old +% \cs{Etoc@localtop} \emph{minus one}. Memo: \cs{etoclocaltop} has only +% meaningful meaning when the local toc has its "active" flag set. Except that +% I used a "notactive" flag to torture myself, so: has the "notactive" flag +% off. +% +% Also attention |1.09| now sets the |\c@tocdepth| there in relation to +% implementation of \localtocwrdp. This is needed for line styles in +% compatibility mode as the code from standard classes checks the tocdepth +% counter. % \begin{macrocode} \def\etoc@@startlocaltoc#1#2{% \ifEtoc@localtoc \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 - \ifEtoc@i \global\let\Etoc@localtop\Etoc@@two@@ \fi - \ifEtoc@ii \global\let\Etoc@localtop\Etoc@@three@@ \fi - \ifEtoc@iii \global\let\Etoc@localtop\Etoc@@four@@ \fi - \ifEtoc@iv \global\let\Etoc@localtop\Etoc@@five@@ \fi - \ifEtoc@v \global\let\Etoc@localtop\Etoc@@six@@ \fi + \ifEtoc@jj \global\let\etoclocaltop\Etoc@@minustwo@@\fi + \ifEtoc@j \global\let\etoclocaltop\Etoc@@minusone@@\fi + \ifEtoc@ \global\let\etoclocaltop\Etoc@@zero@@ \fi + \ifEtoc@i \global\let\etoclocaltop\Etoc@@one@@ \fi + \ifEtoc@ii \global\let\etoclocaltop\Etoc@@two@@ \fi + \ifEtoc@iii \global\let\etoclocaltop\Etoc@@three@@ \fi + \ifEtoc@iv \global\let\etoclocaltop\Etoc@@four@@ \fi + \ifEtoc@v \global\let\etoclocaltop\Etoc@@five@@ \fi + \global\c@tocdepth\Etoc@localtocdepth \global\Etoc@notactivefalse \global\Etoc@vfalse \global\Etoc@ivfalse @@ -12486,9 +12242,11 @@ v1.08p [2018/07/04]^ } \let\etoc@startlocaltoc\@gobble % \end{macrocode} -% |2015/03/16|: |1.08e| tests if a local table of contents turns out empty. The -% \csa{Etoc@localtop} here does not have the same meaning as when set-up by -% the regular \csa{etoc@@startlocaltoc}. It is off by 1 (in general). +% |2015/03/16|: |1.08e| tests if a local table of contents turns out empty. +% The \csa{Etoc@localtop} there does not have the same meaning as when set-up +% by the regular \csa{etoc@@startlocaltoc}. It is off by 1 (in general). THIS +% IS OBSOLETE since |1.09|: a \cs{etoclocaltop} is used with same meaning in +% all code branches. % % After some hesitation I opted for making and obeying the test always (*) for % local tables of contents, and do it also for global tables of contents but @@ -12528,6 +12286,9 @@ v1.08p [2018/07/04]^ % |\contentsline|. % % |1.08i| has two |testingcontentsline| macros, one for local, one for global. +% +% |1.09| renames the \cs{Etoc@localtop} which was used here to a public +% \cs{etoclocaltop} to make it usable in \cs{etocsettocstyle}. % \begin{macrocode} \def\Etoc@setemptytocbool {% \global\Etoc@emptytoctrue @@ -12537,7 +12298,7 @@ v1.08p [2018/07/04]^ \ifEtoc@localtoc \def\etoc@startlocaltoc##1{% \ifnum##1=\Etoc@tocid\relax - \global\let\Etoc@localtop\Etoc@level + \global\let\etoclocaltop\Etoc@level \global\Etoc@notactivefalse \fi }% \let\contentsline\Etoc@testingcontentslinelocal @@ -12546,7 +12307,7 @@ v1.08p [2018/07/04]^ \fi \Etoc@storetocdepth \the\Etoc@toctoks - \Etoc@resettocdepth + \Etoc@restoretocdepth \endgroup } \DeclareRobustCommand*\etocifwasempty @@ -12565,12 +12326,14 @@ v1.08p [2018/07/04]^ % Set |stoptoc| flag afterwards in all cases. |\Etoc@localtop| will have been % initialized by |\etoc@@startlocaltoc| as |\ifEtoc@notactive| flag can be % false only then. +% +% |1.09| renamed the \cs{Etoc@localtop} as formerly here to \cs{etoclocaltop} +% and adds support for \localtocwrdp. % \begin{macrocode} \ifEtoc@notactive \else - \ifnum\Etoc@level>\Etoc@localtop - \ifnum\Etoc@level>\c@tocdepth - \else + \ifnum\Etoc@level>\etoclocaltop + \unless\ifnum\Etoc@level>\Etoc@localtocdepth \global\Etoc@emptytocfalse \global\Etoc@stoptoctrue \fi @@ -12587,8 +12350,7 @@ v1.08p [2018/07/04]^ \else \ifnum\csname Etoc@#1@@\endcsname=\Etoc@@six@@ \else - \ifnum\csname Etoc@#1@@\endcsname>\c@tocdepth - \else + \unless\ifnum\csname Etoc@#1@@\endcsname>\c@tocdepth \global\Etoc@emptytocfalse \global\Etoc@stoptoctrue \fi @@ -12689,6 +12451,7 @@ v1.08p [2018/07/04]^ % induce it into making too many runs. % \begin{macrocode} \def\Etoc@localtableofcontents#1{% + \gdef\etoclocaltop{-\@m}% \Etoc@localtoctrue \global\Etoc@emptytocfalse \edef\Etoc@tocid{#1}% @@ -12697,6 +12460,7 @@ v1.08p [2018/07/04]^ \setbox0\hbox{\ref{Unknown toc ref \@secondoftwo#1. Rerun LaTeX}}% %\if@filesw\immediate\write\@mainaux{\noexpand\@tempswatrue}\fi \global\Etoc@stoptoctrue % do only heading + \gdef\etoclocaltop{-\thr@@}% \Etoc@tableofcontents \expandafter\Etoc@gobbletoetoc@ % skip all the rest \fi @@ -12704,7 +12468,9 @@ v1.08p [2018/07/04]^ % \end{macrocode} % |1.08i|'s |\Etoc@setemptytocbool| now checks |localtoc| flag. % \begin{macrocode} - \ifEtoc@checksemptiness \Etoc@setemptytocbool \fi + \ifEtoc@checksemptiness + \Etoc@setemptytocbool + \fi \ifEtoc@emptytoc \ifEtoc@notactive %\PackageWarning{etoc}{Unknown toc ID \number\Etoc@tocid. Run LaTeX again}% @@ -12712,6 +12478,7 @@ v1.08p [2018/07/04]^ %\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 + \gdef\etoclocaltop{-\thr@@}% \Etoc@tableofcontents \expandafter\expandafter\expandafter\Etoc@gobbletoetoc@ \else @@ -12720,15 +12487,33 @@ v1.08p [2018/07/04]^ \else \global\Etoc@stoptocfalse \global\Etoc@notactivetrue - \global\let\Etoc@localtop\Etoc@@minustwo@@ - \edef\etoc@startlocaltoc##1{\noexpand\etoc@@startlocaltoc{##1}{\Etoc@tocid}}% +% \end{macrocode} +% Prior to |1.09| a \cs{Etoc@localtop} was reset here. This has now been +% moved to \cs{Etoc@tableofcontents} and \cs{Etoc@localtop} replaced by a +% public \cs{etoclocaltop} usable in line styles, and in \cs{etocsettocstyle} +% (under checksemptinesstrue regime). +% +% We can end up here either if the emptiness check was done and turned +% negative (then \cs{etoclocaltop} has the correct level for usage in first +% argument of \cs{etocsettocstyle}), or if the emptiness check was not done. +% For the latter case \cs{etoclocaltop} has setting |-\@m|. +% \begin{macrocode} + \edef\etoc@startlocaltoc##1% + {\noexpand\etoc@@startlocaltoc{##1}{\Etoc@tocid}}% \Etoc@tableofcontents \fi \@gobble\etoc@ \endgroup\ifEtoc@mustclosegroup\endgroup\fi \Etoc@tocdepthreset % 1.07h, renamed 1.08h \etocaftertochook % 1.07g -} +% \end{macrocode} +% |1.09| hesitates about putting this before of after the +% \cs{etocaftertochook}. The information of the used tocdepth is lost if +% puuting it first. The usage of \cs{etocaftertochook} may be broken if +% unexpected tokens follows. +% \begin{macrocode} + \let\Etoc@localtocdepth\c@tocdepth % 1.09 +}% \Etoc@localtableofcontents % \end{macrocode} % |2013/03/07|: I discover a \csa{@namedef} trick to construct the % \csa{Etoc@again} space delimited macro:\\ @@ -12755,6 +12540,7 @@ v1.08p [2018/07/04]^ % \begin{macrocode} \def\Etoc@dothis #1#2\etoc@ {\fi #1} \def\Etoc@t@bleofcontents{% + \gdef\etoclocaltop{-\@M}% \ifx\Etoc@nexttoken\label\Etoc@dothis{\expandafter\Etoc@label\@gobble}\fi \ifx\Etoc@nexttoken\@sptoken\Etoc@dothis{\Etoc@again}\fi % \end{macrocode} @@ -12788,7 +12574,7 @@ v1.08p [2018/07/04]^ \Etoc@tocdepthreset % 1.07h, renamed 1.08h \etocaftertochook % 1.07g \@gobble\etoc@ - } + }% \Etoc@t@bleofcontents % \end{macrocode} % |1.07g| for consistency Etoc@ prefix added. % @@ -12823,10 +12609,12 @@ v1.08p [2018/07/04]^ % \end{macrocode} % Attention that there could be a |\ref| following, thus we don't yet know % whether this is a local or global table of contents. +% +% The \cs{Etoc@tocdepthset} is for \cs{etocsetnexttocdepth} mechanism. % \begin{macrocode} \def\etoctableofcontents{% \Etoc@openouttoc - \Etoc@tocdepthset % new with 1.08h + \Etoc@tocdepthset % new with 1.08h (\etocsetnexttocdepth) \begingroup % closed in \Etoc@t@bleofcontents or \Etoc@localtableofcontents % \end{macrocode} % No need for the |tableof| extra group level, even it is better to get rid of @@ -12843,17 +12631,35 @@ v1.08p [2018/07/04]^ % \begin{macrocode} \@ifstar {\def\Etoc@aftertitlehook{}\Etoc@table@fcontents} - {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@table@fcontents}} + {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@table@fcontents}% +}% \etoctableofcontents \let\tableofcontents\etoctableofcontents \newcommand*\localtableofcontents{% \Etoc@openouttoc - \Etoc@tocdepthset % new with 1.08h + \Etoc@tocdepthset % new with 1.08h (\etocsetnexttocdepth) \begingroup % closed in \Etoc@t@bleofcontents or \Etoc@localtableofcontents \let\tof@begingroup\@empty \let\tof@endgroup \@empty \@ifstar {\def\Etoc@aftertitlehook{}\Etoc@localtable@fcontents} - {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@localtable@fcontents}} + {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@localtable@fcontents}% +}% \localtableofcontents +% \end{macrocode} +% |1.09| adds \localtocwrdp. The motivation is that it is impossible to set +% in a completely satisfactory way the tocdepth from the first argument of +% \cs{etocsettocstyle} because the emptiness check does not execute that +% argument. If one does not care about emptiness check, one can of course set +% the tocdepth from the first argument of \cs{etocsettocstyle}. One can even +% use \cs{etocsetnexttocdepth} for that since |1.09| but anyway direct usage +% of \cs{etocsettocdepth} (or |\setcounter{tocdepth}{...}| is easier as its +% effet when executed there is automatically limited to duration of the TOC. +% \begin{macrocode} +\newcommand*\localtableofcontentswithrelativedepth[1]{% + \edef\Etoc@localtocdepth + {\numexpr\noexpand\etoclocaltop+\the\numexpr#1\relax\relax}% + \localtableofcontents +}% \localtableofcontentswithrelativedepth +\let\Etoc@localtocdepth\c@tocdepth % \end{macrocode} % |1.08| moves earlier the definitions of |\Etoc@savedcontentsline| as % well as |\Etoc@levellist|. It will thus not be operative to do @@ -12914,13 +12720,29 @@ v1.08p [2018/07/04]^ % |1.08k| removes |\let\chapternumberline\numberline| etc... done formerly here % \begin{macrocode} \fi +% \end{macrocode} +% |1.09| makes \cs{etocsetnexttocdepth} usable in |#1| (but this is not 100\% +% compatible with the emptiness check). +% +% |1.09| makes an \cs{etoclocaltop} usable in |#1| if under checksemptiness +% regime. +% \begin{macrocode} #1% + \Etoc@tocdepthset \ifEtoc@parskip\parskip\z@skip\fi %1.07d \Etoc@aftertitlehook +% \end{macrocode} +% |1.09| has replaced former \cs{Etoc@localtop} (\emph{minus one}) by +% \cs{etoclocaltop}. Under checksemptinesstrue regime its value is already +% known, but it will be obtained again from the toc file execution. As it is +% used only if TOC is active, resetting it here this way is decorative and +% could be removed. +% \begin{macrocode} + \gdef\etoclocaltop{-\thr@@}% \Etoc@toctoc \etocaftercontentshook #2\@nobreakfalse % 1.07d: \@nobreakfalse moved here - \Etoc@resettocdepth % 1.07g. moved here from before #2 by 1.08 + \Etoc@restoretocdepth % 1.07g. moved here from before #2 by 1.08 % \end{macrocode} % |1.08|: necessary if |tableof 1.4a| has been used in global mode and thus % was forced to modify globally |\contentsline|. The collateral effect is that @@ -13635,9 +13457,10 @@ v1.08p [2018/07/04]^ % when I first worked on |1.07g| I possibly had more than one token % after |\etoc@settocdepth|, but I changed that later. % +% |1.09| renames \cs{Etoc@resettocdepth} to \cs{Etoc@restoretocdepth}. % \begin{macrocode} -\def\Etoc@storetocdepth {\global\c@etoc@tocdepth\c@tocdepth } -\def\Etoc@resettocdepth {\global\c@tocdepth\c@etoc@tocdepth } +\def\Etoc@storetocdepth {\global\c@etoc@tocdepth\c@tocdepth } +\def\Etoc@restoretocdepth {\global\c@tocdepth\c@etoc@tocdepth } \def\etocobeytoctocdepth {\def\etoc@settocdepth {\afterassignment\Etoc@@nottoodeep \global\c@tocdepth}} \def\Etoc@@nottoodeep {\ifnum\c@tocdepth>\c@etoc@tocdepth @@ -13729,6 +13552,16 @@ v1.08p [2018/07/04]^ % with no intervening TOC, due to the fact that the command did an immediate % modification of the |tocdepth counter|. This is now delayed until % the actual TOC typesetting. +% +% |1.09|: slight refactoring of \cs{etocsetnexttocdepth} to let it be usable +% from first argument of \cs{etocsettocstyle} although it is even simpler to +% use \cs{etocsettocdepth} there, because the setting is automatically undone +% at end of TOC. +% +% Recall that etoc allows to change all numeric +% levels assigned to sectioning names, and the one used by +% \cs{etocsetnexttocdepth} is determined at time of next toc only, when +% \cs{Etoc@tocdepthset} will expand. % \begin{macrocode} \def\invisibletableofcontents {\etocsetnexttocdepth {-3}\tableofcontents }% \def\invisiblelocaltableofcontents @@ -13737,13 +13570,21 @@ v1.08p [2018/07/04]^ \@ifundefined{Etoc@#1@@} {\PackageWarning{etoc} {Unknown sectioning unit #1, \protect\etocsetnextocdepth\space ignored}} - {\def\Etoc@tocdepthset - {\edef\Etoc@tocdepthreset {% - \global\c@tocdepth\the\c@tocdepth\space - \global\let\noexpand\Etoc@tocdepthreset\noexpand\@empty }% - \global\c@tocdepth\csname Etoc@#1@@\endcsname - \global\let\Etoc@tocdepthset\@empty}}% + {\Etoc@setnexttocdepth{\csname Etoc@#1@@\endcsname}}% }% +\def\Etoc@setnexttocdepth#1{% + \def\Etoc@tocdepthset{% + \Etoc@tocdepthreset + \edef\Etoc@tocdepthreset {% + \global\c@tocdepth\the\c@tocdepth\space + \global\let\noexpand\Etoc@tocdepthreset\noexpand\@empty + }% + \global\c@tocdepth#1% + \global\let\Etoc@tocdepthset\@empty + }% +}% +\let\Etoc@tocdepthreset\@empty % new 1.08h functioning of \etocsetnexttocdepth +\let\Etoc@tocdepthset \@empty % % \end{macrocode} % |1.08k|. Serves to make local TOCs even after headings which were not added % to the |.toc| file; but of course the local TOCs can only display @@ -13770,7 +13611,12 @@ v1.08p [2018/07/04]^ \Etoc@setflags \Etoc@skipthisonetrue \else - \ifnum\Etoc@level<\Etoc@localtop +% \end{macrocode} +% Attention, |1.09| has \cs{etoclocaltop} which is former \cs{Etoc@localtop} +% \emph{minus one}. Hence the shape of the conditional. Memo: it makes sense +% only for code executed under "active" status of the TOC. +% \begin{macrocode} + \unless\ifnum\Etoc@level>\etoclocaltop \Etoc@skipthisonetrue \global\Etoc@stoptoctrue \fi @@ -13810,8 +13656,6 @@ v1.08p [2018/07/04]^ \etocstandarddisplaystyle \etocobeytoctocdepth \etocobeydepthtags -\let\Etoc@tocdepthreset\@empty % new 1.08h functioning of \etocsetnexttocdepth -\let\Etoc@tocdepthset \@empty % \let\etocaftertochook \@empty % public for end user. \let\etocbeforetitlehook \@empty % new with 1.07m \endinput @@ -13833,7 +13677,7 @@ v1.08p [2018/07/04]^ Grave accent \` Left brace \{ Vertical bar \| Right brace \} Tilde \~} -\CheckSum{3454}% +\CheckSum{3497}% \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 78a3d78ed45..a8df76bde76 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.ins +++ b/Master/texmf-dist/source/latex/etoc/etoc.ins @@ -1,16 +1,16 @@ %% %% Package: etoc -%% Version: 1.08p-2018/07/04 +%% Version: 1.09-2019/03/09 %% License: LPPL 1.3c -%% Copyright (C) 2012-2018 Jean-Francois Burnol +%% Copyright (C) 2012-2019 Jean-Francois Burnol %% <jfbu at free dot fr> -%% Copyright (C) 2014-2018 Christine Roemer +%% Copyright (C) 2014-2019 Christine Roemer %% <Christine_Roemer at t-online dot de> %% and collaborators for the translation into German of the documentation %% -\def\etocpkgdate {2018/07/04} -\def\etocdocdate {2018/07/04} -\def\etocpkgversion {v1.08p} +\def\etocpkgdate {2019/03/09} +\def\etocdocdate {2019/03/09} +\def\etocpkgversion {v1.09} \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 4cb310fe559..20f51125d70 100644 --- a/Master/texmf-dist/tex/latex/etoc/etoc.sty +++ b/Master/texmf-dist/tex/latex/etoc/etoc.sty @@ -23,14 +23,14 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{etoc} - [2018/07/04 v1.08p Completely customisable TOCs (JFB)] + [2019/03/09 v1.09 Completely customisable TOCs (JFB)] %% %% Package: etoc -%% Version: 1.08p-2018/07/04 +%% Version: 1.09-2019/03/09 %% License: LPPL 1.3c -%% Copyright (C) 2012-2018 Jean-Francois Burnol +%% Copyright (C) 2012-2019 Jean-Francois Burnol %% <jfbu at free dot fr> -%% Copyright (C) 2014-2018 Christine Roemer +%% Copyright (C) 2014-2019 Christine Roemer %% <Christine_Roemer at t-online dot de> %% and collaborators for the translation into German of the documentation %% @@ -85,7 +85,6 @@ \chardef\Etoc@@four@@ 4 \chardef\Etoc@@five@@ 5 \chardef\Etoc@@six@@ 6 -%%\let\Etoc@localtop\Etoc@@minustwo@@ % 1.08e does it at each local TOC. \def\Etoc@@minustwo@{minustwo} \def\Etoc@@minusone@{minusone} \def\Etoc@@zero@ {zero} @@ -304,7 +303,7 @@ \ifEtoc@notactive\Etoc@setflags \Etoc@skipthisonetrue \else - \ifnum\Etoc@level<\Etoc@localtop + \unless\ifnum\Etoc@level>\etoclocaltop \Etoc@skipthisonetrue \global\Etoc@stoptoctrue \fi @@ -315,8 +314,7 @@ \let\Etoc@next\Etoc@gobblefourorthree \ifEtoc@skipthisone \else - \ifnum\c@tocdepth<\Etoc@level - \else + \unless\ifnum\c@tocdepth<\Etoc@level \ifEtoc@standard \let\Etoc@next\Etoc@savedcontentsline \else @@ -620,14 +618,15 @@ \def\etoc@@startlocaltoc#1#2{% \ifEtoc@localtoc \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 - \ifEtoc@i \global\let\Etoc@localtop\Etoc@@two@@ \fi - \ifEtoc@ii \global\let\Etoc@localtop\Etoc@@three@@ \fi - \ifEtoc@iii \global\let\Etoc@localtop\Etoc@@four@@ \fi - \ifEtoc@iv \global\let\Etoc@localtop\Etoc@@five@@ \fi - \ifEtoc@v \global\let\Etoc@localtop\Etoc@@six@@ \fi + \ifEtoc@jj \global\let\etoclocaltop\Etoc@@minustwo@@\fi + \ifEtoc@j \global\let\etoclocaltop\Etoc@@minusone@@\fi + \ifEtoc@ \global\let\etoclocaltop\Etoc@@zero@@ \fi + \ifEtoc@i \global\let\etoclocaltop\Etoc@@one@@ \fi + \ifEtoc@ii \global\let\etoclocaltop\Etoc@@two@@ \fi + \ifEtoc@iii \global\let\etoclocaltop\Etoc@@three@@ \fi + \ifEtoc@iv \global\let\etoclocaltop\Etoc@@four@@ \fi + \ifEtoc@v \global\let\etoclocaltop\Etoc@@five@@ \fi + \global\c@tocdepth\Etoc@localtocdepth \global\Etoc@notactivefalse \global\Etoc@vfalse \global\Etoc@ivfalse @@ -649,7 +648,7 @@ \ifEtoc@localtoc \def\etoc@startlocaltoc##1{% \ifnum##1=\Etoc@tocid\relax - \global\let\Etoc@localtop\Etoc@level + \global\let\etoclocaltop\Etoc@level \global\Etoc@notactivefalse \fi }% \let\contentsline\Etoc@testingcontentslinelocal @@ -658,7 +657,7 @@ \fi \Etoc@storetocdepth \the\Etoc@toctoks - \Etoc@resettocdepth + \Etoc@restoretocdepth \endgroup } \DeclareRobustCommand*\etocifwasempty @@ -673,9 +672,8 @@ \global\expandafter\let\expandafter\Etoc@level\csname Etoc@#1@@\endcsname \ifEtoc@notactive \else - \ifnum\Etoc@level>\Etoc@localtop - \ifnum\Etoc@level>\c@tocdepth - \else + \ifnum\Etoc@level>\etoclocaltop + \unless\ifnum\Etoc@level>\Etoc@localtocdepth \global\Etoc@emptytocfalse \global\Etoc@stoptoctrue \fi @@ -692,8 +690,7 @@ \else \ifnum\csname Etoc@#1@@\endcsname=\Etoc@@six@@ \else - \ifnum\csname Etoc@#1@@\endcsname>\c@tocdepth - \else + \unless\ifnum\csname Etoc@#1@@\endcsname>\c@tocdepth \global\Etoc@emptytocfalse \global\Etoc@stoptoctrue \fi @@ -702,6 +699,7 @@ \Etoc@gobblefourorthree\relax } \def\Etoc@localtableofcontents#1{% + \gdef\etoclocaltop{-\@m}% \Etoc@localtoctrue \global\Etoc@emptytocfalse \edef\Etoc@tocid{#1}% @@ -710,11 +708,14 @@ \setbox0\hbox{\ref{Unknown toc ref \@secondoftwo#1. Rerun LaTeX}}% %\if@filesw\immediate\write\@mainaux{\noexpand\@tempswatrue}\fi \global\Etoc@stoptoctrue % do only heading + \gdef\etoclocaltop{-\thr@@}% \Etoc@tableofcontents \expandafter\Etoc@gobbletoetoc@ % skip all the rest \fi \global\Etoc@notactivetrue - \ifEtoc@checksemptiness \Etoc@setemptytocbool \fi + \ifEtoc@checksemptiness + \Etoc@setemptytocbool + \fi \ifEtoc@emptytoc \ifEtoc@notactive %\PackageWarning{etoc}{Unknown toc ID \number\Etoc@tocid. Run LaTeX again}% @@ -722,6 +723,7 @@ %\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 + \gdef\etoclocaltop{-\thr@@}% \Etoc@tableofcontents \expandafter\expandafter\expandafter\Etoc@gobbletoetoc@ \else @@ -730,15 +732,16 @@ \else \global\Etoc@stoptocfalse \global\Etoc@notactivetrue - \global\let\Etoc@localtop\Etoc@@minustwo@@ - \edef\etoc@startlocaltoc##1{\noexpand\etoc@@startlocaltoc{##1}{\Etoc@tocid}}% + \edef\etoc@startlocaltoc##1% + {\noexpand\etoc@@startlocaltoc{##1}{\Etoc@tocid}}% \Etoc@tableofcontents \fi \@gobble\etoc@ \endgroup\ifEtoc@mustclosegroup\endgroup\fi \Etoc@tocdepthreset % 1.07h, renamed 1.08h \etocaftertochook % 1.07g -} + \let\Etoc@localtocdepth\c@tocdepth % 1.09 +}% \Etoc@localtableofcontents \def\Etoc@getrefno #1#2\etoc@ {#1} \def\Etoc@getref #1{\@ifundefined{r@#1}{0}{\expandafter\expandafter\expandafter \Etoc@getrefno\csname r@#1\endcsname\relax\etoc@}} @@ -747,6 +750,7 @@ \@firstofone{\def\Etoc@again} {\futurelet\Etoc@nexttoken\Etoc@t@bleofcontents} \def\Etoc@dothis #1#2\etoc@ {\fi #1} \def\Etoc@t@bleofcontents{% + \gdef\etoclocaltop{-\@M}% \ifx\Etoc@nexttoken\label\Etoc@dothis{\expandafter\Etoc@label\@gobble}\fi \ifx\Etoc@nexttoken\@sptoken\Etoc@dothis{\Etoc@again}\fi \ifx\Etoc@nexttoken\ref\Etoc@dothis{\expandafter\Etoc@ref\@gobble}\fi @@ -762,7 +766,7 @@ \Etoc@tocdepthreset % 1.07h, renamed 1.08h \etocaftertochook % 1.07g \@gobble\etoc@ - } + }% \Etoc@t@bleofcontents \def\Etoc@table@fcontents{% \refstepcounter{etoc@tocid}% \Etoc@tocwithidfalse @@ -776,23 +780,31 @@ \let\etocaftercontentshook \@empty \def\etoctableofcontents{% \Etoc@openouttoc - \Etoc@tocdepthset % new with 1.08h + \Etoc@tocdepthset % new with 1.08h (\etocsetnexttocdepth) \begingroup % closed in \Etoc@t@bleofcontents or \Etoc@localtableofcontents \let\tof@begingroup\@empty \let\tof@endgroup \@empty \@ifstar {\def\Etoc@aftertitlehook{}\Etoc@table@fcontents} - {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@table@fcontents}} + {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@table@fcontents}% +}% \etoctableofcontents \let\tableofcontents\etoctableofcontents \newcommand*\localtableofcontents{% \Etoc@openouttoc - \Etoc@tocdepthset % new with 1.08h + \Etoc@tocdepthset % new with 1.08h (\etocsetnexttocdepth) \begingroup % closed in \Etoc@t@bleofcontents or \Etoc@localtableofcontents \let\tof@begingroup\@empty \let\tof@endgroup \@empty \@ifstar {\def\Etoc@aftertitlehook{}\Etoc@localtable@fcontents} - {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@localtable@fcontents}} + {\let\Etoc@aftertitlehook\etocaftertitlehook\Etoc@localtable@fcontents}% +}% \localtableofcontents +\newcommand*\localtableofcontentswithrelativedepth[1]{% + \edef\Etoc@localtocdepth + {\numexpr\noexpand\etoclocaltop+\the\numexpr#1\relax\relax}% + \localtableofcontents +}% \localtableofcontentswithrelativedepth +\let\Etoc@localtocdepth\c@tocdepth \long\def\Etoc@gobbletoetoc@ #1\etoc@ {} \newcommand\etocsettocstyle[2]{% \def\Etoc@tableofcontents @@ -815,12 +827,14 @@ \Etoc@levellist \fi #1% + \Etoc@tocdepthset \ifEtoc@parskip\parskip\z@skip\fi %1.07d \Etoc@aftertitlehook + \gdef\etoclocaltop{-\thr@@}% \Etoc@toctoc \etocaftercontentshook #2\@nobreakfalse % 1.07d: \@nobreakfalse moved here - \Etoc@resettocdepth % 1.07g. moved here from before #2 by 1.08 + \Etoc@restoretocdepth % 1.07g. moved here from before #2 by 1.08 \ifx\Etoc@global\global \ifx\tof@finish\@empty \else @@ -1380,8 +1394,8 @@ \addcontentsline {toc}{#1}{#2}} \DeclareRobustCommand*{\etoctoccontentsline} {\@ifstar{\Etoc@addcontentsline@}{\Etoc@addtocontents}} -\def\Etoc@storetocdepth {\global\c@etoc@tocdepth\c@tocdepth } -\def\Etoc@resettocdepth {\global\c@tocdepth\c@etoc@tocdepth } +\def\Etoc@storetocdepth {\global\c@etoc@tocdepth\c@tocdepth } +\def\Etoc@restoretocdepth {\global\c@tocdepth\c@etoc@tocdepth } \def\etocobeytoctocdepth {\def\etoc@settocdepth {\afterassignment\Etoc@@nottoodeep \global\c@tocdepth}} \def\Etoc@@nottoodeep {\ifnum\c@tocdepth>\c@etoc@tocdepth @@ -1456,13 +1470,21 @@ \@ifundefined{Etoc@#1@@} {\PackageWarning{etoc} {Unknown sectioning unit #1, \protect\etocsetnextocdepth\space ignored}} - {\def\Etoc@tocdepthset - {\edef\Etoc@tocdepthreset {% - \global\c@tocdepth\the\c@tocdepth\space - \global\let\noexpand\Etoc@tocdepthreset\noexpand\@empty }% - \global\c@tocdepth\csname Etoc@#1@@\endcsname - \global\let\Etoc@tocdepthset\@empty}}% + {\Etoc@setnexttocdepth{\csname Etoc@#1@@\endcsname}}% +}% +\def\Etoc@setnexttocdepth#1{% + \def\Etoc@tocdepthset{% + \Etoc@tocdepthreset + \edef\Etoc@tocdepthreset {% + \global\c@tocdepth\the\c@tocdepth\space + \global\let\noexpand\Etoc@tocdepthreset\noexpand\@empty + }% + \global\c@tocdepth#1% + \global\let\Etoc@tocdepthset\@empty + }% }% +\let\Etoc@tocdepthreset\@empty % new 1.08h functioning of \etocsetnexttocdepth +\let\Etoc@tocdepthset \@empty % \def\etocsetlocaltop #1#{\Etoc@set@localtop}% \def\Etoc@set@localtop #1{% \@ifundefined{Etoc@#1@@}% @@ -1484,7 +1506,7 @@ \Etoc@setflags \Etoc@skipthisonetrue \else - \ifnum\Etoc@level<\Etoc@localtop + \unless\ifnum\Etoc@level>\etoclocaltop \Etoc@skipthisonetrue \global\Etoc@stoptoctrue \fi @@ -1517,8 +1539,6 @@ \etocstandarddisplaystyle \etocobeytoctocdepth \etocobeydepthtags -\let\Etoc@tocdepthreset\@empty % new 1.08h functioning of \etocsetnexttocdepth -\let\Etoc@tocdepthset \@empty % \let\etocaftertochook \@empty % public for end user. \let\etocbeforetitlehook \@empty % new with 1.07m \endinput |