summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tableof
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 /Master/texmf-dist/tex/latex/tableof
parentd679cd6dd0b4743369e03f65a7dee486a326e148 (diff)
tableof (11mar15)
git-svn-id: svn://tug.org/texlive/trunk@36489 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tableof')
-rw-r--r--Master/texmf-dist/tex/latex/tableof/tableof.sty56
1 files changed, 33 insertions, 23 deletions
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 }