diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/etocsnippet-17.tex | 107 |
1 files changed, 52 insertions, 55 deletions
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}% +} |