diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/etocsnippet-14.tex | 83 |
1 files changed, 23 insertions, 60 deletions
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 |