summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/cleveref
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-12-02 16:06:21 +0000
committerNorbert Preining <preining@logic.at>2007-12-02 16:06:21 +0000
commite248bd684640a14cfb36eeb3df6319483901f1e5 (patch)
treeff39277eb07d7924b1b1fb264f4b629770f0fa1a /Master/texmf-dist/source/latex/cleveref
parent89dcd2b563d003b3984ccbc79ee4cb0841d0052b (diff)
update cleveref from CTAN
git-svn-id: svn://tug.org/texlive/trunk@5680 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/cleveref')
-rw-r--r--Master/texmf-dist/source/latex/cleveref/cleveref.dtx59
1 files changed, 33 insertions, 26 deletions
diff --git a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
index 62ceb705fff..6cad24c2f7a 100644
--- a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
+++ b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
@@ -60,7 +60,7 @@
%</driver>
% \fi
%
-% \CheckSum{3381}
+% \CheckSum{3387}
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -101,6 +101,7 @@
% type. Removed hyperref and ntheorem options; support for these and
% amsmath is enabled automatically if those packages are loaded.}
% \changes{v0.11}{2007/21/11}{Made referencing aware of appendices.}
+% \changes{v0.11.1}{2007/29/11}{Bug fixes.}
%
%
% \GetFileInfo{cleveref.sty}
@@ -969,18 +970,19 @@
% name as the ``type'' and instead uses whatever is supplied.
% \begin{macrocode}
\let\cref@old@refstepcounter\refstepcounter
-\def\refstepcounter%
- {\@ifnextchar[{\refstepcounter@optarg}{\refstepcounter@noarg}}%]
+\def\refstepcounter{%
+ \@ifnextchar[{\refstepcounter@optarg}{\refstepcounter@noarg}%]
+}
\def\refstepcounter@noarg#1{%
\cref@old@refstepcounter{#1}%
- \reset@by{#1}{\@result}%
+ \cref@resetby{#1}{\@result}%
\ifx\@result\relax\def\@result{}%
\else\edef\@result{\csname the\@result\endcsname}\fi%
\protected@edef\@currentlabel{%
[#1][\arabic{#1}][\@result]\@currentlabel}}
\def\refstepcounter@optarg[#1]#2{%
\cref@old@refstepcounter{#2}%
- \reset@by{#2}{\@result}%
+ \cref@resetby{#2}{\@result}%
\ifx\@result\relax\def\@result{}%
\else\edef\@result{\csname the\@result\endcsname}\fi%
\protected@edef\@currentlabel{%
@@ -1072,7 +1074,7 @@
\@ifundefined{chapter}{%
\def\refstepcounter@noarg##1{%
\cref@old@refstepcounter{##1}%
- \reset@by{##1}{\@result}%
+ \cref@resetby{##1}{\@result}%
\ifx\@result\relax\def\@result{}%
\else\edef\@result{\csname the\@result\endcsname}\fi%
\def\@tmpa{##1}
@@ -1087,7 +1089,7 @@
}{%
\def\refstepcounter@noarg##1{%
\cref@old@refstepcounter{##1}%
- \reset@by{##1}{\@result}%
+ \cref@resetby{##1}{\@result}%
\ifx\@result\relax\def\@result{}%
\else\edef\@result{\csname the\@result\endcsname}\fi%
\def\@tmpa{##1}
@@ -1098,7 +1100,7 @@
\else
\protected@edef\@currentlabel{%
[##1][\arabic{##1}][\@result]\@currentlabel}
- \fi}
+ \fi}%
}%
}
% \end{macrocode}
@@ -1193,7 +1195,9 @@
% appropriately. \cmd{\reset@by} searches through all the sectioning
% counters' reset lists, from lowest-level (subsubsection) to highest
% (part), checking whether the given counter is in the list, and
-% returns the first sectioning counter whose list it appears in.
+% returns the first sectioning counter whose list it appears (value is
+% returned by defining its second argument, which should be a macro
+% name).
% \begin{macrocode}
\newif\if@cref@inresetlist
\def\cref@isinresetlist#1#2{%
@@ -1860,7 +1864,7 @@
% Define the other capitalisation variants to be the partial expansions
% (expanded just once) of \cmd{\@tmpa} and \cmd{\@tmpb}.
% \begin{macrocode}
- \newtoks\@toksa%
+ \toksdef\@toksa=0%
\@toksa={%
\expandafter\gdef\csname\@other @#2@name\endcsname}%
\expandafter\the\expandafter\@toksa\expandafter{\@tmpa}%
@@ -1891,6 +1895,7 @@
\@tmplabel{####1}{####3}{####4}}%
\expandafter\def\expandafter\@tmpb\expandafter{%
\@tmplabel{####2}{####5}{####6}}%
+ \toksdef\@toksa=0%
\@toksa={\def\@tmprangelabel##1##2##3##4##5##6}%
\expandafter\expandafter\expandafter\expandafter%
\expandafter\expandafter\expandafter\the%
@@ -1936,7 +1941,6 @@
% \begin{macrocode}
\def\@crefdefineformat#1{%
\begingroup%
- \newtoks\@toksa%
% \end{macrocode}
% put format components into tmp macros
% \begin{macrocode}
@@ -1956,6 +1960,7 @@
% \end{macrocode}
% Define \cmd{\crefformat} and \cmd{\Crefformat}.
% \begin{macrocode}
+ \toksdef\@toksa=0%
\@toksa={\crefformat{#1}}%
\expandafter\the\expandafter\@toksa\expandafter{\@tmpfirst}%
\@toksa={\Crefformat{#1}}%
@@ -1964,8 +1969,6 @@
%
\def\@crefrangedefineformat#1{%
\begingroup%
- \newtoks\@toksa%
- \newtoks\@toksb%
% \end{macrocode}
% put format components into tmp macros
% \begin{macrocode}
@@ -1985,6 +1988,7 @@
% \end{macrocode}
% Define \cmd{\crefrangeformat} and \cmd{\Crefrangeformat}.
% \begin{macrocode}
+ \toksdef\@toksa=0%
\@toksa={\crefrangeformat{#1}}%
\expandafter\the\expandafter\@toksa\expandafter{\@tmpfirst}%
\@toksa={\Crefrangeformat{#1}}%
@@ -1993,8 +1997,6 @@
%
\def\@crefdefinemultiformat#1{%
\begingroup%
- \newtoks\@toksa%
- \newtoks\@toksb%
% \end{macrocode}
% put format components into tmp macros
% \begin{macrocode}
@@ -2027,6 +2029,8 @@
% Bundle all four arguments for \cmd{\crefmultiformat} in token
% register \cmd{\@toksb}, then call it.
% \begin{macrocode}
+ \toksdef\@toksa=0%
+ \toksdef\@toksb=1%
\@toksb={}%
\expandafter\cref@append@toks\expandafter\@toksb\expandafter{%
\expandafter{\@tmpfirst}}%
@@ -2057,8 +2061,6 @@
%
\def\@crefrangedefinemultiformat#1{%
\begingroup%
- \newtoks\@toksa%
- \newtoks\@toksb%
% \end{macrocode}
% put format components into tmp macros
% \begin{macrocode}
@@ -2092,6 +2094,8 @@
% Bundle all four arguments for \cmd{\crefrangemultiformat} in token
% register \cmd{\@toksb}, then call it.
% \begin{macrocode}
+ \toksdef\@toksa=0%
+ \toksdef\@toksb=1%
\@toksb={}%
\expandafter\cref@append@toks\expandafter\@toksb\expandafter{%
\expandafter{\@tmpfirst}}%
@@ -2189,7 +2193,7 @@
% of the capitalisation variant we've just defined above. The
% \cmd{\@toska} token register just makes the code less verbose.
% \begin{macrocode}
- \newtoks\@toksa%
+ \toksdef\@toksa=0%
\@toksa={\def\@tmpa##1##2##3}%
\expandafter\expandafter\expandafter\the%
\expandafter\expandafter\expandafter\@toksa%
@@ -2243,7 +2247,7 @@
% of the capitalisation variant we've just defined above. The
% \cmd{\@toska} token register just makes the code less verbose.
% \begin{macrocode}
- \newtoks\@toksa%
+ \toksdef\@toksa=0%
\@toksa={\def\@tmpa##1##2##3##4##5##6}%
\expandafter\expandafter\expandafter\the%
\expandafter\expandafter\expandafter\@toksa%
@@ -2300,6 +2304,7 @@
% of the capitalisation variant we've just defined above. The
% \cmd{\@toska} token register just makes the code less verbose.
% \begin{macrocode}
+ \toksdef\@toksa=0%
\@toksa={\def\@tmpa##1##2##3}%
\expandafter\expandafter\expandafter\the%
\expandafter\expandafter\expandafter\@toksa%
@@ -2386,6 +2391,7 @@
% of the capitalisation variant we've just defined above. The
% \cmd{\@toska} token register just makes the code less verbose.
% \begin{macrocode}
+ \toksdef\@toksa=0%
\@toksa={\def\@tmpa##1##2##3##4##5##6}%
\expandafter\expandafter\expandafter\the%
\expandafter\expandafter\expandafter\@toksa%
@@ -2731,7 +2737,8 @@
% type information. So we only need to change \cmd{\@currentlabel} in
% our \cmd{\refstepcounter} if an optional argument was supplied.
% \begin{macrocode}
-\def\refstepcounter@noarg#1{\cref@old@refstepcounter{#1}}
+\def\refstepcounter@noarg#1{\cref@old@refstepcounter{#1}%
+}
\def\refstepcounter@optarg[#1]#2{%
\cref@old@refstepcounter{#2}%
\expandafter\@cref@getlabel\@currentlabel\@nil{\@tmplabel}%
@@ -2755,34 +2762,34 @@
\cref@resetby{##1}{\@result}%
\ifx\@result\relax\def\@result{}%
\else\edef\@result{\csname the\@result\endcsname}\fi%
- \def\@tmpa{##1}
+ \def\@tmpa{##1}%
\def\@tmpb{section}%
\ifx\@tmpa\@tmpb%
\protected@edef\@currentlabel{%
[appendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
- \else
+ \else%
\protected@edef\@currentlabel{%
[##1][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
- fi}%
+ \fi}%
}{%
\def\H@refstepcounter##1{%
\stepcounter{##1}%
\cref@resetby{##1}{\@result}%
\ifx\@result\relax\def\@result{}%
\else\edef\@result{\csname the\@result\endcsname}\fi%
- \def\@tmpa{##1}
+ \def\@tmpa{##1}%
\def\@tmpb{chapter}%
\ifx\@tmpa\@tmpb%
\protected@edef\@currentlabel{%
[appendix][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
- \else
+ \else%
\protected@edef\@currentlabel{%
[##1][\arabic{##1}][\@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
- fi}%
+ \fi}%
}%
}
% \end{macrocode}