summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-03-11 20:27:21 +0000
committerKarl Berry <karl@freefriends.org>2015-03-11 20:27:21 +0000
commit82f0cb7ffe472ca28a9ffee3a230e762252ca1e5 (patch)
treef43c45f144251cffbf2e0d1079393beea2b3218b
parentd679cd6dd0b4743369e03f65a7dee486a326e148 (diff)
tableof (11mar15)
git-svn-id: svn://tug.org/texlive/trunk@36489 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/tableof/README5
-rw-r--r--Master/texmf-dist/doc/latex/tableof/README.md14
-rw-r--r--Master/texmf-dist/doc/latex/tableof/tableof.pdfbin48585 -> 53757 bytes
-rw-r--r--Master/texmf-dist/source/latex/tableof/tableof.dtx191
-rw-r--r--Master/texmf-dist/source/latex/tableof/tableof.ins6
-rw-r--r--Master/texmf-dist/tex/latex/tableof/tableof.sty56
6 files changed, 182 insertions, 90 deletions
diff --git a/Master/texmf-dist/doc/latex/tableof/README b/Master/texmf-dist/doc/latex/tableof/README
index da6cef7d425..aef963f769f 100644
--- a/Master/texmf-dist/doc/latex/tableof/README
+++ b/Master/texmf-dist/doc/latex/tableof/README
@@ -1,9 +1,10 @@
+
ABSTRACT
- Package: tableof (Tables of tagged contents)
-- Version: 1.4 (2015/02/20)
+- Version: 1.4a (2015/03/10)
- License: LPPL 1.3c
- Copyright (C) 2012-2015 Jean-Francois Burnol
@@ -55,6 +56,8 @@ twice on it to see examples of tagged tables of contents.
CHANGE HISTORY
+- v1.4a (2015/03/10) changes for enhanced compatibility with etoc.
+
- v1.4 (2015/02/20) under the hood code improvements.
- v1.3 (2015/02/11) comma separated lists of tags now allow spaces.
diff --git a/Master/texmf-dist/doc/latex/tableof/README.md b/Master/texmf-dist/doc/latex/tableof/README.md
index 99e7b661304..93bead96db7 100644
--- a/Master/texmf-dist/doc/latex/tableof/README.md
+++ b/Master/texmf-dist/doc/latex/tableof/README.md
@@ -2,7 +2,7 @@ Abstract
========
- Package: tableof (Tables of tagged contents)
-- Version: 1.4 (2015/02/20)
+- Version: 1.4a (2015/03/10)
- License: LPPL 1.3c
- Copyright (C) 2012-2015 Jean-Francois Burnol <jfbu at free dot fr>
@@ -51,15 +51,17 @@ latex twice on it to see examples of tagged tables of contents.
Change History
==============
-* v1.4 (2015/02/20) under the hood code improvements.
+* v1.4a (2015/03/10) changes for enhanced compatibility with etoc.
-* v1.3 (2015/02/11) comma separated lists of tags now allow spaces.
+* v1.4 (2015/02/20) under the hood code improvements.
-* v1.2 (2013/03/04) added command `\tableoftaggedcontents`.
+* v1.3 (2015/02/11) comma separated lists of tags now allow spaces.
-* v1.1 (2012/12/13) added command `\nexttocwithtags`.
+* v1.2 (2013/03/04) added command `\tableoftaggedcontents`.
-* v1.0 (2012/12/06) first release.
+* v1.1 (2012/12/13) added command `\nexttocwithtags`.
+
+* v1.0 (2012/12/06) first release.
License
diff --git a/Master/texmf-dist/doc/latex/tableof/tableof.pdf b/Master/texmf-dist/doc/latex/tableof/tableof.pdf
index 056c0439f6e..66deda9916d 100644
--- a/Master/texmf-dist/doc/latex/tableof/tableof.pdf
+++ b/Master/texmf-dist/doc/latex/tableof/tableof.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/tableof/tableof.dtx b/Master/texmf-dist/source/latex/tableof/tableof.dtx
index cf0eda06a61..b31b42a18c8 100644
--- a/Master/texmf-dist/source/latex/tableof/tableof.dtx
+++ b/Master/texmf-dist/source/latex/tableof/tableof.dtx
@@ -1,13 +1,13 @@
% -*- coding: iso-latin-1; -*-
%<*none>
-{\def\doctimestamp {Time-stamp: <20-02-2015 23:02:03 CET>}%
+{\def\doctimestamp {Time-stamp: <10-03-2015 22:22:48 CET>}%
\def\getdtxtimestamp #1 <#2 #3 #4>{#2 at #3 #4}%
\xdef\tofdtxtimestamp {\expandafter\getdtxtimestamp\doctimestamp }}%
-\def\docdate{2015/02/20}
+\def\docdate{2015/03/10}
%</none>
%%
%% Package: tableof
-%% Version: 1.4 (2015/02/20)
+%% Version: 1.4a (2015/03/10)
%% License: LPPL 1.3c
%% Copyright (C) 2012-2015 Jean-Francois Burnol <jfbu at free dot fr>
%%
@@ -26,11 +26,11 @@
% Installation:
% ============
%
-% latex tableof.dtx or pdflatex tableof.dtx
+% latex tableof.dtx
%
-% Run twice to get the bookmarks right. `tableof.sty`, `tableof.ins` and
-% `tableoftest.tex` are generated on the first latex run. Move `tableof.sty` to
-% a suitable location within the TeX installation:
+% `tableof.sty`, `tableof.ins` and `tableoftest.tex` are generated
+% on the first latex run. Move `tableof.sty` to a suitable
+% location within the TeX installation:
%
% tableof.sty -> <TDS>/tex/latex/tableof/
%
@@ -39,10 +39,13 @@
% `tableoftest.tex` is an example of use of the package commands. Run
% latex twice on it to see examples of tagged tables of contents.
%
+% To generate the documentation, run once more latex on tableof.dtx,
+% then run dvipdfmx on tableof.dvi
+%
%<*ins>
\def\pkgname {tableof}
-\def\pkgdate {2015/02/20}
-\def\pkgversion {v1.4}
+\def\pkgdate {2015/03/10}
+\def\pkgversion {v1.4a}
\def\pkgdescription {Tables of tagged contents (jfB)}
%</ins>
%<*none>
@@ -372,6 +375,7 @@ pdfpagemode=UseOutlines}
\renewcommand\familydefault\sfdefault
+\usepackage{framed}
\begin{document}
\thispagestyle{empty}
\rmfamily
@@ -434,9 +438,14 @@ tags. The tags need not have been predeclared.
\subsection{\csbhyp{toftagthis \{tag1, tag2, ...\}} and
\csbhyp{tofuntagthis \{tag1, tag2, ...\}}}
-The \csa{toftagthis} command flags with the comma separated values from its list
-argument only the \emph{next} sectioning command. The \csa{tofuntagthis} command
-similarly untags only the \emph{next} entry.
+The \csa{toftagthis} command flags with the comma separated values from its
+list argument only the \emph{next} sectioning command. The effect is not
+cumulative: it is the last use of \csa{toftagthis} which counts; use it for
+all the needed tags at once.
+
+The \csa{tofuntagthis} command similarly untags only the \emph{next} entry.
+Similarly, only the tags in the last call of \csa{tofuntagthis} are taken into
+account.
\begin{verbatim}
\toftagstart{kitchenware, rabbits}
\section{Knives and rabbits} % tagged with kitchenware and rabbits
@@ -473,9 +482,10 @@ This command influences the next \csa{tableofcontents} (or equivalent) command:
will let \csa{tableofcontents} print only the sectioning units having been
flagged with both |A| and |B| and none of |C|, |D|, or |E|.
-\textbf{Do not forget the second pair of braces if you only want to require
- some tags:} \csa{nexttocwithtags}|{tag1, tag2}{}|.
-
+\begin{framed}
+ \noindent\textbf{DO NOT FORGET THE SECOND PAIR OF BRACES EVEN IF YOU ONLY
+ WANT TO REQUIRE SOME TAGS:} \csa{nexttocwithtags}|{tag1, tag2}{}|.
+\end{framed}
\subsubsection{starred variants}
@@ -566,56 +576,64 @@ Please consider: this command should \emph{not} be used when the
provided \emph{only} for the case where the document uses \emph{exclusively}
\csa{tableoftaggedcontents}, \csa{tableof} and \csa{tablenotof}.
-\subsection{Compatibility with other packages}
+\section{Compatibility with other packages}
\tableof checks if |hyperref| is loaded as |hyperref| modifies the format of the
lines in the |.toc| file (and this must be taken into account). This check is
done at the \csa{begin}|{document}| so the order of loading is not important.
-\tableof requires that the document |.toc| file uses the |\contentsline| macro
+\tableof requires the document |.toc| file to use the |\contentsline| macro
(possibly patched by other packages). It is thus incompatible with the
|beamer| class. However, if |beamer| is used in an article mode, i.e., with
the article class in conjunction with the |beamerarticle| package, then \tableof
-should work (not tested\dots).
+should work.
\tableof adds the tag data to the |.toc| file, but this data self-defines
itself to do nothing when not activated by \tableof's own commands. Since
release |1.3|, these redefinitions are done in \emph{one single} line of the
-|.toc| file to circumvent \emph{crazy} interference of |biblatex| which adds
+|.toc| file to circumvent interference of |biblatex| which adds
commands to the |.toc| line on every other line (thus, potentially right in
the middle of multi-line commands \verb+:-(+.)
No testing has actually been done of compatibility with packages manipulating
tables of contents, apart from
-\etoc.\footnote{\url{http://www.ctan.org/pkg/etoc}} It went fine.
+\etoc.\footnote{\url{http://www.ctan.org/pkg/etoc}} It went fine.
-\subsection{Version History}
+\section{Version History}
\begingroup
\parindent0pt
\makeatletter
-\settowidth{\dimen@}{\ttfamily 2015/02/20 v1.4: i.\space}
+\settowidth{\dimen@}{\ttfamily 2015/03/10 v1.4a: i.\space}
\everypar\expandafter{\expandafter\hangindent\the\dimen@
\hangafter1 }
\makeatother
-|2015/02/20 v1.4: i. |some code efficiency improvements (some
+|2015/03/10 v1.4a: i. |changes in the code to make it more easily patchable by
+other packages (I have especially the next release of \etoc in mind): changes
+to the way |\tof@begin|, |\tof@finish| are set up, new |\tof@global| which
+defaults to nothing but may be set to be |\global| (this is in view of doing
+TOCs as tabulars of longtables, in the way \etoc |1.08| will permit).
+
+| ii. |improved sectioning of the documentation.
+
+|2015/02/20 v1.4: i. |some code efficiency improvements (some
|\edef|'s replaced by a bunch of |\expandafter|'s.)
-| ii. |improved documentation.
+| ii. |improved documentation.
-|2015/02/11 v1.3: i. |comma separated lists of tags now allow spaces.
+|2015/02/11 v1.3: i. |comma separated lists of tags now allow spaces.
-| ii. |only one line used for the |.toc| code silently
+| ii. |only one line used for the |.toc| code silently
unactivating |tableof| if its |\usepackage{tableof}| has been removed from the
document source. (needed due to aggressive |biblatex| interference with |.toc|
files.)
-| iii. |reading of .toc file is delayed to |\begin{document}| to
+| iii. |reading of .toc file is delayed to |\begin{document}| to
account for possible Babel active characters used therein. Not relevant if
document uses standard |\tableofcontents| or like commands.
-|2013/03/04 v1.2: i. |added \csa{tableoftaggedcontents} as a wrapper for using
+|2013/03/04 v1.2: i. |added \csa{tableoftaggedcontents} as a wrapper for using
\csa{nexttocwithtags} followed with |tableof|'s private copy of the |.toc| data.
| ii. |added \csa{if@filesw} test to \csa{tofOpenTocFileForWrite}.
@@ -648,8 +666,20 @@ produce the pdf documentation.
\StopEventually{\check@checksum\end{document}}
\makeatother
-Writing-up source code comments is hopefully for a future
-release.
+% Suite à mésaventure le 9 mars 2015 dans etoc.dtx:
+
+% ATTENTION QU'AVANT DE COMMENCER DES MACROCODE IL FAUT OBLIGATOIREMENT UN
+% PARAGRAPHE APRÈS \section (SINON ESPACEMENTS VERTICAUX POST MACROCODE
+% SUPPRIMÉS :((((( )
+
+% ceci faisait donc l'affaire :
+
+% Writing-up source code comments is hopefully for a future
+% release.
+
+% maintenant je fais:
+
+\indent
\makeatletter
\begingroup
@@ -687,7 +717,7 @@ release.
\ProcessOptions\relax
\newtoks\tof@toctoks
% \end{macrocode}
-% |1.3| codes this |\tof@readtoc| slightly better (copied from etoc.dtx).
+% |1.3| codes this |\tof@readtoc| slightly better (copied from \etoc.dtx).
% \begin{macrocode}
\def\tof@readtoc {%
\ifeof \tof@tf
@@ -706,7 +736,7 @@ release.
% TOC.
% \begin{macrocode}
\AtBeginDocument{\IfFileExists{\jobname.toc}
- {{\endlinechar-1
+ {{\endlinechar\m@ne
\makeatletter
\newread\tof@tf
\openin\tof@tf\@filef@und
@@ -714,6 +744,11 @@ release.
\global\tof@toctoks=\expandafter{\the\tof@toctoks}%
\closein\tof@tf}}{}}
% \end{macrocode}
+% The trick is that |\@ifundefined| chooses the undefined branch if the
+% meaning is |\relax|. Thus it is possible for \tableof to define and use
+% |\tof@begin| and later set it to |\relax|, the entire influence of \tableof
+% will then be turned off.
+%
% |1.2| of |2013/03/04|: \csa{string\{}->\{, idem with
% \}. And added \csa{if@filesw} test.
%
@@ -722,21 +757,64 @@ release.
% might get inserted right in the middle of arguments to a multi-line macro!
% also removed a bunch of |\string|'s: when I first wrote this package I had
% still limited understanding of \TeX's macros.
+%
+% |1.4a| uses |\@empty| for the default |\tof@finish| rather than |\relax|,
+% for no special reason. Also the |\let|'s in case |\tof@begin| is undefined
+% or |\relax| are all made global, because for compatibility with the fancy
+% things \etoc |1.08| will allow for TOC as table we need a global mode, and
+% the simplest is here to do the things global by default.
% \begin{macrocode}
\AtBeginDocument{
\addtocontents{toc}{\string\@ifundefined{tof@begin}%
- {\let\string\tof@begin\relax
- \let\string\tof@finish\relax
- \let\string\tof@starttags\string\@gobble
- \let\string\tof@stoptags\string\@gobble
- \let\string\tof@tagthis\string\@gobble
- \let\string\tof@untagthis\string\@gobble}{}}
+ {\global\let\string\tof@begin\relax
+ \global\let\string\tof@finish\string\@empty
+ \global\let\string\tof@starttags\string\@gobble
+ \global\let\string\tof@stoptags\string\@gobble
+ \global\let\string\tof@tagthis\string\@gobble
+ \global\let\string\tof@untagthis\string\@gobble}{}}
\addtocontents{toc}{\string\tof@begin}
\@ifpackageloaded{hyperref}
{\def\tof@gobblethree@orfour#1#2#3#4{}%
\ifx\hyper@last\@undefined\tof@toctoks{}\fi}
{\def\tof@gobblethree@orfour#1#2#3{}}}
\AtEndDocument{\addtocontents{toc}{\string\tof@finish}}
+% \end{macrocode}
+% |1.4a| makes the things more easily patchable by other packages, especially
+% I have \etoc in mind.
+%
+% |\tof@@starttags| and |\tof@@stoptags| are defined a bit later in the code.
+% And we use |\tof@global|. And we need |\tof@@finish| to reset |\tof@tags| to
+% empty, just in case |\tof@global| was |\global|. And also |\contentsline| !!
+% But here it is a problem redefining it globally. In normal use of \tableof,
+% nothing needs to be done, because the |\tof@endgroup| closes the scope. In
+% global mode (triggered only by \etoc with |\etocglobaldefs| for tabulars),
+% it needed to globally modify |\contentsline|, thus it or \etoc has to
+% globally unmodify it. \etoc |1.08| by itself without \tableof doesn't have
+% to reset |\contentsline| because it re-defined it \emph{before} an eventual
+% tabular. But as it forced \tableof to do global things, in such case \etoc
+% will have to proceed globally as well.
+% \begin{macrocode}
+\let\tof@global \@empty
+\let\tof@begingroup \begingroup
+\let\tof@endgroup \endgroup
+\def\tof@@finish {\tof@global\let\contentsline\tof@savedcontentsline
+ \tof@endgroup\global\let\tof@begin\relax
+ \global\let\tof@tags\@empty }
+\def\tof@@tagthis #1{\def\tof@tags@tmp{#1}}
+\def\tof@@untagthis #1{\def\tof@untags@tmp{#1}}
+\def\tof@init#1{%
+ \def\tof@begin{%
+ \tof@begingroup
+ \tof@global\let\tof@tagthis \tof@@tagthis
+ \tof@global\let\tof@untagthis\tof@@untagthis
+ \tof@global\let\tof@starttags\tof@@starttags
+ \tof@global\let\tof@stoptags \tof@@stoptags
+ \tof@global\let\tof@finish \tof@@finish
+ \tof@global\let\tof@savedcontentsline\contentsline
+ \tof@global\def\contentsline {#1}}}
+% \end{macrocode}
+% place holder for comments
+% \begin{macrocode}
\newcommand\tofOpenTocFileForWrite{%
\if@filesw
\newwrite \tf@toc
@@ -746,10 +824,14 @@ release.
% Creating our booleans is not the most economical, (one could have used a
% single list macro) but heck, how many tags are there going to be anyhow in
% normal use? a dozen at the very most I think.
+%
+% |1.4a|: fortunately no need for the |\tof@global| thing! However, careful
+% with |\tof@tags| it will have to be reset to empty by |\tof@finish| in case
+% |\tof@global| is |\global|.
% \begin{macrocode}
-\def\tof@tags{}
-\def\tof@tags@tmp{}
-\def\tof@untags@tmp{}
+\let\tof@tags \@empty
+\let\tof@tags@tmp \@empty
+\let\tof@untags@tmp\@empty
\def\tof@true #1{\expandafter\let\csname tofsw@#1\endcsname\iftrue}
\def\tof@false#1{\expandafter\let\csname tofsw@#1\endcsname\iffalse}
\def\tof@secondiftrue#1%
@@ -757,7 +839,9 @@ release.
\def\tof@secondiffalse#1%
{\csname tofsw@#1\endcsname\else\let\tof@next\@secondoftwo\fi}
% \end{macrocode}
-% placeholder for comments
+% |1.4a|: fortunately no need for the |\tof@global| thing; the |\tof@setflags|
+% is used at \emph{each} |\contentsline|. Quite useful design, congrats to the
+% original architect !
% \begin{macrocode}
\def\tof@setflags #1{\let\tof@next\@firstoftwo
\@for\@tempa:=#1\do {\tof@true {\@tempa}}%
@@ -777,33 +861,26 @@ release.
\expandafter\expandafter\expandafter{\expandafter
\tof@tmptags\expandafter,#2}%
\fi\fi}
+% \end{macrocode}
+% |1.4a| needs the |\tof@global| in the hope for \tableof to be compatible with
+% future \etoc |1.08| when employed in the delicate art of TOC as a table !
+% \begin{macrocode}
\def\tof@@starttags#1{%
\ifx\tof@tags\@empty
- \def\tof@tags{#1}%
+ \tof@global\def\tof@tags{#1}%
\else
+ \tof@global
\expandafter\def\expandafter\tof@tags\expandafter{\tof@tags,#1}%
\fi }
\def\tof@@stoptags#1{%
\@for\@tempa:=#1\do{%
\def\tof@tmptags{}%
\@for\@tempb:=\tof@tags\do{\tof@filter\@tempa\@tempb}%
+ \tof@global
\expandafter\def\expandafter\tof@tags\expandafter{\tof@tmptags}%
}%
}
% \end{macrocode}
-% placeholder for comments
-% \begin{macrocode}
-\def\tof@init#1{%
- \def\tof@begin{%
- \begingroup
- \def\tof@finish{\endgroup\global\let\tof@begin\relax}%
- \let\tof@savedcontentsline\contentsline
- \let\tof@starttags\tof@@starttags
- \let\tof@stoptags\tof@@stoptags
- \def\tof@tagthis ####1{\def\tof@tags@tmp{####1}}%
- \def\tof@untagthis ####1{\def\tof@untags@tmp{####1}}%
- \def\contentsline {#1}}}
-% \end{macrocode}
% Until |1.3|, I was just using the \csa{@for} thing with no attempt at any
% extra parsing, for spaces in particular. With |1.3| of |2015/02/11| I use an
% |\edef| to remove all spaces first, using a |\zapspaces| macro pioneered in
@@ -905,7 +982,7 @@ release.
Grave accent \` Left brace \{ Vertical bar \|
Right brace \} Tilde \~}
-\CheckSum{505}
+\CheckSum{552}
\Finale
%%
diff --git a/Master/texmf-dist/source/latex/tableof/tableof.ins b/Master/texmf-dist/source/latex/tableof/tableof.ins
index af6d6597489..183a5e8ca3d 100644
--- a/Master/texmf-dist/source/latex/tableof/tableof.ins
+++ b/Master/texmf-dist/source/latex/tableof/tableof.ins
@@ -1,12 +1,12 @@
%%
%% Package: tableof
-%% Version: 1.4 (2015/02/20)
+%% Version: 1.4a (2015/03/10)
%% License: LPPL 1.3c
%% Copyright (C) 2012-2015 Jean-Francois Burnol <jfbu at free dot fr>
%%
\def\pkgname {tableof}
-\def\pkgdate {2015/02/20}
-\def\pkgversion {v1.4}
+\def\pkgdate {2015/03/10}
+\def\pkgversion {v1.4a}
\def\pkgdescription {Tables of tagged contents (jfB)}
%% This file `tableof.ins' is provided for compatibility with TeX
%% distributions expecting to find it for installation of `tableof.sty'.
diff --git a/Master/texmf-dist/tex/latex/tableof/tableof.sty b/Master/texmf-dist/tex/latex/tableof/tableof.sty
index 855ada6d8d3..3d73b4f89cb 100644
--- a/Master/texmf-dist/tex/latex/tableof/tableof.sty
+++ b/Master/texmf-dist/tex/latex/tableof/tableof.sty
@@ -22,10 +22,10 @@
%% in the same archive or directory.)
%%
\ProvidesPackage{tableof}
- [2015/02/20 v1.4 Tables of tagged contents (jfB)]
+ [2015/03/10 v1.4a Tables of tagged contents (jfB)]
%%
%% Package: tableof
-%% Version: 1.4 (2015/02/20)
+%% Version: 1.4a (2015/03/10)
%% License: LPPL 1.3c
%% Copyright (C) 2012-2015 Jean-Francois Burnol <jfbu at free dot fr>
%%
@@ -42,7 +42,7 @@
\expandafter\tof@readtoc
\fi }
\AtBeginDocument{\IfFileExists{\jobname.toc}
- {{\endlinechar-1
+ {{\endlinechar\m@ne
\makeatletter
\newread\tof@tf
\openin\tof@tf\@filef@und
@@ -51,26 +51,44 @@
\closein\tof@tf}}{}}
\AtBeginDocument{
\addtocontents{toc}{\string\@ifundefined{tof@begin}%
- {\let\string\tof@begin\relax
- \let\string\tof@finish\relax
- \let\string\tof@starttags\string\@gobble
- \let\string\tof@stoptags\string\@gobble
- \let\string\tof@tagthis\string\@gobble
- \let\string\tof@untagthis\string\@gobble}{}}
+ {\global\let\string\tof@begin\relax
+ \global\let\string\tof@finish\string\@empty
+ \global\let\string\tof@starttags\string\@gobble
+ \global\let\string\tof@stoptags\string\@gobble
+ \global\let\string\tof@tagthis\string\@gobble
+ \global\let\string\tof@untagthis\string\@gobble}{}}
\addtocontents{toc}{\string\tof@begin}
\@ifpackageloaded{hyperref}
{\def\tof@gobblethree@orfour#1#2#3#4{}%
\ifx\hyper@last\@undefined\tof@toctoks{}\fi}
{\def\tof@gobblethree@orfour#1#2#3{}}}
\AtEndDocument{\addtocontents{toc}{\string\tof@finish}}
+\let\tof@global \@empty
+\let\tof@begingroup \begingroup
+\let\tof@endgroup \endgroup
+\def\tof@@finish {\tof@global\let\contentsline\tof@savedcontentsline
+ \tof@endgroup\global\let\tof@begin\relax
+ \global\let\tof@tags\@empty }
+\def\tof@@tagthis #1{\def\tof@tags@tmp{#1}}
+\def\tof@@untagthis #1{\def\tof@untags@tmp{#1}}
+\def\tof@init#1{%
+ \def\tof@begin{%
+ \tof@begingroup
+ \tof@global\let\tof@tagthis \tof@@tagthis
+ \tof@global\let\tof@untagthis\tof@@untagthis
+ \tof@global\let\tof@starttags\tof@@starttags
+ \tof@global\let\tof@stoptags \tof@@stoptags
+ \tof@global\let\tof@finish \tof@@finish
+ \tof@global\let\tof@savedcontentsline\contentsline
+ \tof@global\def\contentsline {#1}}}
\newcommand\tofOpenTocFileForWrite{%
\if@filesw
\newwrite \tf@toc
\immediate \openout \tf@toc \jobname.toc\relax
\fi}
-\def\tof@tags{}
-\def\tof@tags@tmp{}
-\def\tof@untags@tmp{}
+\let\tof@tags \@empty
+\let\tof@tags@tmp \@empty
+\let\tof@untags@tmp\@empty
\def\tof@true #1{\expandafter\let\csname tofsw@#1\endcsname\iftrue}
\def\tof@false#1{\expandafter\let\csname tofsw@#1\endcsname\iffalse}
\def\tof@secondiftrue#1%
@@ -93,27 +111,19 @@
\fi\fi}
\def\tof@@starttags#1{%
\ifx\tof@tags\@empty
- \def\tof@tags{#1}%
+ \tof@global\def\tof@tags{#1}%
\else
+ \tof@global
\expandafter\def\expandafter\tof@tags\expandafter{\tof@tags,#1}%
\fi }
\def\tof@@stoptags#1{%
\@for\@tempa:=#1\do{%
\def\tof@tmptags{}%
\@for\@tempb:=\tof@tags\do{\tof@filter\@tempa\@tempb}%
+ \tof@global
\expandafter\def\expandafter\tof@tags\expandafter{\tof@tmptags}%
}%
}
-\def\tof@init#1{%
- \def\tof@begin{%
- \begingroup
- \def\tof@finish{\endgroup\global\let\tof@begin\relax}%
- \let\tof@savedcontentsline\contentsline
- \let\tof@starttags\tof@@starttags
- \let\tof@stoptags\tof@@stoptags
- \def\tof@tagthis ####1{\def\tof@tags@tmp{####1}}%
- \def\tof@untagthis ####1{\def\tof@untags@tmp{####1}}%
- \def\contentsline {#1}}}
\def\tof@zapspaces #1 #2{#1#2\tof@zapspaces }%
\def\tof@cleanspaces #1#2{\edef\tof@tmp {{\tof@zapspaces #2 \@gobble}}%
\expandafter #1\tof@tmp }