diff options
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/etoc/etoc.dtx | 554 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/etoc/etoc.ins | 6 |
2 files changed, 430 insertions, 130 deletions
diff --git a/Master/texmf-dist/source/latex/etoc/etoc.dtx b/Master/texmf-dist/source/latex/etoc/etoc.dtx index 37f616758e2..e928932c634 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.dtx +++ b/Master/texmf-dist/source/latex/etoc/etoc.dtx @@ -1,15 +1,15 @@ % -*- coding: iso-latin-1; time-stamp-format: "%02d-%02m-%:y %02H:%02M:%02S %Z" -*- %<*none> -\def\doctimestamp {Time-stamp: <03-12-2013 17:49:49 CET>} +\def\doctimestamp {Time-stamp <07-03-2014 09:16:51 CET>} %</none> %<*!package> -\def\jfbpkgname {etoc} \def\jfbpkgdate {2013/12/03} \def\jfbpkgversion {v1.07j} +\def\jfbpkgname {etoc} \def\jfbpkgdate {2014/03/06} \def\jfbpkgversion {v1.07k} \def\jfbpkgdescription {Completely customisable TOCs (jfB)} %</!package> %% %% Package: etoc -%% Version: 2013/12/03 v1.07j -%% Copyright (C) 2012-2013 by Jean-Francois Burnol <jfbu at free dot fr> +%% Version: 2014/03/06 v1.07k +%% Copyright (C) 2012-2013-2014 by Jean-Francois Burnol <jfbu at free dot fr> %% % This Work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either @@ -65,7 +65,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesFile{\jfbpkgname.tex}% [\jfbpkgdate\space\jfbpkgversion\space\jfbpkgdescription]% -\PassOptionsToClass{a4paper,11pt}{scrdoc} +\PassOptionsToClass{a4paper,fontsize=11pt,twoside}{scrdoc} \chardef\Withdvipdfmx 1 % replace 1 by 0 for using latex/pdflatex, rather. \chardef\NoSourceCode 0 % replace 0 by 1 for the doc *without* the source code \input etoc.dtx @@ -141,7 +141,7 @@ \chardef\extractfiles 1 % 1 = extract .sty, .ins, .tex and typeset \chardef\Withdvipdfmx 0 % 0 = pdflatex or latex+dvips \chardef\NoSourceCode 1 % - \PassOptionsToClass{a4paper,11pt}{scrdoc}% + \PassOptionsToClass{a4paper,fontsize=11pt,twoside}{scrdoc}% \else % latex run is on etoc.tex \chardef\extractfiles 2 % do not extract files \fi @@ -182,7 +182,10 @@ \ifdefined\MessageDeFin\AtEndDocument{\MessageDeFin}\fi %------------------------------------------------------------------------------- % twoside option à partir de version du 3 déc 2013 (1.07j) -\documentclass[abstract,twoside]{scrdoc} +% (2014/03/05:) cependant ce n'était pas le bon endroit pour le mettre, cf plus +% haut les \PassOptionsToClass. +\documentclass[abstract]{scrdoc} + \ifnum\NoSourceCode=1 \OnlyDescription\fi \makeatletter @@ -206,6 +209,17 @@ \usepackage[hscale=0.66,vscale=0.75]{geometry} \pagestyle{headings} +% January 2014. work-around a bug in KOMA 3.12: +\makeatletter +\def\buggysectionmark #1{% KOMA 3.12 as released to CTAN December 2013 + \if@twoside\expandafter\markboth\else\expandafter\markright\fi + {\MakeMarkcase{\ifnumbered{section}{\sectionmarkformat\fi}{}#1}}{}} +\ifx\buggysectionmark\sectionmark +\def\sectionmark #1{% + \if@twoside\expandafter\markboth\else\expandafter\markright\fi + {\MakeMarkcase{\ifnumbered{section}{\sectionmarkformat}{}#1}}{}} +\fi +\makeatother \makeatletter % 2013/03/07. @@ -559,17 +573,101 @@ pdfpagemode=UseOutlines} \newcommand\starit[1]{\csa{#1\lowast}} \newcommand\staritb[1]{\csb{#1}\lowast} -\hyphenation{toc-depth sec-num-depth etoc-framed-style etoc-ruled-style} -\hyphenation{etoc-toc-style-with-marks etoc-ruled etoc-framed} -\hyphenation{etoc-stan-dard-display-style} -\hyphenation{etoc-the-page etoc-the-name etoc-the-num-ber etoc-if-num-bered} -\hyphenation{etoc-link etoc-stan-dard-lines etoc-toc-lines} -\hyphenation{etoc-in-ner-top-sep} -\hyphenation{etoc-the-linked-name etoc-the-linked-num-ber etoc-the-linked-page} -\hyphenation{etoc-the-link} -\hyphenation{etoc-skip-first-pre-fix etoc-the-page - etoc-ruled-style etoc-mul-ti-col-style etoc-default-lines} -\hyphenation{etoc-local-ruled} +\hyphenation{toc-depth sec-num-depth} +\hyphenation{etoc-tan-dard-lines +etoc-de-fault-lines +etoc-toc-lines +etoc-set-style +etoc-name +etoc-page +etoc-skip-first-pre-fix +etoc-num-ber +etoc-ifnum-bered +etoc-thename +etoc-thenum-ber +etoc-thep-age +etoc-link +etoc-the-linked-name +etoc-the-linked-num-ber +etoc-the-linked-page +etoc-the-link +etoc-setlevel +etoc-set-toc-depth +etoc-set-next-toc-depth +etoc-set-toc-depth +etoc-obey-toc-toc-depth +etoc-ig-nor-toc-depth +etoc-depth-tag +etoc-set-tagdepth +etoc-obey-depth-tags +etoc-ig-nore-depth-tags +etoc-stan-dard-dis-playstyle +etoc-set-toc-style +etoc-mul-ti-col-style +etoc-mul-ti-col +etoc-lo-cal-mul-ti-col +etoc-toc-style +etoc-toc-style-with-marks +etoc-toc-style-with-mark-snouc +etoc-ruled-style +etoc-ruled +etoc-lo-cal-ruled +etoc-framed-style +etoc-framed +etoc-lo-cal-framed +etoc-in-line +etoc-af-ter-ti-tle-hook +etoc-af-ter-con-tentshook +etoc-af-ter-toc-hook} + +\hyphenation{ +etoc-font-mi-nus-two +etoc-font-mi-nus-one +etoc-font-zero +etoc-font-one +etoc-font-two +etoc-font-three +etoc-sep-mi-nus-two +etoc-sep-mi-nus-one +etoc-sep-zero +etoc-sep-one +etoc-sep-two +etoc-sep-three +etoc-mi-nus-two-left-mar-gin +etoc-mi-nus-two-right-mar-gin +etoc-mi-nus-one-left-mar-gin +etoc-mi-nus-one-right-mar-gin +etoc-base-line-spread-mi-nus-two +etoc-base-line-spread-mi-nus-one +etoc-base-line-spread-zero +etoc-base-line-spread-one +etoc-base-line-spread-two +etoc-base-line-spread-three +etoc-toc-line-lead-ers +etoc-ab-brev-page-name +etoc-part-name +etoc-book-name +etoc-above-toc-skip +etoc-be-low-toc-skip +etoc-column-sep +etoc-mul-ti-col-sep +etoc-mul-ti-col-pre-tol-er-ance +etoc-mul-ti-col-tol-er-ance +etoc-de-fault-nb-col +etoc-in-ner-top-sep +etoc-top-rule +etoc-top-rule-col-or-cmd +etoc-in-ner-left-sep +etoc-in-ner-right-sep +etoc-in-ner-bot-tom-sep +etoc-left-rule +etoc-right-rule +etoc-bot-tom-rule +etoc-left-rule-col-or-cmd +etoc-rightrule-col-or-cmd +etoc-bot-tom-rule-col-or-cmd +etoc-bkg-col-or-cmd +etoc-framed-mp-hook} \frenchspacing @@ -636,7 +734,6 @@ pdfpagemode=UseOutlines} \etocdepthtag.toc {preamble} - \section{Foreword} Popular packages dealing with TOCs include |tocloft|, |titletoc| @@ -667,9 +764,10 @@ found in a line of the |.toc| file) in a completely arbitrary manner: they are made available via the \csb{etocname}, \csb{etocnumber}, and \csb{etocpage} commands. -\etoc appears to be (at least partially) -compatible with the |article|, |book|, |report|, |scrartcl|, -|scrbook|, |scrreprt| and |memoir| classes. +\etoc appears to be (at least partially) compatible with the +|article|, |book|, |report|, |scrartcl|, |scrbook|, |scrreprt| and +|memoir| classes. Starting with release |1.07k| it is possible to +use \etoc concurrently with package |tocloft|. \endgroup \clearpage @@ -854,7 +952,9 @@ possible to switch into a compatibility mode which uses the defaults from the document class.\footnote{for the ``toc display style'' \etoc checks if it knows the class, and if not defaults to - the |article| class layout.} This is activated by:\\ + the |article| class layout. It will also check if + \texttt{tocloft} has customized the TOC title.} +This is activated by:\\ \makebox[5.2cm][l]{\csb{etocstandardlines}} |% `line entries' as without \usepackage{etoc}|\\ \makebox[5.2cm][l]{\csb{etocstandarddisplaystyle}} @@ -869,23 +969,25 @@ preamble} the package will be at |\begin{document}| in this |report|, |scrartcl|, |scrbook|, |scrreprt| and |memoir| classes. - Any use of \csa{etocsetstyle} in the \emph{preamble or body} of the document - turns off from that point on the compatibility mode for line styles. One - re-activates the compatibility mode with \csb{etocstandardlines}; and the - command \csb{etoctoclines} will re-activate the line styles as defined by the - last uses of \csa{etocsetstyle}, if their scope was not limited to a group or - environment. - -The -command \csb{etocdefaultlines} resets the line styles to be -the package initial default ones. - -Even if \csb{etocsetstyle} has been used, the global display -style remains initially as defined by the document class; -one needs to use the command \csb{etocsettocstyle} or its -variants to exit from this compatibility mode at the ``toc -display style'' level. It will be re-activated if use if -made of \csb{etocstandarddisplaystyle}. + Any use of \csa{etocsetstyle} in the \emph{preamble or body} of + the document turns off from that point on the compatibility mode + for line styles, but maintains the compatibility mode for the + TOC title. One re-activates the compatibility mode for line + styles with \csb{etocstandardlines}; and + \csb{etoctoclines} will re-activate the line styles as defined + with the help of \csa{etocsetstyle}, if their scope was not + limited to a group or environment. + + The command \csb{etocdefaultlines} resets the line styles as + pre-defined internally by \etoc and described in + \autoref{etocdefaultlines}. + +Even if \csb{etocsetstyle} has been used, the global display style +remains initially as defined by the document class (or the +|tocloft| package); one needs to use the command +\csb{etocsettocstyle} or its variants to exit from this +compatibility mode at the ``toc display style'' level. It will be +re-activated if use if made of \csb{etocstandarddisplaystyle}. \section{A first example} \label{sec:firstexample} @@ -951,12 +1053,11 @@ out there are no subsubsections in this part). The two commands used are \csb{etocruledstyle} for the TOC global style. The |\rightskip| is shared by all, and creates space where the page -numbers get printed. See also -\autoref{ssec:tocwithdepthtags} which provides a TOC with parts and -paragraphs, with multi-line headings as in the standard classes -layout (and the technique for setting there the page numbers on the right -is closer than here to what \LaTeX2e's |\@dottedtocline| macro -does). +numbers get printed. For an elaboration of this technique see the next +\autoref{sec:secondexample} as well as \autoref{ssec:tocwithdepthtags} +which provides a TOC with parts and paragraphs. Both allow multi-line +headings and employ a technique for putting page numbers in the right margin +which was inspired from what \LaTeX2e's |\@dottedtocline| macro does. @@ -989,6 +1090,114 @@ does). \endgroup \end{verbatim} +\section{A second example} +\label{sec:secondexample} + +This second example displays only the contents from +\autoref{part:linestyles} and \autoref{part:globalcmds}. This selection +is done via the technique of \emph{depth tags}, described in +\autoref{etocsettagdepth} and \autoref{ssec:tocwithdepthtags}. Its +layout is a bit like the one of the \hyperref[toc:main]{main document + TOC}, although the line styles are coded very differently. + +\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} +\etocsettagdepth {arbitrarily}{none} +\etocsettagdepth {surprising} {none} +\etocsettagdepth {linestyles} {subsection} +\etocsettagdepth {globalcmds} {subsection} +\etocsettagdepth {custom} {none} +\etocsettagdepth {tips} {none} +\etocsettagdepth {code} {none} + +\etocsettocstyle {\centering\LARGE\textsc{\contentsname}\par\nobreak\medskip}{} +\etocsetnexttocdepth {subsection} +\tableofcontents +\endgroup + +The code: +\begin{verbatim} +\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} +\etocsettagdepth {arbitrarily}{none} +\etocsettagdepth {surprising} {none} +\etocsettagdepth {linestyles} {subsection} +\etocsettagdepth {globalcmds} {subsection} +\etocsettagdepth {custom} {none} +\etocsettagdepth {tips} {none} +\etocsettagdepth {code} {none} + +\etocsettocstyle {\centering\LARGE\textsc{\contentsname}\par\nobreak\medskip}{} +\etocsetnexttocdepth {subsection} +\tableofcontents +\endgroup +\end{verbatim} \section{Linked list of the main package commands} % 16 octobre @@ -1165,8 +1374,8 @@ table of contents of all the paragraphs from the document! compatibility mode, which would insist on inserting a gigantic left margin.} -\section{The \csbhyp{etocsettocdepth} and - \csbhyp{etocsetnexttocdepth} commands} +\section{The \csbhyp{etoc\-set\-toc\-depth} and + \csbhyp{etoc\-set\-next\-toc\-depth} commands} \label{etocsettocdepth} \label{etocsetnexttocdepth} @@ -1221,7 +1430,7 @@ this did not modify the bookmark tree of the |pdf| file. Now that \csb{etocsetnexttocdepth} has been added to the package, we have used it systematically and there was no need for |bookmarksdepth=3| anymore. -\section{The command \csbhyp{etocsettoc\-depth.toc}} +\section{The command \csbhyp{etoc\-set\-toc\-dep\-th.toc}} \label{etocsettocdepth.toc} This command \csb{etocsettocdepth.toc} implements some functionality of @@ -1264,7 +1473,7 @@ needed; and \csb{etocobeytoctocdepth} will re-activate it. The package does initially \csb{etocobeytoctocdepth}. -\section{The commands \csbhyp{etocdepthtag.toc} and \csbhyp{etocsettagdepth}} +\section{The commands \csbhyp{etoc\-depth\-tag.toc} and \csbhyp{etocsettagdepth}} \label{etocdepthtag.toc} \label{etocsettagdepth} @@ -1666,14 +1875,13 @@ it here we just wrote:\par\smallskip \csb{etoctoccontentsline}|{visibletoc}{\thevisibletoc}|. This \etoc command \csb{etoctoccontentsline}\marg{level\_name}\marg{name} has the same effect as: - \centeredline{| |% - |\addcontentsline{toc}|\marg{level\_name}\marg{name}} + \centeredline{| ||\addcontentsline{toc}|\marg{level\_name}\marg{name}} but its usefulness is to circumvent\footnote{using \csa{addtocontents} rather than \csa{addcontentsline}} the patching for automatic creation of bookmarks done to \csa{addcontentsline} by the |hyperref| package, as pdf bookmarks don't make much sense here (and would elicit a complaint - of |hyperref| that the bookmark level is `unknown').\footnote{ + of |hyperref| that the bookmark level is `unknown').\footnote{% The package provides a starred variant \staritb{etoctoccontentsline}, which does allow the creation of bookmarks and has a third mandatory argument which is the @@ -2495,7 +2703,7 @@ contents of this (or another) document part, only a \csa{sectiontok} and a \hypersetup{hidelinks}% \begin{tikzpicture} [grow cyclic, - level 1/.style={level distance=4cm,sibling angle=90}, + 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] @@ -2524,7 +2732,7 @@ producing it: \hypersetup{hidelinks}% \begin{tikzpicture} [grow cyclic, - level 1/.style={level distance=4cm,sibling angle=90}, + 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] @@ -3529,8 +3737,7 @@ can be followed with optional labels or references:\par \medskip The commands for local tables of contents do \emph{not} react to a \csa{ref} following them. -When -re-displaying another toc, only its contents are transferred: +When re-displaying another toc, only its contents are transferred: both the line styles and the toc display style are the ones currently defined, not the ones from the cloned toc. @@ -3538,23 +3745,34 @@ currently defined, not the ones from the cloned toc. \section{The package default line styles: \csbhyp{etocdefaultlines}} \label{etocdefaultlines} -Activating the use of the package default line styles is -done via \csa{etocdefaultlines}, or \csa{etoctoclines} if these styles have not -been modified with \csa{etocsetstyle}. Sections and sub-sections are printed in -essentially the same manner, except that the leading for sub-sections is a bit -smaller (with document classes lacking a \csa{chapter} command, the sections are -printed in bold typeface; this is the case in the present document). -Sub-sub-sections are printed inline, in one paragraph, with no numbers or page -numbers. This style was designed and tested with documents having lots of -sub-sub-sections, and should be used on a two-column layout: it provides (only -in that situation with many sub-sub-sections) a more compact presentation than -what is achieved by the \LaTeX{} default.\footnote{and there will never be a - Part or Chapter entry alone at the bottom of a column or page (except if it - has no sub-unit).} On the other hand, used with a one-column layout, and with -few sub-sub-sections, the style is a bit more spread out vertically than the -\LaTeX{} default, sub-sections are not visually much different from sections -(especially for document classes with a \csa{chapter} command), so the result is -less hierarchical in appearance than in the \LaTeX{} default. +These line styles were written at an early stage in the +development of the package; although the next section explains how +to customize the font choicess or vertical spaces, etc\dots, used +by these line styles, most other changes would require copying +them from the sources and modify them directly. Admittedly they +have been written at a rather scary low-\TeX{} level, and will not +serve as a very friendly starting point. + +Activating their use is done via \csa{etocdefaultlines}, or +\csa{etoctoclines} if the line styles have not been modified with +\csa{etocsetstyle}. Sections and sub-sections are printed in +essentially the same manner, except that the leading for +sub-sections is a bit smaller (with document classes lacking a +\csa{chapter} command, the sections are printed in bold typeface; +this is the case in the present document). Sub-sub-sections are +printed inline, in one paragraph, with no numbers or page numbers. +This style was designed and tested with documents having lots of +sub-sub-sections, and should be used on a two-column layout: it +provides (only in that situation with many sub-sub-sections) a +more compact presentation than what is achieved by the \LaTeX{} +default.\footnote{and there will never be a Part or Chapter entry + alone at the bottom of a column or page (except if it has no + sub-unit).} On the other hand, used with a one-column layout, +and with few sub-sub-sections, the style is a bit more spread out +vertically than the \LaTeX{} default, sub-sections are not +visually much different from sections (especially for document +classes with a \csa{chapter} command), so the result is less +hierarchical in appearance than in the \LaTeX{} default. In this document, for the \hyperref[toc:main]{main table of contents}, we did |\etocsetlevel{subsection}{3}| hence the sub-sections were printed with the @@ -3566,7 +3784,7 @@ print sections as chapters, and subsections as sections. We use \csa{etocsetlevel} for that, and also we need to change the font style of ``sections'' (which in truth are our subsections) to use not the bold but the medium series; we modify the \csa{etocfontone} command for that. Also we use dot -leaders which are less spread out than in the package defautl. +leaders which are less spread out than in the package default. \begin{verbatim} @@ -3721,12 +3939,12 @@ The \csa{etocframedmphook} is positioned immediately after the beginning of a minipage environment where the contents of the framed TOC are typeset. -The \csa{...colorcmd} things are initially set to be -\csa{relax}, so there is no need to do \csa{usepackage}|{color}| -if the document does not use colors. If the scope of a change -to a color command such as \csa{etocbkgcolorcmd} has not -been limited to a group and one then wishes to let it again be -\csa{relax} one must use a \csa{renewcommand} and not +The \csa{...colorcmd} commands are initially set to expand to +\csa{relax} (hence do not require package |color| or |xcolor| +to be loaded). If one has modified a command such as +\csa{etocbkgcolorcmd} to expand to a color command and wants +to reset it to do nothing, one \emph{must} use +|\renewcommand{\etocbkgcolorcmd}{\relax}| and not \csa{let}\csa{etocbkgcolorcmd}\csa{relax}. Regarding the dimensions of the top rule they can be specified @@ -3981,7 +4199,6 @@ this technique): {\end{enumerate}} \renewcommand{\etoccolumnsep}{2.75em} \renewcommand{\columnseprule}{1pt} -\etocmarkbothnouc{List of all subsections} \etocmulticol[3]{\subsection{All subsections of this document}} \endgroup \end{verbatim} @@ -4094,12 +4311,9 @@ stands here is for using within a section). \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}.}% + 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}% @@ -4112,12 +4326,14 @@ stands here is for using within a section). \subsection{Using depth tags} \label{ssec:tocwithdepthtags} -We want a TOC which will have a heading for each |\part| (except the last part -with the code source, which we decide not to include), and will additionally -open up \autoref{part:globalcmds} up to paragraphs. So we simply added to this -source various \csb{etocdepthtag.toc} commands, and it is now just a matter to -set the levels for each one of these tags (as they were left undefined until -now, they were ignored in all previous tables of contents). +We want a TOC which will have a heading for each |\part| (except +the last part with the code source, which we decide not to +include), and will additionally open up \autoref{part:globalcmds} +up to paragraphs. To achieve this we added to this source various +\csb{etocdepthtag.toc} commands, and it remains now to set the +levels for each tag using \csb{etocsettagdepth} (this was used +earlier in this document, in \autoref{sec:secondexample}, within a +group hence it did not affect the other tables of contents). However, the package line styles do not display paragraphs, and the standard line styles of the document class give too much vertical @@ -4299,7 +4515,7 @@ a fully hyperlinked table of contents. The code follows, after the table. \toks2 \expandafter{\etocthelinkedname}% \toks4 \expandafter{\etocthelinkedpage}% \edef\toctablepiece {\noexpand\hline - \strut\the\toks0 &\noexpand\bfseries\the\toks2 + \noexpand\strut\the\toks0 &\noexpand\bfseries\the\toks2 &\the\toks4 \noexpand\\ \noexpand\hline}% } @@ -4311,13 +4527,15 @@ a fully hyperlinked table of contents. The code follows, after the table. \edef\toctablepiece {\the\toks0 &\the\toks2 &\the\toks4 \noexpand\\}% } +% new version for 1.07k, 2014/03/06 \newcommand*{\PrepareSubsection}{% \toks0 \expandafter{\etocthelinkednumber}% - \toks2 \expandafter{\etocthelinkedname}% - \toks4 \expandafter{\etocthelinkedpage}% - \edef\toctablepiece{\noexpand\centering - \the\toks0 &\the\toks2 &\noexpand\itshape\the\toks4 - \noexpand\\}% + \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\\}% } \etocsetstyle{part}{}{} @@ -4329,10 +4547,7 @@ a fully hyperlinked table of contents. The code follows, after the table. {} \etocsetstyle{subsection}{}{} - {\toctabletok\expandafter - {\the\toctabletok &\small\begin{tabular}{@{}p{1cm}@{}p{5cm}r@{}}}% - \PrepareSubsection\appendtotok\toctabletok\toctablepiece - \toctabletok\expandafter{\the\toctabletok\end{tabular}&\\}} + {\PrepareSubsection\appendtotok\toctabletok\toctablepiece} {} \etocsettocstyle @@ -4366,24 +4581,22 @@ a fully hyperlinked table of contents. The code follows, after the table. \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{\etocthelinkedname}% - \toks4 \expandafter{\etocthelinkedpage}% - \edef\toctablepiece{\noexpand\centering\the\toks0 - &\the\toks2 &\noexpand\itshape\the\toks4 \noexpand\\}% + \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\\}% } -\etocsetstyle{part}{}{} - {\PreparePart \appendtotok\toctabletok\toctablepiece}{} -\etocsetstyle{section}{}{} - {\PrepareSection \appendtotok\toctabletok\toctablepiece}{} -\etocsetstyle{subsection}{}{} -% each line does its own tabular, to allow page breaks in the long table - {\toctabletok\expandafter - {\the\toctabletok &\small\begin{tabular}{@{}p{1cm}@{}p{5cm}r@{}}}% - \PrepareSubsection\appendtotok\toctabletok\toctablepiece - \toctabletok\expandafter{\the\toctabletok\end{tabular}&\\}} - {} + +\etocsetstyle{part}{}{}{\PreparePart \appendtotok\toctabletok\toctablepiece}{} + +\etocsetstyle{section}{}{}{\PrepareSection \appendtotok\toctabletok\toctablepiece}{} + +\etocsetstyle{subsection}{}{}{\PrepareSubsection\appendtotok\toctabletok\toctablepiece}{} \etocsettocstyle {\toctabletok{\hypersetup{hidelinks}% @@ -4404,6 +4617,34 @@ a fully hyperlinked table of contents. The code follows, after the table. |hyperref| aware and hopefully |hyperref| compatible! It doesn't matter whether \etoc or |hyperref| is loaded first. +Release |1.07k| adds compatibility with package +|tocloft|:\footnote{\url{http://ctan.org/pkg/tocloft}} steps are +taken to prevent the redefinition of |\tableofcontents| done by +|tocloft| at |\begin{document}|. +% +As long as \etoc is left in compatibility mode the customization done by +|tocloft| will be obeyed, for both the line styles and the TOC title. +One may still benefit from the \emph{depth tags} management by \etoc, +from its |\localtableofcontents|, from its |\label+\ref| mechanism. One +may use |\etocsetstyle| to define via \etoc the layout for one TOC and +then use rather |tocloft| for another one, if |\tableofcontents| follows +\csb{etocstandardlines} and \csb{etocstandarddisplaystyle}. In this +compatibility mode |\etocsetlevel{division unit}{6}| will render +invisible the chosen division level, but exchanging levels is otherwise +not possible. + +\begin{framed} + One should load \etoc \emph{after} \texttt{tocloft}. A warning is + issued if otherwise. +\end{framed} + +Release |1.07k| has also improved the compatibility with the |memoir| +class: its |appendix| level has been made known to \etoc. It is at the +same level as |chapter|, thus the chapter +line style should possibly do a test for some boolean which may be +activated via an instruction added to the |.toc| file, if one needs to +distinguish the two kinds of divisions. + The contents of the |.toc| file (if it already exists) are read into memory by \etoc once, at the time of \csa{usepackage\{etoc\}}. The |.toc| file remains available to other packages for read operations until the location of the first @@ -4627,6 +4868,11 @@ with the time stamp \texttt{\dtxtimestamp}. The package version is \begin{multicols}{2} \begin{jfverbatim} +v1.07k [2014/03/06] + + compatibility with package tocloft; and improved compatibility with + class memoir. Novel TOC example in Overview. + v1.07j [2013/12/03] some issues with the documentation formatting (now two-sided) have been @@ -5184,8 +5430,13 @@ v1.02 [2012/11/18] \def\etocthepage {#1}% \def\etocthelinkedpage {#1}% } +% \end{macrocode} +% |1.07k| corrects a bug here with an extra space before |##1| in +% |\@namedef{etoclink } ##1|. In 99.99\% of use cases however, the +% macro gets redefined at a later stage, thus the bug did not show. +% \begin{macrocode} \def\Etoc@getthepage@hyp #1#2#3#4#5\etoc@ {% - \@namedef{etoclink } ##1{\leavevmode #1{#2}{#3}{##1}#5}% + \@namedef{etoclink }##1{\leavevmode #1{#2}{#3}{##1}#5}% \edef\etocthelink ##1{\noexpand\hyperlink {#3}{##1}}% \def\etocthepage {#4}% \toks@ {#4}% @@ -5429,7 +5680,7 @@ v1.02 [2012/11/18] % \end{macrocode} % |1.07g| suppresses the printing of |--unknown etoc ref: run latex again--| as % sometimes one uses |\localtableofcontents| to prepare something else, and one -% does not want at any output of text at all even in an intermediate run. +% does not want any text output even in intermediate runs. % % Also |1.07g| adds |\etocaftertochook| to help with % |\invisiblelocaltableofcontents| (and then I did |\etocsetnexttocdepth|). @@ -5617,7 +5868,7 @@ v1.02 [2012/11/18] % % \begin{macrocode} \def\etocdefaultlines{\Etoc@standardfalse % -%% `book' in memoir class: +%% `book': \etoc@setstyle{@minustwo} {\addpenalty\@M\etocskipfirstprefix} {\addpenalty\@secpenalty} @@ -5834,11 +6085,19 @@ v1.02 [2012/11/18] \Etoc@next{\end{multicols}}% \addvspace{\etocbelowtocskip}}} % \end{macrocode} +% |1.07k| defines |\Etoc@relax| and |\etocbkgcolorcmd| as |\long|: the user +% manual says to use |\renewcommand\etocbkgcolorcmd|, and an |\ifx| test is used +% in the framed style. It was thus a bug to have non-long definitions before. Or +% I could have said in the user manual to use |\renewcommand*|, or in +% |\etocframedstyle| I should test for the two, or I should pause to try to +% remember about this code and think about it. +% \begin{macrocode} +\def\etocframedmphook{\relax} +\long\def\etocbkgcolorcmd{\relax} +\long\def\Etoc@relax{\relax} +% \end{macrocode} % placeholder for comments % \begin{macrocode} -\long\def\etocframedmphook{\relax} -\def\etocbkgcolorcmd{\relax} -\def\Etoc@relax{\relax} \newbox\etoc@framed@titlebox \newbox\etoc@framed@contentsbox \newcommand*\etocframedstyle[2][\etocdefaultnbcol]{% @@ -6049,6 +6308,11 @@ v1.02 [2012/11/18] {} {\if@twocolumn \aftergroup \twocolumn \onecolumn \fi }} {}% +% \end{macrocode} +% |1.07k|: next line to do as within current |scrartcl 2013/12/19 v3.12| +% KOMA-Script article class. +% \begin{macrocode} + \iftocfeature {toc}{numberline}{\def \nonumberline {\numberline {}}}{}% \tocbasic@listhead {\listoftocname}% \begingroup \expandafter \expandafter \expandafter \endgroup \expandafter @@ -6112,12 +6376,48 @@ v1.02 [2012/11/18] {\renewcommand*\etocfontone{\normalfont\normalsize} \renewcommand*\etocstandarddisplaystyle{\etocscrreprtstyle} \Etoc@redefetocstyle{chapter}}{} +% \end{macrocode} +%|1.07k (2014/03/06)| adds the |appendix| to the list of known levels if class +%|memoir| is detected. +% \begin{macrocode} \@ifclassloaded{memoir} - {\renewcommand*\etocfontone{\normalfont\normalsize} + {\etocsetlevel{appendix}{0}% + \renewcommand*\etocfontone{\normalfont\normalsize} \etocmemoirtoctotocfmt{chapter}{\contentsname}% \renewcommand*\etocstandarddisplaystyle{\etocmemoirstyle} \Etoc@redefetocstyle{chapter}}{} % \end{macrocode} +%|1.07k (2014/03/06)| adds the compatibility with the |tocloft| package; in +% compatibility mode etoc will obey the |tocloft| customisation for the division +% headings as well as for the toc title. +% \begin{macrocode} +\def\etoctocloftstyle {% + \etocsettocstyle + {\@cfttocstart\par\begingroup + \parindent\z@ \parskip\cftparskip \@cftmaketoctitle + \if@cfttocbibind\@cftdobibtoc\fi }% + {\endgroup\@cfttocfinish }% +} +\@ifpackageloaded{tocloft} + {\if@cftnctoc\else + \renewcommand*\etocstandarddisplaystyle{\etoctocloftstyle} + \AtBeginDocument{\let\tableofcontents\etoctableofcontents} + \fi } + {\AtBeginDocument + {\@ifpackageloaded{tocloft} + {\if@cftnctoc\else + \PackageWarning {etoc} + {Package `tocloft' was loaded after `etoc'!^^J% +**** to prevent it from overwriting \protect\tableofcontents, it will be tricked^^J% +**** into believing to have been loaded with option `titles'. For better^^J% +**** compatibility, please load `tocloft' before `etoc'}% + \AtEndDocument{\PackageWarning{etoc} + {Please load `tocloft' /before/ `etoc'!}}\fi + \@cftnctoctrue }% + {}% + }% + } +% \end{macrocode} % placeholder for comments % \begin{macrocode} \def\Etoc@addtocontents #1#2% @@ -6287,7 +6587,7 @@ v1.02 [2012/11/18] Grave accent \` Left brace \{ Vertical bar \| Right brace \} Tilde \~} -\CheckSum{2909} +\CheckSum{2953} \csname check@checksum\endcsname \Finale diff --git a/Master/texmf-dist/source/latex/etoc/etoc.ins b/Master/texmf-dist/source/latex/etoc/etoc.ins index 2921840a645..074957c4e54 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.ins +++ b/Master/texmf-dist/source/latex/etoc/etoc.ins @@ -1,9 +1,9 @@ -\def\jfbpkgname {etoc} \def\jfbpkgdate {2013/12/03} \def\jfbpkgversion {v1.07j} +\def\jfbpkgname {etoc} \def\jfbpkgdate {2014/03/06} \def\jfbpkgversion {v1.07k} \def\jfbpkgdescription {Completely customisable TOCs (jfB)} %% %% Package: etoc -%% Version: 2013/12/03 v1.07j -%% Copyright (C) 2012-2013 by Jean-Francois Burnol <jfbu at free dot fr> +%% Version: 2014/03/06 v1.07k +%% Copyright (C) 2012-2013-2014 by Jean-Francois Burnol <jfbu at free dot fr> %% %% Run tex on this file to extract etoc.sty and etoc.tex from etoc.dtx %% |