summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/cleveref
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-01-18 23:23:14 +0000
committerKarl Berry <karl@freefriends.org>2012-01-18 23:23:14 +0000
commitd3671f22432b637eaff8373f0a05d42b116d39be (patch)
tree204b63eeb7f3167330e9328d28cf1118fe2083ec /Master/texmf-dist/source/latex/cleveref
parentd5b1d635e3cbfd4d919e11ec0bcb4fced2d7b212 (diff)
cleveref 0.18.2 (17jan12)
git-svn-id: svn://tug.org/texlive/trunk@25141 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/cleveref')
-rw-r--r--Master/texmf-dist/source/latex/cleveref/cleveref.dtx433
1 files changed, 204 insertions, 229 deletions
diff --git a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
index f977a23fd89..24201299088 100644
--- a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
+++ b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx
@@ -1,5 +1,5 @@
-\def\packagedate{2011/12/24}
-\def\packageversion{0.18.1}
+\def\packagedate{2012/01/17}
+\def\packageversion{0.18.2}
% \iffalse meta-comment
%
% Package 'cleveref' to use with LaTeX2e
@@ -56,7 +56,7 @@
%</driver>
% \fi
%
-% \CheckSum{18240}
+% \CheckSum{18176}
%% \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
@@ -253,6 +253,12 @@
% \textbackslash{}label.}
% \changes{v0.18.1}{2011/12/24}{Fixed compatibility with newer versions
% of \package{caption} package.}
+% \changes{v0.18.2}{2012/01/17}{Don't try to redefine
+% \textbackslash{}appendix if it's not defined in current document
+% class. Fixed bug in \textbackslash{}\@setnamecref. Refactored common
+% code in format-definition macros into separate
+% \textbackslash{}\cref@othervariant macro. Added
+% \package{IEEEtrantools} support.}
%
% \GetFileInfo{cleveref.sty}
%
@@ -2005,112 +2011,114 @@
% ``section'' is the top-level sectioning command, and one if
% ``chapter'' fulfils that role.
% \begin{macrocode}
-\let\cref@old@appendix\appendix
-\renewcommand\appendix{%
- \cref@old@appendix%
- \@ifundefined{chapter}{%
- \gdef\refstepcounter@noarg##1{%
- \cref@old@refstepcounter{##1}%
- \cref@constructprefix{##1}{\cref@result}%
+\@ifundefined{appendix}{}{%
+ \let\cref@old@appendix\appendix
+ \renewcommand\appendix{%
+ \cref@old@appendix%
+ \@ifundefined{chapter}{%
+ \gdef\refstepcounter@noarg##1{%
+ \cref@old@refstepcounter{##1}%
+ \cref@constructprefix{##1}{\cref@result}%
% \end{macrocode}
% We add a large value to the front of the counter data, to force
% references to anything in appendices to be sorted after everything
% else.
% \begin{macrocode}
- \ifx\cref@result\@empty%
- \def\cref@result{2147483647}%
- \else%
- \edef\cref@result{2147483647,\cref@result}%
- \fi%
+ \ifx\cref@result\@empty%
+ \def\cref@result{2147483647}%
+ \else%
+ \edef\cref@result{2147483647,\cref@result}%
+ \fi%
% \end{macrocode}
% Override the cross-reference type of sectioning commands.
% \begin{macrocode}
- \def\@tempa{##1}%
- \def\@tempb{section}%
- \ifx\@tempa\@tempb%
- \protected@xdef\cref@currentlabel{%
- [appendix][\arabic{##1}][\cref@result]%
- \csname p@##1\endcsname\csname the##1\endcsname}%
- \else%
\def\@tempa{##1}%
- \def\@tempb{subsection}%
+ \def\@tempb{section}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subappendix][\arabic{##1}][\cref@result]%
+ [appendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tempa{##1}%
- \def\@tempb{subsubsection}%
+ \def\@tempb{subsection}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subsubappendix][\arabic{##1}][\cref@result]%
+ [subappendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
- \@ifundefined{cref@##1@alias}%
- {\def\@tempa{##1}}%
- {\def\@tempa{\csname cref@##1@alias\endcsname}}%
- \protected@xdef\cref@currentlabel{%
- [\@tempa][\arabic{##1}][\cref@result]%
- \csname p@##1\endcsname\csname the##1\endcsname}
+ \def\@tempa{##1}%
+ \def\@tempb{subsubsection}%
+ \ifx\@tempa\@tempb%
+ \protected@xdef\cref@currentlabel{%
+ [subsubappendix][\arabic{##1}][\cref@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
+ \else%
+ \@ifundefined{cref@##1@alias}%
+ {\def\@tempa{##1}}%
+ {\def\@tempa{\csname cref@##1@alias\endcsname}}%
+ \protected@xdef\cref@currentlabel{%
+ [\@tempa][\arabic{##1}][\cref@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}
+ \fi%
\fi%
- \fi%
- \fi}%
- }{%
- \def\refstepcounter@noarg##1{%
- \cref@old@refstepcounter{##1}%
- \cref@constructprefix{##1}{\cref@result}%
+ \fi}%
+ }{%
+ \def\refstepcounter@noarg##1{%
+ \cref@old@refstepcounter{##1}%
+ \cref@constructprefix{##1}{\cref@result}%
% \end{macrocode}
% Again, the large value added to the front of the counter data forces
% references to appendix items to be sorted last.
% \begin{macrocode}
- \ifx\cref@result\@empty%
- \def\cref@result{2147483647}%
- \else%
- \edef\cref@result{2147483647,\cref@result}%
- \fi%
+ \ifx\cref@result\@empty%
+ \def\cref@result{2147483647}%
+ \else%
+ \edef\cref@result{2147483647,\cref@result}%
+ \fi%
% \end{macrocode}
% Override the cross-reference type of sectioning commands.
% \begin{macrocode}
- \def\@tempa{##1}%
- \def\@tempb{chapter}%
- \ifx\@tempa\@tempb%
- \protected@xdef\cref@currentlabel{%
- [appendix][\arabic{##1}][\cref@result]%
- \csname p@##1\endcsname\csname the##1\endcsname}%
- \else%
\def\@tempa{##1}%
- \def\@tempb{section}%
+ \def\@tempb{chapter}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subappendix][\arabic{##1}][\cref@result]%
+ [appendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tempa{##1}%
- \def\@tempb{subsection}%
+ \def\@tempb{section}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subsubappendix][\arabic{##1}][\cref@result]%
+ [subappendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tempa{##1}%
- \def\@tempb{subsubsection}%
+ \def\@tempb{subsection}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subsubsubappendix][\arabic{##1}][\cref@result]%
+ [subsubappendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
- \@ifundefined{cref@##1@alias}%
- {\def\@tempa{##1}}%
- {\def\@tempa{\csname cref@##1@alias\endcsname}}%
- \protected@xdef\cref@currentlabel{%
- [\@tempa][\arabic{##1}][\cref@result]%
- \csname p@##1\endcsname\csname the##1\endcsname}
+ \def\@tempa{##1}%
+ \def\@tempb{subsubsection}%
+ \ifx\@tempa\@tempb%
+ \protected@xdef\cref@currentlabel{%
+ [subsubsubappendix][\arabic{##1}][\cref@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
+ \else%
+ \@ifundefined{cref@##1@alias}%
+ {\def\@tempa{##1}}%
+ {\def\@tempa{\csname cref@##1@alias\endcsname}}%
+ \protected@xdef\cref@currentlabel{%
+ [\@tempa][\arabic{##1}][\cref@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}
+ \fi%
\fi%
\fi%
- \fi%
- \fi}%
+ \fi}%
+ }%
}%
-}
+}% end of \@ifundefined{appendix}
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -3592,7 +3600,7 @@
% \cmd{\namecref} commands.
% \begin{macrocode}
\def\@@setnamecref#1#2{%
- \edef\@tempa{#1}%
+ \expandafter\def\expandafter\@tempa\expandafter{#1}%
\expandafter#2\@tempa}
% \end{macrocode}
% \end{macro}
@@ -3986,6 +3994,32 @@
% \end{macro}
% \end{macro}
%
+%
+% \begin{macro}{cref@othervariant}
+% The following utility macro sets up the appropriate definitions for
+% the other capitalisation variant. It defines the macro passed in |#2|
+% to be the other variant (``cref'' or ``Cref'') to the one specified
+% in |#1|, and defines |#3| to be the appropriate
+% capitalisation-changing command. It makes use of the fact that the
+% first character of \#1 is ``c'' for the lower-case variant and ``C''
+% for the upper-case one.
+% \begin{macrocode}
+\def\cref@othervariant#1#2#3{\cref@@othervariant#1\@nil#2#3}
+\def\cref@@othervariant#1#2\@nil#3#4{%
+ \if#1c%
+ \def#3{C#2}%
+ \def#4{\MakeUppercase}%
+ \else%
+ \def#3{c#2}%
+ \if@cref@capitalise%
+ \def#4{}%
+ \else%
+ \def#4{\MakeLowercase}%
+ \fi%
+ \fi}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@crefname}
% The \cmd{\@crefname} utility macro does the real work of defining
% format names, by defining an appropriately named command to contain
@@ -4001,28 +4035,10 @@
\expandafter\def\csname #1@#2@name#5\endcsname{#3}%
\expandafter\def\csname #1@#2@name@plural#5\endcsname{#4}%
% \end{macrocode}
-% The following \cmd{\@tempa} macro makes use of the fact that the first
-% character of \#1 is ``c'' for lower-case and ``C'' for upper-case, in
-% order to wrap the capitalisation-dependent parts in macros so that the
-% rest of the code can be capitalisation-variant agnostic.
-% \begin{macrocode}
- \def\@tempa##1##2\@nil{%
- \if##1c%
- \def\@other{C##2}%
- \def\@tempc{\expandafter\MakeUppercase}%
- \else%
- \def\@other{c##2}%
- \if@cref@capitalise%
- \def\@tempc{}%
- \else%
- \def\@tempc{\MakeLowercase}%
- \fi%
- \fi}%
- \@tempa#1\@nil%
-% \end{macrocode}
% If the other capitalisation variant is not already defined\dots
% \begin{macrocode}
- \@ifundefined{\@other @#2@name#5}{%
+ \cref@othervariant{#1}{\@tempc}{\@tempd}%
+ \@ifundefined{\@tempc @#2@name#5}{%
% \end{macrocode}
% Define \cmd{\@tempa} and \cmd{@tmpb} to be partial expansions (expanded
% just once) of the macros for the capitalisation variant we've just
@@ -4037,18 +4053,18 @@
\expandafter\expandafter\expandafter{%
\csname#1@#2@name@plural\endcsname}%
% \end{macrocode}
-% Add the case-change command stored in \cmd{\@tempc} to the front of the
+% Add the case-change command stored in \cmd{\@tempd} to the front of the
% definitions of \cmd{\@tempa} and \cmd{\@tempb}.
% \begin{macrocode}
\expandafter\ifx\@tempa\@empty\else%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\@tempa%
\expandafter\expandafter\expandafter{%
- \expandafter\@tempc\@tempa}%
+ \expandafter\@tempd\@tempa}%
\expandafter\expandafter\expandafter\def%
\expandafter\expandafter\expandafter\@tempb%
\expandafter\expandafter\expandafter{%
- \expandafter\@tempc\@tempb}%
+ \expandafter\@tempd\@tempb}%
\fi%
% \end{macrocode}
% Define the other capitalisation variants to be the partial expansions
@@ -4057,10 +4073,10 @@
% \begin{macrocode}
\toksdef\@toksa=0%
\@toksa={%
- \expandafter\def\csname\@other @#2@name#5\endcsname}%
+ \expandafter\def\csname\@tempc @#2@name#5\endcsname}%
\expandafter\the\expandafter\@toksa\expandafter{\@tempa}%
\@toksa={%
- \expandafter\def\csname\@other @#2@name@plural#5\endcsname}%
+ \expandafter\def\csname\@tempc @#2@name@plural#5\endcsname}%
\expandafter\the\expandafter\@toksa\expandafter{\@tempb}%
}{}%
% \end{macrocode}
@@ -4708,27 +4724,9 @@
\begingroup%
\expandafter\gdef\csname #1@#2@format\endcsname##1##2##3{#3}%
% \end{macrocode}
-% The following \cmd{\@tempa} macro makes use of the fact that the first
-% character of \#1 is ``c'' for lower-case and ``C'' for upper-case, in
-% order to wrap the capitalisation-dependent parts in macros so that the
-% rest of the code can be capitalisation-variant agnostic.
-% \begin{macrocode}
- \def\@tempa##1##2\@nil{%
- \if##1c%
- \def\@other{C##2}%
- \def\@changecase{\expandafter\MakeUppercase}%
- \else%
- \def\@other{c##2}%
- \if@cref@capitalise%
- \def\@changecase{}%
- \else%
- \def\@changecase{\MakeLowercase}%
- \fi%
- \fi}%
- \@tempa#1\@nil%
-% \end{macrocode}
% If the other capitalisation variant is not already defined\dots
% \begin{macrocode}
+ \cref@othervariant{#1}{\@other}{\@changecase}%
\@ifundefined{\@other @#2@format}{%
% \end{macrocode}
% Define \cmd{\@tempa} to be a partial expansion (expanded just once) of
@@ -4771,27 +4769,9 @@
\expandafter\gdef\csname #1@#2@format\endcsname%
##1##2##3##4##5##6{#3}%
% \end{macrocode}
-% The following \cmd{\@tempa} macro makes use of the fact that the first
-% character of \#1 is ``c'' for lower-case and ``C'' for upper-case, in
-% order to wrap the capitalisation-dependent parts in macros so that the
-% rest of the code can be capitalisation-variant agnostic.
-% \begin{macrocode}
- \def\@tempa##1##2\@nil{%
- \if##1c%
- \def\@other{C##2}%
- \def\@changecase{\expandafter\MakeUppercase}%
- \else%
- \def\@other{c##2}%
- \if@cref@capitalise%
- \def\@changecase{}%
- \else%
- \def\@changecase{\MakeLowercase}%
- \fi%
- \fi}%
- \@tempa#1\@nil%
-% \end{macrocode}
% If the other capitalisation variant is not already defined\dots
% \begin{macrocode}
+ \cref@othervariant{#1}{\@other}{\@changecase}%
\@ifundefined{\@other @#2@format}{%
% \end{macrocode}
% Define \cmd{\@tempa} to be a partial expansion (expanded just once) of
@@ -4835,28 +4815,10 @@
\expandafter\gdef\csname #1@#2@format@middle\endcsname##1##2##3{#5}%
\expandafter\gdef\csname #1@#2@format@last\endcsname##1##2##3{#6}%
% \end{macrocode}
-% The following \cmd{\@tempa} macro makes use of the fact that the first
-% character of \#1 is ``c'' for lower-case and ``C'' for upper-case, in
-% order to wrap the capitalisation-dependent parts in macros so that the
-% rest of the code can be capitalisation-variant agnostic.
-% \begin{macrocode}
- \def\@tempa##1##2\@nil{%
- \if##1c%
- \def\@other{C##2}%
- \def\@changecase{\expandafter\MakeUppercase}%
- \else%
- \def\@other{c##2}%
- \if@cref@capitalise%
- \def\@changecase{}%
- \else%
- \def\@changecase{\MakeLowercase}%
- \fi%
- \fi}%
- \@tempa#1\@nil%
-% \end{macrocode}
% If the other capitalisation variant of the first part of the
% multi-format definition is not already defined\dots
% \begin{macrocode}
+ \cref@othervariant{#1}{\@other}{\@changecase}%
\@ifundefined{\@other @#2@format@first}{%
% \end{macrocode}
% Define \cmd{\@tempa} to be a partial expansion (expanded just once) of
@@ -4931,28 +4893,10 @@
\expandafter\gdef\csname #1@#2@format@last\endcsname%
##1##2##3##4##5##6{#6}%
% \end{macrocode}
-% The following \cmd{\@tempa} macro makes use of the fact that the first
-% character of \#1 is ``c'' for lower-case and ``C'' for upper-case, in
-% order to wrap the capitalisation-dependent parts in macros so that the
-% rest of the code can be capitalisation-variant agnostic.
-% \begin{macrocode}
- \def\@tempa##1##2\@nil{%
- \if##1c%
- \def\@other{C##2}%
- \def\@changecase{\expandafter\MakeUppercase}%
- \else%
- \def\@other{c##2}%
- \if@cref@capitalise%
- \def\@changecase{}%
- \else%
- \def\@changecase{\MakeLowercase}%
- \fi%
- \fi}%
- \@tempa#1\@nil%
-% \end{macrocode}
% If the other capitalisation variant of the first part of the
% multi-format definition is not already defined\dots
% \begin{macrocode}
+ \cref@othervariant{#1}{\@other}{\@changecase}%
\@ifundefined{\@other @#2@format@first}{%
% \end{macrocode}
% Define \cmd{\@tempa} to be a partial expansion (expanded just once) of
@@ -5098,111 +5042,113 @@
% ``appendix'' instead. But this time, it is \cmd{\H@refstepcounter}
% that needs to be redefined.
% \begin{macrocode}
- \renewcommand\appendix{%
- \cref@old@appendix%
- \@ifundefined{chapter}{%
- \def\H@refstepcounter##1{%
- \cref@old@H@refstepcounter{##1}%
- \cref@constructprefix{##1}{\cref@result}%
+ \@ifundefined{appendix}{}{%
+ \renewcommand\appendix{%
+ \cref@old@appendix%
+ \@ifundefined{chapter}{%
+ \def\H@refstepcounter##1{%
+ \cref@old@H@refstepcounter{##1}%
+ \cref@constructprefix{##1}{\cref@result}%
% \end{macrocode}
% We add a large value to the front of the counter data, to force
% references to anything in appendices to be sorted after
% everything else.
% \begin{macrocode}
- \ifx\cref@result\@empty%
- \def\cref@result{2147483647}%
- \else%
- \edef\cref@result{2147483647,\cref@result}%
- \fi%
+ \ifx\cref@result\@empty%
+ \def\cref@result{2147483647}%
+ \else%
+ \edef\cref@result{2147483647,\cref@result}%
+ \fi%
% \end{macrocode}
% Override the cross-reference type of sectioning commands.
% \begin{macrocode}
- \def\@tempa{##1}%
- \def\@tempb{section}%
- \ifx\@tempa\@tempb%
- \protected@xdef\cref@currentlabel{%
- [appendix][\arabic{##1}][\cref@result]%
- \csname p@##1\endcsname\csname the##1\endcsname}%
- \else%
\def\@tempa{##1}%
- \def\@tempb{subsection}%
+ \def\@tempb{section}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subappendix][\arabic{##1}][\cref@result]%
+ [appendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tempa{##1}%
- \def\@tempb{subsubsection}%
+ \def\@tempb{subsection}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subsubappendix][\arabic{##1}][\cref@result]%
+ [subappendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
- \@ifundefined{cref@##1@alias}%
- {\def\@tempa{##1}}%
- {\def\@tempa{\csname cref@##1@alias\endcsname}}%
- \protected@xdef\cref@currentlabel{%
- [\@tempa][\arabic{##1}][\cref@result]%
- \csname p@##1\endcsname\csname the##1\endcsname}
+ \def\@tempa{##1}%
+ \def\@tempb{subsubsection}%
+ \ifx\@tempa\@tempb%
+ \protected@xdef\cref@currentlabel{%
+ [subsubappendix][\arabic{##1}][\cref@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
+ \else%
+ \@ifundefined{cref@##1@alias}%
+ {\def\@tempa{##1}}%
+ {\def\@tempa{\csname cref@##1@alias\endcsname}}%
+ \protected@xdef\cref@currentlabel{%
+ [\@tempa][\arabic{##1}][\cref@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}
+ \fi%
\fi%
- \fi%
- \fi}%
- }{%
- \def\H@refstepcounter##1{%
- \cref@old@H@refstepcounter{##1}%
- \cref@constructprefix{##1}{\cref@result}%
+ \fi}%
+ }{%
+ \def\H@refstepcounter##1{%
+ \cref@old@H@refstepcounter{##1}%
+ \cref@constructprefix{##1}{\cref@result}%
% \end{macrocode}
% Again, the large value added to the front of the counter data
% forces references to appendix items to be sorted last.
% \begin{macrocode}
- \ifx\cref@result\@empty%
- \def\cref@result{2147483647}%
- \else%
- \edef\cref@result{2147483647,\cref@result}%
- \fi%
+ \ifx\cref@result\@empty%
+ \def\cref@result{2147483647}%
+ \else%
+ \edef\cref@result{2147483647,\cref@result}%
+ \fi%
% \end{macrocode}
% Override the cross-reference type of sectioning commands.
% \begin{macrocode}
- \def\@tempa{##1}%
- \def\@tempb{chapter}%
- \ifx\@tempa\@tempb%
- \protected@xdef\cref@currentlabel{%
- [appendix][\arabic{##1}][\cref@result]%
- \csname p@##1\endcsname\csname the##1\endcsname}%
- \else%
\def\@tempa{##1}%
- \def\@tempb{section}%
+ \def\@tempb{chapter}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subappendix][\arabic{##1}][\cref@result]%
+ [appendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tempa{##1}%
- \def\@tempb{subsection}%
+ \def\@tempb{section}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subsubappendix][\arabic{##1}][\cref@result]%
+ [subappendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
\def\@tempa{##1}%
- \def\@tempb{subsubsection}%
+ \def\@tempb{subsection}%
\ifx\@tempa\@tempb%
\protected@xdef\cref@currentlabel{%
- [subsubsubappendix][\arabic{##1}][\cref@result]%
+ [subsubappendix][\arabic{##1}][\cref@result]%
\csname p@##1\endcsname\csname the##1\endcsname}%
\else%
- \@ifundefined{cref@##1@alias}%
- {\def\@tempa{##1}}%
- {\def\@tempa{\csname cref@##1@alias\endcsname}}%
- \protected@xdef\cref@currentlabel{%
- [\@tempa][\arabic{##1}][\cref@result]%
- \csname p@##1\endcsname\csname the##1\endcsname}
+ \def\@tempa{##1}%
+ \def\@tempb{subsubsection}%
+ \ifx\@tempa\@tempb%
+ \protected@xdef\cref@currentlabel{%
+ [subsubsubappendix][\arabic{##1}][\cref@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}%
+ \else%
+ \@ifundefined{cref@##1@alias}%
+ {\def\@tempa{##1}}%
+ {\def\@tempa{\csname cref@##1@alias\endcsname}}%
+ \protected@xdef\cref@currentlabel{%
+ [\@tempa][\arabic{##1}][\cref@result]%
+ \csname p@##1\endcsname\csname the##1\endcsname}
+ \fi%
\fi%
\fi%
- \fi%
- \fi}%
+ \fi}%
+ }%
}%
- }
+ }% end of \@ifundefined{appendix}
% \end{macrocode}
% \end{macro}
%
@@ -5812,6 +5758,35 @@
%
%
%
+% \subsubsection{\package{IEEEtrantools} support}
+% \begin{macro}{IEEEtrantools}
+% The \cmd{IEEEeqnarray} environment calls \cmd{\stepcounter} instead
+% of \cmd{\refstepcounter} to increment the |equation| counter, so it
+% fails to set the cross-reference type for \package{cleveref}.
+% \begin{macrocode}
+\@ifpackageloaded{IEEEtrantools}{%
+ \PackageInfo{cleveref}{`IEEEtrantools' support loaded}
+% \end{macrocode}
+%
+% \begin{macro}{\@@IEEEeqnarray}
+% Rather than copying the whole of \cmd{\@@IEEEeqnarray} just to patch
+% one line (which would be liable to breakage), we insert an extra step
+% which calls \cmd{\refstepcounter} to set the cross-reference type,
+% then decrements the |equation| counter by one, before calling the
+% original \cmd{\@@IEEEeqnarray}.
+% \begin{macrocode}
+ \let\cref@orig@@IEEEeqnarray\@@IEEEeqnarray
+ \def\@@IEEEeqnarray[#1]#2{%
+ \refstepcounter{equation}%
+ \addtocounter{equation}{-1}%
+ \cref@orig@@IEEEeqnarray[#1]{#2}}
+}{}% end of \@ifpackageloaded{IEEEtrantools}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+%
+%
% \subsubsection{\package{amsthm} support}
% \begin{macro}{amsthm}
% If \package{amsthm} is loaded, we need to modify its theorem
@@ -7547,7 +7522,7 @@
\let\old@@setnamecref\@@setnamecref
\def\@@setnamecref#1#2{%
\old@@setnamecref{#1}{#2}%
- \edef\@tempa{#1}%
+ \expandafter\def\expandafter\@tempa\expandafter{#1}%
\def\@tempb{#2}%
\expandafter\expandafter\expandafter\g@addto@macro%
\expandafter\expandafter\expandafter{%