From 6311db5eab343592f05dd142aa7de2f710b58580 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 20 Jan 2012 23:00:51 +0000 Subject: cleveref 0.18.3 (19jan12) git-svn-id: svn://tug.org/texlive/trunk@25162 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/cleveref/cleveref.dtx | 77 ++++++++++++++++++---- 1 file changed, 66 insertions(+), 11 deletions(-) (limited to 'Master/texmf-dist/source/latex/cleveref') diff --git a/Master/texmf-dist/source/latex/cleveref/cleveref.dtx b/Master/texmf-dist/source/latex/cleveref/cleveref.dtx index 24201299088..ae5514f82f7 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{2012/01/17} -\def\packageversion{0.18.2} +\def\packagedate{2012/01/18} +\def\packageversion{0.18.3} % \iffalse meta-comment % % Package 'cleveref' to use with LaTeX2e @@ -56,7 +56,7 @@ % % \fi % -% \CheckSum{18176} +% \CheckSum{18207} %% \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 @@ -259,6 +259,8 @@ % code in format-definition macros into separate % \textbackslash{}\cref@othervariant macro. Added % \package{IEEEtrantools} support.} +% \changes{v0.18.3}{2012/01/18}{Fixed bugs with multiple equations and +% subequations in an \textbackslash{}IEEEeqnarray.} % % \GetFileInfo{cleveref.sty} % @@ -5760,9 +5762,11 @@ % % \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}. +% The |IEEEeqnarray| environment and \cmd{\IEEEeqnarraccr} command call +% \cmd{\stepcounter} instead of \cmd{\refstepcounter} to increment the +% equation counters, so they fail to set the cross-reference type for +% \package{cleveref}. We patch in calls to \cmd{\refstepcounter} to fix +% this. % \begin{macrocode} \@ifpackageloaded{IEEEtrantools}{% \PackageInfo{cleveref}{`IEEEtrantools' support loaded} @@ -5770,19 +5774,70 @@ % % \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}. +% the \cmd{\stepcounter} line (which would be fragile and 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} +% +% We do the same thing with \cmd{\@IEEEeqnarrayXCR}, the last in the +% chain of macros that gets invoked by |\\| (let to +% \cmd{\IEEEeqnarraycr}) within |IEEEeqnarray| environments. +% \begin{macro}{\@IEEEeqnarrayXCR} +% \begin{macrocode} + \let\cref@orig@IEEEeqnarrayXCR\@IEEEeqnarrayXCR + \def\@IEEEeqnarrayXCR[#1]{% + \if@eqnsw% + \if@IEEEissubequation% + %\addtocounter{equation}{1}% + \refstepcounter{IEEEsubequation}% + \addtocounter{IEEEsubequation}{-1}% + \else% + \refstepcounter{equation}% + \addtocounter{equation}{-1}% + \fi% + \fi% + \cref@orig@IEEEeqnarrayXCR[#1]} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\IEEEyessubnumber} +% And again for \cmd{IEEEyessubnumber} (used to turn an equation into a +% subequation). +% \begin{macrocode} + \let\cref@orig@IEEEyessubnumber\IEEEyessubnumber + \def\IEEEyessubnumber{% + \if@IEEEeqnarrayISinner% + \if@IEEElastlinewassubequation\else% + \setcounter{IEEEsubequation}{0}% + \refstepcounter{IEEEsubequation}% + \fi% + \fi% + \cref@orig@IEEEyessubnumber} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{IEEEsubequation} +% To get the subequation formatting right, we harmlessly add the +% |IEEEsubequation| counter to the |equation| counter reset list so +% that \package{cleveref} can figure out the subnumbering relationship, +% and define |IEEEsubequation| to be an alias of the |equation| format. +% \begin{macrocode} + \@addtoreset{IEEEsubequation}{equation}% + \crefalias{IEEEsubequation}{equation}% +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +}{}% end of \@ifpackageloaded{IEEEtrantools} +% \end{macrocode} % \end{macro} % % -- cgit v1.2.3