From 2116b098967c4ac8c5c341b24ece64007d46d45f Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 21 Sep 2012 22:30:34 +0000
Subject: mdframed (21sep12)

git-svn-id: svn://tug.org/texlive/trunk@27762 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/mdframed/mdframed.sty | 72 +++++++++++++++--------
 1 file changed, 47 insertions(+), 25 deletions(-)

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

diff --git a/Master/texmf-dist/tex/latex/mdframed/mdframed.sty b/Master/texmf-dist/tex/latex/mdframed/mdframed.sty
index acc8315d123..1c00a5a2a12 100644
--- a/Master/texmf-dist/tex/latex/mdframed/mdframed.sty
+++ b/Master/texmf-dist/tex/latex/mdframed/mdframed.sty
@@ -48,12 +48,13 @@
 %% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 %% ==================================================
 %% 
-\def\mdversion{v1.6b}
+\def\mdversion{1.6d}
 \def\mdframedpackagename{mdframed}
-\def\mdf@maindate@svn$#1: #2 #3 #4-#5-#6 #7 #8${#4/#5/#6\space }
+\def\mdfmaindate{2012/09/21}
+\def\mdfrevision{162}% Done by github: git rev-list HEAD | wc -l
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{mdframed}%
-     [\mdf@maindate@svn$Id: mdframed.dtx 426 2012-06-02 12:18:56Z marco $%
+     [\mdfmaindate\ %
       \mdversion: \mdframedpackagename]
 \newcommand*\mdf@PackageError[1]{\PackageError{\mdframedpackagename}{#1}}
 \newcommand*\mdf@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}}
@@ -279,6 +280,7 @@
     {subtitlebelowline==false},
     {subsubtitleaboveline==false},
     {subsubtitlebelowline==false},
+    {draft==false},
 }
 %%special boolflag hidealllines:
 \newbool{mdf@hidealllines}%
@@ -460,7 +462,7 @@
 {%
  \newrobustcmd\mdf@patchamsthm{%
    \let\mdf@deferred@thm@head\deferred@thm@head
-   \patchcmd{\deferred@thm@head}{\indent}{}%
+   \pretocmd{\deferred@thm@head}{\@inlabelfalse}%
       {\mdf@PackageInfo{mdframed detected package amsthm ^^J
                         changed the theoerem header of amsthm\MessageBreak}%
       }{%
@@ -667,9 +669,9 @@
 \newrobustcmd*\mdf@@frametitle@use{%
    \parskip\z@\relax%
    \parindent\z@\relax%
-   \offinterlineskip\relax%
    \mdf@ignorevbadness%
    \setbox\mdf@splitbox@one=\vbox{%
+       \offinterlineskip\relax%
        \unvcopy\mdf@frametitlebox\relax%
        \mdf@@frametitlerule\relax%
        \unvbox\mdf@splitbox@one\relax%
@@ -766,6 +768,10 @@
    \let\width\z@%
    \let\height\z@%
    \mdf@checkntheorem%
+   \ifbool{mdf@draft}%
+     {%
+      \ifdimgreater{\overfullrule}{0pt}{}{\setlength\overfullrule{5pt}}%
+     }{}%
    \mdf@styledefinition%
    \mdf@footnoteinput%
    \color{\mdf@fontcolor}%
@@ -1016,7 +1022,8 @@
     \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
     \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}{\dimen@}%
       {%splitted wrong
-       \mdf@PackageInfo{Box was splittet wrong^^M starting loop to iterate
+       \mdf@PackageInfo{Box was splittet wrong^^J
+                        starting loop to iterate
                         the splitting point\MessageBreak}%
        \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
        \dimen@i=\dimen@%\relax
@@ -1025,26 +1032,31 @@
         \ifdim\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax>\dimen@
           \advance\dimen@i by -\p@\relax
           \advance\@tempcnta by \@ne\relax
-          \ifnum\@tempcnta>100
-            \let\iterate\relax
-            \mdf@PackageWarning{correct box splittet fails^^M
-                                It seems you are using a non splittable
-                                contents\MessageBreak}
-          \fi
+%%          \immediate\typeout{***mdframed \string\@tempcnta=\the\@tempcnta***}
+%%          \immediate \typeout{***mdframed \string\dimen@i=\the\dimen@i***}
           \mdf@ignorevbadness%
-          \setbox\mdf@splitbox@one=\vbox{\break\unvcopy\mdf@splitbox@save}%
+          \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
           \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
           \mdf@ignorevbadness%
           \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@i\relax%
           \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%
           \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
+          \ifnum\@tempcnta>100
+            \let\iterate\relax
+            \mdf@PackageWarning{correct box splittet fails^^J
+                                It seems you are using a non splittable
+                                contents\MessageBreak}
+            \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
+            \setbox\mdf@splitbox@two=\vbox{}%
+            \def\mdf@reserved@a{\mdf@put@frame}%
+          \fi
        \repeat%
       }{}%
     \ifvoid\mdf@splitbox@one\relax%
       \mdf@PackageWarning{You got a bad break because the splittet box
-                          is empty^^M
-                          You have to change the page settings^^M
-                          like enlargethispage or something else^^M
+                          is empty^^J
+                          You have to change the page settings^^J
+                          like enlargethispage or something else^^J
                           the package increases do
                           \enlargethispage{\baselineskip}\MessageBreak}%
       \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}
@@ -1053,11 +1065,11 @@
     \fi%
     \ifdim\wd\mdf@splitbox@two=\wd\mdf@splitbox@one\relax
     \else%
-      \mdf@PackageInfo{You first box width is to small^^M
+      \mdf@PackageInfo{You first box width is to small^^J
                        mdframed fixed it\MessageBreak}%
       \setbox\mdf@splitbox@two=\vbox%
                    {%
-                    \hrule \@height\z@ \@width\wd\mdf@splitbox@one\relax
+                    \hrule \@height\z@ \@width\mdfboundingboxwidth\relax
                     \unvcopy\mdf@splitbox@two%
                    }%
     \fi%
@@ -1148,9 +1160,11 @@
      \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \mdf@freevspace@length
      \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}
      \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}
-     \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}{\dimen@}%
+     \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}%
+                  {\mdf@freevspace@length}%
        {%splitted wrong
-        \mdf@PackageInfo{Box was splittet wrong^^M starting loop to iterate
+        \mdf@PackageInfo{Box was splittet wrong^^J
+                         starting loop to iterate
                          the splitting point\MessageBreak}%
         \dimen@i=\mdf@freevspace@length%\relax
         \@tempcnta=\z@\relax
@@ -1159,13 +1173,16 @@
               \mdf@freevspace@length\relax
           \advance\dimen@i by -\p@\relax%
           \advance\@tempcnta by \@ne\relax%
+%%          \immediate\typeout{***mdframed \string\@tempcnta=\the\@tempcnta***}
+%%          \immediate \typeout{***mdframed \string\dimen@i=\the\dimen@i***}
           \ifnum\@tempcnta>100
             \let\iterate\relax%
-            \mdf@PackageWarning{correct box splittet fails^^M
+            \mdf@PackageWarning{correct box splittet fails^^J
                                 It seems you are using a non splittable
                                 contents\MessageBreak}%
           \fi
-          \setbox\mdf@splitbox@one=\vbox{\break\unvcopy\mdf@splitbox@save}%
+          \mdf@ignorevbadness%
+          \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
           \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
           \mdf@ignorevbadness%
           \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@i\relax%
@@ -1175,15 +1192,20 @@
        }{}%
      \ifvoid\mdf@splitbox@one\relax%
         \mdf@PackageWarning{You got a bad break because the splittet box is
-                            empty^^M
-                            You have to change the page settings^^M
-                            like enlargethispage or something else^^M
+                            empty^^J
+                            You have to change the page settings^^J
+                            like enlargethispage or something else^^J
                             the package increases do
                             \enlargethispage{\baselineskip}\MessageBreak}%
         \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
         \enlargethispage{\baselineskip}%
         \def\mdf@reserved@a{\mdf@put@frame@ii}%
      \else
+      \setbox\mdf@splitbox@two=\vbox%
+                   {%
+                    \hrule \@height\z@ \@width\mdfboundingboxwidth\relax
+                    \unvcopy\mdf@splitbox@two%
+                   }%
         \begingroup\mdf@@setzref\mdf@putbox@middle\endgroup%
           \hrule \@height\z@ \@width\hsize%
           \vfill\eject%
-- 
cgit v1.2.3

