diff options
author | Karl Berry <karl@freefriends.org> | 2023-03-02 21:01:34 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-03-02 21:01:34 +0000 |
commit | b8da298343979094f22cce0307bba6a106426d42 (patch) | |
tree | 7d1a220754f3312493a9768642aea9e2f44e090e /Master/texmf-dist/doc/latex/etoc | |
parent | ef4b3553f6f32608d2dbd42af151d5adbd5fb54d (diff) |
etoc (2mar23)
git-svn-id: svn://tug.org/texlive/trunk@66299 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/etoc')
30 files changed, 1193 insertions, 1289 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/README.md b/Master/texmf-dist/doc/latex/etoc/README.md index b452990b348..ed067af2716 100644 --- a/Master/texmf-dist/doc/latex/etoc/README.md +++ b/Master/texmf-dist/doc/latex/etoc/README.md @@ -1,6 +1,6 @@ <!-- --> - Source: etoc.dtx (1.1c) + Source: etoc.dtx (1.2) Author: Jean-Francois Burnol Info: Completely customisable TOCs License: LPPL 1.3c @@ -10,68 +10,49 @@ ABSTRACT ======== -The etoc package gives to the user complete control on how the entries -of the table of contents should be constituted from the *name*, -*number*, and *page number* of each sectioning unit. This goes via the -definition of *line styles* for each sectioning level used in the -document. The package provides its own custom line styles. Simpler -ones are given as examples in the documentation. The simplest usage -will be to take advantage of the layout facilities of packages dealing -with list environments. - -Regarding the *global toc display*, etoc provides pre-defined styles -based on a multi-column format, with, optionally, a ruled title or -framed contents. - -The `\tableofcontents` command may be used arbitrarily many times and -it has a variant `\localtableofcontents` which prints tables of -contents 'local' to the current surrounding document unit. An -extension of the `\label/\ref` syntax allows to reproduce (with -another layout) a local table of contents defined somewhere else in -the document. - -Via *depth tags*, one gets an even finer control for each table of -contents of which sectioning units it should, or not, display. - -The formatting inherited (and possibly customized by other packages) -from the document class will be used when in compatibility mode. - -The assignment of levels to the sectioning units can be changed at any -time, and etoc can thus be used in a quite general manner to create -custom ''lists of'', additionally to the tables of contents related to -the document sectioning units. No auxiliary file is used additionally -to the standard `.toc` file. +With `etoc` loaded, `\tableofcontents` can be used multiple times and +an added command `\localtableofcontents` allows to typeset "local" +tables of contents, i.e. having their scope limited to the last +sectioning command encountered. + +No auxiliary file is used additionally to the standard `.toc` file. +Release 1.2 provides experimental additions `\locallistoffigures` and +`\locallistoftables` which also use only the `.toc` file. + +Such local TOCs or "Lists Of" typically need to adopt a "display +style" (i.e. the way the title is rendered, whether it should add +itself an entry in the `.toc` file, ...) somewhat distinct from the +global TOC. The release 1.2 default adapts automatically the titles +of local TOCs to their depths in the sectioning hierarchy. Should the +need arise to customize such "display style", full control is allowed +by package commands. + +Regarding how the individual "contents lines" are handled, here again +complete control is given to the user to define from the ground-up how +to use the *name*, *number*, and *page number* for each entry, +according to their "levels" (i.e. part, chapter, section, subsection, +...). As this requires some LaTeX fluency, many examples which can +serve as starting points are attached to the PDF documentation as +extractible files. + +Loading `etoc` per itself modifies nothing to "contents lines" +rendering from the class default or changes from other packages. But +full usage of the package allows spectacular effects such as displaying +TOCs as trees or mind maps. INSTALLATION ============ -To extract the package (.sty) and driver (.tex) files from etoc.dtx, -execute `etex etoc.dtx`. - -It is also possible to execute latex or pdflatex directly on etoc.dtx. - -To produce etoc.pdf one can run pdflatex directly on etoc.dtx or on -the file etoc.tex which was extracted from `etex etoc.dtx` step. - -Options can be set in etoc.tex: - -- scrartcl class options (paper size, font size, ...) -- with or without source code, -- with dvipdfmx or with latex+dvips or pdflatex. - -Since release 1.08h pdflatex is the default in etoc.tex (prior it -was latex+dvipdfmx as it produces smaller PDFs) in order to allow -inclusion via the use of package `attachfile` of about 25 code -samples as file attachment annotations. - -Installation: +For manual installation do `etex etoc.dtx` to extract files then move +`etoc.sty` to a place where TeX can find it. etoc.sty -> TDS:tex/latex/etoc/etoc.sty etoc.dtx -> TDS:source/latex/etoc/etoc.dtx etoc.pdf -> TDS:doc/latex/etoc/etoc.pdf README.md -> TDS:doc/latex/etoc/README.md -The other files may be discarded. +To produce `etoc.pdf` run pdflatex on the extracted file `etoc.tex` +sufficiently many times (`latexmk -pdf etoc` is recommended). LICENSE ======= @@ -97,123 +78,29 @@ etoc.sty, etoc.tex, etoc.pdf, etoc.dvi. RECENT CHANGES ============== -1.1c \[2023/01/20\] -------------------- - -Fix a brace removal bug in the construction of `\etocname`. It -remained without visible effects in documents using `hyperref` and -default settings, thanks to the hyperlink wrapper, but e.g. -`\section{{\color{blue}Blue}}` in a document not using `hyperref`, -and not using etoc only in "compatibility mode", could cause a -color leak in the table of contents. - -With the KOMA-script numberline toc feature, unnumbered entries in -TOCs typeset via etoc user-defined or package provided line styles -but using compatibility mode for the global display style were -(knowingly) considered to be numbered with an empty number. They -are now considered by `\etocifnumbered` to be not numbered and the -empty `\etocnumber` will carry no hyperlink. - -Fix a 1.1a regression in the context of KOMA-script unnumbered TOC -entries: `\etocthelinkedname` could lose its hyperlink. - -Continue internal trimming of old code branches which became -un-needed after the 1.1a refactoring. Add relatively decent -code comments to accompany the 1.1a-c refactoring. Update -warning messages to use more consistently LaTeX's templates. - -1.1b \[2023/01/15\] -------------------- - -Documentation fix, 1.1a forgot to mention the following change: -`\etocthelinkedname`, `\etocthelinkednumber`, `\etocthelinkedpage` -are now always hyperlinks independently of linktoc status. - -1.1a \[2023/01/14\] -------------------- - -This version brings no new functionality, despite the number bump. -It implements a complete rewrite of old legacy core internals. -Formerly, etoc waited for -[hyperref](https://ctan.org/pkg/hyperref) -(if present) to have added hyperlinks via its patch to LaTeX's -`\contentsline`. etoc examined the arguments of `\l@section` and -other commands to extract hyperlinking information, if any. -With this release etoc decides earlier according to -[hyperref](https://ctan.org/pkg/hyperref) -linktoc status whether section names and page numbers -should be hyperlinked, and adds links itself via `\hyperlink`. -etoc is thus now immune to the details of how hyperref patches -the `\contentsline` command, which is not executed anymore. -Overall, the code is greatly simplified. - -`\etoclink` now wraps its argument in an hyperlink even if -[hyperref](https://ctan.org/pkg/hyperref) is configured via -`linktoc=none`. Formerly no hyperlink was added then. - -Deprecation of `\etocsavedsectiontocline` and similarly named -commands. They are not needed as `\l@section` et al. are with this -release left unmodified during the table of contents typesetting. - -LaTeX kernel from `2020/10/01` or later is required (to allow -assuming the `\contentsline` entries in the TOC file always have -four arguments). - -1.09i \[2022/11/21\] --------------------- - -Fix bug showing when a document uses both `\etocchecksemptiness` and -`\etocsetlocaltop.toc`: the `start` and `finish` parts of some levels -were executed possibly causing extra printed output. - -More hyperlinking in the implementation part of the documentation. - -1.09h \[2022/11/20\] --------------------- - -Documentation improvements. In particular, attached code snippets -are now visible via their filenames in the page margins. Also, -command names are doubly hyperlinked: first half links to the devoted -part of the user manual, second half links to the implementation part. - -1.09g \[2022/11/17\] --------------------- - -Compatibility hotfix with recent hyperref `7.00u` of `2022-11-13`. -Thanks to Denis Bitouzé for signaling the breakage to the author. - -1.09f \[2022/08/30\] --------------------- - -No more shipping of a German translation of the documentation, as -it was last updated in April 2015. - -(etoc.pdf) User level commands hyperlink from their code source -definitions to their descriptions in the documentation part. Macros -used in the code source hyperlink to where they first got defined -there. - -Wrap the `\etocpartname` (from etoc's package provided toc line style) -together with the part number in a potential common hyperlink. - -Try to sync the emulation of the global display style with KOMA-script -`v3.37` (in particular regarding the `noparskipfake` KOMA toc feature). - -Improve documentation of some aspects under `memoir` class. - -Remove the `\nonumberline` token, even though empty, from the meaning of -`\etocthename` (KOMA-script classes). - -Add `\etocimmediatedepthtag.toc` to work around problems related to -`\include` (see user doc). Thanks to Norman Ramsey who reported the problem -and proposed a work-around in July 2016. Apologies for the somewhat longish -delay in incorporating it... - -Also add `\etocimmediatesettocdepth.toc`. - -Also add `\etocimmediatetoccontentsline` and its starred variant. - -Also add `\etocimmediatesetlocaltop.toc`. - -Fix an obscure bug (see source code comments) in the `\etocsetlocaltop.toc` -mechanism. +This is `1.2` of `2023/03/01`. + +`1.1a` up to `1.1d` were mainly about refactoring core legacy code +dating back to the earliest versions of the package. The initial +stimulus came from the necessity to prepare for changes to how +hyperref and the LaTeX kernel will interact in the future. + +`1.2` added `\locallistoffigures` and `\locallistoftables`. One must +pass options `lof` and `lot` to the package to activate these +experimental features. + +The initial default rendering of the titles of tables of contents now +uses the emulated document class code only for the global ones +(`\tableofcontents`); for local ones (`localtableofcontents` and the +new "local lists of") it uses by default a context aware title +(such as `\subsection*` if local to a section). Thus, usage of +`\etocsettocstyle` is now purely optional. Regarding the +"line styles", the package has always used the unaltered rendering +from the document class, so using the other core customization command +`\etocsetstyle` to truly unleash the package powers has always been +optional. + +Shoud they dare to go check the PDF documentations, users will +discover that it has been completely restructured at release `1.2`, to +the extent allowed by random permutations of topics, and that many +commands have been added to facilitate usage of `\etocsettocstyle`. diff --git a/Master/texmf-dist/doc/latex/etoc/etoc.pdf b/Master/texmf-dist/doc/latex/etoc/etoc.pdf Binary files differindex 8029b61f1f7..667b79b3adf 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/doc/latex/etoc/etoc.tex b/Master/texmf-dist/doc/latex/etoc/etoc.tex index bcb321cdb16..a875f28b1a5 100644 --- a/Master/texmf-dist/doc/latex/etoc/etoc.tex +++ b/Master/texmf-dist/doc/latex/etoc/etoc.tex @@ -1,19 +1,19 @@ %% %% Package: etoc -%% Version: 1.1c +%% Version: 1.2 %% License: LPPL 1.3c %% Copyright (C) 2012-2023 Jean-Francois Burnol %% <jfbu at free dot fr> %% To produce the documentation etoc.pdf with source code included: %% latexmk -pdf etoc.tex -%% Or -%% pdflatex etoc.tex -%% enough times. For customizations see comments and classe options below. +%% (or sufficiently many times pdflatex etoc.tex) +%% For customizations see comments and classe options below. +\tracinglostchars3 \chardef\Withdvipdfmx 0 % replace 0 by 1 for using latex+dvipdfmx \chardef\NoSourceCode 0 % replace 0 by 1 for the doc *without* the source code \NeedsTeXFormat{LaTeX2e} \ProvidesFile {etoc.tex}[Driver for etoc documentation]% -\PassOptionsToClass {a4paper,fontsize=11pt,twoside}{scrartcl} +\PassOptionsToClass {a4paper,fontsize=10pt,twoside}{scrartcl} \PassOptionsToPackage {ngerman,english}{babel} \input etoc.dtx %%% Local Variables: diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex index ccf2140a7e6..bba880187d2 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-01.tex @@ -1,30 +1,22 @@ %% LaTeX2e file `etocsnippet-01.tex' -%% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentshere' environment +%% from source `etoc' on 2023/03/02. %% -\begingroup\parindent 0pt \parfillskip 0pt \leftskip 0cm \rightskip 1cm -\etocsetstyle {section} - {} - {\leavevmode\leftskip 0cm\relax} - {\bfseries\normalsize\makebox[.5cm][l]{\etocnumber.}% - \etocname\nobreak\hfill\nobreak - \rlap{\makebox[1cm]{\mdseries\etocpage}}\par} - {} -\etocsetstyle {subsection} - {} - {\leavevmode\leftskip .5cm\relax } - {\mdseries\normalsize\makebox[1cm][l]{\etocnumber}% - \etocname\nobreak\hfill\nobreak - \rlap{\makebox[1cm]{\etocpage}}\par} - {} -\etocsetstyle {subsubsection} - {} - {\leavevmode\leftskip 1.5cm\relax } - {\mdseries\normalsize\makebox[1cm][l]{\etocnumber}% - \etocname\nobreak\hfill\nobreak - \rlap{\makebox[1cm]{\etocpage}}\par} - {} -\etocruledstyle[1]{\bfseries \Large My first \etoc: TOC of - \autoref{part:overview} (\nameref{part:overview})} -\tableofcontents \ref {toc:overview} -\endgroup +\etocsetstyle{section} +{\begin{enumerate}} +{\normalsize\bfseries\rmfamily\item} +{\etocname{} (page \etocpage)} +{\end{enumerate}} + +\etocsetstyle{subsection} +{\begin{enumerate}} +{\normalfont\item} +{\etocname{} (p.~\etocpage)} +{\end{enumerate}} + +\etocsetstyle{subsubsection} +{\par\nobreak\begingroup\normalfont + \footnotesize\itshape\etocskipfirstprefix} +{\allowbreak\,--\,} +{\etocname} +{.\hfil\par\endgroup\pagebreak[3]} diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex index eaf16b0895c..34f37a9770f 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-02.tex @@ -1,53 +1,23 @@ %% LaTeX2e file `etocsnippet-02.tex' -%% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentshere' environment +%% from source `etoc' on 2023/03/02. %% +\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape + \fbox{\parbox{.6\linewidth}{ + \leftskip 0pt plus .5fil + \rightskip 0pt plus -.5fil + \parfillskip 0pt plus 1fil This is the global table of + contents on two columns, using \etoc default line styles, but with + sections as chapters, and subsections as sections. + }}} +\etocdefaultlines +\etocsetnexttocdepth{1} \begingroup -\newcommand*{\DotsAndPage} -{\nobreak\leaders\hbox{\bfseries\normalsize\hbox to .75ex {\hss.\hss}}% - \hfill\nobreak - \makebox[\rightskip][r]{\bfseries\normalsize\etocpage}\par} - -\etocsetstyle {part} -{\parindent 0pt - \nobreak - \etocskipfirstprefix} -{\pagebreak[3]\bigskip} -{\large\rmfamily\bfseries\scshape\centering - \etocifnumbered{Part \etocnumber{} -- }{}\etocname\par} -{} - -\etocsetstyle {section} -{\leftskip 0pt \rightskip .75cm \parfillskip-\rightskip - \nobreak\medskip - \etocskipfirstprefix} -{\leftskip 0pt \rightskip .75cm \parfillskip-\rightskip - \pagebreak[1]\smallskip} -{\normalsize\rmfamily\bfseries\scshape - \etocnumber. \etocname\DotsAndPage } -{\parfillskip 0pt plus 1fil\relax } - -\etocsetstyle {subsection} -{\leftskip1cm\rightskip .75cm \parfillskip 0pt plus 1fil\relax - \nobreak\smallskip} -{} -{\footnotesize\sffamily\mdseries\itshape - \etocname{} (\etocnumber, p. \etocpage). } -{\par\medskip} - -\etocsettagdepth {preamble} {none} -%\etocsettagdepth {overview} {none}% not needed explicitely, keeps value -%\etocsettagdepth {arbitrarily}{none} -%\etocsettagdepth {examples} {none} -%\etocsettagdepth {surprising} {none} -\etocsettagdepth {linestyles} {subsection} -\etocsettagdepth {globalcmds} {subsection} -\etocsettagdepth {custom} {none} -%\etocsettagdepth {tips} {none} -%\etocsettagdepth {etocandworld}{none} -%\etocsettagdepth {code} {none} - -\etocsettocstyle {\centering\LARGE\textsc{\contentsname}\par\nobreak\medskip}{} -\etocsetnexttocdepth {subsection} +\etocsetlevel{section}{0} +\etocsetlevel{subsection}{1} +\renewcommand*{\etocfontone}{\normalfont \normalsize} +\renewcommand*{\etoctoclineleaders} + {\hbox{\normalfont\normalsize\hbox to 1ex {\hss.\hss}}} +\sloppy \tableofcontents \endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex index e0d0e8ca795..01d153eacb5 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-03.tex @@ -1,32 +1,20 @@ %% LaTeX2e file `etocsnippet-03.tex' %% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\begingroup % we start a group to keep the style changes local -\newlength{\tocleftmargin} \setlength{\tocleftmargin}{5cm} -\newlength{\tocrightmargin} \setlength{\tocrightmargin}{1cm} - -\etocsetstyle{section} % will pretend to be a Chapter -{\addvspace{1ex}\parfillskip0pt - \leftskip\tocleftmargin % (already done in title) - \rightskip\the\tocrightmargin plus 1fil - \parindent0pt\color{cyan}} % (already done) -{\bfseries\LARGE\upshape\addvspace{1ex}\leavevmode} -{\llap{Chapter\hspace{.5em}{\etocnumber}\hspace{.75cm}}\etocname - \hfill\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par} -{} - -\etocsetstyle{subsection} % will pretend to be a Section -{} -{\mdseries\large\addvspace{.5ex}\leavevmode} -{\llap{\etocnumber\hspace{.75cm}}\textit{\etocname}% - \hfill\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par} -{} - -\def\tmptitle{My Beautiful Thesis} -\etocsettocstyle{\color{cyan}\parindent0pt \leftskip\tocleftmargin - \leavevmode\leaders\hrule height 1pt\hfill\ - \huge\textit{\tmptitle}\par}{\bigskip} - -\tableofcontents \ref{toc:overview} -\endgroup +\begin{figure}[ht!] + \centering + \begingroup + % this is a KOMA-script specific customization + \DeclareTOCStyleEntry[numwidth=2em,indent=0pt]{tocline}{section} + \DeclareTOCStyleEntry[numwidth=3.2em,indent=2em]{tocline}{subsection} + \etocstandardlines % <-- use the defaults from the document class + \renewcommand{\etocbkgcolorcmd}{\color{green!5}} + \renewcommand{\etocbelowtocskip}{0pt\relax} + \fboxsep1ex + \etocframedstyle [1]{\fbox{\makebox[.5\linewidth]{\etocfontminusone + I am from \hyperref[toc:part:styling]{far away}}}} + \etocsetnexttocdepth{subsection} + \tableofcontents \label{toc:d} \ref{toc:part:styling} + \endgroup +\end{figure} diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex index 204f5cc0fc3..054a559732a 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-04.tex @@ -1,16 +1,30 @@ %% LaTeX2e file `etocsnippet-04.tex' %% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\begin{figure}[ht!] - \centering - \begingroup - \etocstandardlines - \renewcommand{\etocbkgcolorcmd}{\color{green!5}} - \renewcommand{\etocbelowtocskip}{0pt\relax} - \fboxsep1ex - \etocframedstyle [1]{\fbox{\makebox[.5\linewidth]{\etocfontminusone - \hyperref[toc:c]{I am from far away}}}} - \tableofcontents \label{toc:d} \ref{toc:c} - \endgroup -\end{figure} +\begingroup\parindent 0pt \parfillskip 0pt \leftskip 0cm \rightskip 1cm +\etocsetstyle {section} + {} + {\leavevmode\leftskip 0cm\relax} + {\bfseries\normalsize\makebox[.5cm][l]{\etocnumber.}% + \etocname\nobreak\hfill\nobreak + \rlap{\makebox[1cm][r]{\mdseries\etocpage}}\par} + {} +\etocsetstyle {subsection} + {} + {\leavevmode\leftskip .5cm\relax } + {\mdseries\normalsize\makebox[1cm][l]{\etocnumber}% + \etocname\nobreak\hfill\nobreak + \rlap{\makebox[1cm][r]{\etocpage}}\par} + {} +\etocsetstyle {subsubsection} + {} + {\leavevmode\leftskip 1.5cm\relax } + {\mdseries\normalsize\makebox[1cm][l]{\etocnumber}% + \etocname\nobreak\hfill\nobreak + \rlap{\makebox[1cm][r]{\etocpage}}\par} + {} +\etocruledstyle[1]{\bfseries \Large My first \etoc: TOC of + \autoref{part:overview} (\nameref{part:overview})} +\tableofcontents \ref {toc:overview} +\endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex index 026dcc39479..440d27fada6 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-05.tex @@ -1,25 +1,50 @@ %% LaTeX2e file `etocsnippet-05.tex' -%% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentsdef' environment +%% from source `etoc' on 2023/03/02. %% -\makeatletter -\newcommand{\MyStandardTOC}{% - \begingroup - % for the book or article classes: - %\etocsetstyle{part}{}{} - % {\l@part{\etocnumber\hspace{1em}\etocname}{\etocpage}}{}% - % for the scrbook or scrartcl classes: - \etocsetstyle{part}{}{} - {\l@part{\numberline{\etocnumber}\etocname}{\etocpage}}{}% - % following is identical in book/article/scrbook/scrartcl classes: - \etocsetstyle{chapter}{}{} %%% only for book and scrbook - {\l@chapter{\numberline{\etocnumber}\etocname}{\etocpage}}{}% - \etocsetstyle{section}{}{} - {\l@section{\numberline{\etocnumber}\etocname}{\etocpage}}{}% - \etocsetstyle{subsection}{}{} - {\l@subsection{\numberline{\etocnumber}\etocname}{\etocpage}}{}% - % etc... if further sectioning units are used - \etocstandarddisplaystyle % this is for the title, page-marks, etc... - \tableofcontents - \endgroup} -\makeatother +\begingroup +\newcommand*{\DotsAndPage} +{\nobreak\leaders\hbox{\bfseries\normalsize\hbox to .75ex {\hss.\hss}}% + \hfill\nobreak + \makebox[\rightskip][r]{\bfseries\normalsize\etocpage}\par} + +\etocsetstyle {part} +{\parindent 0pt + \nobreak + \etocskipfirstprefix} +{\pagebreak[3]\bigskip} +{\large\rmfamily\bfseries\centering %\scshape + \etocifnumbered{Part \etocnumber{} -- }{}\etocname\par} +{} + +\etocsetstyle {section} +{\leftskip 0pt \rightskip .75cm \parfillskip-\rightskip + \nobreak\medskip + \etocskipfirstprefix} +{\leftskip 0pt \rightskip .75cm \parfillskip-\rightskip + \pagebreak[1]\smallskip} +{\normalsize\rmfamily\bfseries %\scshape + \etocnumber. \etocname\DotsAndPage } +{\parfillskip 0pt plus 1fil\relax } + +\etocsetstyle {subsection} +{\leftskip1cm\rightskip .75cm \parfillskip 0pt plus 1fil\relax + \nobreak\smallskip} +{} +{\footnotesize\sffamily\mdseries\itshape + \etocname{} (\etocnumber, p. \etocpage). } +{\par\medskip} + +\etocsettagdepth {preamble} {none} +\etocsettagdepth {overview} {none} +\etocsettagdepth {styling} {subsection} +\etocsettagdepth {control} {none} +\etocsettagdepth {examples} {none} +\etocsettagdepth {advanced} {none} +\etocsettagdepth {etocandworld}{none} +\etocsettagdepth {code} {none} + +\etocsettocstyle {\centering\LARGE\textsc{\contentsname}\par\nobreak\medskip}{} +\etocsetnexttocdepth {subsection} +\tableofcontents +\endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex index d6726052ce7..4b0e28273ca 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-06.tex @@ -1,36 +1,32 @@ %% LaTeX2e file `etocsnippet-06.tex' -%% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentsdef' environment +%% from source `etoc' on 2023/03/02. %% -\makeatletter -\newcommand*{\MyQuasiStandardTOC}[1]{% - \begingroup - \etocsetstyle{section} - {} - {\ifnum\etocthenumber=4 - \etocsetstyle{subsection} - {\par\nopagebreak\begingroup - \leftskip1.5em \rightskip\@tocrmarg - \parfillskip \@flushglue - \parindent 0pt - \normalfont\normalsize\rmfamily\itshape - \etocskipfirstprefix} - {\allowbreak\,--\,} - {\etocname\ \textup{(\etocnumber)}} - {.\par\endgroup}% - \else - \etocsetstyle{subsection} - {}% - {}% - {\l@subsection{\numberline{\etocnumber}\etocname}{\etocpage}}% - {}% - \fi - }% prefix for section sets the style dynamically for subsections! - {\l@section{\numberline{{\color{cyan}\etocthenumber}}\etocname}{\etocpage}}% - {}% - \etocstandarddisplaystyle - \etocsetnexttocdepth {2}% - \tableofcontents #1 - \endgroup -} -\makeatother +\begingroup % we start a group to keep the style changes local +\newlength{\tocleftmargin} \setlength{\tocleftmargin}{4cm} +\newlength{\tocrightmargin} \setlength{\tocrightmargin}{1cm} + +\etocsetstyle{section} % will pretend to be a Chapter +{\addvspace{1ex}\parfillskip0pt + \leftskip\tocleftmargin % (already done in title) + \rightskip\the\tocrightmargin plus 1fil + \parindent0pt\color{cyan}} % (already done) +{\bfseries\LARGE\upshape\addvspace{1ex}\leavevmode} +{\llap{Chapter\hspace{.5em}{\etocnumber}\hspace{.75cm}}\etocname + \nobreak\hfill\kern1em\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par} +{} + +\etocsetstyle{subsection} % will pretend to be a Section +{} +{\mdseries\large\addvspace{.5ex}\leavevmode} +{\llap{\etocnumber\hspace{.75cm}}\textit{\etocname}% + \hfill\makebox[-\tocrightmargin][l]{\makebox[0pt]{\etocpage}}\par} +{} + +\def\tmptitle{My Beautiful Thesis} +\etocsettocstyle{\color{cyan}\parindent0pt \leftskip\tocleftmargin + \leavevmode\leaders\hrule height 1pt\hfill\ + \huge\textit{\tmptitle}\par}{\bigskip} + +\tableofcontents \ref{toc:overview} +\endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex index fa6fd85870c..0727f0eecef 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-07.tex @@ -1,100 +1,23 @@ %% LaTeX2e file `etocsnippet-07.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -% it will be easy to globally shift the TOC horizontally if needed -\def\TOCleftmargin {0pt} -\def\TOCrightmargin {2.55em}% like LaTeX's \@tocrmarg - -% this is for dotted leaders -\newbox\TOCleaderbox -\def\TOCleaderboxwidth {0.7777em}% about like what standard classes do - -% vertical spacing -\def\TOCverysmallvskip {0pt plus .2pt} -\def\TOCmedvskip {1em plus 1pt} -\def\TOCbigvskip {2.25em plus 1pt} - -% the ``numwidths'' for typesetting the numbering of division units. -% I don't recall exactly how (and for which fonts) these figures were chosen. -% They quickly prove too small if using Roman numerals (as do too the book -% class defaults even though they are a bit larger). -\def\TOCnumwidthB {1.5em} % chapter -\def\TOCnumwidthC {2.278em}% section, I think default is 2.3em -\def\TOCnumwidthD {3.056em}% analog in standard class is 3.2em -\def\TOCnumwidthE {3.833em}% analog in standard class is 4.1em -\def\TOCnumwidthF {4.611em}% analog in standard class is 5em -\def\TOCnumwidthG {5.389em}% analog in standard class is 6em - -% The code for the ``global toc style''. - -\newcommand*\TOCglobalstyle {% -\etocsettocstyle - {\if@twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi - \parindent\z@ \leftskip\z@skip \rightskip \z@skip - \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}% - \chapter *{\noindent\kern\TOCleftmargin\relax % uses "pt"... - \contentsname - \@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}}% - \rightskip \TOCrightmargin\relax - \parfillskip -\rightskip % or a smaller value if desired - \leftskip \TOCleftmargin \relax } - {\if@restonecol \twocolumn \fi\cleardoublepage}% -% -\etocsetstyle{part} - {} - {\addpenalty {-\@highpenalty}% - \addvspace \TOCbigvskip - \leavevmode - {\large \bfseries % use a group to limit font change - \interlinepenalty\@M - \etocifnumbered{\etocnumber\hspace{1em}}{}% - \etocname - \nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}}\par - \nobreak - } - {} - {}% -% -\etocsetstyle{chapter} - {\advance\leftskip\TOCnumwidthB\relax} - {\addpenalty {-\@highpenalty }% - \vskip \TOCmedvskip\relax - \leavevmode - {\interlinepenalty\@M - \etocifnumbered - {\llap{\makebox[\TOCnumwidthB][l]{\bfseries\etocnumber}}} - {\advance\leftskip-\TOCnumwidthB\relax}% - \bfseries\etocname - \nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }% - \penalty \@highpenalty - } - {} - {\advance\leftskip-\TOCnumwidthB\relax}% -% - \TOCsetlinestyle {section} {\TOCnumwidthC}% - \TOCsetlinestyle {subsection} {\TOCnumwidthD}% - \TOCsetlinestyle {subsubsection}{\TOCnumwidthE}% - \TOCsetlinestyle {paragraph} {\TOCnumwidthF}% - \TOCsetlinestyle {subparagraph} {\TOCnumwidthG}% -}% end of \TOCglobalstyle - -%The common code for line styles is abstracted into a macro: - -\newcommand\TOCsetlinestyle [2]{% #1= unit, #2= numwidth as macro -\etocsetstyle{#1} - {\advance\leftskip#2\relax} - {\vskip \TOCverysmallvskip\relax - \leavevmode - {\interlinepenalty\@M - \etocifnumbered - {\llap{\makebox[#2][l]{\etocnumber}}}{\advance\leftskip-#2\relax}% - \etocname - \nobreak\leaders \copy\TOCleaderbox - \hfil\makebox[-\parfillskip][r]{\etocpage}% - \par }% - } - {} - {\advance\leftskip-#2\relax}% -} +\makeatletter +\newcommand{\MyLocalTOC}[1][section]{% + \begingroup + \etocsetstyle{section}{}{} + {\l@section{\numberline{\etocnumber}\etocname}{\etocpage}}{}% + \etocsetstyle{subsection}{}{} + {\l@subsection{\numberline{\etocnumber}\etocname}{\etocpage}}{}% + \etocsetstyle{subsubsection}{}{} + {\l@subsubsection{\numberline{\etocnumber}\etocname}{\etocpage}}{}% + % etc... if further sectioning units are needed + % (i.e. not excluded by tocdepth and actually there in document) + % Here #1 defaults to section, meaning this is appropriate + % for local TOC in a chapter + \etocsettocstyle{\@nameuse{#1}*{Local contents}} + {} + % + \localtableofcontents + \endgroup} \makeatother diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex index a21e70d24e9..6850e8a4039 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-08.tex @@ -1,49 +1,100 @@ %% LaTeX2e file `etocsnippet-08.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\makeatletter -\newcommand*\TOClocalstyle {% +% it will be easy to globally shift the TOC horizontally if needed +\def\TOCleftmargin {0pt} +\def\TOCrightmargin {2.55em}% like LaTeX's \@tocrmarg + +% this is for dotted leaders +\newbox\TOCleaderbox +\def\TOCleaderboxwidth {0.7777em}% about like what standard classes do + +% vertical spacing +\def\TOCverysmallvskip {0pt plus .2pt} +\def\TOCmedvskip {1em plus 1pt} +\def\TOCbigvskip {2.25em plus 1pt} + +% the ``numwidths'' for typesetting the numbering of division units. +% I don't recall exactly how (and for which fonts) these figures were chosen. +% They quickly prove too small if using Roman numerals (as do too the book +% class defaults even though they are a bit larger). +\def\TOCnumwidthB {1.5em} % chapter +\def\TOCnumwidthC {2.278em}% section, I think default is 2.3em +\def\TOCnumwidthD {3.056em}% analog in standard class is 3.2em +\def\TOCnumwidthE {3.833em}% analog in standard class is 4.1em +\def\TOCnumwidthF {4.611em}% analog in standard class is 5em +\def\TOCnumwidthG {5.389em}% analog in standard class is 6em + +% The code for the ``global toc style''. + +\newcommand*\TOCglobalstyle {% \etocsettocstyle - {\if@twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi - \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}% - \parindent\z@ - \dimen@ 2.25em % for left indenting - \section *{\kern\dimen@ % use of \dimen@ works here by sheer luck - \contentsname - % un-comment this if marks are wanted: - %\@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}% - }% end of \section - \parskip \z@skip - \vspace{-1.25\baselineskip}% somewhat ad hoc - \leftskip 2.25em - \rightskip 4.5em - \advance\rightskip-\TOCrightmargin\relax - \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par - \rightskip 4.5em - \parfillskip -\TOCrightmargin\relax } - {\nobreak\vskip-.5\baselineskip - \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par - \bigskip - \if@restonecol \twocolumn \fi }% + {\if@twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi + \parindent\z@ \leftskip\z@skip \rightskip \z@skip + \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}% + \chapter *{\noindent\kern\TOCleftmargin\relax % uses "pt"... + \contentsname + \@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}}% + \rightskip \TOCrightmargin\relax + \parfillskip -\rightskip % or a smaller value if desired + \leftskip \TOCleftmargin \relax } + {\if@restonecol \twocolumn \fi\cleardoublepage}% % -\etocsetstyle{section} - {\advance\leftskip\TOCnumwidthC\relax} - {\addpenalty \@secpenalty - \etociffirst{}{\addvspace{\TOCmedvskip}}% +\etocsetstyle{part} + {} + {\addpenalty {-\@highpenalty}% + \addvspace \TOCbigvskip + \leavevmode + {\large \bfseries % use a group to limit font change + \interlinepenalty\@M + \etocifnumbered{\etocnumber\hspace{1em}}{}% + \etocname + \nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}}\par + \nobreak + } + {} + {}% +% +\etocsetstyle{chapter} + {\advance\leftskip\TOCnumwidthB\relax} + {\addpenalty {-\@highpenalty }% + \vskip \TOCmedvskip\relax \leavevmode {\interlinepenalty\@M - \bfseries\etocifnumbered - {\llap{\makebox[\TOCnumwidthC][l]{\etocnumber}}} - {\advance\leftskip-\TOCnumwidthC}% - \etocname\nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }% - \penalty \@highpenalty } + \etocifnumbered + {\llap{\makebox[\TOCnumwidthB][l]{\bfseries\etocnumber}}} + {\advance\leftskip-\TOCnumwidthB\relax}% + \bfseries\etocname + \nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }% + \penalty \@highpenalty + } {} - {\advance\leftskip-\TOCnumwidthC\relax}% -% the rest is identical with code for global tocs: + {\advance\leftskip-\TOCnumwidthB\relax}% +% + \TOCsetlinestyle {section} {\TOCnumwidthC}% \TOCsetlinestyle {subsection} {\TOCnumwidthD}% \TOCsetlinestyle {subsubsection}{\TOCnumwidthE}% \TOCsetlinestyle {paragraph} {\TOCnumwidthF}% \TOCsetlinestyle {subparagraph} {\TOCnumwidthG}% -}% end of \TOClocalstyle +}% end of \TOCglobalstyle + +%The common code for line styles is abstracted into a macro: + +\newcommand\TOCsetlinestyle [2]{% #1= unit, #2= numwidth as macro +\etocsetstyle{#1} + {\advance\leftskip#2\relax} + {\vskip \TOCverysmallvskip\relax + \leavevmode + {\interlinepenalty\@M + \etocifnumbered + {\llap{\makebox[#2][l]{\etocnumber}}}{\advance\leftskip-#2\relax}% + \etocname + \nobreak\leaders \copy\TOCleaderbox + \hfil\makebox[-\parfillskip][r]{\etocpage}% + \par }% + } + {} + {\advance\leftskip-#2\relax}% +} \makeatother diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex index 853659bfb8a..09b96ec99b7 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-09.tex @@ -1,35 +1,49 @@ %% LaTeX2e file `etocsnippet-09.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\etocdefaultlines -\begingroup -\renewcommand{\etoccolumnsep}{2em} -\renewcommand{\etocinnerleftsep}{1.5em} -\renewcommand{\etocinnerrightsep}{1.5em} -% specify a background color for the toc contents -\renewcommand{\etocbkgcolorcmd}{\color{yellow!10}} -% set up the top and bottom rules -\renewcommand{\etoctoprule}{\hrule height 1pt} -\renewcommand{\etoctoprulecolorcmd}{\color{red!25}} -\renewcommand{\etocbottomrule}{\hrule height 1pt} -\renewcommand{\etocbottomrulecolorcmd}{\color{red!25}} -% set up the left and right rules -\renewcommand{\etocleftrule}{\vrule width 5pt} -\renewcommand{\etocrightrule}{\vrule width 5pt} -\renewcommand{\etocleftrulecolorcmd}{\color{red!25}} -\renewcommand{\etocrightrulecolorcmd}{\color{red!25}} -% use \fcolorbox to set up a colored frame for the title -\fboxrule1pt -\renewcommand{\etocbelowtocskip}{0pt\relax} -\etocframedstyle {\normalsize\rmfamily\itshape - \fcolorbox{red}{white}{\parbox{.8\linewidth}{\centering - This is a table of contents \`a la \etoc, but just for - the sections and subsections in this part. As it is put - in a frame, it has to be small enough to fit on - one page. It has the label |toc:b|.}}} -\begin{figure}[ht!] - \centering -\tableofcontents \label{toc:b} \ref{toc:globalcmds} -\end{figure} -\endgroup +\makeatletter +\newcommand*\TOClocalstyle {% +\etocsettocstyle + {\if@twocolumn \@restonecoltrue \onecolumn \else \@restonecolfalse \fi + \setbox\TOCleaderbox\hbox to \TOCleaderboxwidth{\hss.\hss}% + \parindent\z@ + \dimen@ 2.25em % for left indenting + \section *{\kern\dimen@ % use of \dimen@ works here by sheer luck + \contentsname + % un-comment this if marks are wanted: + %\@mkboth {\MakeUppercase \contentsname}{\MakeUppercase \contentsname}% + }% end of \section + \parskip \z@skip + \vspace{-1.25\baselineskip}% somewhat ad hoc + \leftskip 2.25em + \rightskip 4.5em + \advance\rightskip-\TOCrightmargin\relax + \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par + \rightskip 4.5em + \parfillskip -\TOCrightmargin\relax } + {\nobreak\vskip-.5\baselineskip + \leavevmode\leaders\hrule\@height\p@\hfill\kern\z@\par + \bigskip + \if@restonecol \twocolumn \fi }% +% +\etocsetstyle{section} + {\advance\leftskip\TOCnumwidthC\relax} + {\addpenalty \@secpenalty + \etociffirst{}{\addvspace{\TOCmedvskip}}% + \leavevmode + {\interlinepenalty\@M + \bfseries\etocifnumbered + {\llap{\makebox[\TOCnumwidthC][l]{\etocnumber}}} + {\advance\leftskip-\TOCnumwidthC}% + \etocname\nobreak\hfil\makebox[-\parfillskip][r]{\etocpage}\par }% + \penalty \@highpenalty } + {} + {\advance\leftskip-\TOCnumwidthC\relax}% +% the rest is identical with code for global tocs: + \TOCsetlinestyle {subsection} {\TOCnumwidthD}% + \TOCsetlinestyle {subsubsection}{\TOCnumwidthE}% + \TOCsetlinestyle {paragraph} {\TOCnumwidthF}% + \TOCsetlinestyle {subparagraph} {\TOCnumwidthG}% +}% end of \TOClocalstyle +\makeatother diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex index b17c17d9cc9..60965c39bc9 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-10.tex @@ -1,80 +1,35 @@ %% LaTeX2e file `etocsnippet-10.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\begin{figure}[htbp!]\centering -\colorlet{subsecnum}{black} -\colorlet{secbackground}{green!30} -\colorlet{tocbackground}{red!20!green!20} - -\renewcommand{\etocbkgcolorcmd}{\color{tocbackground}} -\renewcommand{\etocleftrulecolorcmd}{\color{tocbackground}} -\renewcommand{\etocrightrulecolorcmd}{\color{tocbackground}} -\renewcommand{\etocbottomrulecolorcmd}{\color{tocbackground}} -\renewcommand{\etoctoprulecolorcmd}{\color{tocbackground}} - -\renewcommand{\etocleftrule}{\vrule width 3cm} -\renewcommand{\etocrightrule}{\vrule width 1cm} -\renewcommand{\etocbottomrule}{\hrule height 12pt} -\renewcommand{\etoctoprule}{\hrule height 12pt} - -\renewcommand{\etocinnertopsep}{0pt} -\renewcommand{\etocinnerbottomsep}{0pt} -\renewcommand{\etocinnerleftsep}{0pt} -\renewcommand{\etocinnerrightsep}{0pt} - -\newcommand\shiftedwhiterule[2]{% - \hbox to \linewidth{\color{white}% - \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip - \vskip#2} - -\etocsetstyle{subsubsection} -{\etocskipfirstprefix} -{\shiftedwhiterule{\leftskip}{6pt}} -{\sffamily\footnotesize - \leftskip2.3cm\hangindent1cm\rightskip.5cm\relax - \makebox[1cm][l]{\color{subsecnum}\etocnumber}% - \color{black}\etocname - \nobreak\leaders\hbox to.2cm{\hss.}\hfill - \rlap{\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}\par - \nointerlineskip\vskip3pt} -{} - -\etocsetstyle{subsection} -{\etocskipfirstprefix} -{\shiftedwhiterule{1.5cm}{6pt}} -{\sffamily\small - \leftskip1.5cm\hangindent.8cm\rightskip.5cm\relax - \makebox[.75cm][l]{\color{subsecnum}\etocnumber}% - \color{black}\etocname - \nobreak\leaders\hbox to.2cm{\hss.}\hfill - \rlap{\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}\par - \nointerlineskip\vskip3pt} -{} - -\newcommand{\coloredstuff}[2]{% - \leftskip0pt\rightskip0pt\parskip0pt - \fboxsep0pt % \colorbox uses \fboxsep also when no frame! - \noindent\colorbox{secbackground} - {\parbox{\linewidth}{% - \vskip5pt - {\noindent\color{#1}#2\par}\nointerlineskip - \vskip3pt}}% - \par\nointerlineskip} - -\etocsetstyle{section} -{\coloredstuff{blue}{\hfil \bfseries\large Contents of Part One\hfil}} -{\vskip3pt\sffamily\small} -{\coloredstuff{blue} - {\leftskip1.5cm\rightskip.5cm\parfillskip-\rightskip - \makebox[0pt][r]{\makebox[.5cm][l]{\etocnumber}}% - \etocname\nobreak\hfill\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}% - \vskip6pt} -{} - -\etocframedstyle[1]{} -\tableofcontents \label{toc:floating} \ref{toc:overview} -\vspace{-\baselineskip} -\centeredline{|\tableofcontents \ref{toc:overview}| -(\emph{cf.} \hyperref[toc:clone]{this other toc})} +\etocdefaultlines +\begingroup +\renewcommand{\etoccolumnsep}{2em} +\renewcommand{\etocinnerleftsep}{1.5em} +\renewcommand{\etocinnerrightsep}{1.5em} +% specify a background color for the toc contents +\renewcommand{\etocbkgcolorcmd}{\color{yellow!10}} +% set up the top and bottom rules +\renewcommand{\etoctoprule}{\hrule height 1pt} +\renewcommand{\etoctoprulecolorcmd}{\color{red!25}} +\renewcommand{\etocbottomrule}{\hrule height 1pt} +\renewcommand{\etocbottomrulecolorcmd}{\color{red!25}} +% set up the left and right rules +\renewcommand{\etocleftrule}{\vrule width 5pt} +\renewcommand{\etocrightrule}{\vrule width 5pt} +\renewcommand{\etocleftrulecolorcmd}{\color{red!25}} +\renewcommand{\etocrightrulecolorcmd}{\color{red!25}} +% use \fcolorbox to set up a colored frame for the title +\fboxrule1pt +\renewcommand{\etocbelowtocskip}{0pt\relax} +\etocframedstyle {\normalsize\rmfamily\itshape + \fcolorbox{red}{white}{\parbox{.8\linewidth}{\centering + This is a table of contents \`a la \etoc, but for + the subsections and subsubsections of \autoref{sec:tocstyle}. + As it is put in a frame, it has to be small enough to fit on + one page. It has the label |toc:b|.}}} +\begin{figure}[ht!] + \centering +\tableofcontents \label{toc:b} \ref{toc:tocstyle} \end{figure} +\endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex index 1a2ee57d2b6..e6e9101f62b 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-11.tex @@ -1,27 +1,80 @@ %% LaTeX2e file `etocsnippet-11.tex' -%% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentshere' environment +%% from source `etoc' on 2023/03/02. %% -\begingroup -\newsavebox{\forsubsections} -\etocsetstyle{part}{\upshape. \etocskipfirstprefix} - {. \upshape} - {\bfseries\etocname:~~} - {} -\etocsetstyle{section}{\itshape\etocskipfirstprefix} - {, } - {\mdseries\etocname} - {} -\etocsetstyle{subsection} - {\begin{lrbox}{\forsubsections}\footnotesize\upshape\etocskipfirstprefix} - {; } - {\etocname} - {.\end{lrbox}\footnote{\unhbox\forsubsections}} +\begin{figure}[htbp!]\centering +\colorlet{subsecnum}{black} +\colorlet{secbackground}{green!30} +\colorlet{tocbackground}{red!20!green!20} + +\renewcommand{\etocbkgcolorcmd}{\color{tocbackground}} +\renewcommand{\etocleftrulecolorcmd}{\color{tocbackground}} +\renewcommand{\etocrightrulecolorcmd}{\color{tocbackground}} +\renewcommand{\etocbottomrulecolorcmd}{\color{tocbackground}} +\renewcommand{\etoctoprulecolorcmd}{\color{tocbackground}} + +\renewcommand{\etocleftrule}{\vrule width 3cm} +\renewcommand{\etocrightrule}{\vrule width 1cm} +\renewcommand{\etocbottomrule}{\hrule height 12pt} +\renewcommand{\etoctoprule}{\hrule height 12pt} + +\renewcommand{\etocinnertopsep}{0pt} +\renewcommand{\etocinnerbottomsep}{0pt} +\renewcommand{\etocinnerleftsep}{0pt} +\renewcommand{\etocinnerrightsep}{0pt} + +\newcommand\shiftedwhiterule[2]{% + \hbox to \linewidth{\color{white}% + \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip + \vskip#2} + \etocsetstyle{subsubsection} - { (\itshape\etocskipfirstprefix} - {, } - {\etocname} - {\/\upshape)} -\etocsettocstyle{Here is the inline table of contents. }{.\par} -\tableofcontents \label{toc:crazyinline} -\endgroup +{\etocskipfirstprefix} +{\shiftedwhiterule{\leftskip}{6pt}} +{\sffamily\footnotesize + \leftskip2.3cm\hangindent1cm\rightskip.5cm\relax + \makebox[1cm][l]{\color{subsecnum}\etocnumber}% + \color{black}\etocname + \nobreak\leaders\hbox to.2cm{\hss.}\hfill + \rlap{\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}\par + \nointerlineskip\vskip3pt} +{} + +\etocsetstyle{subsection} +{\etocskipfirstprefix} +{\shiftedwhiterule{1.5cm}{6pt}} +{\sffamily\small + \leftskip1.5cm\hangindent.8cm\rightskip.5cm\relax + \makebox[.75cm][l]{\color{subsecnum}\etocnumber}% + \color{black}\etocname + \nobreak\leaders\hbox to.2cm{\hss.}\hfill + \rlap{\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}\par + \nointerlineskip\vskip3pt} +{} + +\newcommand{\coloredstuff}[2]{% + \leftskip0pt\rightskip0pt\parskip0pt + \fboxsep0pt % \colorbox uses \fboxsep also when no frame! + \noindent\colorbox{secbackground} + {\parbox{\linewidth}{% + \vskip5pt + {\noindent\color{#1}#2\par}\nointerlineskip + \vskip3pt}}% + \par\nointerlineskip} + +\etocsetstyle{section} +{\coloredstuff{blue}{\hfil \bfseries\large Contents of Part One\hfil}} +{\vskip3pt\sffamily\small} +{\coloredstuff{blue} + {\leftskip1.5cm\rightskip.5cm\parfillskip-\rightskip + \makebox[0pt][r]{\makebox[.5cm][l]{\etocnumber}}% + \etocname\nobreak\hfill\makebox[.5cm][r]{\etocpage\hspace{.1cm}}}% + \vskip6pt} +{} + +\etocframedstyle[1]{} +\tableofcontents \label{toc:floating} \ref{toc:part:styling} +\vspace{-\baselineskip} +\centeredline{|\tableofcontents \ref{toc:part:styling}| +(\emph{cf.} \hyperref[toc:clone]{this other toc})} +\end{figure} diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex index 6daaaf779b9..bb53da16dbd 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-12.tex @@ -1,25 +1,27 @@ %% LaTeX2e file `etocsnippet-12.tex' -%% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentsdef' environment +%% from source `etoc' on 2023/03/02. %% - < in the preamble > -\newcounter{visibletoc} -\renewcommand{\etocaftertitlehook} - {\stepcounter{visibletoc}\etoctoccontentsline{visibletoc}{\thevisibletoc}} -\etocsetlevel{visibletoc}{6} -\begin{document} - < document body > -\subsection{Surprising uses of etoc} \begingroup - \etocinline - \etocsetlevel{part}{1} - % \etocsetlevel{chapter}{1} % (no chapters in scrartcl class) - \etocsetlevel{visibletoc}{0} - \etocsetstyle{visibletoc} - {\etocskipfirstprefix}{, }{{\color{niceone}\etocname}}{} - \etocsettocstyle{}{} % don't set any title, rules or frame or multicol! - \etocsetnexttocdepth{visibletoc} % display only the `visibletoc' entries from .toc - -Here is the numbered and linked list of all tables of contents which are -displayed within this document: \tableofcontents. +\newsavebox{\forsubsections} +\etocsetstyle{part}{\upshape. \etocskipfirstprefix} + {. \upshape} + {\bfseries\etocname:~~} + {} +\etocsetstyle{section}{\itshape\etocskipfirstprefix} + {, } + {\mdseries\etocname} + {} +\etocsetstyle{subsection} + {\begin{lrbox}{\forsubsections}\footnotesize\upshape\etocskipfirstprefix} + {; } + {\etocname} + {.\end{lrbox}\footnote{\unhbox\forsubsections}} +\etocsetstyle{subsubsection} + { (\itshape\etocskipfirstprefix} + {, } + {\etocname} + {\/\upshape)} +\etocsettocstyle{Here is the inline table of contents. }{.\par} +\tableofcontents \label{toc:crazyinline} \endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex index a45ae4e1b69..8c530da9467 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-13.tex @@ -1,20 +1,74 @@ %% LaTeX2e file `etocsnippet-13.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% - \etocsetnexttocdepth{2} % sections are at level 1 and will show up \begingroup - \etocsetlevel{exercise}{2} % but: - \etocsetlevel{chapter}{3} % no chapters - \etocsetlevel{subsection}{3} % no subsections - \etocsetlevel{part}{3} % no parts - \etocsetstyle{exercise}{}{} % \etocname = exercise number - {\noindent\etocname\strut\leaders\etoctoclineleaders\hfill\etocpage\par} - {\pagebreak[2]\vskip\baselineskip} - \etocsetstyle{section}{}{} - {\noindent\strut{\bfseries\large\etocnumber\hskip.5em\etocname}\par - \nopagebreak[3]}{} - \etocruledstyle[4]{\Large\bfseries List of the exercises} - \setlength{\columnseprule}{.4pt} - \tableofcontents +\definecolor{subsecnum}{RGB}{13,151,225} +\definecolor{secbackground}{RGB}{0,177,235} +\definecolor{tocbackground}{RGB}{212,237,252} + +\renewcommand{\etocbkgcolorcmd}{\color{tocbackground}} +\renewcommand{\etocleftrulecolorcmd}{\color{tocbackground}} +\renewcommand{\etocrightrulecolorcmd}{\color{tocbackground}} +\renewcommand{\etocbottomrulecolorcmd}{\color{tocbackground}} +\renewcommand{\etoctoprulecolorcmd}{\color{tocbackground}} + +\renewcommand{\etocleftrule}{\vrule width 1cm} +\renewcommand{\etocrightrule}{\vrule width .5cm} +\renewcommand{\etocbottomrule}{\hrule height 12pt} +\renewcommand{\etoctoprule}{\hrule height 12pt} + +\renewcommand{\etocinnertopsep}{0pt} +\renewcommand{\etocinnerbottomsep}{0pt} +\renewcommand{\etocinnerleftsep}{0pt} +\renewcommand{\etocinnerrightsep}{0pt} + +\newcommand\shiftedwhiterule[2]{% + \hbox to \linewidth{\color{white}% + \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip\vskip#2} + +\etocsetstyle{subsubsection}{\etocskipfirstprefix} + {\shiftedwhiterule{\leftskip}{6pt}} + {\sffamily\footnotesize + \leftskip2.5cm\hangindent1cm\rightskip1cm\noindent + \hbox to 1cm{\color{subsecnum}\etocnumber\hss}% + \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill + \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par + \nointerlineskip\vskip3pt} + {} + +\etocsetstyle{subsection}{\etocskipfirstprefix} + {\shiftedwhiterule{1.5cm}{6pt}} + {\sffamily\small + \leftskip1.5cm\hangindent1cm\rightskip1cm\noindent + \hbox to 1cm{\color{subsecnum}\etocnumber\hss}% + \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill + \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par + \nointerlineskip\vskip6pt} + {} + +\newcommand{\coloredstuff}[2]{% + \leftskip0pt\rightskip0pt\parskip0pt + \fboxsep0pt % \colorbox uses \fboxsep also when no frame! + \noindent\colorbox{secbackground} + {\parbox{\linewidth}{% + \vskip5pt + {\noindent\color{#1}#2\par}\nointerlineskip + \vskip3pt}}% + \par\nointerlineskip} + +\etocsetstyle{section} +{\coloredstuff{white} + {\hfil \hyperref[toc:b]{\bfseries\large I am a twin of + that other TOC (click me!)}\hfil}} +{\vskip3pt\sffamily\small} +{\coloredstuff{white} + {\leftskip1.5cm\rightskip.5cm\parfillskip-\rightskip + \makebox[0pt][r]{\makebox[.5cm][r]{\etocnumber\hspace{.2cm}}}% + \etocname\hfill\makebox[.5cm][r]{\etocpage\hspace{.2cm}}}% + \vskip6pt } +{} + +\etocframedstyle[1]{} +\tableofcontents \label{toc:clone} \ref{toc:tocstyle} \endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex index ba0dd1581cd..bd4b3fc53c5 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex @@ -1,62 +1,25 @@ %% LaTeX2e file `etocsnippet-14.tex' -%% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentshere' environment +%% from source `etoc' on 2023/03/02. %% -% \newtoks\treetok % put this (uncommented) preferably in the preamble -% \newtoks\tmptok % (idem) - -\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2 - #1\expandafter\expandafter\expandafter - {\expandafter\the\expandafter #1#2}} - -\newcommand*\PrepareSectionNode{% - \tmptok {\centering\bfseries}% - \appendtotok\tmptok\etocthelinkedname - \edef\foresttreenode{ [{\noexpand\parbox{2cm}{\the\tmptok}}}% -} - -\newcommand*{\PrepareSubsectionNode}{% - \tmptok {\raggedright}% - \appendtotok\tmptok\etocthelinkedname - \edef\foresttreenode{ [{\noexpand\parbox{6cm}{\the\tmptok}}}% -} - -\etocsetstyle{section} - {\etocskipfirstprefix} - {\appendtotok\treetok{ ]}} - {\PrepareSectionNode \appendtotok\treetok\foresttreenode} - {\appendtotok\treetok{ ]}} - -\etocsetstyle{subsection} - {\etocskipfirstprefix} - {\appendtotok\treetok{ ]}} - {\PrepareSubsectionNode \appendtotok\treetok\foresttreenode} - {\appendtotok\treetok{ ]}} - -\etocsettocstyle - {\treetok{[{\hyperref[part:overview]{Overview}}}} - {\global\appendtotok\treetok{ ]}} - -% forest does not like @\the\treetok if \treetok is empty. On first latex -% run, this will be the case because the TOC style defined above will not -% have been executed, as the label {toc:overview} does not refer to a valid -% TOC yet. So we must give a safe default value to \treetok -\treetok{[{run latex again}]} - -\begin{figure}[th!]\centering - \etocsetnexttocdepth{subsection} - \tableofcontents \label{toc:forest}\ref{toc:overview} - \hypersetup{hidelinks}% - \bracketset{action character=@} - \begin{forest} - for tree={anchor=center,child anchor=west, - grow'=east,draw,thick, - edge={draw,thick,dashed,color=teal}}, - where={level()==1}{circle,thick,fill=blue!5, - before computing xy={l=3cm}}{}, - where={level()==2}{fill=red!5, - before computing xy={l=6cm}}{}, - rectangle, thick, fill=cyan!5, inner sep=6pt, - @\the\treetok - \end{forest} -\end{figure} + < in the preamble > +\newcounter{visibletoc} +\renewcommand{\etocaftertitlehook} + {\stepcounter{visibletoc}\etoctoccontentsline{visibletoc}{\thevisibletoc}} +\etocsetlevel{visibletoc}{6} +\begin{document} + < document body > +\subsection{Surprising uses of etoc} +\begingroup + \etocinline + \etocsetlevel{part}{1} + % \etocsetlevel{chapter}{1} % (no chapters in scrartcl class) + \etocsetlevel{visibletoc}{0} + \etocsetstyle{visibletoc} + {\etocskipfirstprefix}{, }{{\color{niceone}\etocname}}{} + \etocsettocstyle{}{} % don't set any title, rules or frame or multicol! + \etocsetnexttocdepth{visibletoc} % display only the `visibletoc' entries from .toc + +Here is the numbered and linked list of all tables of contents which are +displayed within this document: \tableofcontents. +\endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex index 5c6619b2ebb..52aab42673c 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-15.tex @@ -1,48 +1,20 @@ %% LaTeX2e file `etocsnippet-15.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -% \newtoks\treetok % put this (uncommented) preferably in the preamble -% \newtoks\sectiontok -% \newtoks\subsectiontok -\newcommand*{\treenode}{} - -\newcommand*{\appendchildtree}[2]{% token list t1 becomes: t1 child {t2} - \edef\tmp{\the#1 child {\the#2}}% - #1\expandafter{\tmp}% -} -\newcommand*{\preparetreenode}{% - \tmptok\expandafter{\etocthelinkednumber}% expanded one time (mandatory) - \edef\treenode{node {\the\tmptok}}% -} - -\etocsetstyle{section} - {\etocskipfirstprefix} - {\appendchildtree\treetok\sectiontok} - {\preparetreenode \sectiontok\expandafter{\treenode}} - {\appendchildtree\treetok\sectiontok} - -\etocsetstyle{subsection} - {\etocskipfirstprefix} - {\appendchildtree\sectiontok\subsectiontok} - {\preparetreenode \subsectiontok\expandafter{\treenode}} - {\appendchildtree\sectiontok\subsectiontok} - -\etocsettocstyle - {\treetok{\node {\hyperref[part:overview]{Overview}}}} - {\global\appendtotok\treetok{ ;}} - -\begin{figure}[thbp!]\centering - \etocsetnexttocdepth{subsection} - \tableofcontents \label{toc:molecule} \ref{toc:overview} - \hypersetup{hidelinks}% - \begin{tikzpicture} - [grow cyclic, - level 1/.style={level distance=4cm,sibling angle=72}, - level 2/.style={level distance=2cm,sibling angle=60}, - every node/.style={ball color=red,circle,text=SkyBlue}, - edge from parent path={[dashed,very thick,color=cyan] - (\tikzparentnode) --(\tikzchildnode)}] - \the\treetok - \end{tikzpicture} -\end{figure} + \etocsetnexttocdepth{2} % sections are at level 1 and will show up +\begingroup + \etocsetlevel{exercise}{2} % but: + \etocsetlevel{chapter}{3} % no chapters + \etocsetlevel{subsection}{3} % no subsections + \etocsetlevel{part}{3} % no parts + \etocsetstyle{exercise}{}{} % \etocname = exercise number + {\noindent\etocname\strut\leaders\etoctoclineleaders\hfill\etocpage\par} + {\pagebreak[2]\vskip\baselineskip} + \etocsetstyle{section}{}{} + {\noindent\strut{\bfseries\large\etocnumber\hskip.5em\etocname}\par + \nopagebreak[3]}{} + \etocruledstyle[4]{\Large\bfseries List of the exercises} + \setlength{\columnseprule}{.4pt} + \tableofcontents +\endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex index 1d24860f4e9..8b6d8881f77 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-16.tex @@ -1,120 +1,67 @@ %% LaTeX2e file `etocsnippet-16.tex' %% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% +% \newtoks\treetok % put this (uncommented) preferably in the preamble +% \newtoks\tmptok % (idem) \begingroup -% \newtoks\treetok % done in preamble -% \newtoks\parttok - -\newcommand*\partnode {} % just to check we don't overwrite something -\newcommand*\childnode {} - -\newcommand*\tmprotate {} % just to check we don't overwrite something -\newcommand*\tmpoption {} % just to check we don't overwrite something -\newcommand*\tmpstuff {} % just to check we don't overwrite something - \newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2 - #1\expandafter\expandafter\expandafter{\expandafter\the\expandafter #1#2}} + #1\expandafter\expandafter\expandafter + {\expandafter\the\expandafter #1#2}} -\newcommand*{\appendchildtree}[3]{% -% this is to construct "t1 child [#3]{t2}" from #1=t1 and #2=t2 -% t1 and t2 are two toks variable (not macros) -% #3 = for example teal!60 - \edef\tmpstuff {\the#1 child [#3]{\the#2}}% - #1\expandafter {\tmpstuff }% +\newcommand*\PrepareSectionNode{% + \tmptok {\centering\bfseries}% + \appendtotok\tmptok\etocthelinkedname + \edef\foresttreenode{ [{\noexpand\parbox{2cm}{\the\tmptok}}}% } -\newcounter{partco} - -% 1,2,3,4,5,... -> 1,2,3,1,2,3,1,2,3 -\def\pseudomodthree #1{\numexpr #1 + 3 - 3*((#1+1)/3)\relax} +\newcommand*{\PrepareSubsectionNode}{% + \tmptok {\raggedright}% + \appendtotok\tmptok\etocthelinkedname + \edef\foresttreenode{ [{\noexpand\parbox{6cm}{\the\tmptok}}}% +} -\etocsetstyle{part} +\etocsetstyle{section} {\etocskipfirstprefix} -% This updates the global tree with the data from the previous -% part and all its children sections. Moved here because for some parts the -% sections are not displayed due to depth tags. - {\ifnum\value{partco}=3 - \appendchildtree\treetok\parttok {branch color= green!50,level distance=10cm}% - \else -\ifcase\pseudomodthree{\value{partco}}% - \or \appendchildtree\treetok\parttok {branch color= teal!60}% first - \or \appendchildtree\treetok\parttok {branch color= yellow!80}% second - \else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ... - \fi\fi - } - {\stepcounter{partco}% -% customize manually some TikZ set-up (should be done inside the TikZ thing I guess) - \def\tmpoption {}% - \def\tmprotate {}% first - %\ifnum\value{partco}=5 \def\tmprotate {[counterclockwise from =-40]}\fi - %\ifnum\value{partco}=8 \def\tmprotate {[counterclockwise from =-50]}\fi -% define the part node - \edef\partnode{node \tmpoption - {\unexpanded\expandafter{\etocthelinkednumber}. - \unexpanded\expandafter{\etocthelinkedname}}\tmprotate }% -% this is a starting point which will be filled it by the section children - \parttok\expandafter{\partnode}} - {\ifcase\pseudomodthree{\value{partco}}% - \or \appendchildtree\treetok\parttok {branch color= teal!60}% first - \or \appendchildtree\treetok\parttok {branch color= yellow!80}% second - \else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ... - \fi - } + {\appendtotok\treetok{ ]}} + {\PrepareSectionNode \appendtotok\treetok\foresttreenode} + {\appendtotok\treetok{ ]}} -\etocsetstyle{section} - {} - {} - {% define the section node - \edef\childnode{child {node {\unexpanded\expandafter{\etocthelinkednumber} - \unexpanded\expandafter{\etocthelinkedname}}}}% - % append it to the current \parttok - \appendtotok\parttok\childnode - } - {} +\etocsetstyle{subsection} + {\etocskipfirstprefix} + {\appendtotok\treetok{ ]}} + {\PrepareSubsectionNode \appendtotok\treetok\foresttreenode} + {\appendtotok\treetok{ ]}} \etocsettocstyle - {\setcounter{partco}{0}% - \treetok{\node [root concept]{\textbf{The \etoc documentation}}}} - {\global\appendtotok\treetok{ ;}} -% The \global above is mandatory because etoc always typesets TOC inside a group - -\etocsetnexttocdepth{section} -% use of depth tags to cut out some sections. -\etocsettagdepth {preamble} {none} -\etocsettagdepth {overview} {part} -\etocsettagdepth {arbitrarily}{part} -\etocsettagdepth {examples} {section} -\etocsettagdepth {surprising} {part} -\etocsettagdepth {linestyles} {part} -\etocsettagdepth {globalcmds} {part} -\etocsettagdepth {custom} {section} -\etocsettagdepth {tips} {part} -\etocsettagdepth {etocandworld}{part} -\etocsettagdepth {code} {section} + {\treetok{[{\hyperref[part:styling]{The \etoc styling commands}}}} + {\global\appendtotok\treetok{ ]}} -\tikzset{ - branch color/.style={ - concept color=#1!white, - every child/.append style={concept color=#1!white!30!white, font=\normalsize}, - } -}% +% forest does not like @\the\treetok if \treetok is empty. On first latex +% run, this will be the case because the TOC style defined above will not +% have been executed, as the label {toc:overview} does not refer to a valid +% TOC yet. So we must give a safe default value to \treetok +\treetok{[{run latex again}]} -\begin{figure}[thp!] -\tableofcontents\label{toc:mindmap}% -\centeredline{\resizebox{.85\paperwidth}{!}% -{\begin{tikzpicture}[mindmap, - grow cyclic, - text width=2cm, - align=flush center, - nodes={concept}, - concept color=orange!60, - root concept/.append style={text width=4cm, font=\Large}, - level 1/.append style={level distance=5cm,sibling angle=40, text width=3cm}, - level 2/.append style={level distance=7cm,sibling angle=30, text width=3cm}, - level 1 concept/.append style={font=\normalsize}, - ] -\the\treetok -\end{tikzpicture}}} +\begin{figure}[htbp!] +\centering + \etocsetnexttocdepth{subsection} + \tableofcontents \label{toc:forest}\ref{toc:part:styling} + \hypersetup{hidelinks}% + \bracketset{action character=@} +% manual adjustments to fit the printed page +% \kern-1cm +\noindent\kern-3cm + \begin{forest} + for tree={anchor=center,child anchor=west, + grow'=east,draw,thick, + edge={draw,thick,dashed,color=teal}}, + where={level()==1}{circle,thick,fill=blue!5, + before computing xy={l=6cm}}{}, + where={level()==2}{fill=red!5, + before computing xy={l=6cm}}{}, + rectangle, thick, fill=cyan!5, inner sep=6pt, + @\the\treetok + \end{forest} \end{figure} \endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex index 6661c40b12a..1aedcdf646e 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex @@ -1,64 +1,61 @@ %% LaTeX2e file `etocsnippet-17.tex' -%% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentshere' environment +%% from source `etoc' on 2023/03/02. %% -\begingroup -\etocglobaldefs % necessary for \etocname etc... to survive & -\makeatletter -% hack into longtable \hline to avoid annoying (here) stray lines at top -\def\LT@@hline{% - \ifx\@let@token\hline - \global\let\@gtempa\@gobble - \global\let\@gtempb\@firstofone %%% ADDED - \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}% - \else - \global\let\@gtempa\@empty - \global\let\@gtempb\@gobble %%% ADDED - \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}% - \fi - \ifnum0=`{\fi}% - \multispan\LT@cols - \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr - \@gtempb{% %%% ADDED - \noalign{\LT@sep}% - \multispan\LT@cols - \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr - \noalign{\penalty\@M}% - }% %%% ADDED - \@gtempa} -\makeatother +% \newtoks\treetok % put this (uncommented) preferably in the preamble +% \newtoks\subsectiontok +% \newtoks\subsubsectiontok +% Attention: this code has been prepared only for subsections +% and subsubsections. -% observe the locations of the \\ -\etocsetstyle{part} - {} - {} - {\\\hline\multicolumn{3}{c}{\bfseries\vrule height6ex depth3ex width0pt - \etocifnumbered{\etocnumber. }{}\etocname}} - {} +\newcommand*{\treenode}{}% only to make sure our \edef's do not overwrite + % an existing command -\etocsetstyle{section} - {} - {\etociffirst{\\\hline}{\\}} - {\etocnumber&\etocname &\etocpage } - {} +% expands 2nd argument (macro) and appends it to 1st argument (toks) +\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2 + #1\expandafter\expandafter\expandafter + {\expandafter\the\expandafter #1#2}} + +% appends 2nd argument contents (toks) as child of first argument (toks) +\newcommand*{\appendchildtree}[2]{% token list t1 becomes: t1 child {t2} + \edef\tmp{\the#1 child {\the#2}}% + #1\expandafter{\tmp}% +} +% prepare the (hyperlinked) number in the "node (number)" shape +\newcommand*{\preparetreenode}{% + \tmptok\expandafter{\etocthelinkednumber}% expanded once (needed) + \edef\treenode{node {\the\tmptok}}% +} \etocsetstyle{subsection} - {} - {\\} - {&\makebox[1cm][c]{\etocnumber}% - \parbox[t]{\dimexpr6cm-\tabcolsep\relax}{\sloppy\itshape\etocname\strut}% - &\itshape\etocpage } - {} + {\etocskipfirstprefix} + {\appendchildtree\treetok\subsectiontok} + {\preparetreenode + \subsectiontok\expandafter{\treenode}} + {\appendchildtree\treetok\subsectiontok} -\etocsettocstyle - {\hypersetup{hidelinks}% - \begin{longtable}{|>{\bfseries}c|p{7cm}|r|} - \hline - \multicolumn{3}{|c|}{\Large\bfseries\strut\strut TABLE OF CONTENTS}% - } - {\\\hline\end{longtable}} +\etocsetstyle{subsubsection} + {\etocskipfirstprefix} + {\appendchildtree\subsectiontok\subsubsectiontok} + {\preparetreenode + \subsubsectiontok\expandafter{\treenode}} + {\appendchildtree\subsectiontok\subsubsectiontok} -\etocsetnexttocdepth {subsection} +\etocsettocstyle + {\treetok{\node {\hyperref[sec:linestyles]{Line styles}}}} + {\global\appendtotok\treetok{ ;}} -\tableofcontents -\endgroup +\centeredline{% from package centeredline (limits scope of \hypersetup) + \etocsetnexttocdepth{subsubsection} + \etocinline\tableofcontents \label{toc:molecule} \ref{toc:tocstyle} + \hypersetup{hidelinks}% + \begin{tikzpicture} + [grow cyclic, + level 1/.style={level distance=4cm,sibling angle=72}, + level 2/.style={level distance=2cm,sibling angle=60}, + every node/.style={ball color=red,circle,text=SkyBlue}, + edge from parent path={[dashed,very thick,color=cyan] + (\tikzparentnode) --(\tikzchildnode)}] + \the\treetok + \end{tikzpicture}% +} diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex index 9414dcbe37c..5f2d92cc469 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-18.tex @@ -1,23 +1,116 @@ %% LaTeX2e file `etocsnippet-18.tex' %% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\begin{center} +% \newtoks\treetok % done in preamble +% \newtoks\parttok +\newcommand*\partnode {} % check with \newcommand we will not overwrite something +\newcommand*\childnode {} + +\newcommand*\tmprotate {} % (idem) +\newcommand*\tmpoption {} % +\newcommand*\tmpstuff {} % + +\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2 + #1\expandafter\expandafter\expandafter{\expandafter\the\expandafter #1#2}} + +\newcommand*{\appendchildtree}[3]{% +% this is to construct "t1 child [#3]{t2}" from #1=t1 and #2=t2 +% t1 and t2 are two toks variable (not macros) +% #3 = for example teal!60 + \edef\tmpstuff {\the#1 child [#3]{\the#2}}% + #1\expandafter {\tmpstuff }% +} + +\newcounter{partco} + +% 1,2,3,4,5,... -> 1,2,3,1,2,3,1,2,3 +\def\pseudomodthree #1{\numexpr #1 + 3 - 3*((#1+1)/3)\relax} + +\etocsetstyle{part} + {\etocskipfirstprefix} +% This updates the global tree with the data from the previous +% part and all its children sections. Moved here because for some parts the +% sections are not displayed due to depth tags. + {\ifnum\value{partco}=3 + \appendchildtree\treetok\parttok {branch color= green!50,level distance=10cm}% + \else +\ifcase\pseudomodthree{\value{partco}}% + \or \appendchildtree\treetok\parttok {branch color= teal!30}% first + \or \appendchildtree\treetok\parttok {branch color= yellow!80}% second + \else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ... + \fi\fi + } + {\stepcounter{partco}% +% customize manually some TikZ set-up (should be done inside the TikZ thing I guess) + \def\tmpoption {}% + \def\tmprotate {}% first + %\ifnum\value{partco}=5 \def\tmprotate {[counterclockwise from =-40]}\fi + %\ifnum\value{partco}=8 \def\tmprotate {[counterclockwise from =-50]}\fi +% define the part node + \edef\partnode{node \tmpoption + {\unexpanded\expandafter{\etocthelinkednumber}. + \unexpanded\expandafter{\etocthelinkedname}}\tmprotate }% +% this is a starting point which will be filled it by the section children + \parttok\expandafter{\partnode}} + {\ifcase\pseudomodthree{\value{partco}}% + \or \appendchildtree\treetok\parttok {branch color= teal!60}% first + \or \appendchildtree\treetok\parttok {branch color= yellow!80}% second + \else\appendchildtree\treetok\parttok {branch color= green!50}% third and next ... + \fi + } + \etocsetstyle{section} - {} - {\etociffirst{\\\hline\hline}{\\\hline}} - {\etocname & \etocnumber & \etocpage } - {} + {} + {} + {% define the section node + \edef\childnode{child {node {\unexpanded\expandafter{\etocthelinkednumber} + \unexpanded\expandafter{\etocthelinkedname}}}}% + % append it to the current \parttok + \appendtotok\parttok\childnode + } + {} \etocsettocstyle - {\hypersetup{hidelinks}\begin{tabular}{|p{4cm}|c|c|}\hline - \multicolumn{1}{|c|}{\bfseries Section}& - \bfseries number& - \bfseries page} - {\\\hline\end{tabular}} + {\setcounter{partco}{0}% + \treetok{\node [root concept]{\textbf{The \etoc documentation}}}} + {\global\appendtotok\treetok{ ;}} +% The \global above is mandatory because etoc always typesets TOC inside a group + +\etocsetnexttocdepth{section} +% use of depth tags to cut out sections for most parts, the sections +% are too numerous to fit well with the circular growth +\etocsettagdepth {preamble} {part} +\etocsettagdepth {overview} {part} +\etocsettagdepth {styling} {part} +\etocsettagdepth {control} {part} +\etocsettagdepth {examples} {part} +\etocsettagdepth {advanced} {part} +\etocsettagdepth {etocandworld}{part} +\etocsettagdepth {code} {section} -\etocglobaldefs % MANDATORY !! -\etocsetnexttocdepth{1} +\tikzset{ + branch color/.style={ + concept color=#1!white, + every child/.append style={concept color=#1!white!30!white, font=\normalsize}, + } +}% -\tableofcontents\ref{toc:overview} -\end{center} +\begin{figure}[htbp!] +\etocobeydepthtags % obey the depth tags restrictions (which is default anyhow) +\tableofcontents\label{toc:mindmap}% +\centeredline{\resizebox{.85\paperwidth}{!}% +{\begin{tikzpicture}[mindmap, + grow cyclic, + text width=2cm, + align=flush center, + nodes={concept}, + concept color=orange!60, + root concept/.append style={text width=4cm, font=\Large}, + level 1/.append style={level distance=5cm,sibling angle=45, text width=3cm}, + level 2/.append style={level distance=7cm,sibling angle=30, text width=3cm}, + level 1 concept/.append style={font=\normalsize}, + ] +\the\treetok +\end{tikzpicture}}} +\end{figure} diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex index f26f28713a6..cc3a6647b6f 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex @@ -1,57 +1,64 @@ %% LaTeX2e file `etocsnippet-19.tex' -%% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentsdef' environment +%% from source `etoc' on 2023/03/02. %% +\begingroup +\etocglobaldefs % necessary for \etocname etc... to survive & \makeatletter -\newcommand*\TOCcompute@numwidths [2]{% #1=empty/"local", #2=minimal indent - \begingroup - \def\TOCnumwidthB {0pt}% - \def\TOCnumwidthC {0pt}% - \def\TOCnumwidthD {0pt}% - \def\TOCnumwidthE {0pt}% - \def\TOCnumwidthF {0pt}% - \def\TOCnumwidthG {0pt}% - \etocsetstyle{part}{}{}{}{}% - \etocsetstyle{chapter}{} - {\setbox0\hbox{\bfseries\etocthenumber\kern#2}} - {\ifdim\wd0>\TOCnumwidthB\edef\TOCnumwidthB{\the\wd0}\fi}{}% - \etocsetstyle{section}{} - {\setbox0\hbox{\bfseries\etocthenumber\kern#2}} - {\ifdim\wd0>\TOCnumwidthC\edef\TOCnumwidthC{\the\wd0}\fi}{}% - \etocsetstyle{subsection}{} - {\setbox0\hbox{\etocthenumber\kern#2}} - {\ifdim\wd0>\TOCnumwidthD\edef\TOCnumwidthD{\the\wd0}\fi}{}% - \etocsetstyle{subsubsection}{} - {\setbox0\hbox{\etocthenumber\kern#2}} - {\ifdim\wd0>\TOCnumwidthE\edef\TOCnumwidthE{\the\wd0}\fi}{}% - \etocsetstyle{paragraph}{} - {\setbox0\hbox{\etocthenumber\kern#2}} - {\ifdim\wd0>\TOCnumwidthF\edef\TOCnumwidthF{\the\wd0}\fi}{}% - \etocsetstyle{subparagraph}{} - {\setbox0\hbox{\etocthenumber\kern#2}} - {\ifdim\wd0>\TOCnumwidthG\edef\TOCnumwidthG{\the\wd0}\fi}{}% - % - \etocsettocstyle{} - {\global\let\TOCnumwidthB\TOCnumwidthB - \global\let\TOCnumwidthC\TOCnumwidthC - \global\let\TOCnumwidthD\TOCnumwidthD - \global\let\TOCnumwidthE\TOCnumwidthE - \global\let\TOCnumwidthF\TOCnumwidthF - \global\let\TOCnumwidthG\TOCnumwidthG}% - \etocnopar - \csname #1tableofcontents\endcsname -\typeout{Next TOCs will use \TOCnumwidthB\space for chapter number width}% -\typeout{Next TOCs will use \TOCnumwidthC\space for section number width}% -\typeout{Next TOCs will use \TOCnumwidthD\space for subsection number width}% -\typeout{Next TOCs will use \TOCnumwidthE\space for subsubsection number width}% -\typeout{Next TOCs will use \TOCnumwidthF\space for paragraph number width}% -\typeout{Next TOCs will use \TOCnumwidthG\space for subparagraph number width}% - \endgroup -}% -\newcommand*\TOCcomputenumwidths [1][0.5em]{% - \TOCcompute@numwidths {}{#1}% -}% -\newcommand*\TOCcomputelocalnumwidths [1][0.5em]{% - \TOCcompute@numwidths {local}{#1}% -}% +% hack into longtable \hline to avoid annoying (here) stray lines at top +\def\LT@@hline{% + \ifx\@let@token\hline + \global\let\@gtempa\@gobble + \global\let\@gtempb\@firstofone %%% ADDED + \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}% + \else + \global\let\@gtempa\@empty + \global\let\@gtempb\@gobble %%% ADDED + \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}% + \fi + \ifnum0=`{\fi}% + \multispan\LT@cols + \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr + \@gtempb{% %%% ADDED + \noalign{\LT@sep}% + \multispan\LT@cols + \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr + \noalign{\penalty\@M}% + }% %%% ADDED + \@gtempa} \makeatother + +% observe the locations of the \\ +\etocsetstyle{part} + {} + {} + {\\\hline\multicolumn{3}{c}{\bfseries\vrule height6ex depth3ex width0pt + \makebox[0pt]{\etocifnumbered{\etocnumber. }{}\etocname}}} + {} + +\etocsetstyle{section} + {} + {\etociffirst{\\\hline}{\\}} + {\etocnumber&\etocname &\etocpage } + {} + +\etocsetstyle{subsection} + {} + {\\} + {&\makebox[1cm][c]{\etocnumber}% + \parbox[t]{\dimexpr6cm-\tabcolsep\relax}{\sloppy\itshape\etocname\strut}% + &\itshape\etocpage } + {} + +\etocsettocstyle + {\hypersetup{hidelinks}% + \begin{longtable}{|>{\bfseries}c|p{7cm}|r|} + \hline + \multicolumn{3}{|c|}{\Large\bfseries\strut\strut TABLE OF CONTENTS}% + } + {\\\hline\end{longtable}} + +\etocsetnexttocdepth {subsection} + +\tableofcontents +\endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex index 20f3d797004..596ed0ef821 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-20.tex @@ -1,22 +1,23 @@ %% LaTeX2e file `etocsnippet-20.tex' -%% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentsdef' environment +%% from source `etoc' on 2023/03/02. %% +\begin{center} \etocsetstyle{section} -{\begin{enumerate}} -{\normalsize\bfseries\rmfamily\item} -{\etocname{} (page \etocpage)} -{\end{enumerate}} + {} + {\etociffirst{\\\hline\hline}{\\\hline}} + {\etocname & \etocnumber & \etocpage } + {} -\etocsetstyle{subsection} -{\begin{enumerate}} -{\normalfont\item} -{\etocname{} (p.~\etocpage)} -{\end{enumerate}} +\etocsettocstyle + {\hypersetup{hidelinks}\begin{tabular}{|>{\RaggedRight}p{4.5cm}|c|c|}\hline + \multicolumn{1}{|c|}{\bfseries Section title}& + \bfseries number& + \bfseries page} + {\\\hline\end{tabular}} -\etocsetstyle{subsubsection} -{\par\nobreak\begingroup\normalfont - \footnotesize\itshape\etocskipfirstprefix} -{\allowbreak\,--\,} -{\etocname} -{.\hfil\par\endgroup\pagebreak[3]} +\etocglobaldefs % MANDATORY !! +\etocsetnexttocdepth{1} + +\tableofcontents\ref{toc:overview} +\end{center} diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex index 5827d81d277..717cf57c94f 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-21.tex @@ -1,19 +1,59 @@ %% LaTeX2e file `etocsnippet-21.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\etocsettocdepth {subsubsection} % set the initial tocdepth -\etocdefaultlines % use the package default line styles. At this early stage in - % the document they had not yet been modified by \etocsetstyle - % commands, so \etoctoclines could have been used, too. -\etocmarkboth\contentsname -\etocmulticolstyle[1] % one-column display - {\pdfbookmark[1]{Table of contents}{MAINTOC}% create a bookmark in the pdf - \noindent\bfseries\Large - \leaders\hrule height1pt\hfill - \MakeUppercase{Table of Contents}} -\begingroup % use a group to limit the scope of the - \etocsetlevel{subsection}{3} % subsection level change. - \etocsetlevel{subsubsection}{4} % anything > tocdepth=3. - \tableofcontents \label{toc:main} -\endgroup +\makeatletter +\newcommand*\TOCcompute@numwidths [2]{% #1=empty/"local", #2=minimal indent + \begingroup + \def\TOCnumwidthB {0pt}% + \def\TOCnumwidthC {0pt}% + \def\TOCnumwidthD {0pt}% + \def\TOCnumwidthE {0pt}% + \def\TOCnumwidthF {0pt}% + \def\TOCnumwidthG {0pt}% + \etocsetstyle{part}{}{}{}{}% + \etocsetstyle{chapter}{} + {\setbox0\hbox{\bfseries\etocthenumber\kern#2}} + {\ifdim\wd0>\TOCnumwidthB\edef\TOCnumwidthB{\the\wd0}\fi}{}% + \etocsetstyle{section}{} + {\setbox0\hbox{\bfseries\etocthenumber\kern#2}} + {\ifdim\wd0>\TOCnumwidthC\edef\TOCnumwidthC{\the\wd0}\fi}{}% + \etocsetstyle{subsection}{} + {\setbox0\hbox{\etocthenumber\kern#2}} + {\ifdim\wd0>\TOCnumwidthD\edef\TOCnumwidthD{\the\wd0}\fi}{}% + \etocsetstyle{subsubsection}{} + {\setbox0\hbox{\etocthenumber\kern#2}} + {\ifdim\wd0>\TOCnumwidthE\edef\TOCnumwidthE{\the\wd0}\fi}{}% + \etocsetstyle{paragraph}{} + {\setbox0\hbox{\etocthenumber\kern#2}} + {\ifdim\wd0>\TOCnumwidthF\edef\TOCnumwidthF{\the\wd0}\fi}{}% + \etocsetstyle{subparagraph}{} + {\setbox0\hbox{\etocthenumber\kern#2}} + {\ifdim\wd0>\TOCnumwidthG\edef\TOCnumwidthG{\the\wd0}\fi}{}% + % + \etocsettocstyle + {} + {\global\let\TOCnumwidthB\TOCnumwidthB + \global\let\TOCnumwidthC\TOCnumwidthC + \global\let\TOCnumwidthD\TOCnumwidthD + \global\let\TOCnumwidthE\TOCnumwidthE + \global\let\TOCnumwidthF\TOCnumwidthF + \global\let\TOCnumwidthG\TOCnumwidthG + }% make the found maximal widths have global scope + \etocnopar + \csname #1tableofcontents\endcsname +\typeout{Next TOCs will use \TOCnumwidthB\space for chapter number width}% +\typeout{Next TOCs will use \TOCnumwidthC\space for section number width}% +\typeout{Next TOCs will use \TOCnumwidthD\space for subsection number width}% +\typeout{Next TOCs will use \TOCnumwidthE\space for subsubsection number width}% +\typeout{Next TOCs will use \TOCnumwidthF\space for paragraph number width}% +\typeout{Next TOCs will use \TOCnumwidthG\space for subparagraph number width}% + \endgroup % matches \begingroup at start of definition +}% +\newcommand*\TOCcomputenumwidths [1][0.5em]{% + \TOCcompute@numwidths {}{#1}% +}% +\newcommand*\TOCcomputelocalnumwidths [1][0.5em]{% + \TOCcompute@numwidths {local}{#1}% +}% +\makeatother diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex index aefa80b73d4..e576278e2a1 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-22.tex @@ -1,23 +1,48 @@ %% LaTeX2e file `etocsnippet-22.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape - \fbox{\parbox{.6\linewidth}{ - \leftskip 0pt plus .5fil - \rightskip 0pt plus -.5fil - \parfillskip 0pt plus 1fil This is the global table of - contents on two columns, using \etoc default line styles, but with - sections as chapters, and subsections as sections. - }}} -\etocdefaultlines -\etocsetnexttocdepth{1} -\begingroup -\etocsetlevel{section}{0} -\etocsetlevel{subsection}{1} -\renewcommand*{\etocfontone}{\normalfont \normalsize} -\renewcommand*{\etoctoclineleaders} - {\hbox{\normalfont\normalsize\hbox to 1ex {\hss.\hss}}} -\sloppy -\tableofcontents -\endgroup +\newsavebox\firstnamei \newsavebox\firstnumberi +\newsavebox\lastnamei \newsavebox\lastnumberi +\newsavebox\firstnameii \newsavebox\firstnumberii +\newsavebox\lastnameii \newsavebox\lastnumberii +\newcounter{mycounti} \newcounter{mycountii} +\newcommand*{\thispartstatsauxi}{} \newcommand*{\thispartstatsauxii}{} +\newcommand*{\oldtocdepth}{} +\newcommand*{\thispartstats}{% + \setcounter{mycounti}{0}% + \setcounter{mycountii}{0}% + \def\thispartstatsauxi{% + \sbox{\firstnamei}{\footnotesize\etocname}% + \sbox{\firstnumberi}{\footnotesize\etocnumber}% + \def\thispartstatsauxi{}}% + \def\thispartstatsauxii{% + \sbox{\firstnameii}{\footnotesize\etocname}% + \sbox{\firstnumberii}{\footnotesize\etocnumber}% + \def\thispartstatsauxii{}}% + \begingroup + \etocsetstyle{subsection} {} {} + {\thispartstatsauxii + \stepcounter{mycountii}% + \sbox{\lastnameii}{\footnotesize\etocname}% + \sbox{\lastnumberii}{\footnotesize\etocnumber}} {}% + \etocsetstyle{section} {} {} + {\thispartstatsauxi + \stepcounter{mycounti}% + \sbox{\lastnamei}{\footnotesize\etocname}% + \sbox{\lastnumberi}{\footnotesize\etocnumber}} + {{\footnotesize\itshape + Here are some statistics for this part: it contains \arabic{mycounti} + section\ifnum\value{mycounti}>1 s\fi{} and \arabic{mycountii} + subsection\ifnum\value{mycountii}>1 s\fi. The name of the first section is + \unhbox\firstnamei{} and the corresponding number is \unhbox\firstnumberi. + The name of the last section is \unhbox\lastnamei{} and its number is + \unhbox\lastnumberi. The name of the first subsection is \unhbox\firstnameii{} + and the corresponding number is \unhbox\firstnumberii. The name of the last + subsection is \unhbox\lastnameii{} and its number is \unhbox\lastnumberii.\par}}% + \etocinline % cancels the automatic \par automatically before the TOC + \etocsettocstyle {}{} + \etocsetnexttocdepth{2}% + \localtableofcontents % to be used at the top level of a Part. + \endgroup +} diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex index 1a291c0426e..03d59c42f7a 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-23.tex @@ -1,74 +1,31 @@ %% LaTeX2e file `etocsnippet-23.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% -\begingroup -\definecolor{subsecnum}{RGB}{13,151,225} -\definecolor{secbackground}{RGB}{0,177,235} -\definecolor{tocbackground}{RGB}{212,237,252} - -\renewcommand{\etocbkgcolorcmd}{\color{tocbackground}} -\renewcommand{\etocleftrulecolorcmd}{\color{tocbackground}} -\renewcommand{\etocrightrulecolorcmd}{\color{tocbackground}} -\renewcommand{\etocbottomrulecolorcmd}{\color{tocbackground}} -\renewcommand{\etoctoprulecolorcmd}{\color{tocbackground}} - -\renewcommand{\etocleftrule}{\vrule width 1cm} -\renewcommand{\etocrightrule}{\vrule width .5cm} -\renewcommand{\etocbottomrule}{\hrule height 12pt} -\renewcommand{\etoctoprule}{\hrule height 12pt} - -\renewcommand{\etocinnertopsep}{0pt} -\renewcommand{\etocinnerbottomsep}{0pt} -\renewcommand{\etocinnerleftsep}{0pt} -\renewcommand{\etocinnerrightsep}{0pt} - -\newcommand\shiftedwhiterule[2]{% - \hbox to \linewidth{\color{white}% - \hskip#1\leaders\vrule height1pt\hfil}\nointerlineskip\vskip#2} - -\etocsetstyle{subsubsection}{\etocskipfirstprefix} - {\shiftedwhiterule{\leftskip}{6pt}} - {\sffamily\footnotesize - \leftskip2.5cm\hangindent1cm\rightskip1cm\noindent - \hbox to 1cm{\color{subsecnum}\etocnumber\hss}% - \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill - \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par - \nointerlineskip\vskip3pt} - {} - -\etocsetstyle{subsection}{\etocskipfirstprefix} - {\shiftedwhiterule{1.5cm}{6pt}} - {\sffamily\small - \leftskip1.5cm\hangindent1cm\rightskip1cm\noindent - \hbox to 1cm{\color{subsecnum}\etocnumber\hss}% - \color{black}\etocname\leaders\hbox to .2cm{\hss.}\hfill - \rlap{\hbox to 1cm{\hss\etocpage\hskip.2cm}}\par - \nointerlineskip\vskip6pt} - {} - -\newcommand{\coloredstuff}[2]{% - \leftskip0pt\rightskip0pt\parskip0pt - \fboxsep0pt % \colorbox uses \fboxsep also when no frame! - \noindent\colorbox{secbackground} - {\parbox{\linewidth}{% - \vskip5pt - {\noindent\color{#1}#2\par}\nointerlineskip - \vskip3pt}}% - \par\nointerlineskip} - -\etocsetstyle{section} -{\coloredstuff{white} - {\hfil \hyperref[toc:b]{\bfseries\large I am a twin of - that other TOC (click me!)}\hfil}} -{\vskip3pt\sffamily\small} -{\coloredstuff{white} - {\leftskip1.5cm\rightskip.5cm\parfillskip-\rightskip - \makebox[0pt][r]{\makebox[.5cm][r]{\etocnumber\hspace{.2cm}}}% - \etocname\hfill\makebox[.5cm][r]{\etocpage\hspace{.2cm}}}% - \vskip6pt } -{} - -\etocframedstyle[1]{} -\tableofcontents \label{toc:clone} \ref{toc:globalcmds} -\endgroup +\makeatletter +\newcommand*\firstsubname {} \newcommand*\lastsubname {} +\newcommand*\firstsubnumber {} \newcommand*\lastsubnumber {} +\newcommand*\thisspecialstatsaux{} +\newcommand*{\thisspecialstats}{% + \setcounter{mycounti}{0}% + \def\thisspecialstatsaux{% + \let\firstsubname\etocthelinkedname + \let\firstsubnumber\etocthelinkednumber + \def\thisspecialstatsaux{}} + \begingroup + \etocsetstyle{subsection} {} {} + {\thisspecialstatsaux + \stepcounter{mycounti}% + \let\lastsubname\etocthelinkedname + \let\lastsubnumber\etocthelinkednumber } + {Here are some statistics for this section. It contains \arabic{mycounti} + subsections. The name of its first is \emph{\firstsubname{}} and the + corresponding number is {\firstsubnumber}. The name of the last + subsection is \emph{\lastsubname{}} and its number is {\lastsubnumber}.}% + \etocsettocstyle {}{} + \etocinline + \etocsetnexttocdepth {1}% + \localtableofcontents % to be used within a section + \endgroup +} +\makeatother diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex index 2b1b015c1e2..23f2843f099 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-24.tex @@ -1,48 +1,65 @@ %% LaTeX2e file `etocsnippet-24.tex' -%% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentsdef' environment +%% from source `etoc' on 2023/03/02. %% -\newsavebox\firstnamei \newsavebox\firstnumberi -\newsavebox\lastnamei \newsavebox\lastnumberi -\newsavebox\firstnameii \newsavebox\firstnumberii -\newsavebox\lastnameii \newsavebox\lastnumberii -\newcounter{mycounti} \newcounter{mycountii} -\newcommand*{\thispartstatsauxi}{} \newcommand*{\thispartstatsauxii}{} -\newcommand*{\oldtocdepth}{} -\newcommand*{\thispartstats}{% - \setcounter{mycounti}{0}% - \setcounter{mycountii}{0}% - \def\thispartstatsauxi{% - \sbox{\firstnamei}{\footnotesize\etocname}% - \sbox{\firstnumberi}{\footnotesize\etocnumber}% - \def\thispartstatsauxi{}}% - \def\thispartstatsauxii{% - \sbox{\firstnameii}{\footnotesize\etocname}% - \sbox{\firstnumberii}{\footnotesize\etocnumber}% - \def\thispartstatsauxii{}}% - \begingroup - \etocsetstyle{subsection} {} {} - {\thispartstatsauxii - \stepcounter{mycountii}% - \sbox{\lastnameii}{\footnotesize\etocname}% - \sbox{\lastnumberii}{\footnotesize\etocnumber}} {}% - \etocsetstyle{section} {} {} - {\thispartstatsauxi - \stepcounter{mycounti}% - \sbox{\lastnamei}{\footnotesize\etocname}% - \sbox{\lastnumberi}{\footnotesize\etocnumber}} - {{\footnotesize\itshape - Here are some statistics for this part: it contains \arabic{mycounti} - section\ifnum\value{mycounti}>1 s\fi{} and \arabic{mycountii} - subsection\ifnum\value{mycountii}>1 s\fi. The name of the first section is - \unhbox\firstnamei{} and the corresponding number is \unhbox\firstnumberi. - The name of the last section is \unhbox\lastnamei{} and its number is - \unhbox\lastnumberi. The name of the first subsection is \unhbox\firstnameii{} - and the corresponding number is \unhbox\firstnumberii. The name of the last - subsection is \unhbox\lastnameii{} and its number is \unhbox\lastnumberii.\par}}% - \etocinline % cancels the automatic \par automatically before the TOC - \etocsettocstyle {}{} - \etocsetnexttocdepth{2}% - \localtableofcontents % to be used at the top level of a Part. - \endgroup -} +\etocsetnexttocdepth {all} +\begingroup +\parindent 0pt \leftskip 0cm \rightskip .75cm \parfillskip -\rightskip +\newcommand*{\EndParWithPagenoInMargin} + {\nobreak\hfill + \makebox[0.75cm][r]{\mdseries\normalsize\etocpage}% + \par} +\renewcommand*\etoctoclineleaders + {\hbox{\normalfont\normalsize\hbox to .75ex {\hss.\hss}}} +\newcommand*{\EndParWithPagenoInMarginAndLeaders} + {\nobreak\leaders\etoctoclineleaders\hfill + \makebox[0.75cm][r]{\mdseries\normalsize\etocpage}% + \par } +\etocsetstyle {part} + {} + {\leavevmode\leftskip 1cm\relax} + {\bfseries\large\llap{\makebox[1cm][r]{\etocnumber\ \ }}% + \etocname\EndParWithPagenoInMargin\smallskip} + {} +\etocsetstyle {section} + {} + {\leavevmode\leftskip 1.75cm\relax} + {\bfseries\normalsize\llap{\makebox[.75cm][l]{\etocnumber}}% + \etocname\EndParWithPagenoInMarginAndLeaders} + {} +\etocsetstyle {subsection} + {} + {\leavevmode\leftskip 2.75cm\relax } + {\mdseries\normalsize\llap{\makebox[1cm][l]{\etocnumber}}% + \etocname\EndParWithPagenoInMarginAndLeaders} + {} +\etocsetstyle {subsubsection} + {} + {\leavevmode\leftskip 4cm\relax } + {\mdseries\normalsize\llap{\makebox[1.25cm][l]{\etocnumber}}% + \etocname\EndParWithPagenoInMarginAndLeaders} + {} +\etocsetstyle {paragraph} + {} + {\leavevmode\leftskip 5.5cm\relax } + {\mdseries\normalsize\llap{\makebox[1.5cm][l]{\etocnumber}}% + \etocname\EndParWithPagenoInMarginAndLeaders} + {} +\etocsettagdepth {preamble} {all} +\etocsettagdepth {overview} {part} +\etocsettagdepth {styling} {subsection} +\etocsettagdepth {control} {subsubsection} +\etocsettagdepth {examples} {part} +\etocsettagdepth {advanced} {part} +\etocsettagdepth {etocandworld}{all} +\etocsettagdepth {code} {all} +\renewcommand\etoctoprule {\hrule height 3pt\relax } +\renewcommand\etoctoprulecolorcmd {\color{blue}} +\renewcommand\etocaftercontentshook + {\medskip\begingroup \color{blue}\hrule height 3pt \endgroup } +\etocruledstyle [1]{\Large\bfseries + \fbox{\makebox[8cm]{A TOC using depth tags}}} +\sloppy +\etocobeydepthtags % let's not forget to activate this (default anyhow) +\tableofcontents +\endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex index 0926c9356be..948944c9bc9 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-25.tex @@ -1,31 +1,59 @@ %% LaTeX2e file `etocsnippet-25.tex' %% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. +%% from source `etoc' on 2023/03/02. %% \makeatletter -\newcommand*\firstsubname {} \newcommand*\lastsubname {} -\newcommand*\firstsubnumber {} \newcommand*\lastsubnumber {} -\newcommand*\thisspecialstatsaux{} -\newcommand*{\thisspecialstats}{% - \setcounter{mycounti}{0}% - \def\thisspecialstatsaux{% - \let\firstsubname\etocthelinkedname - \let\firstsubnumber\etocthelinkednumber - \def\thisspecialstatsaux{}} +\newcommand*{\MyQuasiStandardTOC}[2][]{% + % #1 is an optional "\ref{somelabeltoanothertoc}" + % #2 is the number of some exceptional section \begingroup - \etocsetstyle{subsection} {} {} - {\thisspecialstatsaux - \stepcounter{mycounti}% - \let\lastsubname\etocthelinkedname - \let\lastsubnumber\etocthelinkednumber } - {Here are some statistics for this section. It contains \arabic{mycounti} - subsections. The name of its first is \emph{\firstsubname{}} and the - corresponding number is {\firstsubnumber}. The name of the last - subsection is \emph{\lastsubname{}} and its number is {\lastsubnumber}.}% - \etocsettocstyle {}{} - \etocinline - \etocsetnexttocdepth {1}% - \localtableofcontents % to be used within a section + \etocsetstyle{section} + {} + {\etociffirst{% Suppress display of subsections for the first section! + \etocsetlevel{subsection}{6}} + {\etocsetlevel{subsection}{2}}% + \ifnum\etocthenumber=#2 % Handle especially section number #2 ! + \etocsetstyle{subsection} + {\def\foo{}\par\nopagebreak\begingroup + \leftskip2em \rightskip\@tocrmarg + \parfillskip \@flushglue + \parindent 0pt + \normalfont\normalsize\rmfamily\itshape + \etocskipfirstprefix} + {\allowbreak\,--\,} + {\edef\foo{\the\numexpr\foo+1}\etocname\ \textup{(\etocnumber)}} + {.\par \upshape My AI counted circa \foo\space subsections, + was it right?\par\endgroup}% + \else + \ifnum\etocthenumber>#2 % Only count subsections in those sections ! + \etocsetstyle{subsection} + {\def\foo{}}% + {\edef\foo{\the\numexpr\foo+1}}% + {}% + {\leftskip2em \emph{There are \foo\space subsections here, + but I will need payment to display them.}\par}% + \else + \etocsetstyle{subsection} + {}% + {}% + {\l@subsection{\numberline{\etocnumber}\etocname}{\etocpage}}% + {}% + \fi + \fi + }% + {% Display in a special color the number of the special section! + \l@section{\numberline{{\ifnum\etocthenumber=#2 + \color{red}\else\color{cyan}\fi\etocthenumber}}% + \etociffirst{\etocname\space (SUBSECTIONS SKIPPED)}{\etocname}} + {\etocpage}}% + {}% + \etocclasstocstyle % will use the ambient document class + % special KOMA-script customization as this document uses scrartcl + % and we need to enlarge numwidth for some subsections + \DeclareTOCStyleEntry[numwidth=2em,indent=0pt]{tocline}{section} + \DeclareTOCStyleEntry[numwidth=2.5em,indent=2em]{tocline}{subsection} + \etocsetnexttocdepth {subsection}% + \tableofcontents #1 \endgroup } \makeatother diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex index b760b6ecf76..6ae1352dd27 100644 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex +++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-26.tex @@ -1,67 +1,50 @@ %% LaTeX2e file `etocsnippet-26.tex' -%% generated by the `filecontentsdef' environment -%% from source `etoc' on 2023/01/21. +%% generated by the `filecontentshere' environment +%% from source `etoc' on 2023/03/02. %% -\etocsetnexttocdepth {all} +\newtoks\toctabletok +\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2 + #1\expandafter\expandafter\expandafter {\expandafter\the\expandafter #1#2}} + +\newcommand*\PreparePart{% + \toks0 \expandafter{\etocthelinkednumber}% + \toks2 \expandafter{\etocthelinkedname}% + \toks4 \expandafter{\etocthelinkedpage}% + \edef\toctablepiece {\noexpand\hline + \noexpand\strut\the\toks0 &\noexpand\bfseries\the\toks2 + &\the\toks4 \noexpand\\\noexpand\hline}% +} +\newcommand*\PrepareSection{% + \toks0 \expandafter{\etocthelinkednumber}% + \toks2 \expandafter{\etocthelinkedname}% + \toks4 \expandafter{\etocthelinkedpage}% + \edef\toctablepiece {\the\toks0 &\the\toks2 &\the\toks4 \noexpand\\}% +} +% +\newcommand*{\PrepareSubsection}{% + \toks0 \expandafter{\etocthelinkednumber}% + \toks2 \expandafter{\expandafter\itshape\etocthelinkedname\strut}% + \toks4 \expandafter{\expandafter\itshape\etocthelinkedpage}% + \edef\toctablepiece{&\noexpand\makebox[1cm][c]{\the\toks0}% + \noexpand\parbox[t]{\dimexpr6cm-\tabcolsep\relax} + {\noexpand\sloppy\the\toks2}% + &\the\toks4 \noexpand\\}% +} + \begingroup -\parindent 0pt \leftskip 0cm \rightskip .75cm \parfillskip -\rightskip -\newcommand*{\EndParWithPagenoInMargin} - {\nobreak\hfill - \makebox[0.75cm][r]{\mdseries\normalsize\etocpage}% - \par} -\renewcommand*\etoctoclineleaders - {\hbox{\normalfont\normalsize\hbox to .75ex {\hss.\hss}}} -\newcommand*{\EndParWithPagenoInMarginAndLeaders} - {\nobreak\leaders\etoctoclineleaders\hfill - \makebox[0.75cm][r]{\mdseries\normalsize\etocpage}% - \par } -\etocsetstyle {part} - {} - {\leavevmode\leftskip 1cm\relax} - {\bfseries\large\llap{\makebox[1cm][r]{\etocnumber\ \ }}% - \etocname\EndParWithPagenoInMargin\smallskip} - {} -\etocsetstyle {section} - {} - {\leavevmode\leftskip 1.75cm\relax} - {\bfseries\normalsize\llap{\makebox[.75cm][l]{\etocnumber}}% - \etocname\EndParWithPagenoInMarginAndLeaders} - {} -\etocsetstyle {subsection} - {} - {\leavevmode\leftskip 2.75cm\relax } - {\mdseries\normalsize\llap{\makebox[1cm][l]{\etocnumber}}% - \etocname\EndParWithPagenoInMarginAndLeaders} - {} -\etocsetstyle {subsubsection} - {} - {\leavevmode\leftskip 4cm\relax } - {\mdseries\normalsize\llap{\makebox[1.25cm][l]{\etocnumber}}% - \etocname\EndParWithPagenoInMarginAndLeaders} - {} -\etocsetstyle {paragraph} - {} - {\leavevmode\leftskip 5.5cm\relax } - {\mdseries\normalsize\llap{\makebox[1.5cm][l]{\etocnumber}}% - \etocname\EndParWithPagenoInMarginAndLeaders} - {} -\etocsettagdepth {preamble} {none} -\etocsettagdepth {overview} {part} -%\etocsettagdepth {arbitrarily}{part}% not needed explicitely, keeps value -%\etocsettagdepth {examples} {part} -%\etocsettagdepth {surprising} {part} -%\etocsettagdepth {linestyles} {part} -\etocsettagdepth {globalcmds} {paragraph} -\etocsettagdepth {custom} {part} -%\etocsettagdepth {tips} {part} -%\etocsettagdepth {etocandworld}{part} -\etocsettagdepth {code} {none} -\renewcommand\etoctoprule {\hrule height 3pt\relax } -\renewcommand\etoctoprulecolorcmd {\color{blue}} -\renewcommand\etocaftercontentshook - {\medskip\begingroup \color{blue}\hrule height 3pt \endgroup } -\etocruledstyle [1]{\Large\bfseries - \fbox{\makebox[8cm]{A TOC using depth tags}}} -\sloppy +\etocsetstyle{part}{}{}{\PreparePart \appendtotok\toctabletok\toctablepiece}{} + +\etocsetstyle{section}{}{}{\PrepareSection \appendtotok\toctabletok\toctablepiece}{} + +\etocsetstyle{subsection}{}{}{\PrepareSubsection\appendtotok\toctabletok\toctablepiece}{} + +\etocsettocstyle + {\toctabletok{\hypersetup{hidelinks}% + \begin{longtable}{|>{\bfseries}c|p{7cm}|r|}\hline + \multicolumn{3}{|c|}{\Large\bfseries\strut TABLE OF CONTENTS}% + \\\hline\hline}} + {\global\toctabletok\expandafter{\the\toctabletok\hline\end{longtable}}} +\etocsettocdepth {subsection} \tableofcontents +\the\toctabletok \endgroup diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex deleted file mode 100644 index fb9958afa7b..00000000000 --- a/Master/texmf-dist/doc/latex/etoc/etocsnippet-27.tex +++ /dev/null @@ -1,50 +0,0 @@ -%% LaTeX2e file `etocsnippet-27.tex' -%% generated by the `filecontentshere' environment -%% from source `etoc' on 2023/01/21. -%% -\newtoks\toctabletok -\newcommand*\appendtotok[2]{% #1=toks variable, #2=macro, expands once #2 - #1\expandafter\expandafter\expandafter {\expandafter\the\expandafter #1#2}} - -\newcommand*\PreparePart{% - \toks0 \expandafter{\etocthelinkednumber}% - \toks2 \expandafter{\etocthelinkedname}% - \toks4 \expandafter{\etocthelinkedpage}% - \edef\toctablepiece {\noexpand\hline - \noexpand\strut\the\toks0 &\noexpand\bfseries\the\toks2 - &\the\toks4 \noexpand\\\noexpand\hline}% -} -\newcommand*\PrepareSection{% - \toks0 \expandafter{\etocthelinkednumber}% - \toks2 \expandafter{\etocthelinkedname}% - \toks4 \expandafter{\etocthelinkedpage}% - \edef\toctablepiece {\the\toks0 &\the\toks2 &\the\toks4 \noexpand\\}% -} -% new version for 1.07k, 2014/03/06 -\newcommand*{\PrepareSubsection}{% - \toks0 \expandafter{\etocthelinkednumber}% - \toks2 \expandafter{\expandafter\itshape\etocthelinkedname\strut}% - \toks4 \expandafter{\expandafter\itshape\etocthelinkedpage}% - \edef\toctablepiece{&\noexpand\makebox[1cm][c]{\the\toks0}% - \noexpand\parbox[t]{\dimexpr6cm-\tabcolsep\relax} - {\noexpand\sloppy\the\toks2}% - &\the\toks4 \noexpand\\}% -} - -\begingroup -\etocsetstyle{part}{}{}{\PreparePart \appendtotok\toctabletok\toctablepiece}{} - -\etocsetstyle{section}{}{}{\PrepareSection \appendtotok\toctabletok\toctablepiece}{} - -\etocsetstyle{subsection}{}{}{\PrepareSubsection\appendtotok\toctabletok\toctablepiece}{} - -\etocsettocstyle - {\toctabletok{\hypersetup{hidelinks}% - \begin{longtable}{|>{\bfseries}c|p{7cm}|r|}\hline - \multicolumn{3}{|c|}{\Large\bfseries\strut TABLE OF CONTENTS}% - \\\hline\hline}} - {\global\toctabletok\expandafter{\the\toctabletok\hline\end{longtable}}} -\etocsettocdepth {subsection} -\tableofcontents -\the\toctabletok -\endgroup |