From 5ef2df8bfda41900423878ffa05270a76986718b Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 29 Nov 2009 00:16:18 +0000
Subject: cleveref 0.15 (28nov09)

git-svn-id: svn://tug.org/texlive/trunk@16225 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/cleveref/cleveref.sty | 58 ++++++++++++++++++++---
 1 file changed, 52 insertions(+), 6 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/cleveref/cleveref.sty')

diff --git a/Master/texmf-dist/tex/latex/cleveref/cleveref.sty b/Master/texmf-dist/tex/latex/cleveref/cleveref.sty
index 7775250ed17..f2a447d8f46 100644
--- a/Master/texmf-dist/tex/latex/cleveref/cleveref.sty
+++ b/Master/texmf-dist/tex/latex/cleveref/cleveref.sty
@@ -22,7 +22,7 @@
 %% version 1999/12/01 or later.
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \ProvidesPackage{cleveref}
- [2009/09/22 v0.14.2 Intelligent cross-referencing]
+ [2009/11/26 v0.15 Intelligent cross-referencing]
 %% \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
@@ -112,7 +112,7 @@
     \gdef\refstepcounter@noarg##1{%
       \cref@old@refstepcounter{##1}%
       \cref@constructprefix{##1}{\@result}%
-      \edef\@result{{2147483647}\@result}%
+      \edef\@result{2147483647,\@result}%
       \def\@tmpa{##1}%
       \def\@tmpb{section}%
       \ifx\@tmpa\@tmpb%
@@ -141,7 +141,7 @@
     \def\refstepcounter@noarg##1{%
       \cref@old@refstepcounter{##1}%
       \cref@constructprefix{##1}{\@result}%
-      \edef\@result{{2147483647}\@result}%
+      \edef\@result{2147483647,\@result}%
       \def\@tmpa{##1}%
       \def\@tmpb{chapter}%
       \ifx\@tmpa\@tmpb%
@@ -777,6 +777,7 @@
 \DeclareRobustCommand{\crefrange}[2]{\@setcrefrange{#1}{#2}{cref}{}}
 \DeclareRobustCommand{\Crefrange}[2]{\@setcrefrange{#1}{#2}{Cref}{}}
 \def\@cref#1#2{%
+  \leavevmode%
   \begingroup%
   \countdef\count@consecutive=0%
   \countdef\count@group=1%
@@ -1488,7 +1489,7 @@
       \def\H@refstepcounter##1{%
         \stepcounter{##1}%
         \cref@constructprefix{##1}{\@result}%
-        \edef\@result{{2147483647}\@result}%
+        \edef\@result{2147483647,\@result}%
         \def\@tmpa{##1}%
         \def\@tmpb{section}%
         \ifx\@tmpa\@tmpb%
@@ -1520,7 +1521,7 @@
       \def\H@refstepcounter##1{%
         \stepcounter{##1}%
         \cref@constructprefix{##1}{\@result}%
-        \edef\@result{{2147483647}\@result}%
+        \edef\@result{2147483647,\@result}%
         \def\@tmpa{##1}%
         \def\@tmpb{chapter}%
         \ifx\@tmpa\@tmpb%
@@ -1632,7 +1633,52 @@
     \advance\@totalleftmargin \theorem@indent%
     \parshape \@ne \@totalleftmargin \linewidth%
     \@ifnextchar[{\@ythm{#1}{#2}{#3}}{\@xthm{#1}{#2}{#3}}%]
-  }}{}%  end of \@ifpackageloaded
+  }
+  }{}%  end of \@ifpackageloaded
+  \@ifpackageloaded{amsthm}{%
+  \PackageInfo{cleveref}{`amsthm' support loaded}
+\let\@thmnoarg\@thm
+\def\@thm{\@ifnextchar[{\@thmoptarg}{\@thmnoarg}}%]
+\def\@thmoptarg[#1]#2#3#4{%
+  \ifhmode\unskip\unskip\par\fi
+  \normalfont
+  \trivlist
+  \let\thmheadnl\relax
+  \let\thm@swap\@gobble
+  \thm@notefont{\fontseries\mddefault\upshape}%
+  \thm@headpunct{.}% add period after heading
+  \thm@headsep 5\p@ plus\p@ minus\p@\relax
+  \thm@space@setup
+  #2% style overrides
+  \@topsep \thm@preskip               % used by thm head
+  \@topsepadd \thm@postskip           % used by \@endparenv
+  \def\@tempa{#3}\ifx\@empty\@tempa
+    \def\@tempa{\@oparg{\@begintheorem{#4}{}}[]}%
+  \else
+    \refstepcounter[#1]{#3}%
+    \def\@tempa{\@oparg{\@begintheorem{#4}{\csname the#3\endcsname}}[]}%
+  \fi
+  \@tempa}
+\def\@ynthm#1[#2]#3{%
+  \ifx\relax#2\relax
+    \def\@tempa{\@oparg{\@xthm{#1}{#3}}[]}%
+  \else
+    \@ifundefined{c@#2}{%
+      \def\@tempa{\@nocounterr{#2}}%
+    }{%
+      \@xp\xdef\csname the#1\endcsname{\@xp\@nx\csname the#2\endcsname}%
+      \toks@{#3}%
+      \@xp\xdef\csname#1\endcsname{%
+        \@nx\@thm[#1]{% <<<<< new optional argument for theorem name
+          \let\@nx\thm@swap
+            \if S\thm@swap\@nx\@firstoftwo\else\@nx\@gobble\fi
+          \@xp\@nx\csname th@\the\thm@style\endcsname}%
+            {#2}{\the\toks@}}%
+      \let\@tempa\relax
+    }%
+  \fi
+  \@tempa}
+  }{}%  end of \@ifpackageloaded
 \@ifpackageloaded{varioref}{%
     \PackageInfo{cleveref}{`varioref' support loaded}
     \PackageInfo{cleveref}{`cleveref' supersedes `varioref's %
-- 
cgit v1.2.3

