From 2f2f8135aece956533150760a0b8fabbb491239e Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 15 May 2013 21:52:26 +0000 Subject: etoc (15may13) git-svn-id: svn://tug.org/texlive/trunk@30488 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/etoc/etoc.dtx | 173 +++------------------------ 1 file changed, 16 insertions(+), 157 deletions(-) (limited to 'Master/texmf-dist/source/latex/etoc') diff --git a/Master/texmf-dist/source/latex/etoc/etoc.dtx b/Master/texmf-dist/source/latex/etoc/etoc.dtx index 25c806beed9..c5e48633f32 100644 --- a/Master/texmf-dist/source/latex/etoc/etoc.dtx +++ b/Master/texmf-dist/source/latex/etoc/etoc.dtx @@ -39,8 +39,8 @@ % The generated auxiliary files may be discarded. % %<*none> -\def\lasttimestamp{Time-stamp: <06-04-2013 13:48:01 CEST jfb>} -\def\docdate{2013/04/06} +\def\lasttimestamp{Time-stamp: <14-05-2013 16:34:59 CEST jfb>} +\def\docdate{2013/05/14} \def\striptimestamp#1 <#2 #3 #4 #5>{#2 at #3 #4} \edef\dtxtimestamp{\expandafter\striptimestamp\lasttimestamp} \ProvidesFile{\pkgname.dtx} @@ -124,7 +124,7 @@ % ATTENTION ATTENTION ATTENTION Un changement de taille comme \small semble % déclencher (peut-être) la relecture de t1txtt.fd et quoi qu'il en soit le -% \hyphenchar est REMIS à -1 !!! MERDE! (6 avril 2013) +% \hyphenchar est REMIS à -1 ! \DeclareFontFamily{T1}{txtt}{} \DeclareFontShape{T1}{txtt}{m}{n}{ %medium @@ -191,13 +191,13 @@ } % ok il faut ceci pour dvipdfmx: -%\def\pgfsysdriver{pgfsys-dvipdfm.def} +% \def\pgfsysdriver{pgfsys-dvipdfm.def} \usepackage{tikz} \usetikzlibrary{trees} % added for "cyclic" grow function 2013/03/02 \usepackage{tikz-qtree} -\usepackage[%dvipdfmx, +\usepackage[% dvipdfmx, pdfencoding=pdfdoc,bookmarks=true]{hyperref} \hypersetup{% @@ -377,15 +377,6 @@ pdfpagemode=UseOutlines} \newcommand\etoc{% \texorpdfstring{{\color{joli}\ttfamily\bfseries etoc}}{etoc}\xspace} -% en fait je charge directement txtt en supprimant \hyphenchar\font\m@ne -%\DeclareRobustCommand\csa[1]{{\ttfamily\hyphenchar\font45 \char`\\#1}} - -% OUI MAIS CE PUTAIN DE \small REMET LE \hyphenchar à -1!! -% Je l'ai déterminé en faisant pour tester: -% \makeatletter -% \DeclareRobustCommand\csb[1]{{\ttfamily\f@encoding\the\hyphenchar\font #1}} -% \makeatother - \DeclareRobustCommand\csa[1]{{\ttfamily\hyphenchar\font45 \char`\\ #1}} \DeclareRobustCommand\csb[1] {{\color{blue}\ttfamily\hyphenchar\font45 \char`\\ #1}} @@ -415,8 +406,6 @@ pdfpagemode=UseOutlines} \setcounter{secnumdepth}{4} -%% \usepackage{tableof} % was for testing only. - \begin{document} \rmfamily @@ -646,12 +635,8 @@ v1.02 [2012/11/18] \etocsetlevel{subsection}{3} \etocsetlevel{subsubsection}{6} -%% essai de tableof: -%%\nexttocwithtags{ESSAI}{} +\tableofcontents \label{toc:main} - \tableofcontents \label{toc:main} - -%%\tableof{ESSAI} \endgroup @@ -665,7 +650,6 @@ v1.02 [2012/11/18] \localtableofcontents \label{toc:partone} \setcounter{tocdepth}{3} -%%\toftagthis{ESSAI} \section{Initial motivation: nested lists} The initial impetus was to feed nested list environments @@ -1033,14 +1017,6 @@ However, using as here the \TeX{} primitive |\par|,\footnote{\csa{par} is surest way to completely understand and master what happens. Any user of \LaTeX{} should learn their signification. -% \footnote{I am always slightly bemused to -% observe that some, not the majority perhaps, of \LaTeX{} -% experts and advisers are prompt to say ``don't do this, don't do that''; -% for example I even read somewhere that \csa{hbox} was not -% to be used except in the \LaTeX{} kernel! well I am sorry -% but \csa{makebox} and \csa{mbox} do a \csa{leavevmode} -% which sometimes leaves no option than to use rather -% \csa{hbox}. } \subsection{Again the table of contents of this part}\label{ssec:again} @@ -1154,22 +1130,15 @@ coding used. \setcounter{tocdepth}{2}% \setcounter{mycounti}{0}% \def\thissectionstatsaux{% ou plus simple si on ne veut pas le lien. - \toks@\expandafter{\etocthename}% - \edef\firstsubname{\noexpand\hyperlink{\Hy@tocdestname}{\the\toks@}}% - \toks@\expandafter{\etocthenumber}% - \edef\firstsubnumber{\noexpand\hyperlink{\Hy@tocdestname}{\the\toks@}}% + \let\firstsubname\etocthelinkedname + \let\firstsubnumber\etocthelinkednumber \def\thissectionstatsaux{}} \begingroup - \etocsetstyle{subsection} - {} - {} + \etocsetstyle{subsection} {} {} {\thissectionstatsaux \stepcounter{mycounti}% - \toks@\expandafter{\etocthename}% - \edef\lastsubname{\noexpand\hyperlink{\Hy@tocdestname}{\the\toks@}}% - \toks@\expandafter{\etocthenumber}% - \edef\lastsubnumber{\noexpand\hyperlink{\Hy@tocdestname}{\the\toks@}}% - } + \let\lastsubname\etocthelinkedname + \let\lastsubnumber\etocthelinkednumber } {Here are some statistics for this section. It contains \arabic{mycounti} subsections. The name of its first is @@ -1877,42 +1846,6 @@ outcome to \csa{treetok} for later execution in a |tikzpicture|. \appendtotok\tmptok\etocthelinkedname \edef\qtreenode{ [.{\noexpand\parbox{2cm}{\the\tmptok}}}% } -% --- date d'avant \etocthelinkedname etc... : -% 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)] - -% UPDATE: mais ça marche avec des arbres dans la syntaxe de TikZ! - -%%%%% ne marche pas, mais finalement le problème semble être avec -%%%%% tikz-qtree, car l'analogue avec des arbres dans la syntaxe -%%%%% de TikZ fonctionne!!! (3 mars) -% \makeatletter -% \newcommand*\PrepareSubsectionNode{% -% \tmptok\expandafter{\etocthename}% -% \edef\qtreenode{ [.{\noexpand\parbox{6cm}{\noexpand\raggedright -% \noexpand\hyperlink{\Hy@tocdestname}{\the\tmptok}}}}% -% } -% \makeatother % 7 mars: j'utilise maintenant \etocthelinkedname \newcommand*{\PrepareSubsectionNode}{% @@ -1981,14 +1914,6 @@ ever use of TikZ). [2013/03/01]\\ Update [2013/03/03]: it \emph{does} work when using the regular TikZ syntax for trees, so perhaps there is here some interaction with |tikz-qtree|. See next section.} -% 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).\\ - - Here is the code used, the whole thing being with double dangerous-bend signs, I shall not comment much the actual \LaTeX{} programming used therein: @@ -2192,9 +2117,6 @@ I don't know why it goes wrong for the trees constructed with the \cs{Tree} command of package |tikz-qtree|, contrarily to those coded as here with the original ``child'' TikZ syntax. -% attention à ce \clearpage -% \clearpage - \etocsettocstyle {\treetok{\node {\autoref{part:globalcmds}}}} @@ -2236,8 +2158,6 @@ those coded as here with the original ``child'' TikZ syntax. \end{verbatim} \end{minipage} -% \clearpage - \part{Package commands for line styles} \thispartstats @@ -2381,16 +2301,6 @@ where no provision is made for them and added the definitive: \end{verbatim} This is also the situation with the default package line styles! -% \subsubsection{secnum\-depth and tocdepth} - -% The \LaTeX{} counter |secnumdepth| decides down to which level division -% headings are numbered. Numbered or not they are (at least in the standard -% classes) written to the |.toc| file. The counter |tocdepth| decides then the -% finest level which will be displayed in the table of contents: its local -% value is obeyed by \etoc, and as the \toc command and its variants may now -% be used multiple times, this is an important customization lever. - - \subsection{The \csbhyp{etocnumber} command} So far, our specifications would use the numbering generated by the |enumerate| environments, but of course we generally want @@ -3403,12 +3313,6 @@ use or not colors is left to the user. \etocframedstyle[1]{} -% CETTE TOC AUSSI AVAIT LE SYNDROME DU HYPHENCHAR -1 POUR TXTT -% NE SERAIT-CE PAS LE SMALL QUI PROVOQUE CELA? OUI BORDEL DE BORDEL DE BORDEL - -% POURQUOI BORDEL DE BORDEL \SMALL VA REPRENDRE T1TXTT ALORS QUE LE DOCUMENT -% CONTIENT LE DECLAREFONTFAMILY ?? FAIT CHIER LATEX, LATEX FAIT CHIER MERDEUHHH! - \tableofcontents \label{toc:clone} \ref{toc:globalcmds} \endgroup @@ -3627,35 +3531,6 @@ section \ref{sec:surprising} for other uses of this technique): \etocmarkbothnouc{List of all subsections} -% PUTAIN BORDEL j'en ai marre de me demander pourquoi mes noms de commandEs mis -% en \csb ne sont pas soumis à hyphénation ici alors qu'ils le sont ailleurs !! -% je me dis qu'il y a quelque chose avec multicol je n'arrive pas à repérer -% quoi. J'ai essayé plusieurs choses. Vraiment c'est chiant. - -% c'est à cause de \ttfamily mais pourtant le hyphenchar n'est pas -1, il doit - -% MERDE MERDE MERDE mais qui m'a rechangé le \hyphenchar de txtt !!!!! - -% Il est bien à 45 et pourtant l'hyphénation n'a lieu QUE si je mets -% explicitement \hyphenchar à 45 dans \csb ?????? -% \begingroup \ttfamily \the\hyphenchar\font \endgroup -% BORDEL DE BORDEL, le hyphenchar est mis à -1 dans certaines circonstances, ici -% même pour cette TOC il l'est et le fait de mettre le bloc verbatim avant ou -% après ne change rien, et il l'est aussi pour la TOC de la section One more -% example TOC layout MAIS IL EST BIEN À 45 PARTOUT AILLEURS. - -% IL Y A DU CODE QUELQUE PART QUI MET LE HYPHENCHAR À -1 MAIS JE NE SAIS PAS OÙ. - -% bien sûr on peut soupçonner verbatim ou \verb mais je n'ai vraiment pas le -% temps d'aller voir plus avant maintenant. L'explication doit être -% transparente, mais il est tout de même étrange que ce phénomène n'apparaisse -% qu'en deux endroits et je ne vois pas dans l'immédiat ce qu'il y a de commun. - -% C'EST LE \SMALL PUTAIN FAIT CHIER LATEX LE DECLAREFONTFAMILY EST DANS LE DOC -% POURQUOI ALLER LE RE-CHERCHER APRES UN SMALL FAIT CHIER PUTAIN FAIT CHIER - -% ************ LATEX FAIT CHIER !!!!! MERDEUUUUUUH *********** - \etocmulticol[3]{\subsection{All subsections of this document}} \endgroup @@ -3742,25 +3617,20 @@ And now, the variant which was used for \setcounter{tocdepth}{2}% \setcounter{mycounti}{0}% \def\thissectionstatsaux{% ou plus simple si on ne veut pas le lien. - \toks@\expandafter{\etocthename}% - \edef\firstsubname{\noexpand\hyperlink{\Hy@tocdestname}{\the\toks@}}% - \toks@\expandafter{\etocthenumber}% - \edef\firstsubnumber{\noexpand\hyperlink{\Hy@tocdestname}{\the\toks@}}% + \let\firstsubname\etocthelinkedname + \let\firstsubnumber\etocthelinkednumber \def\thissectionstatsaux{}} \begingroup \etocsetstyle{subsection} {} {} {\thissectionstatsaux \stepcounter{mycounti}% - \toks@\expandafter{\etocthename}% - \edef\lastsubname{\noexpand\hyperlink{\Hy@tocdestname}{\the\toks@}}% - \toks@\expandafter{\etocthenumber}% - \edef\lastsubnumber{\noexpand\hyperlink{\Hy@tocdestname}{\the\toks@}}% - } + \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{\color{cyan}\firstsubname{}} and the corresponding number is {\color{cyan}\firstsubnumber}. The name of the last subsection is \emph{\color{teal}\lastsubname{}} and its number is - {\color{teal}\lastsubnumber}.}% (with boxes, \emph would have done nothing) + {\color{teal}\lastsubnumber}.}% \etocsettocstyle {}{} \etocinline \localtableofcontents @@ -3793,14 +3663,6 @@ line containing an \etoc inner command and an identification number is added to the |.toc| file. The correct local table of contents will be displayed only on the next |latex| run. -% This is the only kind of data written by \etoc to the |.toc| -% file, but of course it does mean that if you remove usage of -% \etoc from the document, you should trash the |.toc| file. -% The commands written by \etoc to the |.toc| file do nothing -% when not used by \etoc itself, so other packages may -% also read the |.toc| file and execute its -% contents.\footnote{see previous footnote.} - \etoc expects the document sectioning units to write their data into the file having extension |.toc|, in the form of lines containing the \csa{contentsline} command and its @@ -3873,9 +3735,6 @@ groups. All TOCs are typeset inside groups. these instructions should be done in such a way that they can be activated or deactivated easily from the document source, as need be. - % Do not clone a clone but produce rather twins by cloning the - % same original local table of contents. - As is usual with toc and labels, after each change, one has to run latex a certain number of times to let the produced document get its final appearance (at least twice).\par -- cgit v1.2.3