summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex')
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex50
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex b/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex
new file mode 100644
index 00000000000..cf042b6f9b5
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/etoc/etocsnippet-54.tex
@@ -0,0 +1,50 @@
+%% LaTeX2e file `etocsnippet-54.tex'
+%% generated by the `filecontentshere' environment
+%% from source `etoc' on 2019/11/17.
+%%
+\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