diff options
author | Karl Berry <karl@freefriends.org> | 2013-01-25 23:11:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-01-25 23:11:39 +0000 |
commit | 5f3212160431d7cff965e91f1c958d6c4771e7bc (patch) | |
tree | 6e5eca838ec6ebc04643989b6c332f40eec53bc2 /Master | |
parent | ce5b961be58acc74649ab3fc752f5fa93c0671eb (diff) |
etoc 1.06 (25jan13)
git-svn-id: svn://tug.org/texlive/trunk@28944 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/README | 38 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/etoc/etoc.pdf | bin | 239811 -> 188046 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/etoc/etoc.dtx | 621 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/etoc/etoc.ins | 1 |
4 files changed, 590 insertions, 70 deletions
diff --git a/Master/texmf-dist/doc/latex/etoc/README b/Master/texmf-dist/doc/latex/etoc/README index ae791fed1cc..4b6fc1e839e 100644 --- a/Master/texmf-dist/doc/latex/etoc/README +++ b/Master/texmf-dist/doc/latex/etoc/README @@ -13,10 +13,12 @@ and version 1.3 or later is part of all distributions of LaTeX version 2003/12/01 or later. +package version 1.06, 2012/12/07 +documentation updated 2013/01/25 Installation - `latex etoc.dtx' creates (among others) the file `etoc.sty'. + `latex etoc.dtx' creates the file `etoc.sty'. `latex etoc.dtx' (again) finishes producing the documentation. Put `etoc.sty' in a suitable location within the TeX installation: @@ -30,20 +32,26 @@ the entries of the table of contents should be constituted from the name, number, and page number of each sectioning unit. This goes via the definition of line styles for each - sectioning level used in the document. The package provides - its own custom line styles as an example. The simplest usage - though will be to delegate the details of the layout to - packages dealing with list environments. + sectioning level used in the document. The package + provides its own custom line styles as an example. The + simplest usage though will be to delegate the details of + the layout to packages dealing with list environments. The \tableofcontents command can be used arbitrarily many times and has a variant \localtableofcontents which prints - (surprise!) `local' tables of contents. The formatting - inherited (possibly customized by other packages) from the - document class can also be used. Regarding the global toc - display, etoc provides styles based on a possibly - multi-column format, with either a heading or a title - in-between rules, optionally with a frame around the table - of contents. Using labels, one can reproduce at another - location (and with another layout) a (local) TOC defined - somewhere in the document. - + tables of contents `local' to the current surrounding + document unit. An extension of the label/ref syntax allows + to reproduce at another location (and with another layout) + a TOC defined somewhere else in the document. + + The formatting inherited (possibly customized by other + packages) from the document class can also be used. + Regarding the global toc display, etoc provides styles + based on a multi-column format, optionally with a frame or + a ruled title. + + As the assignment of levels to the sectioning units can be + changed at any time, etoc can be used to create custom + 'lists of' in a very general manner. It does not create + auxiliary files other than the usual .toc file. + diff --git a/Master/texmf-dist/doc/latex/etoc/etoc.pdf b/Master/texmf-dist/doc/latex/etoc/etoc.pdf Binary files differindex 809044ccfbb..5c67868e7c2 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 a561cf81640..7c85fbb1215 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.dtx +++ b/Master/texmf-dist/source/latex/etoc/etoc.dtx @@ -1,6 +1,5 @@ % -*- coding: iso-latin-1; -*- %<*ins> -\def\lasttimestamp{Time-stamp: <07-12-2012 20:15:47 CET jfb>} \def\pkgname{etoc} \def\pkgdate{2012/12/07} \def\pkgversion{v1.06} @@ -11,7 +10,8 @@ %% Copyright (C) 2012 by Jean-Francois Burnol %% %<*none> -\def\docdate{2012/12/07} +\def\lasttimestamp{Time-stamp: <25-01-2013 12:29:15 CET jfb>} +\def\docdate{2013/01/24} \def\striptimestamp#1 <#2 #3 #4 #5>{#2 at #3 #4} \edef\dtxtimestamp{\expandafter\striptimestamp\lasttimestamp} \ProvidesFile{\pkgname.dtx} @@ -92,19 +92,25 @@ \usepackage[hscale=0.66,vscale=0.75]{geometry} \usepackage{verbatim} \usepackage{txfonts} -\usepackage{xspace} -\usepackage{multicol} +%\usepackage{xspace} +%\usepackage{multicol} \usepackage{enumitem} -\usepackage{color} +%\usepackage{color} \usepackage{xcolor} +\usepackage{graphicx} \definecolor{joli}{RGB}{225,95,0} \definecolor{JOLI}{RGB}{225,95,0} \definecolor{BLUE}{RGB}{0,0,255} +\colorlet{niceone}{green!35!blue!75} \usepackage[english]{babel} +\AtBeginDocument{ + \renewcommand\partname{Part} + \addto\captionsenglish{\renewcommand\partname{Part}} +} -\usepackage[%dvipdfmx,% +\usepackage[%dvipdfmx, pdfencoding=pdfdoc,bookmarks=true]{hyperref} \hypersetup{% @@ -137,13 +143,31 @@ pdfpagemode=UseOutlines} \newcommand\starit[1]{\cs{#1\lowast}} \newcommand\staritb[1]{\csb{#1\lowast}} + +\usepackage{etoc} % loads xspace and multicol +%-------- +% add-ons for the new section `surprising uses of etoc' (2013/01/24) +\newcounter{visibletoc} +\makeatletter +\renewcommand{\etocaftertitlehook}{\stepcounter{visibletoc}% + \addtocontents {toc}{\protect\contentsline + {visibletoc}{\thevisibletoc }{\thepage }{\@currentHref }}} +\makeatother +\etocsetlevel{visibletoc}{5} +%-------- +% add-ons for the `fancy TOC' (2013/01/25) + \newcounter{dummypart} + \newcounter{dummychapter} + \newcounter{dummysection} + \etocsetlevel{dummypart}{5} + \etocsetlevel{dummychapter}{5} + \etocsetlevel{dummysection}{5} + + \newcommand\toc{\cs{table\-of\-contents}\xspace} \newcommand\localtoc{\cs{local\-table\-of\-contents}\xspace} \newcommand\tocb{\csb{table\-of\-contents}\xspace} \newcommand\localtocb{\csb{local\-table\-of\-contents}\xspace} - -\usepackage{etoc} - \newcommand\etoc{% \texorpdfstring{{\color{joli}\ttfamily\bfseries etoc}}{etoc}\xspace} @@ -156,21 +180,29 @@ pdfpagemode=UseOutlines} \renewcommand\familydefault\sfdefault \setcounter{secnumdepth}{3} + +% ATTENTION HYPERREF TIENT COMPTE DE TOCDEPTH POUR LES BOOKMARKS! \setcounter{tocdepth}{3} +% IL FAUT DONC TOUJOURS REMETTRE À 3 AVANT CHAQUE \section ou \subsection !!! + +\makeatletter +\def\verbatim@font{\ttfamily\small\baselineskip12pt }% +\makeatother -\begin{document}\rmfamily +\begin{document} + +\rmfamily \thispagestyle{empty} -\addto\captionsenglish{\renewcommand\partname{Part}} -\renewcommand\partname{Part} + \begin{center} - {\normalfont\Large The \etoc package}\\ + {\normalfont\Large The \etoc package}\\ \textsc{Jean-François Burnol}\par \footnotesize \ttfamily jfbu (at) free (dot) fr\\ Package version: \pkgversion\ (\pkgdate)\\ Documentation generated from the source file\\ - with timestamp ``\dtxtimestamp'' + with timestamp ``\dtxtimestamp''\par \end{center} \begin{abstract} @@ -184,17 +216,23 @@ pdfpagemode=UseOutlines} details of the layout to packages dealing with list environments. - The \cs{tableofcontents} command can be used arbitrarily - many times and has a variant \cs{localtableofcontents} which - prints (surprise!) `local' tables of contents. The - formatting inherited (possibly customized by other packages) + The \cs{tableofcontents} command can be used arbitrarily many + times and has a variant \cs{localtableofcontents} which prints + tables of contents `local' to the current surrounding + document unit. An extension of the \cs{label}/\cs{ref} syntax + allows to reproduce at another location (and with another + layout) a TOC defined somewhere else in the document. + + The formatting inherited (possibly customized by other packages) from the document class can also be used. Regarding the - \emph{global toc display}, \etoc provides styles - based on a possibly multi-column format, with either a - heading or a title in-between rules, optionally with a frame - around the table of contents. Using labels, one can - reproduce at another location (and with another layout) a - (local) TOC defined somewhere in the document.\par + \emph{global toc display}, \etoc provides styles based on a + multi-column format, optionally with a frame or a ruled + title. + + As the assignment of levels to the sectioning units can be + changed at any time, \etoc can be used to create custom ``lists + of'' in a very general manner. It does not create auxiliary + files other than the usual |.toc| file. \end{abstract} @@ -230,12 +268,14 @@ manner: they are made available via the \csb{etocname}, It is hoped that \etoc will turn out to be essentially compatible with the |article|, |book|, |report|, |scrartcl|, -|scrbook|, |scrreprt| and |memoir| classes. Preliminary -testing is positive, but the author not being familiar with the -latter classes,\footnote{latter=all but |article|...} he does -not have a stock of documents which could have been used to -test all their bells and whistles in the presence of -\etoc. \par +|scrbook|, |scrreprt| and |memoir| classes. + +% Preliminary +% testing is positive, but the author not being familiar with the +% latter classes,\footnote{latter=all but |article|...} he does +% not have a stock of documents which could have been used to +% test all their bells and whistles in the presence of +% \etoc. \par \clearpage @@ -468,10 +508,10 @@ obeyed. As an example here is the table of contents of Part We actually did something like:\\ \hbox to \linewidth{\hss \toc\space\cs{label}|{toc:d}|\cs{ref}|{toc:c}|\hss} Hence -\hyperref[toc:d]{\color{green!35!blue!75}the present location} +\hyperref[toc:d]{\color{niceone}the present location} can itself now be referred to via |\ref{toc:d}|: it gives the id of this TOC\footnote{\emph{i.e} -{\color{green!35!blue!75}\ref{toc:d}}, there was an invisible +{\color{niceone}\ref{toc:d}}, there was an invisible TOC with id 2 at the beginning of this part.} in the sequence of document TOCs, and will be a link if package |hyperref| is used. @@ -500,6 +540,7 @@ line in the source file starting with the first \begin{verbatim} \setcounter{tocdepth}{-3} \localtableofcontents \label{toc:partone} +\setcounter{tocdepth}{3} \end{verbatim} The |tocdepth| being set to -3, nothing at all was inserted in the page (\etoc @@ -507,7 +548,6 @@ cancels printing even the heading of the TOC if the |tocdepth| is -2 or less, except for the |memoir| class for which it needs to be -3 or less). We can then display the TOC with: \begin{verbatim} -\setcounter{tocdepth}{3} \subsection{Local table of contents for this part} \tableofcontents \ref{toc:partone} \end{verbatim} @@ -594,9 +634,462 @@ part of the \meta{start} code of the section `line style'. The frame borders have been set to have the same color as the one which serves as background for the entire thing. This design (with other colors) is in use also for -\hyperref[toc:clone]{\color{green!35!blue!75}this other toc}, +\hyperref[toc:clone]{\color{niceone}this other toc}, and the coding used is to be found at its location. +\section{Surprising uses of \etoc} +\label{sec:surprising} + +\subsection{The TOC of TOCs} + +\begingroup +\makeatletter +% to get rid of the \par... +\def\table@fcontents{%\par + \refstepcounter{etoc@tocid}% + \Etoc@tocwithidfalse + \futurelet\Etoc@nexttoken\Etoc@t@bleofcontents} +\makeatother + +\etocsetlevel{part}{1} +\etocsetlevel{chapter}{1} +\etocsetlevel{visibletoc}{0} +\etocsetstyle{visibletoc}{\etocskipfirstprefix}{, }{{\color{niceone}\etocname}}{} +\etocnakedtocdisplaystyle +\setcounter{tocdepth}{0} + + +Here is the numbered and linked list of all tables of contents which are +displayed within this document: +\tableofcontents\setcounter{tocdepth}{3}\endgroup. And to obtain +it here we just wrote:\footnote{click the `3' from the list to confirm +that this is indeed the third visible table of contents of this +document...}\par\smallskip +{\leftskip3cm\rightskip\leftskip + \ttfamily\small\baselineskip11pt \noindent Here is the numbered and + linked list of all tables of contents which are displayed + within this document:~\string\tableofcontents.\par} + + The preparatory work was the following. First, we defined a + counter |visibletoc| whose vocation is to get incremented at + each displayed toc. \etoc has its own private counter but it + counts all TOCs, even those not displayed because the |tocdepth| + value was |-2| or |-3|. + +We could have added manually |\refstepcounter{visibletoc}| and +|\label| commands at +all suitable locations in the document source, and use here |\ref| +commands, but this requires quite some manual editing of the +source. + +There is a much better way: there is a hook +\cs{etocaftertitlehook} and we told it to increment the +|visibletoc| counter and to write a line to the |.toc| file, +exactly as sectioning commands such as |chapter|, |section|, or +|subsection| do. The name of the fictitious unit was chosen to be +again |visibletoc|. + +In the preamble of the document we did +|\etocsetlevel{visibletoc}{5}| and in this subsection +|\etocsetlevel{visibletoc}{0}|, |\setcounter{tocdepth}{0}|, and we +also assigned to |part| and |chapter| level |1|. So the printed +table of contents uses \emph{only} the `visibletoc' entries from +the |.toc| file. The other entries are just discarded. We also +defined a simple style with \cs{etocsetstyle} for inline display. + +To tell the entire truth the current version |1.06| of \etoc +issues |\par| automatically before typesetting a table of +contents, so we had to copy the suitable inner macro and remove +from it the |\par|. Next release of \etoc will have a public +command to tell the package not to do this |\par| (today I don't +want to modify the code source, only enhance a bit this +documentation). + +Here are the implementation details: + +\begingroup +\begin{verbatim} +... in the preamble: +\newcounter{visibletoc} +\makeatletter +\renewcommand{\etocaftertitlehook}{\stepcounter{visibletoc}% + % no \refstepcounter needed nor useful as etoc's inner counter + % for TOCs got incremented just before + \addtocontents {toc}{\protect\contentsline + {visibletoc}{\thevisibletoc }{\thepage }{\@currentHref }}} + % we do not use \addcontentsline which is patched by hyperref + % In this way no bookmark creation, only hyperlinks. +\makeatother + +% Only displayed TOCs will execute this hook. Invisible TOCs defined +% for display elsewhere do not. The package has a private counter +% which we didn't use as it counts all TOCs. The contentsline data +% defines an `unnumbered' entity (there is no \numberline macro +% in the last parameter), whose name is the current value of the +% counter visibletoc. So we will use \etocname. + +\etocsetlevel{visibletoc}{5} % hence the added data will remain + % invisible as long as tocdepth < 5 + +\begin{document} +... document body +\subsection{Surprising uses of etoc} +\begingroup +\etocsetlevel{part}{1} +\etocsetlevel{chapter}{1} +\etocsetlevel{visibletoc}{0} +\etocsetstyle{visibletoc} + {\etocskipfirstprefix}{, }{{\color{niceone}\etocname}}{} +\etocsettocstyle{}{} % don't set any title, rules or frame or multicol! +\setcounter{tocdepth}{0} % display only the `visibletoc' entries from .toc + +Here is the numbered and linked list of all tables of contents which are +displayed within this document: \tableofcontents. +\endgroup +\end{verbatim} +\endgroup + +Subsection \ref{subsec:interverting} gives another use of the +shuffling of levels. + +% ATTENTION HYPERREF TIENT COMPTE DE TOCDEPTH +% MAIS C'EST DEBILE ÇA ! IL DEVRAIT Y AVOIR UN +% SETTING GLOBAL +% \setcounter{tocdepth}{3} % fait plus haut + +\subsection{Arbitrary ``List Of...''} + +This idea of interverting the levels is very powerful and allows +to let \etoc display lists of arbitrary things contained in the +document. All of that still +using nothing else than the |.toc| file! +Example: imagine a document with dozens of +exercises, perhaps defined as |\newtheorem{exercise}{}[section]|. Let +us explain how to instruct \etoc to display an hyperlinked list +of all these exercises. For this we put in the preamble: +\begingroup +\makeatletter +\def\verbatim@font{\ttfamily\small\baselineskip12pt }% +\makeatother +\begin{verbatim} + \newtheorem{exerci}{}[section] + \newcommand{\exercisetotoc}{\addcontentsline{toc}{exercise}{\theexerci}} + \newenvironment{exercise}{\begin{exerci}\exercisetotoc}{\end{exerci}} + \etocsetlevel{exercise}{5} +\end{verbatim} +Then, the list of exercises can be typeset in a four-column format +with the following code: +\begin{verbatim} +\begingroup + \etocsetlevel{exercise}{2} + \etocsetlevel{chapter}{3} \etocsetlevel{subsection}{3} \etocsetlevel{part}{3} + \setcounter{tocdeph}{2} + \etocsetstyle{exercise}{}{} + {\noindent\etocname\strut\leaders\etoctoclineleaders\hfill\etocpage\par} + {\pagebreak[2]\vskip\baselineskip} + \etocsetstyle{section}{}{} + {\noindent\strut{\bfseries\large\etocnumber\hskip.5em\etocname}\par + \nopagebreak[3]}{} + \etocruledstyle[4]{\Large\bfseries List of the exercises} + \setlength{\columnseprule}{.4pt} + \tableofcontents + \setcounter{tocdepth}{3} +\endgroup +\end{verbatim} +The above was motivated by question |94766| on the +\TeX-StackExchange site. + +When package |hyperref| is used, all +these exercise numbers will be hyperlinks. But |hyperref| will +also add bookmarks to be used if the output format is PDF. One +needs to inform it of a suitable level to be used for these +bookmarks, so here for example this could be |2|, so that for +bookmark purposes the exercises will be considered as sub-units of +sections. This goes in the preamble of the document: +\begin{verbatim} +\makeatletter +\providecommand*{\toclevel@exercise}{2} +\makeatother +\end{verbatim} +It is also possible to prevent |hyperref| from creating any bookmark +for the exercices. This does it: +\begin{verbatim} +\makeatletter + \newcommand{\exercisetotoc}{% + \addtocontents {toc}{\protect\contentsline + {exercise}{\theexerci }{\thepage }{\@currentHref }}} +\makeatother +\end{verbatim} +\endgroup + +\subsection{A TOC with a fancy layout} + +Another question (numbered |61297|) on the \TeX{} StackExchange +site was about using \LaTeX{} to obtain a table of contents where +the sections from a given chapter would be represented by a number +range (like 18--22 for a given chapter, 42--49 for another one ... +of course to be inserted automatically in the TOC). The next page +is the result of my effort at using \etoc for this problem. How +this was done will be found on the above cited site. + +This is not an image inclusion, the TOC was recreated entirely +within this document via the creation of dummy part, chapter and +section units as a well as a dummy page count. The dummy data was +created using loops and found its way into the |.toc| file. +And the table of +contents was then displayed after issuing: +\begin{verbatim} + \etocsetlevel{dummypart}{-1} + \etocsetlevel{dummychapter}{0} + \etocsetlevel{dummysection}{1} + \etocsetlevel{part}{2} + \etocsetlevel{chapter}{2} + \etocsetlevel{section}{2} + \setcounter{tocdepth}{1} +\end{verbatim} +In this way the styles used to typeset originally the TOC from a +dedicated |.tex| file could be +inserted in the present documentation (as the current version of +\etoc does not have user commands to import a |.toc| file from +another document, we had to create as mentioned above the +apparatus for the generation of these dummy parts, chapters, sections). + +\clearpage + +\begingroup + + \etocsetlevel{dummypart}{-1} + \etocsetlevel{dummychapter}{0} + \etocsetlevel{dummysection}{1} + \etocsetlevel{part}{2} + \etocsetlevel{chapter}{2} + \etocsetlevel{section}{2} + + \newif\ifextraidone + \newif\ifextraiidone + + \etocsetstyle{dummypart} + {} + {} + {\begin{center}\Large\bfseries PART \etocnumber + \ifextraiidone\\\etocname.\fi\end{center} + \ifextraidone\else + \noindent\hskip.7\linewidth + \hbox to .2\linewidth +% +% je modifie ici en ajoutant un \hss, pour compenser la plus petite +% taille de txrm. Ok. + {\hss\small\textsc{\bfseries Sections.\hss Page.}}\par\fi + \extraidonetrue + } + {} + + \newcommand\mytocleaders{\hbox to .125\linewidth{...\hss}} + \etocsetstyle{dummychapter} + {} + {\par\noindent\etocifnumbered + {\makebox[.15\linewidth][r]{\bfseries\etocnumber.}} + {\hspace*{.15\linewidth}}} + {\hbox to .65\linewidth + {\hspace{1em}\etocname\unskip\leaders\mytocleaders\hss}% + \hskip-.1\linewidth + \hbox to .2\linewidth{\hspace{1.5em}...\hss + \etocifnumbered + {\etocpage} + {\ifextraiidone\else\etocpage\fi}}% + \hskip-.2\linewidth + } + {} + + \newbox\forsectionnumbers + \makeatletter + \etocsetstyle{dummysection} + {\setbox\forsectionnumbers=\hbox to .1\linewidth + \bgroup\hss\etocskipfirstprefix} + {\@gobble} + {\etocnumber---} + {\etocnumber\egroup + % for reasons I do not quite understand, in some pdf viewers the dots + % do not completely disappear if here \fboxsep0pt is used. + \fboxsep=.5pt\colorbox{white}{\box\forsectionnumbers}\par + \ifextraiidone\else + \begin{center}\bfseries Concord.\end{center} + \noindent\makebox[.15\linewidth][r]{\textsc{\bfseries Lesson.}}\par + \fi\extraiidonetrue + } + \makeatother + + + \renewcommand{\etocinnertopsep}{0pt} + + \etocruledstyle[1]{% + \parbox{\linewidth}{% + \centering + \textsc{\bfseries\LARGE\MakeUppercase{Table of Contents}}\\ + \rule{.2\linewidth}{2pt}}% + } + + \setcounter{tocdepth}{1} + \leavevmode\vfill + \tableofcontents + \vfill\clearpage + \setcounter{tocdepth}{3} + +\makeatletter + \def\adddummysection {\stepcounter{dummysection}% + \addtocontents {toc}{\protect\contentsline + {dummysection}{\protect\numberline{\thedummysection}} + {\the\dummypage }{\@currentHref }}} + + \def\adddummychapter #1{\stepcounter{dummychapter}% + \advance\dummypage2 + \addtocontents {toc}{\protect\contentsline + {dummychapter}{\protect\numberline{\thedummychapter}#1} + {\the\dummypage }{\@currentHref }}} + + \def\adddummychapno #1{\advance\dummypage2 + \addtocontents {toc}{\protect\contentsline + {dummychapter}{#1}{\the\dummypage }{\@currentHref }}} + + \def\adddummypart #1{\stepcounter{dummypart}% + \advance\dummypage4 + \addtocontents {toc}{\protect\contentsline + {dummypart}{\protect\numberline{\Roman{dummypart}}#1} + {\the\dummypage }{\@currentHref }}} + +\makeatother + + \newcount\dummypage \dummypage-1 + + \adddummypart {} + + + \adddummychapno {Introductory} + + \newcount\tempcount + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<8 + \repeat + + \adddummychapter {Concord of Subject and Verb} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<17 + \repeat + + \adddummychapter {Concord of Substantive and Adjective} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<22 + \repeat + + \adddummychapno {Concord of Relative and its Antecedent} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<25 + \repeat + + \adddummypart {Government} + + \adddummychapter {The Accusative Case} + + \adddummychapno {General uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<30 + \repeat + + \adddummychapno {Particular uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<37 + \repeat + + \adddummychapter {Verbs governing two Accusatives} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<41 + \repeat + + \adddummychapter {The Causal} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<49 + \repeat + + \adddummychapter {The Instrumental Case} + + \adddummychapno {General uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<54 + \repeat + + \adddummychapno {Particular uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<59 + \repeat + + \adddummychapter {The Dative Case} + + \adddummychapno {General uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<65 + \repeat + + \adddummychapno {Particular uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<71 + \repeat + + \adddummychapter {The Ablative Case} + + \adddummychapno {General uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<75 + \repeat + + \adddummychapno {Particular uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<86 + \repeat + + \adddummychapter {The Locative Case} + + \adddummychapno {General uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<92 + \repeat + + \adddummychapno {Particular uses} + + \loop\advance\tempcount by 1 + \adddummysection + \ifnum\tempcount<100 + \repeat +\endgroup \part{Package commands for line styles} @@ -829,7 +1322,7 @@ The package predefines for use in its default line styles: \begin{verbatim} \newcommand\etocfontminustwo{\normalfont \LARGE \bfseries} \newcommand\etocfontminusone{\normalfont \large \bfseries} -\newcommand\etocfontzero{\normalfont \normalsize \bfseries} +\newcommand\etocfontzero{\normalfont \large \bfseries} \newcommand\etocfontone{\normalfont \normalsize \bfseries} \newcommand\etocfonttwo{\normalfont \normalsize} \newcommand\etocfontthree{\normalfont \footnotesize} @@ -881,7 +1374,7 @@ that \etoc always typesets the entire table of contents inside a group, hence no font change therein can propagate to the outside. -\section{Am I also in red?} +\section{Am I also red?} Well, actually no in this |scrartcl| class but I assure you I was in the |article| class! @@ -944,7 +1437,7 @@ provided by the document class, and a two-column layout: 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{green!35!blue!75}the next TOC} + \hyperref[toc:test]{\color{niceone}the next TOC} it contains paragraph entries.}} \tableofcontents \end{verbatim} @@ -958,7 +1451,7 @@ provided by the document class, and a two-column layout: 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{green!35!blue!75}the next TOC} it + \hyperref[toc:test]{\color{niceone}the next TOC} it contains paragraph entries.}} \tableofcontents @@ -988,6 +1481,7 @@ We then switch to our set-up from the previous part and add to it: \tableofcontents \label{toc:test} \ref{toc:main} +\setcounter{tocdepth}{3} \part{Package commands for global styles} \label{part:globalcmds} @@ -995,6 +1489,7 @@ We then switch to our set-up from the previous part and add to it: \begin{verbatim} \setcounter{tocdepth}{-3} \localtableofcontents \label{toc:globalcmds} +\setcounter{tocdepth}{3} \end{verbatim} \setcounter{tocdepth}{-3} @@ -1034,7 +1529,7 @@ rid of the horizontal rules via: \end{verbatim} The green frame for the heading of the table of contents at the \hyperref[toc:a]{% - \color{green!35!blue!75} start of the second part of this + \color{niceone} start of the second part of this document} was obtained with: \begin{verbatim} \etocruledstyle[1]{\etocfontminusone\color{green} @@ -1562,7 +2057,7 @@ use or not colors is left to the user. -\subsection{Customizing the \etoc line styles} +\subsection{Customizing the \etoc pre-defined line styles} We will simply list the relevant commands as defined in the @@ -1572,7 +2067,7 @@ package. Customizing them goes through suitable \begin{verbatim} \newcommand\etocfontminustwo{\normalfont \LARGE \bfseries} \newcommand\etocfontminusone{\normalfont \large \bfseries} -\newcommand\etocfontzero{\normalfont \normalsize \bfseries} +\newcommand\etocfontzero{\normalfont \large \bfseries} \newcommand\etocfontone{\normalfont \normalsize \bfseries} \newcommand\etocfonttwo{\normalfont \normalsize} \newcommand\etocfontthree{\normalfont \footnotesize} @@ -1624,7 +2119,7 @@ typesetting toc entries in the \LaTeX{} default manner Using the \cs{etoctoclines} (obviously) or even just one \cs{etocsetstyle} command turns off the compatibility mode -(all of this obey the scoping mecanism of \TeX/\LaTeX{} groups). +(all of this obeys the scoping mecanism of \TeX/\LaTeX{} groups). \subsection{Customizing the global styles} @@ -1664,11 +2159,9 @@ by re-defining them to do \cs{relax}. % hooks \newcommand\etocframedmphook{\relax} -\newcommand\etocaftertitlehook{\relax} \end{verbatim} -\cs{etocaftertitlehook} was commented upon before, and -\cs{etocframedmphook} is positioned immediately +The \cs{etocframedmphook} is positioned immediately after the beginning of a minipage environment where the contents of the framed TOC are typeset. @@ -1730,8 +2223,10 @@ accepted here. \subsection{Interverting the levels} +\label{subsec:interverting} -Let us display and count all subsections occurring in this document. +Let us display and count all subsections occurring in this document (see +section \ref{sec:surprising} for other uses of this technique): \begin{verbatim} \setcounter{tocdepth}{2} \etocsetlevel{part}{3} @@ -1745,6 +2240,7 @@ label=,leftmargin=0pt]} \renewcommand{\columnseprule}{1pt} \etocmarkbothnouc{List of all subsections} \etocmulticol[3]{\subsection{All subsections of this document}} +\setcounter{tocdepth}{3} \end{verbatim} \setcounter{tocdepth}{2} @@ -1769,18 +2265,35 @@ label=,leftmargin=0pt]} \etocmulticol[3]{\subsection{All subsections of this document}} \endgroup +\setcounter{tocdepth}{3} + \subsection{Compatibility with other packages} \etoc uses the packages |multicol| and |xspace|. It is |hyperref| aware and hopefully |hyperref| compatible! It doesn't matter whether \etoc or |hyperref| is loaded first. -The -macros \cs{etocname}, \cs{etocnumber}, and \cs{etocpage} -contain the |hyperref| links, if present (note that the -|linktoc=all| option of |hyperref| tells it to put a link also -in the page number corresponding to a given toc entry). The -tables of contents of the present document are fully linked. +It seems that package |hyperref| takes into account the current +value of the |tocdepth| counter to decide whether to create a +bookmark for the next sectioning unit. So it is recommended if +this value is modified for the needs of displaying a table of +contents to immediately reset it to the global document value, as +this will decide the depth of the bookmarks added in the PDF +output (\emph{e.g.} if one displays inside a section a table of contents with +|tocdepth| set to zero, the next section will not make it to the +bookmarks if |tocdepth| is not reset to at least one). Also, +recall that \LaTeX{} counters are global: a +change to |tocdepth| in a group or environment does modify its +(global) value. + +The macros \cs{etocname}, \cs{etocnumber}, and \cs{etocpage} +contain the |hyperref| links,\footnote{a future version of the +package will provide additionally macros without the +\texttt{hyperref} or \texttt{xspace} `decoration', as this can be +useful in certain circumstances.} if present (note that the +|linktoc=all| option of |hyperref| tells it to put a link also in +the page number corresponding to a given toc entry). The tables of +contents of the present document are fully linked. The contents of the |.toc| file (if it exists) are read into memory by \etoc once, at the time of \cs{usepackage\{etoc\}}. @@ -1874,9 +2387,9 @@ one must trash the previous |.aux| and |.toc| files. But adding \cs{usepackage\{hyperref\}} to a non-hyperlinked source should cause no trouble at all (the old |.toc| file will not be used, the new one, whose format differs, will be -used on the next run).\footnote{Note however than an error +used on the next run).\footnote{Note though that an error results when one adds \cs{usepackage\{hyperref\}} to a - document having some \cs{label}'s and \cs{ref}'s, and that + document having some \cs{label}'s and \cs{ref}'s; one must run |latex| another time or trash the |.aux| file to get rid of the error. This is related neither with \etoc nor with the |.toc| file.} diff --git a/Master/texmf-dist/source/latex/etoc/etoc.ins b/Master/texmf-dist/source/latex/etoc/etoc.ins index 1fed2b372ac..a414f5c64b3 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.ins +++ b/Master/texmf-dist/source/latex/etoc/etoc.ins @@ -1,4 +1,3 @@ -\def\lasttimestamp{Time-stamp: <07-12-2012 20:15:47 CET jfb>} \def\pkgname{etoc} \def\pkgdate{2012/12/07} \def\pkgversion{v1.06} |