diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/README | 11 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/etoc.pdf | bin | 221047 -> 226762 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/etoc/etoc.dtx | 920 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/etoc/etoc.ins | 4 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/etoc/etoc.sty | 213 |
5 files changed, 754 insertions, 394 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/README b/Master/texmf-dist/doc/latex/etoc/README index 94dbc6ebcd4..ed9083cfe48 100644 --- a/Master/texmf-dist/doc/latex/etoc/README +++ b/Master/texmf-dist/doc/latex/etoc/README @@ -1,4 +1,4 @@ -version 1.07d (2013/02/24) +version 1.07e (2013/03/01) Package `etoc' @@ -64,6 +64,15 @@ version 1.07d (2013/02/24) Change log ========== + v1.07e [2013/03/01] + + improvements in the package own line styles with + regards to penalties and vertical spaces. + + addition to the documentation of an example of + a tree-like table of contents (uses tikz). + + v1.07d [2013/02/24] minor code improvements and new documentation diff --git a/Master/texmf-dist/doc/latex/etoc/etoc.pdf b/Master/texmf-dist/doc/latex/etoc/etoc.pdf Binary files differindex 160054fa73a..36504c6e39f 100644 --- a/Master/texmf-dist/doc/latex/etoc/etoc.pdf +++ b/Master/texmf-dist/doc/latex/etoc/etoc.pdf diff --git a/Master/texmf-dist/source/latex/etoc/etoc.dtx b/Master/texmf-dist/source/latex/etoc/etoc.dtx index db36e5fbbc7..aaee5430715 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.dtx +++ b/Master/texmf-dist/source/latex/etoc/etoc.dtx @@ -1,8 +1,8 @@ % -*- coding: iso-latin-1; -*- %<*ins> \def\pkgname{etoc} -\def\pkgdate{2013/02/24} -\def\pkgversion{v1.07d} +\def\pkgdate{2013/03/01} +\def\pkgversion{v1.07e} \def\pkgdescription{easily customizable TOCs (jfB)} %</ins> %% @@ -10,8 +10,8 @@ %% Copyright (C) 2012, 2013 by Jean-Francois Burnol %% %<*none> -\def\lasttimestamp{Time-stamp: <24-02-2013 12:23:39 CET jfb>} -\def\docdate{2013/02/24} +\def\lasttimestamp{Time-stamp: <01-03-2013 15:31:43 CET jfb>} +\def\docdate{2013/03/01} \def\striptimestamp#1 <#2 #3 #4 #5>{#2 at #3 #4} \edef\dtxtimestamp{\expandafter\striptimestamp\lasttimestamp} \ProvidesFile{\pkgname.dtx} @@ -90,20 +90,101 @@ \usepackage[latin1]{inputenc} \usepackage[hscale=0.66,vscale=0.75]{geometry} \pagestyle{headings} -\usepackage{txfonts} + +\makeatletter\let\check@percent\relax\makeatother +\def\MacroFont{\ttfamily\small\baselineskip12pt\relax} + +\usepackage{txfonts} % m'occuper de la taille de txtt: +% au passage je supprime \hyphenchar \font\m@ne + +\DeclareFontFamily{T1}{txtt}{} +\DeclareFontShape{T1}{txtt}{m}{n}{ %medium + <->s*[.96] t1xtt% +}{} +\DeclareFontShape{T1}{txtt}{m}{sc}{ %cap & small cap + <->s*[.96] t1xttsc% +}{} +\DeclareFontShape{T1}{txtt}{m}{sl}{ %slanted + <->s*[.96] t1xttsl% +}{} +\DeclareFontShape{T1}{txtt}{m}{it}{ %italic + <->ssub * txtt/m/sl% +}{} +\DeclareFontShape{T1}{txtt}{m}{ui}{ %unslanted italic + <->ssub * txtt/m/sl% +}{} +\DeclareFontShape{T1}{txtt}{bx}{n}{ %bold extended + <->t1xbtt% +}{} +\DeclareFontShape{T1}{txtt}{bx}{sc}{ %bold extended cap & small cap + <->t1xbttsc% +}{} +\DeclareFontShape{T1}{txtt}{bx}{sl}{ %bold extended slanted + <->t1xbttsl% +}{} +\DeclareFontShape{T1}{txtt}{bx}{it}{ %bold extended italic + <->ssub * txtt/bx/sl% +}{} +\DeclareFontShape{T1}{txtt}{bx}{ui}{ %bold extended unslanted italic + <->ssub * txtt/bx/sl% +}{} +\DeclareFontShape{T1}{txtt}{b}{n}{ %bold + <->ssub * txtt/bx/n% +}{} +\DeclareFontShape{T1}{txtt}{b}{sc}{ %bold cap & small cap + <->ssub * txtt/bx/sc% +}{} +\DeclareFontShape{T1}{txtt}{b}{sl}{ %bold slanted + <->ssub * txtt/bx/sl% +}{} +\DeclareFontShape{T1}{txtt}{b}{it}{ %bold italic + <->ssub * txtt/bx/it% +}{} +\DeclareFontShape{T1}{txtt}{b}{ui}{ %bold unslanted italic + <->ssub * txtt/bx/ui% +}{} + \usepackage{xspace} \usepackage{xcolor} \usepackage{graphicx} \usepackage{enumitem} +% ok il faut ceci pour dvipdfmx: +%\def\pgfsysdriver{pgfsys-dvipdfm.def} + +\usepackage{tikz} +\usepackage{tikz-qtree} + +% I have tried this (2013/03/01) to fix the problem with hyperlinks +% in the produced tree: +% \usepackage{hopgf} +% (downloaded yesterday from a link found on tex-stackex) +% but it still does not work. Error messages from a run of dvipdfmx: +% ** WARNING ** Annotation out of page boundary. +% ** WARNING ** Current page's MediaBox: [0 0 595.276 841.89] +% ** WARNING ** Annotation: [94.3997 1200.33 146.512 1209.98] +% ** WARNING ** Maybe incorrect paper size specified. + +% cependant j'ai un autre problème avec dvipdfmx qui donne aussi: +% ** WARNING ** Obsolete four arguments of "endchar" will be used for Type 1 +% "seac" operator. +% ce qui semble lié à txtt, même après avoir retiré mon inclusion modifiée de +% t1txtt.fd. + +% J'ai mis un moment à comprendre que la raison était que j'ai rajouté des +% commentaires en français dans mes blocs verbatim, ce qui enclenche le problème +% avec dvipdfmx et les caractères diacritiques. + +% le plus simple serait peut-être donc de changer de police pour le monotype. +% non le plus simple est de retirer (les accents de) mes commentaires en +% français. OK, c'était bien cela le problème. + \definecolor{joli}{RGB}{225,95,0} \definecolor{JOLI}{RGB}{225,95,0} \definecolor{BLUE}{RGB}{0,0,255} \colorlet{niceone}{green!35!blue!75} -\makeatletter\let\check@percent\relax\makeatother -\def\MacroFont{\ttfamily\small\baselineskip12pt\relax} \usepackage[english]{babel} \AtBeginDocument{ @@ -115,8 +196,8 @@ pdfencoding=pdfdoc,bookmarks=true]{hyperref} \hypersetup{% -linktoc=all,% why is the important relatively recent stuff -bookmarksdepth=3,% in a hard to find README? +linktoc=all,% why is the important stuff +bookmarksdepth=3,% in a *hard* to find README? breaklinks=true,% hidelinks,% pdfauthor={Jean-Fran\c cois Burnol},% @@ -133,6 +214,7 @@ pdfpagemode=UseOutlines} % \def\href#1#2{{#2}} % \makeatother +% en fait je charge directement txtt en supprimant \hyphenchar\font\m@ne \DeclareRobustCommand\csa[1]{{\ttfamily\hyphenchar\font45\char`\\#1}} \DeclareRobustCommand\csb[1]{{% \color{blue}\ttfamily\hyphenchar\font45\char`\\#1}} @@ -145,7 +227,7 @@ pdfpagemode=UseOutlines} \newcommand\staritb[1]{\csb{#1\lowast}} -\usepackage{etoc} % does \RequirePackage{multicol} +\usepackage{etoc} % executes \RequirePackage{multicol} %-------- % add-ons for the new section `surprising uses of etoc' (2013/01/24) \newcounter{visibletoc} @@ -161,7 +243,7 @@ pdfpagemode=UseOutlines} \etocsetlevel{dummychapter}{6} \etocsetlevel{dummysection}{6} %-------- -% add-on for the documentation of 2013/02/21: +% for "Another compatibility mode" (2013/02/21): \makeatletter \newcommand*{\MyQuasiStandardTOC}[1]{% \begingroup @@ -353,6 +435,14 @@ compatible with the |article|, |book|, |report|, |scrartcl|, \begin{multicols}{2} \begin{jfverbatim} +v1.07e [2013/03/01] + + improvements in the package own line styles with + regards to penalties and vertical spaces. + + addition to the documentation of an example of + a tree-like table of contents (uses tikz). + v1.07d [2013/02/24] minor code improvements and new documentation @@ -384,7 +474,7 @@ v1.07 [2013/01/29] addition to the tables of contents. -~columnbreak v1.06 [2012/12/07] +v1.06 [2012/12/07] the standard macros \l@section etc... are modified only during the calls to \tableofcontents; they can thus be @@ -423,15 +513,17 @@ v1.02 [2012/11/18] \endgroup \setcounter{tocdepth}{3} - \etoctoclines \etocmarkboth\contentsname -\etocmulticolstyle{\noindent\bfseries\Large - \leaders\hrule height1pt\hfill - \MakeUppercase{Table of Contents}} - - -\tableofcontents \label{toc:main} +\etocmulticolstyle[1] + {\noindent\bfseries\Large + \leaders\hrule height1pt\hfill + \MakeUppercase{Table of Contents}} +\begingroup + \etocsetlevel{subsection}{3} + \etocsetlevel{subsubsection}{6} + \tableofcontents \label{toc:main} +\endgroup \part{Overview}\label{part:one} @@ -939,7 +1031,7 @@ signification. \subsection{The TOC of TOCs} \begingroup -\etocnopar +\etocinline \etocsetlevel{part}{1} \etocsetlevel{chapter}{1} \etocsetlevel{visibletoc}{0} @@ -986,19 +1078,22 @@ it here we just wrote:\footnote{click the `\protect\thevisibletoc' would target the area just after the title). So, rather than including |\refstepcounter{visibletoc}| inside \csa{etocaftertitlehook}, we just put there - |\stepcounter{visibletoc}| followed by the package command - \csb{etoctoccontentsline}\marg{level\_name}\marg{name}. This - command has the same effect as:\\ + |\stepcounter{visibletoc}| followed by the command + \csb{etoctoccontentsline}|{visibletoc}{\thevisibletoc}|. This \etoc + command \csb{etoctoccontentsline}\marg{level\_name}\marg{name} has the same + effect as:\\ \hbox to \linewidth{| |% |\addcontentsline{toc}|\marg{level\_name}\marg{name}\hss} - but its usefulness is to circumvent the automatic creation - of bookmarks by the |hyperref| package, as they don't make - much sense here (and elicit a complaint + 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'). The package provides a starred variant \staritb{etoctoccontentsline}, which will allow the creation - of bookmarks but has a third mandatory argument which is the + of bookmarks and has a third mandatory argument which is the level to be used by these bookmarks. Finally, the preamble of the document did @@ -1010,15 +1105,14 @@ it here we just wrote:\footnote{click the `\protect\thevisibletoc' \csa{etocsetstyle} command. So there is no need to worry that something could go wrong. - Then, only here we have set |\etocsetlevel{visibletoc}{0}|. - And to display only this kind of entries we assign - temporarily to |part| and |chapter| level |1| (or anything - higher than zero) and set |tocdepth| to the value |0|. - We also did \csa{etocsetstyle\{visibletoc\}\{\string\etocskipfirstprefix\}\{, \}\{\string\etocname\}\{\}} which - defines an inline display with the comma as separator. Finally, as - \etoc issues |\par| automatically by default just before - typesetting a table of contents, we had to use the command - \csb{etocnopar} to turn off this behavior. + Then, only here we have set |\etocsetlevel{visibletoc}{0}|. And to display + only this kind of entries we assign temporarily to |part| and |chapter| level + |1| (or anything higher than zero) and set |tocdepth| to the value |0|. We + also did \csa{etocsetstyle\{visibletoc\}\{\string\etocskipfirstprefix\}\{, + \}\{\string\etocname\}\{\}} which defines an inline display with the comma + as separator. Finally, as \etoc issues |\par| automatically by default just + before typesetting a table of contents, we used the command \csb{etocinline} + (also known as \cs{etocnopar}) which turns off this behavior. Here are the implementation details: @@ -1034,7 +1128,7 @@ Here are the implementation details: . . . document body \subsection{Surprising uses of etoc} \begingroup - \etocnopar + \etocinline \etocsetlevel{part}{1} \etocsetlevel{chapter}{1} \etocsetlevel{visibletoc}{0} @@ -1527,8 +1621,196 @@ entries. Also, a fancier layout has been commented out. +\subsection{The TOC as a tree}\label{tocastree} + +Using |tikz| and the package +|tikz-qtree|\footnote{\url{http://ctan.org/pkg/pgf}, resp. \url{http://ctan.org/pkg/tikz-qtree}} we shall display the +table of contents of this part as a tree. The technique (this whole subsection +perhaps should have double dangerous-bend signs) is to use the \etoc modified +command \csa{tableofcontents} not for typesetting, but to prepare a +macro, or rather here a token list with name \csa{treetok}, with all the +instructions to be executed lated. Putting \csa{etocnumber} or \csa{etocname} +commands in \csa{treetok} would be of no use: to which number or name would they +refer to, in such a delayed execution? Rather the \emph{contents} of +\csa{etocthenumber} or \csa{etocthename} are added with suitable decoration to +\csa{treetok}: the \etoc line styles are modified to expand once +\csa{etocthename} (for example) at the time of the execution and then add the +outcome to \csa{treetok} for later execution in a |tikzpicture|. + +It is perfectly possible to do the same with the |hyperref| link: rather than +trying to do things with \csa{etoclink} (which is a robust command, but one +could access the contents of |\csname etoclink \endcsname|),\footnote{warning: +it contains \csa{Hy@tocdestname} \emph{unexpanded}.} I mention +to the advanced users that the simpler method is to store +|\hyperlink{A}{B}| in \csa{treetok} where |A| stands for the \emph{expansion} of +\cs{Hy@tocdestname}, +and |B| stands for the (one time) \emph{expansion} of \csa{etocthename}. + +This being said, here in our use of |tikz-qtree| we have been confronted with +the problem that the hyperlinks, even if correctly added to the \csa{treetok} +token list, appeared in the final document in (most of the time) completely +wrong locations.\footnote{|dvipdfmx| gives me errors:\quad +|** WARNING ** Annotation out of page boundary.|\quad +|Current page's MediaBox: [0 0 595.276 841.89]|\quad +|Annotation: [94.3997 1200.33 146.512 1209.98]|\\ +Using |hopgf.sty [2012/12/16 v1.1]| of \textsc{Heiko Oberdiek} did not fix it. + I read on the internet that there is some problem with |pgf| +with regards to hyperlinks, but I don't know if this is the same issue here or +something specific to the \cs{pgftree} TikZ command, or if the way +I tried to put the links in the nodes was just completely wrong (as this is my +first ever use of TikZ).} + +\makeatletter + +\newtoks\treetok +\newtoks\tmptok + +\begingroup + +\def\appendtotok #1#2{% #1=token list, #2=macro, expands once #2 + #1\expandafter\expandafter\expandafter + {\expandafter\the\expandafter #1#2}} + +% malheureusement ajouter un \hyperlink ne fonctionne pas, ou +% fonctionne aléatoirement. La façon d'insérer +% \hyperlink{\Hy@tocdestname}{\the\toks0 } +% ici est perfectible, c'est juste un rapide ajout que je fais +% pour essayer encore une fois, et confirmer que \usepackage{hopgf} +% n'améliore pas les choses: +% \def\PrepareSectionNode{% +% \tmptok {\centering\bfseries\hyperlink}% +% \toks0 \expandafter{\etocthename}% +% \edef\tmp{{\Hy@tocdestname}{\the\toks0 }}% +% \appendtotok\tmptok\tmp +% \edef\qtreenode {[.{\noexpand\parbox{2cm}{\the\tmptok}} }% +% \show\qtreenode +% } +% voici un message d'erreur lorsque l'on fait ensuite (par exemple) +% dvipdfmx: +% ** WARNING ** Annotation out of page boundary. +% ** WARNING ** Current page's MediaBox: [0 0 595.276 841.89] +% ** WARNING ** Annotation: [94.3997 1200.33 146.512 1209.98] +% Et ceci en ayant utilisé \usepackage{hopgf} +% [2012/12/16 v1.1 Some fixes for pgf (HO)] + +\def\PrepareSectionNode{% + \tmptok {\centering\bfseries}% + \appendtotok\tmptok\etocthename + \edef\qtreenode {[.{\noexpand\parbox{2cm}{\the\tmptok}} }% + \show\qtreenode +} + +\def\PrepareSubsectionNode{% + \tmptok {\raggedright}% + \appendtotok\tmptok\etocthename + \edef\qtreenode{[.{\noexpand\parbox{4cm}{\the\tmptok}} }% +} + +\etocsetstyle{section} + {\treetok{\Tree [.Overview }\etocskipfirstprefix} + {\appendtotok\treetok{] }} % ] not active! + {\PrepareSectionNode \appendtotok\treetok\qtreenode} + {\appendtotok\treetok{] ]}\global\treetok\expandafter{\the\treetok}} + + +\etocsetstyle{subsection} + {\etocskipfirstprefix} + {\appendtotok\treetok{] }} + {\PrepareSubsectionNode \appendtotok\treetok\qtreenode} + {\appendtotok\treetok{] }} + +\setcounter{tocdepth}{2} +\etocsettocstyle{}{} +\tableofcontents \ref{toc:partone} + +\endgroup + +\vfil +\begin{tikzpicture}[grow'=right] +\tikzset{sibling distance=1ex, + level 1/.style={level distance=4cm}, + level 2/.style={level distance=6cm}, + every level 0 node/.style={draw,fill=cyan!5,inner sep=6pt}, + every level 1 node/.style={draw,circle,thick,fill=blue!5}, + every level 2 node/.style={draw,thick,fill=red!5}, + edge from parent/.style= {% + draw, thick, color=teal, + edge from parent path= + {[dashed](\tikzparentnode.east) -- (\tikzchildnode.west)}} + } +\the\treetok +\end{tikzpicture} +\vfil + +As this whole thing is with double dangerous-bend signs, I shall now include the +code used, with not much commenting: + +\begingroup +\def\MacroFont{\small\ttfamily\baselineskip10pt\relax} +\begin{verbatim} +\makeatletter +\newtoks\treetok \newtoks\tmptok + +\begingroup +\def\appendtotok #1#2{% #1=token list, #2=macro, expands once #2 + #1\expandafter\expandafter\expandafter + {\expandafter\the\expandafter #1#2}} + +\def\PrepareSectionNode{% + \tmptok {\centering\bfseries}% + \appendtotok\tmptok\etocthename + \edef\qtreenode {[.{\noexpand\parbox{2cm}{\the\tmptok}} }% +} + +\def\PrepareSubsectionNode{% + \tmptok {\raggedright}% + \appendtotok\tmptok\etocthename + \edef\qtreenode{[.{\noexpand\parbox{4cm}{\the\tmptok}} }% +} + +% See the tikz-qtree documentation for the syntax of trees. +% (the space at the end of \qtreenode is important) +% The whole command is constructed inside the token list \treetok + +\etocsetstyle{section} + {\treetok{\Tree [.Overview }\etocskipfirstprefix} + {\appendtotok\treetok{] }} % ] not active! + {\PrepareSectionNode \appendtotok\treetok\qtreenode} + {\appendtotok\treetok{] ]}\global\treetok\expandafter{\the\treetok}} + +\etocsetstyle{subsection} + {\etocskipfirstprefix} + {\appendtotok\treetok{] }} + {\PrepareSubsectionNode \appendtotok\treetok\qtreenode} + {\appendtotok\treetok{] }} + +\setcounter{tocdepth}{2} +\etocsettocstyle{}{} +% the whole effect of \tableofcontents will be to fill \treetok +% according to the syntax expected by tikz-qtree. +% This is always in a group, so we used \global in the section-finish code. +% Also, there is a \par, but we are already in vertical mode. +\tableofcontents \ref{toc:partone} +\endgroup + +% Time now to display the tree (see tikz-qtree documentation) +\begin{tikzpicture}[grow'=right] +\tikzset{sibling distance=1ex, + level 1/.style={level distance=4cm}, + level 2/.style={level distance=6cm}, + every level 0 node/.style={draw,fill=cyan!5,inner sep=6pt}, + every level 1 node/.style={circle,draw,thick,fill=blue!5}, + every level 2 node/.style={draw,thick,fill=red!5}, + edge from parent/.style= {% + draw, thick, color=teal, + edge from parent path= + {[dashed](\tikzparentnode.east) -- (\tikzchildnode.west)}} + } +\the\treetok +\end{tikzpicture} +\end{verbatim} +\endgroup -%\clearpage \part{Package commands for line styles} \setcounter{tocdepth}{3} @@ -1765,7 +2047,7 @@ The command \csa{etoclink} is protected. -\subsection{The \csbhyp{etocsetlevel} command} +\section{The \csbhyp{etocsetlevel} command} As already explained in the section \ref{sec:surprising}, one can inform \etoc of a level to associate to a given sectioning @@ -1798,157 +2080,100 @@ does: \etocsetlevel{paragraph}{4} \etocsetlevel{subparagraph}{5} \end{verbatim} -Its own line styles are activated by \csa{etocdefaultlines}. They +\etoc own custom styles are activated by \csa{etocdefaultlines}. They are illustrated by the main table of contents of this -document. The level assignments can be modified at anytime, as has been -explained in the section \ref{sec:surprising}. +document. +These level assignments can be modified at anytime: see the +section\ref{sec:surprising} for various applications of this technique. As one +further example, let's mention here that the \hyperref[toc:main]{main table of +contents} of this document was typeset following these instructions: +\begin{verbatim} +\setcounter{tocdepth}{3} +\etocdefaultlines % use the package default line styles. At this early stage in + % the document they had not yet been modified by \etocsetstyle + % commands, so \etoctoclines could have been used, too. +\etocmarkboth\contentsname +\etocmulticolstyle[1] % one-column display + {\noindent\bfseries\Large + \leaders\hrule height1pt\hfill + \MakeUppercase{Table of Contents}} +\begingroup % use a group to limit the scope of the + \etocsetlevel{subsection}{3} % subsection level change. + \etocsetlevel{subsubsection}{4} % anything > tocdepth=3. + \tableofcontents \label{toc:main} +\endgroup +\end{verbatim} +In this way, the subsections used the style originally designed for +subsubsections, the subsubsections were not printed. Without this modification, +the appearance would have been very different: the package line styles were +targeted to be employed in documents with many many sub-sub-sections, in a +two-column layout, giving thus a more compact output that what is achieved by +the default \LaTeX{} table of contents. But here, we have few sub-sub-sections +and it is more interesting to drop them and print in a visually different manner +sections and subsections. -\color{red!50} -\addtocontents{toc}{\string\color{red!50}} + +\section{Scope of commands added to + the \texorpdfstring{\texttt{.toc}}{.toc} file} \begingroup -\footnotesize +\small -\subsubsection{This is a (pale) red subsubsection for illustrative purposes} +\subsection{Testing the scope} + +Let us switch to the color red, and also add this command to the |.toc| file: -Just before this subsubsection we did: -\begin{verbatim} \color{red!50} \addtocontents{toc}{\string\color{red!50}} -\end{verbatim} -The title here would -be red in the |article| class, but is black in the |scrartcl| -class. In both classes the corresponding entry in the main -table of contents at the beginning of this document is red; it -is not red in the table of contents at the beginning of this -second document part. The reason is that the \meta{finish} -code for the subsubsection level closed a group; the -definition was:\topsep0pt\partopsep0pt -\def\MacroFont{\footnotesize\ttfamily}% -\begin{verbatim} - \etocsetstyle{subsubsection} - {\par\nobreak\begingroup\normalfont - \footnotesize\itshape\etocskipfirstprefix} - {\allowbreak\,--\,} - {\etocname} - {.\hfil\par\endgroup\pagebreak[3]} <--- here is the \endgroup -\end{verbatim} -This illustrates the discussion from subsection \ref{ssec:limitations}. -The default package line styles -do not contain group opening and closing instructions, so the -influence (within TOCs such as the main one in this document) -of the added line in the |.toc| file will propagate until -it is cancelled by another explicit such command inserted in -the |.toc| file. - -\section{Am I also red?} - -Well, actually no in this |scrartcl| class but I assure you I was in the -|article| class!\topsep0pt\partopsep0pt +\def\MacroFont{\footnotesize\ttfamily} \begin{verbatim} - \normalcolor - \addtocontents{toc}{\string\normalcolor} + \color{red!50} % changing text color + \addtocontents{toc}{\string\color{red!50}} % and also in the .toc file \end{verbatim} -\endgroup - - -\normalcolor -\addtocontents{toc}{\string\normalcolor} - -Back to black. Note that this scope problem arises in real -life in a multi-lingual document, as the |babel| package -writes to the |.toc| file the language changes occurring in -the document. There is no easy general solution\footnote{one - can insert by hand the language changes in each concerned - sectioning command.} to this, but it will probably -concern only a minority of cases. Again, the line styles -defined by \etoc do not use groups. - - -% I don't have much to say here. I just added an unnumbered -% section, and made it appear in the |.toc| file. - -% \begin{verbatim} -% \section*{An unnumbered section} -% \addcontentsline{toc}{section}{An unnumbered section} -% \end{verbatim} - - -\section{A comparison} -The \hyperref[toc:main]{main table of contents} was done in -the \etoc style. Let us issue here again two \toc commands, -one with the document class style (with some special -centered title in place of the standard Contents heading) and -the other one with the style we defined in the previous part -on the basis of enumerate environments. +\subsection{This is a (pale) red subsection for illustrative purposes} -\begin{verbatim} -\setcounter{tocdepth}{4} -\end{verbatim} +Actually, this title here was printed black, due to the way the |scrartcl| class +works (it would have been red in the |article| class), but we are more +interested in how it looks in the tables of contents: it does appear red in the +\hyperref[toc:main]{\color{niceone}{main table of contents}} at the beginning of +this document, and also in the \hyperref[toc:a]{\color{niceone}{table of +contents for this part}}. Both entries obey as expected the +|\color{red!50}| command inserted in the |.toc| file. -\setcounter{secnumdepth}{4} -\setcounter{tocdepth}{4} +But let us now close this subsection and start a section. -Let us use the standard formatting of entries, as is -provided by the document class, and a two-column layout: -\begin{verbatim} -\etocstandardlines -\etocruledstyle{% 2 is the default number of columns - \renewcommand{\etoctoprule}{\hrule height0pt}% - \normalfont\normalsize\rmfamily\itshape - \parbox{.8\linewidth}{\centering - This is the global table of contents with standard - (to the {\ttfamily scrartcl} class) entries - (and on two columns). Contrarily to - \hyperref[toc:test]{\color{niceone}the next TOC} - it contains paragraph entries.}} -\tableofcontents -\end{verbatim} -\etocstandardlines +\section{Am I also red?} -\etocruledstyle{% -\renewcommand{\etoctoprule}{\hrule height0pt}% -\normalfont\normalsize\rmfamily\itshape -\parbox{.8\linewidth}{\centering - This is the global table of contents with standard - (to the {\ttfamily scrartcl} class) entries - (and on two columns). Contrarily to - \hyperref[toc:test]{\color{niceone}the next TOC} it - contains paragraph entries.}} +The question is about how it appears in the tables of contents: the answer is +that, yes it is red in the \hyperref[toc:main]{\color{niceone}main TOC}, and no +it is not red in the \hyperref[toc:a]{\color{niceone}local TOC for this part}. +The reason is that the \meta{finish} code for the subsection level closed a +group, as it used |\end{enumerate}|. -% \clearpage +This illustrates the discussion from \autoref{ssec:limitations}. -\tableofcontents +The default package line styles do not contain group opening and closing +instructions: the influence of a command added to the |.toc| file will propagate +until cancelled by another explicit such command inserted in the |.toc| +file. -We then switch to our set-up from the previous part and add to it: \begin{verbatim} -\etocsetstyle{part} -{\begin{enumerate}[label=\etocnumber,leftmargin=1.5em]} -{\etocfontminusone\item} -{\etocname} -{\end{enumerate}} -\tableofcontents + \normalcolor + \addtocontents{toc}{\string\normalcolor} \end{verbatim} +\endgroup +\normalcolor +\addtocontents{toc}{\string\normalcolor} -\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape - \fbox{\parbox{.8\linewidth}{This is the global table of - contents using quickly defined (and easily improvable) - enumerate environments for part, section and subsection, - and an ad hoc in-line italic style for subsubsection.}}} - -\etocsetstyle{part} -{\begin{enumerate}[label=\etocnumber,leftmargin=1.5em]} -{\etocfontminusone\item} -{\etocname} -{\end{enumerate}} - -\tableofcontents \label{toc:test} \ref{toc:main} +Back to black. Note that this scope problem arises in real life in a +multi-lingual document, as the |babel| package writes to the |.toc| file the +language changes occurring in the document. \part{Package commands for toc display styles} @@ -2132,7 +2357,7 @@ environment and automatically adds it to close the heading, before the vertical skip of value \csa{etocinnertopsep}).\footnote{this command \csa{etocoldpar} (= working \csa{par} in the argument to \csa{etocmulticolstyle}) is -not related to the switch \csa{etocnopar} whose purpose is to +not related to the switch \csa{etocinline} whose purpose is to tell \etoc not to do a \csa{par} before the table of contents.} The command \csb{etocoldpar} can also be used explicitely in the mandatory argument to @@ -2255,14 +2480,17 @@ We now opt for a ``framed'' style, using the package default line styles and some colors added. % \clearpage - +\begingroup +\def\MacroFont{\footnotesize\ttfamily}% +\begin{verbatim} \etocdefaultlines -\begingroup +\begingroup % we use a group to limit the scope of the next commands \renewcommand{\etoccolumnsep}{2em} \renewcommand{\etocinnerleftsep}{1.5em} \renewcommand{\etocinnerrightsep}{1.5em} % specify a background color for the toc contents \renewcommand{\etocbkgcolorcmd}{\color{yellow!10}} +%\renewcommand{\etocbkgcolorcmd}{\relax} % set up the top and bottom rules \renewcommand{\etoctoprule}{\hrule height 1pt} \renewcommand{\etoctoprulecolorcmd}{\color{red!25}} @@ -2282,20 +2510,19 @@ line styles and some colors added. in a frame, it has to be small enough to fit on the current page. It has the label |toc:b|.}}} % set up a label for future (or earlier...) reference +\setcounter{tocdepth}{3} \tableofcontents \label{toc:b} \ref{toc:globalcmds} \endgroup +\end{verbatim} +\endgroup -\begingroup -\def\MacroFont{\footnotesize\ttfamily}% -\begin{verbatim} \etocdefaultlines -\begingroup % we use a group to limit the scope of the next commands +\begingroup \renewcommand{\etoccolumnsep}{2em} \renewcommand{\etocinnerleftsep}{1.5em} \renewcommand{\etocinnerrightsep}{1.5em} % specify a background color for the toc contents \renewcommand{\etocbkgcolorcmd}{\color{yellow!10}} -%\renewcommand{\etocbkgcolorcmd}{\relax} % set up the top and bottom rules \renewcommand{\etoctoprule}{\hrule height 1pt} \renewcommand{\etoctoprulecolorcmd}{\color{red!25}} @@ -2315,11 +2542,9 @@ line styles and some colors added. in a frame, it has to be small enough to fit on the current page. It has the label |toc:b|.}}} % set up a label for future (or earlier...) reference -\setcounter{tocdepth}{3} \tableofcontents \label{toc:b} \ref{toc:globalcmds} \endgroup -\end{verbatim} -\endgroup + \subsection{A (crazy) inline display} @@ -2328,8 +2553,8 @@ contents of this entire document. We will typeset the subsections as footnotes... This kind of style is suitable for a hyperlinked document, not for print! -\vfil - +Here is the code which will be used: +\begin{verbatim} \begingroup \setcounter{tocdepth}{3} \newsavebox{\forsubsections} @@ -2345,11 +2570,11 @@ document, not for print! \etocsettocstyle{Here is the inline table of contents. }{.\par} \tableofcontents \endgroup +\end{verbatim} -\vfil -\clearpage And the code which was used: -\begin{verbatim} +%\clearpage + \begingroup \setcounter{tocdepth}{3} \newsavebox{\forsubsections} @@ -2365,9 +2590,11 @@ document, not for print! \etocsettocstyle{Here is the inline table of contents. }{.\par} \tableofcontents \endgroup -\end{verbatim} + +\clearpage + \part{Using and customizing \etoc} \label{part:custom} @@ -2464,7 +2691,86 @@ 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. -\subsection{An example} + +\subsection{The package default line styles: \csbhyp{etocdefaultlines}} + + +Activating the use of the package default line styles\footnote{they were written + at a very early stage in the development of the package, and version |1.07e| + has, among other things, modified the previous unsatisfactory use of penalties + and vertical spacing commands. This will cause differences to + documents having been compiled with earlier versions, apologies for that.} 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. + +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 +sub-sub-section inline style. + +Let us, to the contrary, typeset now this main table of contents as if the +document had been done with a class having the \csa{chapter} command: we will +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. + + +\begin{verbatim} +\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape + \fbox{\parbox{.6\linewidth}{ + \leftskip 0pt plus .5fil + \rightskip 0pt plus -.5fil + \parfillskip 0pt plus 1fil This is the global table of + contents on two columns, using \etoc default line styles, but with + sections + being printed as chapters, and subsections as sections. + }}} +\etocdefaultlines +\setcounter{tocdepth}{1} +\begingroup +\etocsetlevel{section}{0} +\etocsetlevel{subsection}{1} +\renewcommand*{\etocfontone}{\normalfont \normalsize} +\tableofcontents +\endgroup +\end{verbatim} + +\etocruledstyle[2]{\normalfont\normalsize\rmfamily\itshape + \fbox{\parbox{.6\linewidth}{ + \leftskip 0pt plus .5fil + \rightskip 0pt plus -.5fil + \parfillskip 0pt plus 1fil This is the global table of + contents on two columns, using \etoc default line styles, but with + sections + being printed as chapters, and subsections as sections. + }}} + +\etocdefaultlines +\setcounter{tocdepth}{1} + +\begingroup +\etocsetlevel{section}{0} +\etocsetlevel{subsection}{1} +\renewcommand*{\etocfontone}{\normalfont \normalsize} + +\tableofcontents +\endgroup + +\subsection{One more example TOC layout} I got motivated by a @@ -2554,7 +2860,10 @@ the frame. The coding is a bit involved\footnote{and reveals the author's preference for the \TeX{} syntax...} as it does not use any additional -package. A better solution would be to use some package to set +package. Also, it was written at some early stage and I have not revised it +since. + +A better solution would be to use some package to set up a background color possibly extending accross pages, as the framed style (which we used to get this background color) can only deal with material short enough to fit on one @@ -2647,7 +2956,6 @@ use or not colors is left to the user. We will simply list the relevant commands as defined in the package. Customizing them goes through suitable \csa{renewcommand}s: - \begin{verbatim} \newcommand*\etocfontminustwo{\normalfont \LARGE \bfseries} \newcommand*\etocfontminusone{\normalfont \large \bfseries} @@ -2660,7 +2968,8 @@ package. Customizing them goes through suitable \newcommand*\etocsepminusone{4ex plus .5ex minus .5ex} \newcommand*\etocsepzero{2.5ex plus .4ex minus .4ex} \newcommand*\etocsepone{1.5ex plus .3ex minus .3ex} -\newcommand*\etocseptwo{1ex plus .15ex minus .15ex} +%%\newcommand*\etocseptwo{1ex \@plus .15ex \@minus .15ex} % modified in 1.07e +\newcommand*\etocseptwo{.5ex plus .1ex minus .1ex} \newcommand*\etocsepthree{.25ex plus .05ex minus .05ex} \newcommand*\etocminustwoleftmargin{1.5em plus 0.5fil} @@ -2674,13 +2983,12 @@ package. Customizing them goes through suitable \newcommand*\etocbaselinespreadone{1} \newcommand*\etocbaselinespreadtwo{1} \newcommand*\etocbaselinespreadthree{.9} - \newcommand*\etoctoclineleaders -{\hbox{\normalfont\normalsize\hbox to 2ex {\hss.\hss}}} - + {\hbox{\normalfont\normalsize\hbox to 2ex {\hss.\hss}}} \newcommand*\etocabbrevpagename{p.~} -\newcommand*\etocpartname{\partname} -\newcommand*\etocbookname{Book} +\newcommand*\etocpartname{\partname} % utilisateurs de frenchb: attention + % car donne "partie" sans majuscule. +\newcommand*\etocbookname{Book} % to be modified according to language \end{verbatim} No customizing of the standard line styles is possible from @@ -2777,6 +3085,8 @@ used as (horizontal) leaders but as objects of a given specified width. Note that \emph{only} the Plain \TeX{} syntax for rules is accepted here. + +%\clearpage \part{Tips} \section{... and tricks} @@ -2889,7 +3199,7 @@ arguments. The macros \csa{etocname}, \csa{etocnumber}, and that the \emph{linktoc=all} option of |hyperref| tells it to put a link also in the page number corresponding to a given toc entry). For example, the tables of contents of the present document are -fully linked. +fully linked.\footnote{except the \hyperref[tocastree]{tree TOC} ...} It is possible to customize (using package |tocloft| for example) throughout the document the macros \csa{l@section}, @@ -3012,7 +3322,8 @@ release. % \begin{macrocode} \newtoks\Etoc@toctoks \def\Etoc@par{\par} -\newcommand*{\etocnopar}{\def\Etoc@par{}} +\newcommand*{\etocinline}{\def\Etoc@par{}} +\let\etocnopar\etocinline \newif\ifEtoc@jj % book \newif\ifEtoc@j % part \newif\ifEtoc@ % chapter @@ -3653,7 +3964,8 @@ release. \newcommand*\etocsepminusone{4ex \@plus .5ex \@minus .5ex} \newcommand*\etocsepzero{2.5ex \@plus .4ex \@minus .4ex} \newcommand*\etocsepone{1.5ex \@plus .3ex \@minus .3ex} -\newcommand*\etocseptwo{1ex \@plus .15ex \@minus .15ex} +%%\newcommand*\etocseptwo{1ex \@plus .15ex \@minus .15ex} % modified in 1.07e +\newcommand*\etocseptwo{.5ex \@plus .1ex \@minus .1ex} \newcommand*\etocsepthree{.25ex \@plus .05ex \@minus .05ex} % \end{macrocode} % placeholder for comments @@ -3683,121 +3995,137 @@ release. % \begin{macrocode} \def\etocdefaultlines{\Etoc@standardfalse % \end{macrocode} -% placeholder for comments +% Version |1.07e| has rewritten entirely the stuff related to penalties and +% \csa{addvspace}, as this was not satisfactory in the earlier versions, which +% were written at a early stage in the development of the package. % \begin{macrocode} -\etoc@setstyle{@minustwo}{\etocskipfirstprefix}{\pagebreak[3]} -{\begingroup \etocfontminustwo - \addvspace{\etocsepminustwo}% - \parindent \z@ - \leftskip \etocminustwoleftmargin - \rightskip \etocminustworightmargin - \parfillskip \@flushglue - \vbox{\etocifnumbered{\etocbookname~\etocnumber:~}{}\etocname - \baselineskip\etocbaselinespreadminustwo\baselineskip\par}% - \addvspace{\etocsepminusone}\nobreak -\endgroup} -{}% -\etoc@setstyle{@minusone}{\etocskipfirstprefix}{\pagebreak[3]} -{\begingroup \etocfontminusone - \addvspace{\etocsepminusone}% - \parindent \z@ - \leftskip \etocminusoneleftmargin - \rightskip \etocminusonerightmargin - \parfillskip \@flushglue - \vbox{\etocpartname\etocifnumbered{ \etocnumber.~}{ }\etocname - \baselineskip\etocbaselinespreadminusone\baselineskip\par}% - \addvspace{\etocsepzero}\nobreak -\endgroup} -{}% +%% `book' in memoir class: +\etoc@setstyle{@minustwo} + {\addpenalty\@M\etocskipfirstprefix} + {\addpenalty\@secpenalty} + {\begingroup + \etocfontminustwo + \addvspace{\etocsepminustwo}% + \parindent \z@ + \leftskip \etocminustwoleftmargin + \rightskip \etocminustworightmargin + \parfillskip \@flushglue + \vbox{\etocifnumbered{\etocbookname\enspace\etocnumber:\quad}{}\etocname + \baselineskip\etocbaselinespreadminustwo\baselineskip + \par}% + \addpenalty\@M\addvspace{\etocsepminusone}% + \endgroup} + {}% +%% `part': +\etoc@setstyle{@minusone} + {\addpenalty\@M\etocskipfirstprefix} + {\addpenalty\@secpenalty} + {\begingroup + \etocfontminusone + \addvspace{\etocsepminusone}% + \parindent \z@ + \leftskip \etocminusoneleftmargin + \rightskip \etocminusonerightmargin + \parfillskip \@flushglue + \vbox{\etocifnumbered{\etocpartname\enspace\etocnumber.\quad}{}\etocname + \baselineskip\etocbaselinespreadminusone\baselineskip + \par}% + \addpenalty\@M\addvspace{\etocsepzero}% + \endgroup} + {}% +%% `chapter': \etoc@setstyle{@zero} -{\addpenalty\@highpenalty\etocskipfirstprefix}{\pagebreak[2]} -{\begingroup + {\addpenalty\@M\etocskipfirstprefix} + {\addpenalty\@itempenalty} + {\begingroup \etocfontzero \addvspace{\etocsepzero}% \parindent \z@ \parfillskip \@flushglue - \vbox{\etocifnumbered{\etocnumber\space}{}\etocname - \baselineskip\etocbaselinespreadzero\baselineskip\par}% - \addvspace{\etocsepone}\addpenalty\@itempenalty -\endgroup} -{\addpenalty\@secpenalty}% -% \end{macrocode} -% placeholder for comments -% \begin{macrocode} + \vbox{\etocifnumbered{\etocnumber.\enspace}{}\etocname + \baselineskip\etocbaselinespreadzero\baselineskip + \par}% + \endgroup} + {\addpenalty{-\@highpenalty}\addvspace{\etocsepminusone}}% +%% `section': \etoc@setstyle{@one} -{\addpenalty\@medpenalty\etocskipfirstprefix}{\pagebreak[1]} -{\begingroup\etocfontone -\addvspace{\etocsepone}% -\parindent \z@ \parfillskip \z@ -\setbox\z@\vbox{\parfillskip\@flushglue -\etocname\par\setbox\tw@\lastbox -\global\setbox\@ne\hbox{\unhbox\tw@\ }}% -\dimen\z@=\wd\@ne -\setbox\z@=\etoctoclineleaders -\advance\dimen\z@\wd\z@ -\etocifnumbered -{\setbox\tw@\hbox{\etocnumber, \etocabbrevpagename\etocpage}} -{\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}% -\advance\dimen\z@\wd\tw@ -\ifdim\dimen\z@ < \linewidth + {\addpenalty\@M\etocskipfirstprefix} + {\addpenalty\@itempenalty} + {\begingroup + \etocfontone + \addvspace{\etocsepone}% + \parindent \z@ \parfillskip \z@ + \setbox\z@\vbox{\parfillskip\@flushglue + \etocname\par + \setbox\tw@\lastbox + \global\setbox\@ne\hbox{\unhbox\tw@\ }}% + \dimen\z@=\wd\@ne + \setbox\z@=\etoctoclineleaders + \advance\dimen\z@\wd\z@ + \etocifnumbered + {\setbox\tw@\hbox{\etocnumber, \etocabbrevpagename\etocpage}} + {\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}% + \advance\dimen\z@\wd\tw@ + \ifdim\dimen\z@ < \linewidth \vbox{\etocname~% - \leaders\box\z@\hfil\box\tw@ - \baselineskip\etocbaselinespreadone\baselineskip\par} + \leaders\box\z@\hfil\box\tw@ + \baselineskip\etocbaselinespreadone\baselineskip + \par} \else \vbox{\etocname~% - \leaders\copy\z@\hfil\break - \hbox{}\leaders\box\z@\hfil\box\tw@ - \baselineskip\etocbaselinespreadone\baselineskip\par} -\fi -\addvspace{\etocseptwo}\addpenalty\@itempenalty -\endgroup} -{\addpenalty\@secpenalty}% -% \end{macrocode} -% placeholder for comments -% \begin{macrocode} + \leaders\copy\z@\hfil\break + \hbox{}\leaders\box\z@\hfil\box\tw@ + \baselineskip\etocbaselinespreadone\baselineskip + \par} + \fi + \endgroup} + {\addpenalty\@secpenalty\addvspace{\etocsepzero}}% +%% `subsection': \etoc@setstyle{@two} -{\addpenalty\@medpenalty\etocskipfirstprefix} -{\pagebreak[1]} -{\begingroup\etocfonttwo -\addvspace{\etocseptwo}% -\parindent \z@ \parfillskip \z@ -\setbox\z@\vbox{\parfillskip\@flushglue -\etocname\par\setbox\tw@\lastbox -\global\setbox\@ne\hbox{\unhbox\tw@}}% -\dimen\z@=\wd\@ne -\setbox\z@=\etoctoclineleaders -\advance\dimen\z@\wd\z@ -\etocifnumbered -{\setbox\tw@\hbox{\etocnumber, \etocabbrevpagename\etocpage}} -{\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}% -\advance\dimen\z@\wd\tw@ -\ifdim\dimen\z@ < \linewidth + {\addpenalty\@medpenalty\etocskipfirstprefix} + {\addpenalty\@itempenalty} + {\begingroup + \etocfonttwo + \addvspace{\etocseptwo}% + \parindent \z@ \parfillskip \z@ + \setbox\z@\vbox{\parfillskip\@flushglue + \etocname\par\setbox\tw@\lastbox + \global\setbox\@ne\hbox{\unhbox\tw@}}% + \dimen\z@=\wd\@ne + \setbox\z@=\etoctoclineleaders + \advance\dimen\z@\wd\z@ + \etocifnumbered + {\setbox\tw@\hbox{\etocnumber, \etocabbrevpagename\etocpage}} + {\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}% + \advance\dimen\z@\wd\tw@ + \ifdim\dimen\z@ < \linewidth \vbox{\etocname~% - \leaders\box\z@\hfil\box\tw@ - \baselineskip\etocbaselinespreadtwo\baselineskip\par} + \leaders\box\z@\hfil\box\tw@ + \baselineskip\etocbaselinespreadtwo\baselineskip + \par} \else \vbox{\etocname~% - \leaders\copy\z@\hfil\break - \hbox{}\leaders\box\z@\hfil\box\tw@ - \baselineskip\etocbaselinespreadtwo\baselineskip\par} -\fi -\addvspace{\etocsepthree}\addpenalty\@itempenalty -\endgroup} -{\addpenalty\@secpenalty}% -% \end{macrocode} -% placeholder for comments -% \begin{macrocode} + \leaders\copy\z@\hfil\break + \hbox{}\leaders\box\z@\hfil\box\tw@ + \baselineskip\etocbaselinespreadtwo\baselineskip + \par} + \fi + \endgroup} + {\addpenalty\@secpenalty\addvspace{\etocsepone}}% +%% `subsubsection': \etoc@setstyle{@three} -{\nopagebreak -\etocfontthree -\addvspace{\etocsepthree}% -\nointerlineskip\noindent -\etocskipfirstprefix} -{\allowbreak\,--\,} -{\etocname} -{.\hfil\begingroup -\baselineskip\etocbaselinespreadthree\baselineskip -\par\endgroup -\addpenalty{-\@highpenalty}}% + {\addpenalty\@M + \etocfontthree + \vspace{\etocsepthree}% + \noindent + \etocskipfirstprefix} + {\allowbreak\,--\,} + {\etocname} + {.\hfil + \begingroup + \baselineskip\etocbaselinespreadthree\baselineskip + \par + \endgroup + \addpenalty{-\@highpenalty}}% % \end{macrocode} % placeholder for comments % \begin{macrocode} @@ -4185,10 +4513,8 @@ release. \addcontentsline {toc}{#1}{#2}} \DeclareRobustCommand*{\etoctoccontentsline} {\@ifstar{\Etoc@addcontentsline@}{\Etoc@addtocontents}} -% \newcommand*\etocstandardlines{\Etoc@standardtrue} \newcommand*\etoctoclines{\Etoc@standardfalse} % 1.07b -% \etocdefaultlines % for initialization \etocstandardlines % removed silly AtBeginDocument temporarily added for 1.07 \etocstandarddisplaystyle @@ -4211,7 +4537,7 @@ release. Grave accent \` Left brace \{ Vertical bar \| Right brace \} Tilde \~} -\CheckSum{2516} +\CheckSum{2532} \Finale %% diff --git a/Master/texmf-dist/source/latex/etoc/etoc.ins b/Master/texmf-dist/source/latex/etoc/etoc.ins index e14f2c2eabb..745c72f312e 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.ins +++ b/Master/texmf-dist/source/latex/etoc/etoc.ins @@ -1,6 +1,6 @@ \def\pkgname{etoc} -\def\pkgdate{2013/02/24} -\def\pkgversion{v1.07d} +\def\pkgdate{2013/03/01} +\def\pkgversion{v1.07e} \def\pkgdescription{easily customizable TOCs (jfB)} %% %% Package `etoc' by Jean-Francois Burnol diff --git a/Master/texmf-dist/tex/latex/etoc/etoc.sty b/Master/texmf-dist/tex/latex/etoc/etoc.sty index 166b4711d04..ad991703057 100644 --- a/Master/texmf-dist/tex/latex/etoc/etoc.sty +++ b/Master/texmf-dist/tex/latex/etoc/etoc.sty @@ -22,7 +22,7 @@ %% in the same archive or directory.) %% \ProvidesPackage{etoc} - [2013/02/24 v1.07d easily customizable TOCs (jfB)] + [2013/03/01 v1.07e easily customizable TOCs (jfB)] %% %% Package `etoc' by Jean-Francois Burnol %% Copyright (C) 2012, 2013 by Jean-Francois Burnol @@ -34,7 +34,8 @@ \ProcessOptions\relax \newtoks\Etoc@toctoks \def\Etoc@par{\par} -\newcommand*{\etocnopar}{\def\Etoc@par{}} +\newcommand*{\etocinline}{\def\Etoc@par{}} +\let\etocnopar\etocinline \newif\ifEtoc@jj % book \newif\ifEtoc@j % part \newif\ifEtoc@ % chapter @@ -590,7 +591,8 @@ \newcommand*\etocsepminusone{4ex \@plus .5ex \@minus .5ex} \newcommand*\etocsepzero{2.5ex \@plus .4ex \@minus .4ex} \newcommand*\etocsepone{1.5ex \@plus .3ex \@minus .3ex} -\newcommand*\etocseptwo{1ex \@plus .15ex \@minus .15ex} +%%\newcommand*\etocseptwo{1ex \@plus .15ex \@minus .15ex} % modified in 1.07e +\newcommand*\etocseptwo{.5ex \@plus .1ex \@minus .1ex} \newcommand*\etocsepthree{.25ex \@plus .05ex \@minus .05ex} \newcommand*\etocbaselinespreadminustwo{1} \newcommand*\etocbaselinespreadminusone{1} @@ -608,110 +610,133 @@ \newcommand*\etocpartname{\partname} \newcommand*\etocbookname{Book} \def\etocdefaultlines{\Etoc@standardfalse -\etoc@setstyle{@minustwo}{\etocskipfirstprefix}{\pagebreak[3]} -{\begingroup \etocfontminustwo - \addvspace{\etocsepminustwo}% - \parindent \z@ - \leftskip \etocminustwoleftmargin - \rightskip \etocminustworightmargin - \parfillskip \@flushglue - \vbox{\etocifnumbered{\etocbookname~\etocnumber:~}{}\etocname - \baselineskip\etocbaselinespreadminustwo\baselineskip\par}% - \addvspace{\etocsepminusone}\nobreak -\endgroup} -{}% -\etoc@setstyle{@minusone}{\etocskipfirstprefix}{\pagebreak[3]} -{\begingroup \etocfontminusone - \addvspace{\etocsepminusone}% - \parindent \z@ - \leftskip \etocminusoneleftmargin - \rightskip \etocminusonerightmargin - \parfillskip \@flushglue - \vbox{\etocpartname\etocifnumbered{ \etocnumber.~}{ }\etocname - \baselineskip\etocbaselinespreadminusone\baselineskip\par}% - \addvspace{\etocsepzero}\nobreak -\endgroup} -{}% +%% `book' in memoir class: +\etoc@setstyle{@minustwo} + {\addpenalty\@M\etocskipfirstprefix} + {\addpenalty\@secpenalty} + {\begingroup + \etocfontminustwo + \addvspace{\etocsepminustwo}% + \parindent \z@ + \leftskip \etocminustwoleftmargin + \rightskip \etocminustworightmargin + \parfillskip \@flushglue + \vbox{\etocifnumbered{\etocbookname\enspace\etocnumber:\quad}{}\etocname + \baselineskip\etocbaselinespreadminustwo\baselineskip + \par}% + \addpenalty\@M\addvspace{\etocsepminusone}% + \endgroup} + {}% +%% `part': +\etoc@setstyle{@minusone} + {\addpenalty\@M\etocskipfirstprefix} + {\addpenalty\@secpenalty} + {\begingroup + \etocfontminusone + \addvspace{\etocsepminusone}% + \parindent \z@ + \leftskip \etocminusoneleftmargin + \rightskip \etocminusonerightmargin + \parfillskip \@flushglue + \vbox{\etocifnumbered{\etocpartname\enspace\etocnumber.\quad}{}\etocname + \baselineskip\etocbaselinespreadminusone\baselineskip + \par}% + \addpenalty\@M\addvspace{\etocsepzero}% + \endgroup} + {}% +%% `chapter': \etoc@setstyle{@zero} -{\addpenalty\@highpenalty\etocskipfirstprefix}{\pagebreak[2]} -{\begingroup + {\addpenalty\@M\etocskipfirstprefix} + {\addpenalty\@itempenalty} + {\begingroup \etocfontzero \addvspace{\etocsepzero}% \parindent \z@ \parfillskip \@flushglue - \vbox{\etocifnumbered{\etocnumber\space}{}\etocname - \baselineskip\etocbaselinespreadzero\baselineskip\par}% - \addvspace{\etocsepone}\addpenalty\@itempenalty -\endgroup} -{\addpenalty\@secpenalty}% + \vbox{\etocifnumbered{\etocnumber.\enspace}{}\etocname + \baselineskip\etocbaselinespreadzero\baselineskip + \par}% + \endgroup} + {\addpenalty{-\@highpenalty}\addvspace{\etocsepminusone}}% +%% `section': \etoc@setstyle{@one} -{\addpenalty\@medpenalty\etocskipfirstprefix}{\pagebreak[1]} -{\begingroup\etocfontone -\addvspace{\etocsepone}% -\parindent \z@ \parfillskip \z@ -\setbox\z@\vbox{\parfillskip\@flushglue -\etocname\par\setbox\tw@\lastbox -\global\setbox\@ne\hbox{\unhbox\tw@\ }}% -\dimen\z@=\wd\@ne -\setbox\z@=\etoctoclineleaders -\advance\dimen\z@\wd\z@ -\etocifnumbered -{\setbox\tw@\hbox{\etocnumber, \etocabbrevpagename\etocpage}} -{\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}% -\advance\dimen\z@\wd\tw@ -\ifdim\dimen\z@ < \linewidth + {\addpenalty\@M\etocskipfirstprefix} + {\addpenalty\@itempenalty} + {\begingroup + \etocfontone + \addvspace{\etocsepone}% + \parindent \z@ \parfillskip \z@ + \setbox\z@\vbox{\parfillskip\@flushglue + \etocname\par + \setbox\tw@\lastbox + \global\setbox\@ne\hbox{\unhbox\tw@\ }}% + \dimen\z@=\wd\@ne + \setbox\z@=\etoctoclineleaders + \advance\dimen\z@\wd\z@ + \etocifnumbered + {\setbox\tw@\hbox{\etocnumber, \etocabbrevpagename\etocpage}} + {\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}% + \advance\dimen\z@\wd\tw@ + \ifdim\dimen\z@ < \linewidth \vbox{\etocname~% - \leaders\box\z@\hfil\box\tw@ - \baselineskip\etocbaselinespreadone\baselineskip\par} + \leaders\box\z@\hfil\box\tw@ + \baselineskip\etocbaselinespreadone\baselineskip + \par} \else \vbox{\etocname~% - \leaders\copy\z@\hfil\break - \hbox{}\leaders\box\z@\hfil\box\tw@ - \baselineskip\etocbaselinespreadone\baselineskip\par} -\fi -\addvspace{\etocseptwo}\addpenalty\@itempenalty -\endgroup} -{\addpenalty\@secpenalty}% + \leaders\copy\z@\hfil\break + \hbox{}\leaders\box\z@\hfil\box\tw@ + \baselineskip\etocbaselinespreadone\baselineskip + \par} + \fi + \endgroup} + {\addpenalty\@secpenalty\addvspace{\etocsepzero}}% +%% `subsection': \etoc@setstyle{@two} -{\addpenalty\@medpenalty\etocskipfirstprefix} -{\pagebreak[1]} -{\begingroup\etocfonttwo -\addvspace{\etocseptwo}% -\parindent \z@ \parfillskip \z@ -\setbox\z@\vbox{\parfillskip\@flushglue -\etocname\par\setbox\tw@\lastbox -\global\setbox\@ne\hbox{\unhbox\tw@}}% -\dimen\z@=\wd\@ne -\setbox\z@=\etoctoclineleaders -\advance\dimen\z@\wd\z@ -\etocifnumbered -{\setbox\tw@\hbox{\etocnumber, \etocabbrevpagename\etocpage}} -{\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}% -\advance\dimen\z@\wd\tw@ -\ifdim\dimen\z@ < \linewidth + {\addpenalty\@medpenalty\etocskipfirstprefix} + {\addpenalty\@itempenalty} + {\begingroup + \etocfonttwo + \addvspace{\etocseptwo}% + \parindent \z@ \parfillskip \z@ + \setbox\z@\vbox{\parfillskip\@flushglue + \etocname\par\setbox\tw@\lastbox + \global\setbox\@ne\hbox{\unhbox\tw@}}% + \dimen\z@=\wd\@ne + \setbox\z@=\etoctoclineleaders + \advance\dimen\z@\wd\z@ + \etocifnumbered + {\setbox\tw@\hbox{\etocnumber, \etocabbrevpagename\etocpage}} + {\setbox\tw@\hbox{\etocabbrevpagename\etocpage}}% + \advance\dimen\z@\wd\tw@ + \ifdim\dimen\z@ < \linewidth \vbox{\etocname~% - \leaders\box\z@\hfil\box\tw@ - \baselineskip\etocbaselinespreadtwo\baselineskip\par} + \leaders\box\z@\hfil\box\tw@ + \baselineskip\etocbaselinespreadtwo\baselineskip + \par} \else \vbox{\etocname~% - \leaders\copy\z@\hfil\break - \hbox{}\leaders\box\z@\hfil\box\tw@ - \baselineskip\etocbaselinespreadtwo\baselineskip\par} -\fi -\addvspace{\etocsepthree}\addpenalty\@itempenalty -\endgroup} -{\addpenalty\@secpenalty}% + \leaders\copy\z@\hfil\break + \hbox{}\leaders\box\z@\hfil\box\tw@ + \baselineskip\etocbaselinespreadtwo\baselineskip + \par} + \fi + \endgroup} + {\addpenalty\@secpenalty\addvspace{\etocsepone}}% +%% `subsubsection': \etoc@setstyle{@three} -{\nopagebreak -\etocfontthree -\addvspace{\etocsepthree}% -\nointerlineskip\noindent -\etocskipfirstprefix} -{\allowbreak\,--\,} -{\etocname} -{.\hfil\begingroup -\baselineskip\etocbaselinespreadthree\baselineskip -\par\endgroup -\addpenalty{-\@highpenalty}}% + {\addpenalty\@M + \etocfontthree + \vspace{\etocsepthree}% + \noindent + \etocskipfirstprefix} + {\allowbreak\,--\,} + {\etocname} + {.\hfil + \begingroup + \baselineskip\etocbaselinespreadthree\baselineskip + \par + \endgroup + \addpenalty{-\@highpenalty}}% \etoc@setstyle{@four}{}{}{}{}% \etoc@setstyle{@five}{}{}{}{}% } |