summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mdframed/mdframed.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-07-23 23:37:53 +0000
committerKarl Berry <karl@freefriends.org>2012-07-23 23:37:53 +0000
commit5a5ae35291039c9f1bf0f25c40b5adb3ea956920 (patch)
tree066ad9500ae348132d9434b11b3b12d5021ed5fd /Master/texmf-dist/tex/latex/mdframed/mdframed.sty
parent55994f4bf1d4081cd3a038c425f6de7c173629bb (diff)
mdframed (4jun12)
git-svn-id: svn://tug.org/texlive/trunk@27127 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mdframed/mdframed.sty')
-rw-r--r--Master/texmf-dist/tex/latex/mdframed/mdframed.sty890
1 files changed, 491 insertions, 399 deletions
diff --git a/Master/texmf-dist/tex/latex/mdframed/mdframed.sty b/Master/texmf-dist/tex/latex/mdframed/mdframed.sty
index 00974904192..acc8315d123 100644
--- a/Master/texmf-dist/tex/latex/mdframed/mdframed.sty
+++ b/Master/texmf-dist/tex/latex/mdframed/mdframed.sty
@@ -48,13 +48,14 @@
%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
%% ==================================================
%%
-\def\mdversion{v1.5}
+\def\mdversion{v1.6b}
\def\mdframedpackagename{mdframed}
\def\mdf@maindate@svn$#1: #2 #3 #4-#5-#6 #7 #8${#4/#5/#6\space }
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mdframed}%
- [\mdf@maindate@svn$Id: mdframed.dtx 375 2012-04-08 10:52:22Z marco $%
+ [\mdf@maindate@svn$Id: mdframed.dtx 426 2012-06-02 12:18:56Z marco $%
\mdversion: \mdframedpackagename]
+\newcommand*\mdf@PackageError[1]{\PackageError{\mdframedpackagename}{#1}}
\newcommand*\mdf@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}}
\newcommand*\mdf@PackageInfo[1]{\PackageInfo{\mdframedpackagename}{#1}}
\newcommand*\mdf@LoadFile@IfExist[1]{%
@@ -101,7 +102,7 @@
\mdf@iflength{\@tempa}%
{\csxdef{mdfl@#1}{\the\mdf@templength}}%
{\csxdef{mdfl@#1}{\the\mdf@templength}}%
- \expandafter\setlength\csname mdf@#1@length\endcsname{\csname mdfl@#1\endcsname}%
+ \setlength{\csname mdf@#1@length\endcsname}{\csname mdfl@#1\endcsname}%
}%
}
\def\mdf@do@lengthoption#1{%
@@ -140,45 +141,42 @@
\defcounter{mdf@globalstyle@cnt}{0}
\newcommand*\mdfglobal@style{0}
\define@key{mdf}{style}{%
- \mdf@PackageWarning{package option style is depreciated^^J
- use framemethod instead\MessageBreak}%
- \renewcommand*\mdfglobal@style{#1}%
- \defcounter{mdf@globalstyle@cnt}{#1}%
- \ifcase\value{mdf@globalstyle@cnt}\relax
- %0 <- kein Grafikpaket
- \or\mdf@LoadFile@IfExist{tikz}%
- \or\mdf@LoadFile@IfExist{pstricks-add}%
- \or\defcounter{mdf@globalstyle@cnt}{2}%
- \mdf@LoadFile@IfExist{pst-node}%
- \or\mdf@LoadFile@IfExist{pst-node}%
- \else\mdf@PackageWarning{Unknown global style \value{mdf@globalstyle@cnt}}%
- \fi%
+ \mdf@PackageWarning{package option style is depreciated^^J
+ use framemethod instead\MessageBreak}%
+ \renewcommand*\mdfglobal@style{#1}%
+ \defcounter{mdf@globalstyle@cnt}{#1}%
+ \ifcase\value{mdf@globalstyle@cnt}\relax
+ \or\mdf@LoadFile@IfExist{tikz}%=1
+ \or\mdf@LoadFile@IfExist{pstricks-add}%=2
+ \or\defcounter{mdf@globalstyle@cnt}{2}%=3
+ \mdf@LoadFile@IfExist{pst-node}%
+ \or\mdf@LoadFile@IfExist{pst-node}%=4
+ \else%%>4
+ \mdf@PackageWarning{Unknown global style \value{mdf@globalstyle@cnt}}%
+ \fi%
}
\providecommand*\mdf@framemethod{}
\def\mdf@framemethod@i{}%
\def\mdf@framemethod@ii{}%
\def\mdf@framemethod@iii{}%
\define@key{mdf}{framemethod}[default]{%
- \lowercase{\def\mdf@tempa{#1}}
+ \lowercase{\def\mdf@tempa{#1}}%lowercase not expandable
\forcsvlist{\listadd\mdf@framemethod@i}{default,tex,latex,none,0}
\forcsvlist{\listadd\mdf@framemethod@ii}{pgf,tikz,1}
\forcsvlist{\listadd\mdf@framemethod@iii}{pstricks,ps,2,postscript}
\xifinlist{\mdf@tempa}{\mdf@framemethod@i}%
- {\def\mdf@@framemethod{default}\defcounter{mdf@globalstyle@cnt}{0}}%
- {\xifinlist{\mdf@tempa}{\mdf@framemethod@ii}%
- {\def\mdf@@framemethod{tikz}\defcounter{mdf@globalstyle@cnt}{1}}%
- {\xifinlist{\mdf@tempa}{\mdf@framemethod@iii}%
- {\def\mdf@@framemethod{pstricks}\defcounter{mdf@globalstyle@cnt}{2}}%
- {%
- \mdf@LoadFile@IfExist{#1}%
- }%
- }%
- }%
+ {\def\mdf@@framemethod{default}\defcounter{mdf@globalstyle@cnt}{0}}%
+ {\xifinlist{\mdf@tempa}{\mdf@framemethod@ii}%
+ {\def\mdf@@framemethod{tikz}\defcounter{mdf@globalstyle@cnt}{1}}%
+ {\xifinlist{\mdf@tempa}{\mdf@framemethod@iii}%
+ {\def\mdf@@framemethod{pstricks}\defcounter{mdf@globalstyle@cnt}{2}}%
+ {\mdf@LoadFile@IfExist{#1}}%
+ }%
+ }%
\ifcase\value{mdf@globalstyle@cnt}\relax%
- %0 <- kein Grafikpaket
- \or\mdf@LoadFile@IfExist{tikz}%
- \or\mdf@LoadFile@IfExist{pst-node}%
- \or\mdf@LoadFile@IfExist{pst-node}%
+ \or\mdf@LoadFile@IfExist{tikz}%=1
+ \or\mdf@LoadFile@IfExist{pst-node}%=2
+ \or\mdf@LoadFile@IfExist{pst-node}%=3
\fi%
}
\mdf@dolist{\mdf@do@lengthoption}{%
@@ -207,6 +205,19 @@
{frametitleleftmargin==10pt},%
{frametitlerightmargin==10pt},%
{shadowsize==8pt},%
+ {extratopheight==\z@},%
+ {subtitleabovelinewidth==.8pt},%
+ {subtitlebelowlinewidth==.6pt},%
+ {subtitleaboveskip==\baselineskip},%
+ {subtitlebelowskip==1.2\baselineskip},%
+ {subtitleinneraboveskip==.5\baselineskip},%
+ {subtitleinnerbelowskip==.5\baselineskip},%
+ {subsubtitleabovelinewidth==.8pt},%
+ {subsubtitlebelowlinewidth==.6pt},%
+ {subsubtitleaboveskip==\baselineskip},%
+ {subsubtitlebelowskip==1.2\baselineskip},%
+ {subsubtitleinneraboveskip==.5\baselineskip},%
+ {subsubtitleinnerbelowskip==.5\baselineskip},%
}
\mdf@dolist{\mdf@do@stringoption}{%
{frametitle=={}},%
@@ -237,6 +248,14 @@
{firstextra=={}},
{middleextra=={}},
{secondextra=={}},
+ {subtitlefont==\normalfont\bfseries},%
+ {subsubtitlefont==\normalfont},%
+ {subtitlebackgroundcolor==white},%
+ {subsubtitlebackgroundcolor==white},%
+ {subtitleabovelinecolor==black},%
+ {subtitlebelowlinecolor==black},%
+ {subsubtitleabovelinecolor==black},%
+ {subsubtitlebelowlinecolor==black},%
}
\mdf@dolist{\mdf@do@booloption}{%
{ntheorem==false},%
@@ -255,13 +274,19 @@
{repeatframetitle==false},%Noch nicht richtig implementiert
{shadow==false},%
{everyline==false},%
+ {ignorelastdescenders==false},%
+ {subtitleaboveline==false},
+ {subtitlebelowline==false},
+ {subsubtitleaboveline==false},
+ {subsubtitlebelowline==false},
}
%%special boolflag hidealllines:
\newbool{mdf@hidealllines}%
\define@key{mdf}{hidealllines}[false]{%
\setbool{mdf@hidealllines}{#1}%
\ifbool{mdf@hidealllines}{%
- \setkeys{mdf}{leftline=false,topline=false,rightline=false,bottomline=false}%
+ \kvsetkeys{mdf}{leftline=false,topline=false,%
+ rightline=false,bottomline=false}%
}{}%
}
\mdf@dolist{\mdf@do@alignoption}{%
@@ -299,9 +324,8 @@
\define@key{mdf}{pstricksappsetting}{%
\def\mdfpstricks@appendsettings{#1}%
}
-
\def\mdf@xcolor{}
-\define@key{mdf}{xcolor}[none]{%
+\define@key{mdf}{xcolor}[]{%
\def\@tempa{#1}%
\@ifpackageloaded{xcolor}{%
\let\mdf@xcolor\@empty %ignoriere die Eingabe der Optionen
@@ -324,9 +348,9 @@
\endgroup%
}
\DeclareDefaultOption{%
- \mdf@PackageWarning{Unknown Option '\CurrentOption' for mdframed}}
+ \mdf@PackageError{Unknown Option '\CurrentOption' for mdframed}}
\ProcessKeyvalOptions*\relax
-\newrobustcmd*{\mdfsetup}{\setkeys{mdf}}
+\newrobustcmd*{\mdfsetup}{\kvsetkeys{mdf}}
\define@key{mdf}{style}{%
\ifcsundef{mdf@definestyle@#1}{%
\mdf@PackageWarning{Unknown definedstyle #1^^J
@@ -334,8 +358,8 @@
via \string\mdfdefinedstyle\MessageBreak
}%
}%
- {\expandafter\expandafter\expandafter\mdfsetup%
- \expandafter\expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}%
+ {\expandafter\expandafter\expandafter\mdfsetup\expandafter%
+ \expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}%
}%
\let\mdf@PackageNoInfo\@gobble
\newrobustcmd*\mdf@ifstrequal@expand{%
@@ -361,6 +385,7 @@
\newsavebox\mdf@footnotebox
\newsavebox\mdf@splitbox@one
\newsavebox\mdf@splitbox@two
+\newsavebox\mdf@splitbox@save
\newlength\mdfsplitboxwidth
\newlength\mdfsplitboxtotalwidth
\newlength\mdfsplitboxheight
@@ -390,27 +415,38 @@
\newlength\mdf@horizontalwidthofbox@length
\newlength\mdf@verticalmarginwhole@length
-\newrobustcmd\mdfcreateextratikz{}
+\newtoggle{mdf@notfirstframetitle}%
+\togglefalse{mdf@notfirstframetitle}%
+\newrobustcmd\mdfcreateextratikz{}
\def\mdf@lrbox#1{%
%%patch to work with amsthm
\mdf@patchamsthm
-%%end patch
- \edef\mdf@restoreparams{%
- \parindent=\the\parindent \parskip=\the\parskip}
- \setbox#1\vbox\bgroup
+%%%end patch
+ \edef\mdf@restoreparams{%
+ \parindent=\the\parindent\relax \parskip=\the\parskip\relax}%
+ \setbox#1\vbox\bgroup%
\color@begingroup%
- \mdf@horizontalmargin@equation%
- \columnwidth=\hsize%
- \textwidth=\hsize%
- \@parboxrestore%
- \mdf@restoreparams%
- %SETZE
- \@afterindentfalse%
- \@afterheading%
- %STREICHE
- %\@doendpe
+ \mdf@horizontalmargin@equation%
+ \columnwidth=\hsize%
+ \textwidth=\hsize%
+ \let\if@nobreak\iffalse%
+ \let\if@noskipsec\iffalse%
+ \let\par\@@par%
+ \let\-\@dischyph%
+ \let\'\@acci\let\`\@accii\let\=\@acciii%
+ \parindent\z@ \parskip\z@skip%
+ \linewidth\hsize%
+ \@totalleftmargin\z@%
+ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip%
+ \parfillskip\@flushglue \lineskip\normallineskip%
+ \baselineskip\normalbaselineskip%
+%% \sloppy%
+ \let\\\@normalcr%
+ \mdf@restoreparams\relax%
+ \@afterindentfalse%
+ \@afterheading%
}
\def\endmdf@lrbox{\color@endgroup\egroup}
@@ -420,18 +456,20 @@
\vbadness=\@M%
\afterassignment\mdf@restorevbadness}
\newrobustcmd*\mdf@restorevbadness{\vbadness=\mdf@currentvbadness\relax}
-\@ifpackageloaded{amsthm}{%
+\@ifpackageloaded{amsthm}%
+{%
\newrobustcmd\mdf@patchamsthm{%
- \let\mdf@deferred@thm@head\deferred@thm@head
- \patchcmd{\deferred@thm@head}{\indent}{}%
- {\mdf@PackageInfo{mdframed detected package amsthm ^^J
- changed the theoerem header of amsthm\MessageBreak}%
- }{%
- \mdf@PackageInfo{mdframed detected package amsthm ^^J
- changed the theoerem header of amsthm failed\MessageBreak}%
- }%
+ \let\mdf@deferred@thm@head\deferred@thm@head
+ \patchcmd{\deferred@thm@head}{\indent}{}%
+ {\mdf@PackageInfo{mdframed detected package amsthm ^^J
+ changed the theoerem header of amsthm\MessageBreak}%
+ }{%
+ \mdf@PackageError{mdframed detected package amsthm ^^J
+ changed the theoerem header of amsthm
+ failed\MessageBreak}%
+ }%
}%
- }{\let\mdf@patchamsthm\relax}%
+}{\let\mdf@patchamsthm\relax}%
\def\mdf@trivlist#1{%
\setlength{\topsep}{#1}%
\partopsep\z@%
@@ -448,7 +486,13 @@
\item\relax% first Version
}
\let\endmdf@trivlist\endtrivlist
-\patchcmd\endmdf@trivlist\@endparenv\mdf@endparenv{}{}
+\patchcmd\endmdf@trivlist\@endparenv\mdf@endparenv{%
+ \immediate\typeout{^^J****** mdframed patching \string\endmdf@trivlist}%
+ \immediate\typeout{^^J****** -- success******^^J}%
+ }{%
+ \immediate\typeout{^^J****** mdframed patching \string\endmdf@trivlist}%
+ \immediate\typeout{^^J****** -- failed******^^J}%
+}
\def\mdf@endparenv{%
\addpenalty\@endparpenalty\addvspace\mdf@skipbelow@length\@endpetrue}
@@ -487,7 +531,6 @@
\expandafter\let\csname end#2\endcsname\relax%
\newmdenv[#1]{#2}%
}%
-
\DeclareDocumentCommand\newmdtheoremenv{O{} m o m o }{%
\ifboolexpr{ test {\IfNoValueTF {#3}} and test {\IfNoValueTF {#5}} }%
{\newtheorem{#2}{#4}}{%
@@ -499,19 +542,23 @@
\AfterEndEnvironment{#2}{%
\end{mdframed}}%
}
-
+\newrobustcmd*\mdf@thm@caption[2]{}
+\AtBeginDocument{%
+ \@ifpackageloaded{ntheorem}%
+ {\renewrobustcmd*\mdf@thm@caption{\thm@thmcaption}}{}%
+ }
\DeclareDocumentCommand{\mdtheorem}{ O{} m o m o }%
{\ifcsdef{#2}%
{\mdf@PackageWarning{Environment #2 already exits\MessageBreak}}%
{%
\IfNoValueTF {#3}%
{%#3 not given -- number relationship
- \IfNoValueTF {#5}
+ \IfNoValueTF {#5}%
{%#3+#5 not given
\@definecounter{#2}%
- \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}
+ \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}%
\newenvironment{#2}[1][]{%
- \refstepcounter{#2}
+ \refstepcounter{#2}%
\ifstrempty{##1}%
{\let\@temptitle\relax}%
{%
@@ -519,22 +566,24 @@
\mdf@theoremspace%
\mdf@theoremtitlefont%
##1}%
- }
- \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname\@temptitle}]}%
+ \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
+ }%
+ \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
+ \@temptitle}]}%
{\end{mdframed}}%
\newenvironment{#2*}[1][]{%
- \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}
+ \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}%
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
{\end{mdframed}}%
}%
{%#5 given -- reset counter
\@definecounter{#2}\@newctr{#2}[#5]%
- \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}
+ \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}%
\expandafter\xdef\csname the#2\endcsname{%
- \expandafter\noexpand\csname the#5\endcsname \@thmcountersep
+ \expandafter\noexpand\csname the#5\endcsname \@thmcountersep%
\@thmcounter{#2}}%
\newenvironment{#2}[1][]{%
- \refstepcounter{#2}
+ \refstepcounter{#2}%
\ifstrempty{##1}%
{\let\@temptitle\relax}%
{%
@@ -542,8 +591,10 @@
\mdf@theoremspace%
\mdf@theoremtitlefont%
##1}%
+ \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
}
- \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname\@temptitle}]}%
+ \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
+ \@temptitle}]}%
{\end{mdframed}}%
\newenvironment{#2*}[1][]{%
\ifstrempty{##1}%
@@ -553,7 +604,8 @@
\mdf@theoremspace%
\mdf@theoremtitlefont%
##1}%
- }
+ \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
+ }%
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
{\end{mdframed}}%
}%
@@ -561,7 +613,7 @@
{%#3 given -- number relationship
\global\@namedef{the#2}{\@nameuse{the#3}}%
\newenvironment{#2}[1][]{%
- \refstepcounter{#3}
+ \refstepcounter{#3}%
\ifstrempty{##1}%
{\let\@temptitle\relax}%
{%
@@ -569,11 +621,13 @@
\mdf@theoremspace%
\mdf@theoremtitlefont%
##1}%
+ \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
}
- \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname\@temptitle}]}%
+ \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
+ \@temptitle}]}%
{\end{mdframed}}%
\newenvironment{#2*}[1][]{%
- \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}
+ \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}%
\begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
{\end{mdframed}}%
}%
@@ -581,20 +635,29 @@
}
\newrobustcmd\mdfframedtitleenv[1]{%
- \color@begingroup%%
\mdf@lrbox{\mdf@frametitlebox}%
- \mdf@frametitlealignment%
- \color{\mdf@frametitlefontcolor}%
- \normalfont\mdf@frametitlefont{#1}\par\unskip
- \endmdf@lrbox%
+ \mdf@frametitlealignment%
+ \leavevmode\color{\mdf@frametitlefontcolor}%
+ \normalfont\mdf@frametitlefont{#1}
+ \ifbool{mdf@ignorelastdescenders}%
+ {%
+ \par\strut\par
+ \unskip\unskip\setbox0=\lastbox
+ \vspace*{\dimexpr\ht\strutbox-\baselineskip\relax}%
+ }{}%
+ \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%%
+ \endmdf@lrbox\relax%
\mdf@ignorevbadness%
- \global\setbox\mdf@frametitlebox\vbox{\unvbox\mdf@frametitlebox}%
- \global\mdfframetitleboxwidth=\wd\mdf@frametitlebox\relax%
- \global\mdfframetitleboxheight=\ht\mdf@frametitlebox\relax%
- \global\mdfframetitleboxdepth=\dp\mdf@frametitlebox\relax%
- \global\mdfframetitleboxtotalheight=\dimexpr\ht\mdf@frametitlebox+\dp\mdf@frametitlebox
- +\mdf@frametitleaboveskip@length+\mdf@frametitlebelowskip@length\relax%
- \color@endgroup%
+ \setbox\mdf@frametitlebox=\vbox{\unvbox\mdf@frametitlebox}%
+ \mdfframetitleboxwidth=\wd\mdf@frametitlebox\relax%
+ \mdfframetitleboxheight=\ht\mdf@frametitlebox\relax%
+ \mdfframetitleboxdepth=\dp\mdf@frametitlebox\relax%
+ \mdfframetitleboxtotalheight=\dimexpr
+ \ht\mdf@frametitlebox
+ +\dp\mdf@frametitlebox%
+ +\mdf@frametitleaboveskip@length
+ +\mdf@frametitlebelowskip@length
+ \relax%
}
\newrobustcmd*\mdf@@frametitle{%
@@ -602,23 +665,19 @@
}
\newrobustcmd*\mdf@@frametitle@use{%
- \begingroup
- \parskip\z@
- \parindent\z@
- \offinterlineskip
+ \parskip\z@\relax%
+ \parindent\z@\relax%
+ \offinterlineskip\relax%
\mdf@ignorevbadness%
- \global\setbox\mdf@splitbox@one\vbox{%
- \unvcopy\mdf@frametitlebox%
- \mdf@@frametitlerule%
- \unvbox\mdf@splitbox@one
+ \setbox\mdf@splitbox@one=\vbox{%
+ \unvcopy\mdf@frametitlebox\relax%
+ \mdf@@frametitlerule\relax%
+ \unvbox\mdf@splitbox@one\relax%
}%
\mdf@ignorevbadness%
- \global\setbox\mdf@splitbox@one\vbox{%
- \unvbox\mdf@splitbox@one}%
- \endgroup
+ \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}%
\mdfsetup{innertopmargin=\mdf@frametitleaboveskip@length}%
}
-
\newrobustcmd*\mdf@checkntheorem{%
\ifbool{mdf@ntheorem}%
{\ifundef{\theorempreskipamount}%
@@ -632,12 +691,12 @@
\kern0\p@%
\hrule \@width 1in \kern 2.6\p@}
\newrobustcmd*\mdf@footnoteoutput{%
- \ifvoid\@mpfootins\else
+ \ifvoid\@mpfootins\else%
\nobreak%
\vskip\mdf@footenotedistance@length%
\normalcolor%
- \mdf@footnoterule
- \unvbox\@mpfootins
+ \mdf@footnoterule%
+ \unvbox\@mpfootins%
\fi%
}
\newrobustcmd*\mdf@footnoteinput{%
@@ -657,14 +716,14 @@
{\input{md-frame-\value{mdf@globalstyle@cnt}.mdf}}%
{%
\input{md-frame-0.mdf}%
- \mdf@PackageWarning{The style number \value{mdf@globalstyle@cnt} does not exist^^J
- mdframed ues instead style=0 \mdframedpackagename}%
+ \mdf@PackageWarning{The style number \value{mdf@globalstyle@cnt}
+ does not exist^^J
+ mdframed ues instead style=0 \mdframedpackagename}%
}%
\fi%
}%
\mdf@load@style
-
-\newrobustcmd*\mdf@styledefinition{%AVOID!!!
+\newrobustcmd*\mdf@styledefinition{%AVOID!!!Needed for framemethod=default
\ifnumequal{\value{mdf@globalstyle@cnt}}{0}%
{\deflength{\mdf@innerlinewidth@length}{\z@}%
\deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}%
@@ -687,21 +746,6 @@
mdframed uses option nobreak \mdframedpackagename}%
\def\mdf@reserved@a{\mdf@put@frame@standalone}%
\fi
-%% \ifnum\@floatpenalty<0\relax%Detecting float
-%% \if@twocolumn%
-%% \ifx\@captype\@undefined
-%% \def\mdf@reserved@a{\mdf@put@frame}%
-%% \else
-%% \mdf@PackageInfo{mdframed inside float ^^J
-%% mdframed uses option nobreak \mdframedpackagename}%
-%% \def\mdf@reserved@a{\mdf@put@frame@standalone}%
-%% \fi
-%% \else
-%% \mdf@PackageInfo{mdframed inside float ^^J
-%% mdframed uses option nobreak \mdframedpackagename}%
-%% \def\mdf@reserved@a{\mdf@put@frame@standalone}%
-%% \fi%
-%% \fi%
\if@minipage%
\mdf@PackageInfo{mdframed inside minipage ^^J
mdframed uses option nobreak \mdframedpackagename}%
@@ -715,18 +759,9 @@
\fi%
\mdf@reserved@a%
}
-\newrobustcmd*\mdf@hidealllines@check{%
- \ifbool{mdf@hidealllines}{%
- \boolfalse{mdf@leftline}\boolfalse{mdf@rightline}%
- \boolfalse{mdf@topline}\boolfalse{mdf@bottomline}%
- \boolfalse{mdf@frametitleleftline}\boolfalse{mdf@frametitlerightline}%
- \boolfalse{mdf@frametitletopline}\boolfalse{mdf@frametitlebottomline}%
- }{}%
-}
\newenvironment{mdframed}[1][]{%
\color@begingroup%
\mdfsetup{userdefinedwidth=\linewidth,#1}%
-%%% \mdf@hidealllines@check%
\mdf@twoside@checklength%
\let\width\z@%
\let\height\z@%
@@ -741,17 +776,24 @@
\mdf@settings%
\mdf@lrbox{\mdf@splitbox@one}%
}%
- {\par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%%
+ {%
+ \ifbool{mdf@ignorelastdescenders}%
+ {%
+ \par\strut\par
+ \unskip\unskip\setbox0=\lastbox
+ \vspace*{\dimexpr\ht\strutbox-\baselineskip\relax}%
+ }{}%
+ \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%%
\ifmdf@footnoteinside%
\def\mdf@reserveda{%
\mdf@footnoteoutput%
\endmdf@lrbox%
- \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle@use}
+ \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle@use}%
\detected@mdf@put@frame}%
\else%
\def\mdf@reserveda{%
\endmdf@lrbox%
- \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle@use}
+ \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle@use}%
\detected@mdf@put@frame%
\mdf@footnoteoutput%
}%
@@ -786,22 +828,24 @@
\zref@label{mdf@pagelabel-\number\value{mdf@zref@counter}}%
}
\newrobustcmd*\if@mdf@pageodd{%
- \zref@refused{mdf@pagelabel-\the\value{mdf@zref@counter}}%
- \ifodd\zref@extract{mdf@pagelabel-\the\value{mdf@zref@counter}}{mdf@pagevalue}%
- \setlength\mdf@rightmargin@length{\mdf@outermargin@length}%
- \setlength\mdf@leftmargin@length{\mdf@innermargin@length}%
- \else
- \setlength\mdf@rightmargin@length{\mdf@innermargin@length}%
- \setlength\mdf@leftmargin@length{\mdf@outermargin@length}%
- \fi%
+ \zref@refused{mdf@pagelabel-\the\value{mdf@zref@counter}}%
+ \ifodd\zref@extract{mdf@pagelabel-\the\value{mdf@zref@counter}}%
+ {mdf@pagevalue}%
+ \setlength\mdf@rightmargin@length{\mdf@outermargin@length}%
+ \setlength\mdf@leftmargin@length{\mdf@innermargin@length}%
+ \else
+ \setlength\mdf@rightmargin@length{\mdf@innermargin@length}%
+ \setlength\mdf@leftmargin@length{\mdf@outermargin@length}%
+ \fi%
}
\newrobustcmd*\mdf@@setzref{%
\iftoggle{md:checktwoside}{\mdf@zref@label\if@mdf@pageodd}{}%
}
\newrobustcmd*\mdf@freepagevspace{%
- \penalty\@M \vskip 2\baselineskip
- \penalty9999 \vskip -2\baselineskip
- \penalty9999
+ \bgroup\@nobreakfalse\addpenalty\z@\egroup%added 29.5.12
+ \penalty\@M\relax\vskip 2\baselineskip\relax%
+ \penalty9999\relax\vskip -2\baselineskip\relax%
+ \penalty9999%
\ifdimequal{\pagegoal}{\maxdimen}%
{\mdf@freevspace@length\vsize}%
{\mdf@freevspace@length=\pagegoal\relax%
@@ -820,34 +864,45 @@
innerlinewidth,innerleftmargin,innerrightmargin,%
innerlinewidth,middlelinewidth,outerlinewidth,%
rightmargin}%
- \notbool{mdf@leftline}{%
- \advance\mdf@horizontalspaceofbox by \mdf@innerlinewidth@length\relax%
- \advance\mdf@horizontalspaceofbox by \mdf@middlelinewidth@length\relax%
- \advance\mdf@horizontalspaceofbox by \mdf@outerlinewidth@length\relax%
- }{}%
- \notbool{mdf@rightline}{%
- \advance\mdf@horizontalspaceofbox by \mdf@innerlinewidth@length\relax%
- \advance\mdf@horizontalspaceofbox by \mdf@middlelinewidth@length\relax%
- \advance\mdf@horizontalspaceofbox by \mdf@outerlinewidth@length\relax%
- }{}%
+ \notbool{mdf@leftline}%
+ {%
+ \advance\mdf@horizontalspaceofbox by \mdf@innerlinewidth@length\relax%
+ \advance\mdf@horizontalspaceofbox by \mdf@middlelinewidth@length\relax%
+ \advance\mdf@horizontalspaceofbox by \mdf@outerlinewidth@length\relax%
+ }{}%
+ \notbool{mdf@rightline}%
+ {%
+ \advance\mdf@horizontalspaceofbox by \mdf@innerlinewidth@length\relax%
+ \advance\mdf@horizontalspaceofbox by \mdf@middlelinewidth@length\relax%
+ \advance\mdf@horizontalspaceofbox by \mdf@outerlinewidth@length\relax%
+ }{}%
\ifdimless{\mdf@horizontalspaceofbox}{3cm}%
- {\mdf@PackageWarning{You have only a width of 3cm}}{}
+ {\mdf@PackageWarning{You have only a width of 3cm}}{}%
\hsize=\mdf@horizontalspaceofbox%
}
\newrobustcmd*\mdf@keeplines@single{%
- \notbool{mdf@topline}{%
- \advance\mdf@verticalmarginwhole@length by -\mdf@innerlinewidth@length%
- \advance\mdf@verticalmarginwhole@length by -\mdf@middlelinewidth@length%
- \advance\mdf@verticalmarginwhole@length by -\mdf@outerlinewidth@length%
+ \notbool{mdf@topline}%
+ {%
+ \advance\mdf@verticalmarginwhole@length %
+ by -\mdf@innerlinewidth@length\relax%
+ \advance\mdf@verticalmarginwhole@length %
+ by -\mdf@middlelinewidth@length\relax%
+ \advance\mdf@verticalmarginwhole@length %
+ by -\mdf@outerlinewidth@length\relax%
}{}%
- \notbool{mdf@bottomline}{%
- \advance\mdf@verticalmarginwhole@length by -\mdf@innerlinewidth@length%
- \advance\mdf@verticalmarginwhole@length by -\mdf@middlelinewidth@length%
- \advance\mdf@verticalmarginwhole@length by -\mdf@outerlinewidth@length%
+ \notbool{mdf@bottomline}%
+ {%
+ \advance\mdf@verticalmarginwhole@length %
+ by -\mdf@innerlinewidth@length\relax%
+ \advance\mdf@verticalmarginwhole@length %
+ by -\mdf@middlelinewidth@length\relax%
+ \advance\mdf@verticalmarginwhole@length %
+ by -\mdf@outerlinewidth@length\relax%
}{}%
}
\newrobustcmd*\mdf@advancelength@verticalmarginwhole[1]{%
- \advance\mdf@verticalmarginwhole@length by \csname mdf@#1@length\endcsname\relax%
+ \advance\mdf@verticalmarginwhole@length %
+ by \csname mdf@#1@length\endcsname\relax%
}
\newrobustcmd*\mdf@advancelength@freevspace@sub[1]{%
\advance\dimen@ by -\csname mdf@#1@length\endcsname\relax%
@@ -866,8 +921,9 @@
\setlength{\mdf@verticalmarginwhole@length}%
{\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
\mdf@dolist{\mdf@advancelength@verticalmarginwhole}{%
- outerlinewidth,middlelinewidth,innerlinewidth,innertopmargin,
- innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}%
+ outerlinewidth,middlelinewidth,innerlinewidth,%
+ innertopmargin,innerbottommargin,innerlinewidth,%
+ middlelinewidth,outerlinewidth}%
\mdf@keeplines@single%
\def\mdf@reserved@a{\mdf@putbox@single}%
\fi
@@ -875,257 +931,293 @@
}
\def\mdf@put@frame{\relax%
\ifvoid\mdf@splitbox@one\relax
-\mdf@PackageWarning{The environment is empty\MessageBreak}%
-\let\mdf@reserved@a\relax%
+ \mdf@PackageWarning{The environment is empty\MessageBreak}%
+ \let\mdf@reserved@a\relax%
\else
\setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}%
\mdf@print@space%
\mdf@freepagevspace%gives \mdf@freevspace@length
- \mdf@PackageInfoSpace{\the\mdf@freevspace@length before the beginning of \MessageBreak
- the environment ending on input line \MessageBreak}%
- \ifdimless{\mdf@freevspace@length}{2\baselineskip}
- {\mdf@PackageInfo{Not enough space on this page}
- \vfill\eject%
- \def\mdf@reserved@a{\mdf@put@frame}%
- }{%
- %Hier berechnung Box-Inhalt+Rahmen oben und unten
- \setlength{\mdf@verticalmarginwhole@length}%
- {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
- \mdf@dolist{\mdf@advancelength@verticalmarginwhole}{%
- outerlinewidth,middlelinewidth,innerlinewidth,innertopmargin,
- innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}%
- \mdf@keeplines@single%
- \ifdimless{\mdf@verticalmarginwhole@length}{\mdf@freevspace@length}%
- {%passt auf Seite%
- \begingroup
- \mdf@@setzref
- \mdf@putbox@single%
- \endgroup
- \let\mdf@reserved@a\relax}%
- {\def\mdf@reserved@a{\mdf@put@frame@i}}%passt nicht auf Seite
- }%
+ \mdf@PackageInfoSpace{\the\mdf@freevspace@length before the
+ beginning of \MessageBreak
+ the environment ending on input line \MessageBreak}%
+ \ifdimless{\mdf@freevspace@length}{2\baselineskip}
+ {%
+ \mdf@PackageInfo{Not enough space on this page}
+ \vfill\eject%
+ \def\mdf@reserved@a{\mdf@put@frame}%
+ }{%
+ %Hier berechnung Box-Inhalt+Rahmen oben und unten
+ \setlength{\mdf@verticalmarginwhole@length}%
+ {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
+ \mdf@dolist{\mdf@advancelength@verticalmarginwhole}%
+ {%
+ outerlinewidth,middlelinewidth,innerlinewidth,%
+ innertopmargin,innerbottommargin,%
+ innerlinewidth,middlelinewidth,outerlinewidth}%
+ \mdf@keeplines@single%
+ \ifdimless{\mdf@verticalmarginwhole@length}{\mdf@freevspace@length}%
+ {%passt auf Seite%
+ \begingroup\mdf@@setzref\mdf@putbox@single\endgroup%Output no break
+ \let\mdf@reserved@a\relax%
+ }%
+ {%
+ \def\mdf@reserved@a{\mdf@put@frame@i}%passt nicht auf Seite
+ }
+ }%
\fi
\mdf@reserved@a%
}
-\def\mdf@put@frame@i{%Box muss gesplittet werden -- Ausgabe der ersten Teilbox
- %Berechnung der Splittgroesse -- Linien und Abstand oben
- %\vbox to 0pt{}%
- %\rlap{\smash{\the\mdf@freevspace@length}}%\hrule \@height\z@ \@width\hsize
+\def\mdf@put@frame@i{%Box must be splitted
\mdf@freepagevspace%gives \mdf@freevspace@length
- %Berechnung ob nur oberen Linien nur auf die Seite passe
- \dimen@=\the\mdf@freevspace@length%
- \dimen@i=\mdf@innertopmargin@length%
- \advance\dimen@i by \mdf@innerlinewidth@length%
- \advance\dimen@i by \mdf@middlelinewidth@length%
- \advance\dimen@i by \mdf@outerlinewidth@length%
- \advance\dimen@i by 2\baselineskip%
+ \dimen@=\the\mdf@freevspace@length\relax%
+ \dimen@i=\mdf@innertopmargin@length\relax%
+ \advance\dimen@i by \mdf@innerlinewidth@length\relax%
+ \advance\dimen@i by \mdf@middlelinewidth@length\relax%
+ \advance\dimen@i by \mdf@outerlinewidth@length\relax%
+ \advance\dimen@i by 2\baselineskip\relax%
\ifdimless{\dimen@}{\dimen@i}%
{\hrule \@height\z@ \@width\hsize%
\vfill\eject%
\def\mdf@reserved@a{\mdf@put@frame}%
- }{%
- \mdf@freepagevspace%
- \dimen@=\the\mdf@freevspace@length%
+ }%
+ {%
\mdf@dolist{\mdf@advancelength@freevspace@sub}{%calculate with \dimen@
outerlinewidth,middlelinewidth,innerlinewidth,%
innertopmargin,splitbottomskip}%
- \ifbool{mdf@everyline}{%
- \ifbool{mdf@bottomline}{%
- \advance\dimen@ by -\mdf@innerlinewidth@length%
- \advance\dimen@ by -\mdf@middlelinewidth@length%
- \advance\dimen@ by -\mdf@outerlinewidth@length%
- }{}%
- }{}%
- \ifbool{mdf@topline}{}{%
- \advance\dimen@ by \mdf@innerlinewidth@length%
- \advance\dimen@ by \mdf@middlelinewidth@length%
- \advance\dimen@ by \mdf@outerlinewidth@length%
- }%
+ \ifbool{mdf@everyline}%
+ {%
+ \ifbool{mdf@bottomline}%
+ {%
+ \advance\dimen@ by -\mdf@innerlinewidth@length%
+ \advance\dimen@ by -\mdf@middlelinewidth@length%
+ \advance\dimen@ by -\mdf@outerlinewidth@length%
+ }{}%
+ }{}%
+ \notbool{mdf@topline}%
+ {%
+ \advance\dimen@ by \mdf@innerlinewidth@length%
+ \advance\dimen@ by \mdf@middlelinewidth@length%
+ \advance\dimen@ by \mdf@outerlinewidth@length%
+ }{}%
\advance\dimen@.8\pageshrink
\ifdimless{\ht\mdf@splitbox@one+\dp\mdf@splitbox@one}{\dimen@}%
{\mdf@PackageWarning{You got a bad break\MessageBreak
+ because the last box will be empty\MessageBreak
you have to change it manually\MessageBreak
- by changing the text, the space\MessageBreak
- or something else}%
- \advance\dimen@ by -1.8\baselineskip\relax%
+ by changing the text, the space\MessageBreak
+ or something else}%
+ \advance\dimen@ by -1.8\baselineskip\relax%needed????????????????????
}{}%
- \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
- \mdf@ignorevbadness%
- \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@
- \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
- \ifbool{mdf@repeatframetitle}{%
- \setbox\mdf@splitbox@one\vbox{%
- \vbox to \mdf@splittopskip@length{\hsize\z@}
- %\par\unskip\nointerlineskip
- \unvcopy\mdf@frametitlebox%
- \mdf@@frametitlerule%
- \vbox to\dimexpr
- -\mdf@splittopskip@length+\ht\strutbox+\dp\strutbox
- +\mdf@innertopmargin@length\relax{\hsize\z@}%
- \unvbox\mdf@splitbox@one}%
- }{}%
- \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}{\dimen@}%
- {%Falsch gesplittet
- \mdf@PackageInfo{Box was splittet wrong\MessageBreak}%
- \dimen@i=\dimen@
- \advance\dimen@ by -\ht\mdf@splitbox@two
- \advance\dimen@ by -\dp\mdf@splitbox@two
- \advance\dimen@i by 0.5\dimen@
- \splittopskip\z@%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@two%
- %benoetigt um Tiefe zu haben
- \hrule \@height\dp\strutbox \@width\z@
- \unvbox\mdf@splitbox@one}
- \splittopskip\mdf@splittopskip@length%
- \mdf@ignorevbadness%
- \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@i
- \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@}%
- {%
- \splittopskip\z@\mdf@ignorevbadness%%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@two%
- %benoetigt um Tiefe zu haben
- \hrule \@height\dp\strutbox \@width\z@
- \unvbox\mdf@splitbox@one}%
- \mdf@ignorevbadness%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
- }{}%
- \ifbool{mdf@repeatframetitle}{%
- \setbox\mdf@splitbox@one\vbox{%
- \vbox to \mdf@splittopskip@length{\hsize\z@}
- %\par\unskip\nointerlineskip
- \unvcopy\mdf@frametitlebox%
- \mdf@@frametitlerule%
- \vbox to\dimexpr
- -\mdf@splittopskip@length+\ht\strutbox+\dp\strutbox
- +\mdf@innertopmargin@length\relax{\hsize\z@}%
- \unvbox\mdf@splitbox@one}%
- }{}%
- }{}%
- \ifvoid\mdf@splitbox@one
- \mdf@PackageWarning{You got a bad break\MessageBreak
- because the splittet box is empty\MessageBreak
- You have to change the page settings\MessageBreak
- like enlargethispage or something else}%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@two}%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
- \enlargethispage{\baselineskip}%
- \def\mdf@reserved@a{\mdf@put@frame}%
- \fi
- \ifvoid\mdf@splitbox@two%%pruefe, ob erste Box leer ist
+ \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}%
+ \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
+ \mdf@ignorevbadness%
+ \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@
+ \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@}%
+ {%splitted wrong
+ \mdf@PackageInfo{Box was splittet wrong^^M starting loop to iterate
+ the splitting point\MessageBreak}%
+ \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
+ \dimen@i=\dimen@%\relax
+ \@tempcnta=\z@\relax
+ \loop
+ \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
+ \mdf@ignorevbadness%
+ \setbox\mdf@splitbox@one=\vbox{\break\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}%
+ \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
+ 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}%
+ \fi%
+ \ifdim\wd\mdf@splitbox@two=\wd\mdf@splitbox@one\relax
+ \else%
+ \mdf@PackageInfo{You first box width is to small^^M
+ mdframed fixed it\MessageBreak}%
+ \setbox\mdf@splitbox@two=\vbox%
+ {%
+ \hrule \@height\z@ \@width\wd\mdf@splitbox@one\relax
+ \unvcopy\mdf@splitbox@two%
+ }%
+ \fi%
+ \ifvoid\mdf@splitbox@two\relax%
{\hrule \@height\f@size pt \@width\z@%
\hrule \@height\z@ \@width\hsize}%
- %
- \def\mdf@reserved@a{\mdf@put@frame}%
- \else
+ \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
+ \def\mdf@reserved@a{\mdf@put@frame}%
+ \else%
\ifdimequal{\ht\mdf@splitbox@two}{0pt}%
{\hrule \@height\z@ \@width\hsize%
\vfill\eject%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@two\unvbox\mdf@splitbox@one}
+ \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
\def\mdf@reserved@a{\mdf@put@frame}%
}%
{%
- \begingroup%
- \mdf@@setzref
- \mdf@putbox@first%%%Groesse des Splittens passt
- \endgroup%
+ \begingroup\mdf@@setzref\mdf@putbox@first\endgroup%
\hrule \@height\z@ \@width\hsize%
\vfill\eject%
\def\mdf@reserved@a{\mdf@put@frame@ii}%
}%
- \fi%
- }%
+ \fi%
+ }%
\mdf@reserved@a%
}
-\def\mdf@put@frame@ii{%Ausgabe der mittleren Box(en) wenn vorhanden
+\def\mdf@put@frame@ii{%
\setlength{\mdf@freevspace@length}{\vsize}%
+ \ifbool{mdf@repeatframetitle}%
+ {%
+ \toggletrue{mdf@notfirstframetitle}%
+ \splitmaxdepth\z@ \splittopskip\z@%
+ \setbox\mdf@splitbox@one=\vbox{\break\unvbox\mdf@splitbox@one}%
+ \mdf@ignorevbadness%
+ \setbox0=\vsplit\mdf@splitbox@one to \z@\relax%
+ \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}
+ \setbox\mdf@splitbox@one\vbox%
+ {%
+ \vbox to \mdf@frametitleaboveskip@length{}
+ \unvcopy\mdf@frametitlebox\relax%
+ \mdf@@frametitlerule\relax%
+ \unvbox\mdf@splitbox@one\relax%
+ }%
+ \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}%
+ }{}%
\setlength{\dimen@}{\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
- \mdf@dolist{\mdf@advancelength@freevspace@add}{%used \dimen@
- outerlinewidth,middlelinewidth,innerlinewidth,%
- innerbottommargin}%%%Addition der Linien unten
- \ifbool{mdf@everyline}{%
- \ifbool{mdf@topline}{%
- \advance\dimen@ by \mdf@innerlinewidth@length%
- \advance\dimen@ by \mdf@middlelinewidth@length%
- \advance\dimen@ by \mdf@outerlinewidth@length%
- }{}%
- }{}%
- \ifbool{mdf@bottomline}{}{%
- \advance\dimen@ by -\mdf@innerlinewidth@length%
- \advance\dimen@ by -\mdf@middlelinewidth@length%
- \advance\dimen@ by -\mdf@outerlinewidth@length%
- \relax}%
- \ifdimgreater{\dimen@}{\mdf@freevspace@length}%
+ \mdf@dolist{\mdf@advancelength@freevspace@add}%
+ {%used \dimen@
+ innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth,%
+ }%
+ \ifbool{mdf@everyline}%
{%
+ \ifbool{mdf@topline}%
+ {%
+ \advance\dimen@ by \mdf@innerlinewidth@length\relax%
+ \advance\dimen@ by \mdf@middlelinewidth@length\relax%
+ \advance\dimen@ by \mdf@outerlinewidth@length\relax%
+ }{}%
+ }{}%
+ \notbool{mdf@bottomline}%
+ {%
+ \advance\dimen@ by -\mdf@innerlinewidth@length\relax%
+ \advance\dimen@ by -\mdf@middlelinewidth@length\relax%
+ \advance\dimen@ by -\mdf@outerlinewidth@length\relax%
+ \relax%
+ }{}%
+ \ifdimgreater{\dimen@}{\mdf@freevspace@length}%
+ {%have a middle box
\advance\mdf@freevspace@length by -\mdf@splitbottomskip@length\relax%
- \advance\mdf@freevspace@length by .5\ht\strutbox\relax%
- \ifbool{mdf@everyline}{%
- \ifbool{mdf@topline}{%
- \advance\mdf@freevspace@length by -\mdf@innerlinewidth@length%
- \advance\mdf@freevspace@length by -\mdf@middlelinewidth@length%
- \advance\mdf@freevspace@length by -\mdf@outerlinewidth@length%
- }{}%
- \ifbool{mdf@bottomline}{%
- \advance\mdf@freevspace@length by -\mdf@innerlinewidth@length%
- \advance\mdf@freevspace@length by -\mdf@middlelinewidth@length%
- \advance\mdf@freevspace@length by -\mdf@outerlinewidth@length%
- \relax}{}%
- }{}%
- \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
- \mdf@ignorevbadness%
- \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \mdf@freevspace@length%
- \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%PRUEFEN!!!
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%PRUEFEN!!!!
- \ifbool{mdf@repeatframetitle}{%
- \setbox\mdf@splitbox@one\vbox{%
- \vbox to \mdf@splittopskip@length{\hsize\z@}
- %\par\unskip\nointerlineskip
- \unvcopy\mdf@frametitlebox%
- \mdf@@frametitlerule%
- \vbox to\dimexpr
- -\mdf@splittopskip@length+\ht\strutbox+\dp\strutbox
- +\mdf@innertopmargin@length\relax{\hsize\z@}%
- \unvbox\mdf@splitbox@one}%
- }{}%
- \ifvoid\mdf@splitbox@one\relax%
- \mdf@PackageWarning{You got a bad break\MessageBreak
- because the split box is empty\MessageBreak
- You have to change the settings}%
- \setbox\mdf@splitbox@one{\unvbox\mdf@splitbox@two}%
- \def\mdf@reserved@a{\enlargethispage{\baselineskip}\mdf@put@frame@ii}%
- \else
- \begingroup
- \mdf@@setzref
- \mdf@putbox@middle%
- \endgroup
- \hrule \@height\z@ \@width\hsize
- \vfill\eject
+ \ifbool{mdf@everyline}%
+ {%
+ \ifbool{mdf@topline}%
+ {%
+ \advance\mdf@freevspace@length by -\mdf@innerlinewidth@length\relax%
+ \advance\mdf@freevspace@length by -\mdf@middlelinewidth@length\relax%
+ \advance\mdf@freevspace@length by -\mdf@outerlinewidth@length\relax%
+ }{}%
+ \ifbool{mdf@bottomline}%
+ {%
+ \advance\mdf@freevspace@length by -\mdf@innerlinewidth@length\relax%
+ \advance\mdf@freevspace@length by -\mdf@middlelinewidth@length\relax%
+ \advance\mdf@freevspace@length by -\mdf@outerlinewidth@length\relax%
+ \relax
+ }{}%
+ }{}%
+ \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}%
+ \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
+ \mdf@ignorevbadness%
+ \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@}%
+ {%splitted wrong
+ \mdf@PackageInfo{Box was splittet wrong^^M starting loop to iterate
+ the splitting point\MessageBreak}%
+ \dimen@i=\mdf@freevspace@length%\relax
+ \@tempcnta=\z@\relax
+ \loop
+ \ifdim\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax>%
+ \mdf@freevspace@length\relax
+ \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
+ \setbox\mdf@splitbox@one=\vbox{\break\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}%
+ \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
+ 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
+ \begingroup\mdf@@setzref\mdf@putbox@middle\endgroup%
+ \hrule \@height\z@ \@width\hsize%
+ \vfill\eject%
\def\mdf@reserved@a{\mdf@put@frame@ii}%
\fi
- }%Hier die Ausgabe der mittleren Box
- {\ifvoid\mdf@splitbox@one
+ }%End middle box case
+ {%start last box case
+ \ifvoid\mdf@splitbox@one
\mdf@PackageWarning{You got a bad break\MessageBreak
because the last split box is empty\MessageBreak
You have to change the settings}%%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one\hrule \@height\z@ \@width\mdfboundingboxwidth}%
+ \setbox\mdf@splitbox@one=\vbox%
+ {%
+ \unvbox\mdf@splitbox@one%
+ \hrule \@height\z@ \@width\mdfboundingboxwidth
+ }%
\fi%
- \ifdimless{\ht\mdf@splitbox@one}{1sp}{%
- \mdf@PackageWarning{You got a bad break\MessageBreak
- because the last split box is empty\MessageBreak
- You have to change the settings}%
- %\hb@xt@\z@{\box\mdf@splitbox@one}%
- \let\mdf@reserved@a\relax%
- \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one\hrule \@height\z@ \@width\mdfboundingboxwidth}%
+ \ifdimless{\ht\mdf@splitbox@one}{1sp}%
+ {%
+ \mdf@PackageWarning{You got a bad break\MessageBreak
+ because the last split box is empty\MessageBreak
+ You have to change the settings}%
+
+ \let\mdf@reserved@a\relax%
+ \setbox\mdf@splitbox@one=\vbox%
+ {%
+ \unvbox\mdf@splitbox@one%
+ \hrule \@height\z@ \@width\mdfboundingboxwidth
+ }%
}{}%
- \begingroup%
- \mdf@@setzref
- \mdf@putbox@second%
- \hrule \@height\z@ \@width\hsize%
- \endgroup%
- \let\mdf@reserved@a\relax%
- }%Hier kommt die Ausgabe der letzten Box
+ \begingroup\mdf@@setzref\mdf@putbox@second\endgroup%
+ \hrule \@height\z@ \@width\hsize%
+ \let\mdf@reserved@a\relax%
+ }%
\mdf@reserved@a%
}
@@ -1141,65 +1233,65 @@
%%Zusammenhaenge abfragen:
\newrobustcmd*\mdf@test@ltrb{%
\ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
- and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
+ and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@ltr{%
\ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
- and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
+ and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@ltb{%
\ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
- and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
+ and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@trb{%
\ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
- and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
+ and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@lrb{%
\ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
- and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
+ and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@lb{%
\ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
- and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
+ and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@rb{%
\ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
- and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
+ and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@tr{%
\ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
- and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
+ and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@lt{%
\ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
- and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
+ and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@lr{%
- \ifboolexpr{not (bool {mdf@topline}) and not (bool {mdf@bottomline})
- and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
+ \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
+ and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@tb{%
\ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
- and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
+ and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@l{%
\ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
- and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
+ and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@r{%
\ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
- and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
+ and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@t{%
\ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
- and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
+ and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@b{%
\ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
- and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
+ and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@noline{%
\ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
- and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
+ and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\mdf@test@single{%
\ifboolexpr{ not (test {\mdf@test@ltrb} or test {\mdf@test@ltr} or
- test {\mdf@test@ltb} or test {\mdf@test@trb} or
- test {\mdf@test@lrb} or test {\mdf@test@lb} or
- test {\mdf@test@rb} or test {\mdf@test@tr} or
- test {\mdf@test@lt} ) }}
+ test {\mdf@test@ltb} or test {\mdf@test@trb} or
+ test {\mdf@test@lrb} or test {\mdf@test@lb} or
+ test {\mdf@test@rb} or test {\mdf@test@tr} or
+ test {\mdf@test@lt} ) }}
\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{framemethod}%
\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{xcolor}%
\endinput
%%
%% ================================================================
-%% Copyright (C) 2011 by Marco Daniel
+%% Copyright (C) 2012 by Marco Daniel
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either