summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex')
-rw-r--r--Master/texmf-dist/doc/latex/etoc/etocsnippet-19.tex113
1 files changed, 60 insertions, 53 deletions
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