diff options
author | Karl Berry <karl@freefriends.org> | 2013-06-23 23:43:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-06-23 23:43:14 +0000 |
commit | 0ade4baaa2b1857abfa6b1385ca4a72b9c68a08b (patch) | |
tree | 8e34059b97843eedf3e5760dff025d89d19a98de /Master | |
parent | f42dda28c8d669e48f9adcba4a7809d26e210bea (diff) |
mdframed (23jun13)
git-svn-id: svn://tug.org/texlive/trunk@30868 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
21 files changed, 2987 insertions, 4135 deletions
diff --git a/Master/texmf-dist/doc/latex/mdframed/README b/Master/texmf-dist/doc/latex/mdframed/README.txt index df8944c8a17..3f53c02ae52 100644 --- a/Master/texmf-dist/doc/latex/mdframed/README +++ b/Master/texmf-dist/doc/latex/mdframed/README.txt @@ -53,7 +53,7 @@ I recommend the following installation in your texmf-tree: - mdframed-example-pstricks.pdf - mdframed-example-texsx.tex - mdframed-example-texsx.pdf -- donald-duck.jpg +- ctan-lion.png "CTAN lion drawing by Duane Bibby; thanks to www.ctan.org". /source/latex/mdframed/ - Makefile @@ -68,3 +68,4 @@ I recommend the following installation in your texmf-tree: - ltxmdf.cls ================================================================ ================================================================ + diff --git a/Master/texmf-dist/doc/latex/mdframed/ctan-lion.png b/Master/texmf-dist/doc/latex/mdframed/ctan-lion.png Binary files differnew file mode 100644 index 00000000000..c24d9a98f25 --- /dev/null +++ b/Master/texmf-dist/doc/latex/mdframed/ctan-lion.png diff --git a/Master/texmf-dist/doc/latex/mdframed/donald-duck.jpg b/Master/texmf-dist/doc/latex/mdframed/donald-duck.jpg Binary files differdeleted file mode 100644 index fe4f2a769e4..00000000000 --- a/Master/texmf-dist/doc/latex/mdframed/donald-duck.jpg +++ /dev/null diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.pdf b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.pdf Binary files differindex 8f50a07fdda..15f1530bc24 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.pdf +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.pdf diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex index 9f202f496d6..2a2d4156f17 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-default.tex @@ -1,12 +1,33 @@ + \setcounter{errorcontextlines}{999} \documentclass[parskip=false,english,11pt]{ltxmdf} -\usepackage{showexpl} -\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} +\lstset{style=lstltxmdf} \newcommand\Loadedframemethod{default} \usepackage[framemethod=\Loadedframemethod]{mdframed} +\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} + +\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfhighlight} +\def\highlightinputenv{tltxmdfhighlight} + \title{The \Pack{mdframed} package} \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} \author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}} @@ -43,8 +64,8 @@ In the preamble only the package \Pack{mdframed} with the option done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}. {\large\color{red!50!black} -\NOTE Every \Cmd{global} inside the examples is necessary to work with the -package \Pack{showexpl}.} +\NOTE Every \Cmd{global} inside the examples is necessary to work with my own +created environment \Env{tltxmdfexample*}.} \section{Examples} All examples have the following settings: @@ -52,19 +73,19 @@ All examples have the following settings: \begin{tltxmdfexample} \mdfsetup{skipabove=\topskip,skipbelow=\topskip} \newrobustcmd\ExampleText{% -An \textit{inhomogeneous linear} differential equation -has the form -\begin{align} -L[v ] = f, -\end{align} -where $L$ is a linear differential operator, $v$ is -the dependent variable, and $f$ is a given non-zero -function of the independent variables alone. + An \textit{inhomogeneous linear} differential equation has the form + \begin{align} + L[v ] = f, + \end{align} + where $L$ is a linear differential operator, $v$ is the dependent + variable, and $f$ is a given non-zero function of the independent + variables alone. } \end{tltxmdfexample} + \clearpage \Examplesec{very simple} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfdefinestyle{exampledefault}{% linecolor=red,linewidth=3pt,% leftmargin=1cm,rightmargin=1cm @@ -72,20 +93,19 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{hidden line + frame title} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfapptodefinestyle{exampledefault}{% topline=false,bottomline=false} \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] \ExampleText \end{mdframed} -\end{LTXexample} -\clearpage +\end{tltxmdfexample*} \Examplesec{colored frame title} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfapptodefinestyle{exampledefault}{% rightline=true,innerleftmargin=10,innerrightmargin=10, @@ -95,21 +115,21 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{framed picture which is centered} -\begin{LTXexample}[morekeywords=width] +\begin{tltxmdfexample*}[morekeywords=width] \begin{mdframed}[userdefinedwidth=6cm,align=center, linecolor=blue,linewidth=4pt] -\IfFileExists{donald-duck.jpg}% - {\includegraphics[width=\linewidth]{donald-duck}}% +\textit{CTAN lion drawing by Duane Bibby; thanks to \url{www.ctan.org}} +\IfFileExists{ctan-lion.png}% + {\includegraphics[width=\linewidth]{ctan-lion.png}}% {\rule{\linewidth}{4cm}}% \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{Theorem environments} -\begin{LTXexample}[morekeywords={theoremstyle,definition}] +\begin{tltxmdfexample*}[morekeywords={theoremstyle,definition}] \mdfdefinestyle{theoremstyle}{% linecolor=red,linewidth=2pt,% frametitlerule=true,% @@ -126,11 +146,10 @@ function of the independent variables alone. \begin{definition*}[Inhomogeneous linear] \ExampleText \end{definition*} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{theorem with separate header and the help of TikZ (complex)} -\begin{LTXexample}[% +\begin{tltxmdfexample*}[% morekeywords={theo,baseline,anchor,outer,sep,current,bounding,box,east},% moretexcs=tikz] \newcounter{theo}[section] @@ -161,15 +180,14 @@ function of the independent variables alone. \begin{theo} \ExampleText \end{theo} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{hide only a part of a line} The example below is inspired by the following post on StackExchange \href{http://tex.stackexchange.com/questions/24101/theorem-decorations^^A -that-stay-with-theorem-environment}% {Theorem decorations that stay with theorem environment} -\begin{LTXexample}[morekeywords={mdf@frame@leftline@single,mdf@frame@rightline@single,% +\begin{tltxmdfexample*}[morekeywords={mdf@frame@leftline@single,mdf@frame@rightline@single,% mdf@frame@leftline@first,mdf@frame@rightline@first,% mdf@frame@leftline@second,mdf@frame@rightline@second,% mdf@frame@leftline@middle,mdf@frame@rightline@middle,% @@ -179,8 +197,10 @@ The example below is inspired by the following post on StackExchange \newlength{\interruptlength} \newrobustcmd\interruptrule[3]{% \color{#1}% - \hspace*{\dimexpr\mdfboundingboxwidth+\mdf@innerrightmargin@length\relax}% - \rule[\dimexpr-\mdfboundingboxdepth+#2\interruptlength\relax]% + \hspace*{\dimexpr\mdfboundingboxwidth+ + \mdf@innerrightmargin@length\relax}% + \rule[\dimexpr-\mdfboundingboxdepth+ + #2\interruptlength\relax]% {\mdf@middlelinewidth@length}% {\dimexpr\mdfboundingboxtotalheight-#3\interruptlength\relax}% } @@ -206,6 +226,6 @@ The example below is inspired by the following post on StackExchange \begin{mdframed}[linecolor=blue,linewidth=8pt] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \end{document} \endinput diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-pstricks.pdf b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-pstricks.pdf Binary files differindex d27b9dfd610..2061649b842 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-pstricks.pdf +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-pstricks.pdf diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-pstricks.tex b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-pstricks.tex index e116dcbd44d..e347be7342e 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-pstricks.tex +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-pstricks.tex @@ -1,3 +1,4 @@ + \setcounter{errorcontextlines}{999} \documentclass[parskip=false,english,11pt]{ltxmdf} @@ -5,8 +6,26 @@ \newcommand\Loadedframemethod{PSTricks} \usepackage[framemethod=\Loadedframemethod]{mdframed} -\usepackage{showexpl} -\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} +\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} + +\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfhighlight} +\def\highlightinputenv{tltxmdfhighlight} \title{The \Pack{mdframed} package} \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} @@ -44,8 +63,8 @@ In the preamble only the package \Pack{mdframed} width the option done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}. {\large\color{red!50!black} -\NOTE Every \Cmd{global} inside the examples is necessary to work with the -package \Pack{showexpl}.} +\NOTE Every \Cmd{global} inside the examples is necessary to work with my own +created environment \Env{tltxmdfexample*}.} \section{Examples} All examples have the following settings: @@ -53,20 +72,20 @@ All examples have the following settings: \begin{tltxmdfexample} \mdfsetup{skipabove=\topskip,skipbelow=\topskip} \newrobustcmd\ExampleText{% -An \textit{inhomogeneous linear} differential equation -has the form -\begin{align} -L[v ] = f, -\end{align} -where $L$ is a linear differential operator, $v$ is -the dependent variable, and $f$ is a given non-zero -function of the independent variables alone. + An \textit{inhomogeneous linear} differential equation has the form + \begin{align} + L[v ] = f, + \end{align} + where $L$ is a linear differential operator, $v$ is the dependent + variable, and $f$ is a given non-zero function of the independent + variables alone. } \end{tltxmdfexample} + \clearpage \Examplesec{very simple} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfdefinestyle{exampledefault}{% linecolor=red,middlelinewidth=3pt,% leftmargin=1cm,rightmargin=1cm @@ -74,10 +93,10 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault,roundcorner=5] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{hidden line + frame title} -\begin{LTXexample}[morekeywords={innerlinecolor,addtopsstyle,mdfouterlinestyle, +\begin{tltxmdfexample*}[morekeywords={innerlinecolor,addtopsstyle,mdfouterlinestyle, linestyle}] \global\mdfapptodefinestyle{exampledefault}{% topline=false,rightline=false,bottomline=false, @@ -88,21 +107,19 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] \ExampleText \end{mdframed} -\end{LTXexample} - -\clearpage +\end{tltxmdfexample*} \Examplesec{Dash Lines}[morekeywords={pstrickssetting,linestyle,dashed}] -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfdefinestyle{exampledefault}{% pstrickssetting={linestyle=dashed,},linecolor=red,middlelinewidth=2pt} \begin{mdframed}[style=exampledefault] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{Double Lines} -\begin{LTXexample}[morekeywords={addtopsstyle,mdfmiddlelinestyle, +\begin{tltxmdfexample*}[morekeywords={addtopsstyle,mdfmiddlelinestyle, doubleline,doublesep}] \global\mdfdefinestyle{exampledefault}{% pstricksappsetting={\addtopsstyle{mdfmiddlelinestyle}{% @@ -111,11 +128,10 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{Shadow frame} -\begin{LTXexample}[morekeywords={shadow,shadowsize,myshadowbox}] +\begin{tltxmdfexample*}[morekeywords={shadow,shadowsize,myshadowbox}] \newmdenv[shadow=true, shadowsize=11pt, linewidth=8pt, @@ -125,6 +141,6 @@ function of the independent variables alone. \begin{myshadowbox}[frametitle={Inhomogeneous linear}] \ExampleText \end{myshadowbox} -\end{LTXexample} +\end{tltxmdfexample*} \end{document} \endinput diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.pdf b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.pdf Binary files differindex 54af09821f2..513e71a93e8 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.pdf +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.pdf diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex index b486389e415..6f34f23d9a6 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-texsx.tex @@ -1,14 +1,34 @@ + \setcounter{errorcontextlines}{999} \documentclass[parskip=false,english,11pt,lipsum=true]{ltxmdf} -\usepackage{showexpl} -\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} \usepackage{tikz} \usetikzlibrary{calc,arrows,shadings,shadows} \newcommand\Loadedframemethod{tikz} \usepackage[framemethod=\Loadedframemethod]{mdframed} +\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} + +\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfhighlight} +\def\highlightinputenv{tltxmdfhighlight} + \title{The \Pack{mdframed} package} \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} \author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}} @@ -45,8 +65,8 @@ In the preamble only the package \Pack{mdframed} width the option done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}. {\large\color{red!50!black} -\NOTE Every \Cmd{global} inside the examples is necessary to work with the -package \Pack{showexpl}.} +\NOTE Every \Cmd{global} inside the examples is necessary to work with my own +created environment \Env{tltxmdfexample*}.} \section{Examples} All examples have the following settings: @@ -54,14 +74,13 @@ All examples have the following settings: \begin{tltxmdfexample} \mdfsetup{skipabove=\topskip,skipbelow=\topskip} \newrobustcmd\ExampleText{% -An \textit{inhomogeneous linear} differential equation -has the form -\begin{align} -L[v ] = f, -\end{align} -where $L$ is a linear differential operator, $v$ is -the dependent variable, and $f$ is a given non-zero -function of the independent variables alone. + An \textit{inhomogeneous linear} differential equation has the form + \begin{align} + L[v ] = f, + \end{align} + where $L$ is a linear differential operator, $v$ is the dependent + variable, and $f$ is a given non-zero function of the independent + variables alone. } \end{tltxmdfexample} \clearpage @@ -90,24 +109,24 @@ With the new command \Cmd{surroundwithmdframed} you can use \surroundwithmdframed{listings} \end{tltxmdfexample} +\clearpage \Examplesec{Package multicol} How I wrote in \enquote{Known Problems} you can't combine \Pack{multicol} with \Pack{mdframed}. In a simple way without any breaks you can use: -\begin{LTXexample}[morekeywords={multicols}] -\begin{multicols}{2} -\lipsum[1] -\begin{mdframed} -\ExampleText -\end{mdframed} -\lipsum[2] -\end{multicols} -\end{LTXexample} + +\begin{tltxmdfexample*}[morekeywords={multicols}] + \begin{multicols}{2} + \lipsum[1] + \begin{mdframed} + \ExampleText + \end{mdframed} + \lipsum[2] + \end{multicols} +\end{tltxmdfexample*} + \clearpage \twocolumn[\Examplesec{Working in twocolumn mode}] -\begin{tltxmdfexample} -\twocolumn[% - \Examplesec{Working in - twocolumn mode}] +\begin{tltxmdfexample*}[moretexcs={Examplesec}] \lipsum[1]\lipsum[2] \begin{mdframed}[% leftmargin=10pt,% @@ -117,19 +136,12 @@ How I wrote in \enquote{Known Problems} you can't combine \Pack{multicol} with \ExampleText \end{mdframed} \lipsum[2] -\end{tltxmdfexample} -\lipsum[1]\lipsum[2] -\begin{mdframed}[leftmargin=10pt,% - rightmargin=10pt,% - linecolor=red, - backgroundcolor=yellow] -\ExampleText -\end{mdframed} -\lipsum[2] +\end{tltxmdfexample*} + \clearpage \onecolumn \Examplesec{Working inside enumerate} -\begin{LTXexample}[morekeywords={enumerate}] +\begin{tltxmdfexample*}[morekeywords={enumerate}] Text Text Text Text Text Text Text Text \begin{enumerate} \item in the following \ldots @@ -139,10 +151,10 @@ Text Text Text Text Text Text Text Text \item \lipsum[2] \end{enumerate} Text Text Text Text Text Text -\end{LTXexample} -\clearpage +\end{tltxmdfexample*} + \Examplesec{Position a specific symbol at a line} -\begin{LTXexample} +\begin{tltxmdfexample*} \tikzset{ warningsymbol/.style={ rectangle,draw=red, @@ -172,11 +184,10 @@ Text Text Text Text Text Text \begin{mdframed}[style=warning] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{digression-environement inspired by Tobias Weh} -\begin{lstlisting}[morekeywords={% +\begin{tltxmdfexample*}[morekeywords={% font,anchor,let,in,arrow,round,cap,controls,coordinate,% excursus,head,arrows,calc,line,width,and,to,digressionarrows,% base,west},% @@ -232,70 +243,21 @@ Text Text Text Text Text Text \begin{mdframed}[style=digressionarrows] \ExampleText \end{mdframed} -\end{lstlisting} - -\tikzset{ - excursus arrow/.style={% - line width=2pt, - draw=gray!40, - rounded corners=2ex, - }, - excursus head/.style={ - fill=white, - font=\bfseries\sffamily, - text=gray!80, - anchor=base west, - }, -} -\mdfdefinestyle{digressionarrows}{% - singleextra={% - \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q); - \path let \p1=(Q), \p2=(O) in (\x1,{(\y1-\y2)/2}) coordinate (M); - \path [excursus arrow, round cap-to] - ($(O)+(5em,0ex)$) -| (M) |- % - ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. % - ++(23em,2ex); - \node [excursus head] at ($(Q)+(2.5em,-0.75pt)$) {Digression};}, - firstextra={% - \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q); - \path [excursus arrow,-to] - (O) |- % - ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. % - ++(23em,2ex); - \node [excursus head] at ($(Q)+(2.5em,-2pt)$) {Digression};}, - secondextra={% - \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q); - \path [excursus arrow,round cap-] - ($(O)+(5em,0ex)$) -| (Q);}, - middleextra={% - \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q); - \path [excursus arrow] - (O) -- (Q);}, - middlelinewidth=2.5em,middlelinecolor=white, - hidealllines=true,topline=true, - innertopmargin=0.5ex, - innerbottommargin=2.5ex, - innerrightmargin=2pt, - innerleftmargin=2ex, - skipabove=0.87\baselineskip, - skipbelow=0.62\baselineskip, -} - -\begin{mdframed}[style=digressionarrows] - \ExampleText -\end{mdframed} +\end{tltxmdfexample*} \Examplesec{Theorem style shading background} -\begin{LTXexample}[morekeywords={top,bottom,Theorem,shadow,alternativtheorem}] +\begin{tltxmdfexample*}[morekeywords={top,bottom,Theorem,shadow,alternativtheorem}] \mdtheorem[% - apptotikzsetting={\tikzset{mdfbackground/.append style =% - {top color=yellow!40!white, - bottom color=yellow!80!black}, - mdfframetitlebackground/.append style =% - {top color=purple!40!white, - bottom color=purple!80!black} - }% - }, + apptotikzsetting={% + \tikzset{mdfbackground/.append style ={% + top color=yellow!40!white, + bottom color=yellow!80!black}, + mdfframetitlebackground/.append style={ + top color=purple!40!white, + bottom color=purple!80!black + } + }% + }, ,roundcorner=10pt,middlelinewidth=2pt, shadow=true,frametitlerule=true,frametitlerulewidth=4pt, innertopmargin=10pt,% @@ -303,6 +265,6 @@ Text Text Text Text Text Text \begin{alternativtheorem}[Inhomogeneous linear] \ExampleText \end{alternativtheorem} -\end{LTXexample} +\end{tltxmdfexample*} \end{document} \endinput diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.pdf b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.pdf Binary files differindex 24108560453..9044a27f3ef 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.pdf +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.pdf diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex index fcb53648071..64462bf143f 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed-example-tikz.tex @@ -1,12 +1,31 @@ + \setcounter{errorcontextlines}{999} \documentclass[parskip=false,english,11pt]{ltxmdf} -\usepackage{showexpl} -\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} - \newcommand\Loadedframemethod{TikZ} \usepackage[framemethod=\Loadedframemethod]{mdframed} +\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} + +\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfhighlight} +\def\highlightinputenv{tltxmdfhighlight} + \title{The \Pack{mdframed} package} \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} \author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}} @@ -43,8 +62,8 @@ In the preamble only the package \Pack{mdframed} width the option done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}. {\large\color{red!50!black} -\NOTE Every \Cmd{global} inside the examples is necessary to work with the -package \Pack{showexpl}.} +\NOTE Every \Cmd{global} inside the examples is necessary to work with my own +created environment \Env{tltxmdfexample*}.} \section{Examples} All examples have the following settings: @@ -52,19 +71,19 @@ All examples have the following settings: \begin{tltxmdfexample} \mdfsetup{skipabove=\topskip,skipbelow=\topskip} \newrobustcmd\ExampleText{% -An \textit{inhomogeneous linear} differential equation -has the form -\begin{align} -L[v ] = f, -\end{align} -where $L$ is a linear differential operator, $v$ is -the dependent variable, and $f$ is a given non-zero -function of the independent variables alone. + An \textit{inhomogeneous linear} differential equation has the form + \begin{align} + L[v ] = f, + \end{align} + where $L$ is a linear differential operator, $v$ is the dependent + variable, and $f$ is a given non-zero function of the independent + variables alone. } \end{tltxmdfexample} + \clearpage \Examplesec{round corner} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfdefinestyle{exampledefault}{% outerlinewidth=5pt,innerlinewidth=0pt, outerlinecolor=red,roundcorner=5pt @@ -72,29 +91,30 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{hidden line + frame title} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfapptodefinestyle{exampledefault}{% topline=false,leftline=false,} \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] \ExampleText \end{mdframed} -\end{LTXexample} -\clearpage +\end{tltxmdfexample*} + \Examplesec{framed picture which is centered} -\begin{LTXexample} +\begin{tltxmdfexample*} \begin{mdframed}[userdefinedwidth=6cm,align=center, linecolor=blue,middlelinewidth=4pt,roundcorner=5pt] -\IfFileExists{donald-duck.jpg}% - {\includegraphics[width=\linewidth]{donald-duck}}% +\textit{CTAN lion drawing by Duane Bibby; thanks to \url{www.ctan.org}} +\IfFileExists{ctan-lion.png}% + {\includegraphics[width=\linewidth]{ctan-lion.png}}% {\rule{\linewidth}{4cm}}% \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{Gimmick} -\begin{LTXexample}[morekeywords={line,width,dash,dashed,pattern}] +\begin{tltxmdfexample*}[morekeywords={line,width,dash,dashed,pattern}] \mdfsetup{splitbottomskip=0.8cm,splittopskip=0cm, innerrightmargin=2cm,innertopmargin=1cm,% innerlinewidth=2pt,outerlinewidth=2pt, @@ -107,15 +127,15 @@ function of the independent variables alone. \begin{mdframed} \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \clearpage \Examplesec{complex example with TikZ} -\begin{tltxmdfexample}[morekeywords={mdf}] -\tikzstyle{titregris} = - [draw=gray, thick, fill=white, shading = exersicetitle, % - text=gray, rectangle, rounded corners, right,minimum height=.7cm] +\begin{tltxmdfexample*}[morekeywords={mdf}] +\tikzset{titregris/.style = + {draw=gray, thick, fill=white, shading = exersicetitle, % + text=gray, rectangle, rounded corners, right,minimum height=.7cm}} \pgfdeclarehorizontalshading{exersicebackground}{100bp} {color(0bp)=(green!40); color(100bp)=(black!5)} \pgfdeclarehorizontalshading{exersicetitle}{100bp} @@ -141,73 +161,19 @@ function of the independent variables alone. settings={\global\stepcounter{exercise}}, singleextra={% \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}~}; + {~\mdf@frametitlefont{\theexercise}\hbox{~}}; \ifdefempty{\mdf@@exercisepoints}% {}% {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}% + {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}% }, firstextra={% \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}~}; + {~\mdf@frametitlefont{\theexercise}\hbox{~}}; \ifdefempty{\mdf@@exercisepoints}% {}% {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}% - }, -} -\makeatother - -\begin{mdframed}[style=exercisestyle] -\ExampleText -\end{mdframed} - -\begin{mdframed}[style=exercisestyle,exercisepoints=10] -\ExampleText -\end{mdframed} -\end{tltxmdfexample} - -\tikzstyle{titregris} = - [draw=gray, thick, fill=white, shading = exersicetitle, % - text=gray, rectangle, rounded corners, right,minimum height=.7cm] -\pgfdeclarehorizontalshading{exersicebackground}{100bp} - {color(0bp)=(green!40); color(100bp)=(black!5)} -\pgfdeclarehorizontalshading{exersicetitle}{100bp} - {color(0bp)=(red!40);color(100bp)=(black!5)} -\newcounter{exercise} -\renewcommand*\theexercise{Exercise~n\arabic{exercise}} -\makeatletter -\def\mdf@@exercisepoints{}%new mdframed key: -\define@key{mdf}{exercisepoints}{% - \def\mdf@@exercisepoints{#1} -} -\mdfdefinestyle{exercisestyle}{% - outerlinewidth=1em,outerlinecolor=white,% - leftmargin=-1em,rightmargin=-1em,% - middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray, - apptotikzsetting={\tikzset{mdfbackground/.append style ={% - shading = exersicebackground}}}, - innertopmargin=1.2\baselineskip, - skipabove={\dimexpr0.5\baselineskip+\topskip\relax}, - skipbelow={-1em}, - needspace=3\baselineskip, - frametitlefont=\sffamily\bfseries, - settings={\global\stepcounter{exercise}}, - singleextra={% - \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}~}; - \ifdefempty{\mdf@@exercisepoints}% - {}% - {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}% - }, - firstextra={% - \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}~}; - \ifdefempty{\mdf@@exercisepoints}% - {}% - {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}% + {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}% }, } \makeatother @@ -219,10 +185,11 @@ function of the independent variables alone. \begin{mdframed}[style=exercisestyle,exercisepoints=10] \ExampleText \end{mdframed} +\end{tltxmdfexample*} \clearpage \Examplesec{Theorem environments} -\begin{LTXexample}[morekeywords={theoremstyle,definition}] +\begin{tltxmdfexample*}[morekeywords={theoremstyle,definition}] \mdfdefinestyle{theoremstyle}{% linecolor=red,middlelinewidth=2pt,% frametitlerule=true,% @@ -239,7 +206,7 @@ function of the independent variables alone. \begin{definition*}[Inhomogeneous linear] \ExampleText \end{definition*} -\end{LTXexample} - +\end{tltxmdfexample*} \end{document} \endinput + diff --git a/Master/texmf-dist/doc/latex/mdframed/mdframed.pdf b/Master/texmf-dist/doc/latex/mdframed/mdframed.pdf Binary files differindex c6ee0aeb87d..6e8a24268a9 100644 --- a/Master/texmf-dist/doc/latex/mdframed/mdframed.pdf +++ b/Master/texmf-dist/doc/latex/mdframed/mdframed.pdf diff --git a/Master/texmf-dist/source/latex/mdframed/Makefile b/Master/texmf-dist/source/latex/mdframed/Makefile index 0976d3355e9..fd9d5b99a31 100644 --- a/Master/texmf-dist/source/latex/mdframed/Makefile +++ b/Master/texmf-dist/source/latex/mdframed/Makefile @@ -220,7 +220,7 @@ usectanify: echo "" ;\ echo -e "\t$(ERROR_COLOR)Start ctanify$(NO_COLOR)" ;\ ctanify $(PACKAGE).ins $(PACKAGE).pdf README.txt ltxmdf.cls \ - donald-duck.jpg=doc/latex/mdframed/ \ + ctan-lion.png=doc/latex/mdframed/ \ $(EXAMPLED).tex=doc/latex/mdframed/ \ $(EXAMPLED).pdf=doc/latex/mdframed/ \ $(EXAMPLET).tex=doc/latex/mdframed/ \ diff --git a/Master/texmf-dist/source/latex/mdframed/mdframed.dtx b/Master/texmf-dist/source/latex/mdframed/mdframed.dtx index f1209ceffba..dd30dbe2c1f 100644 --- a/Master/texmf-dist/source/latex/mdframed/mdframed.dtx +++ b/Master/texmf-dist/source/latex/mdframed/mdframed.dtx @@ -59,7 +59,7 @@ I recommend the following installation in your texmf-tree: - mdframed-example-pstricks.pdf - mdframed-example-texsx.tex - mdframed-example-texsx.pdf -- donald-duck.jpg +- ctan-lion.png "CTAN lion drawing by Duane Bibby; thanks to www.ctan.org". /source/latex/mdframed/ @@ -106,7 +106,7 @@ License type: lppl HEIKO OBERDIEK HERBERT VOSS - Copyright (c) 2010 Marco Daniel + Copyright (c) 2010-2013 Marco Daniel This package may be distributed under the terms of the LaTeX Project Public License, as described in lppl.txt in the base LaTeX distribution. @@ -216,19 +216,22 @@ Have fun! \setcounter{errorcontextlines}{999} \documentclass[parskip=false,11pt,]{ltxmdf} +\usepackage{pdfpages} \usepackage[framemethod=TikZ]{mdframed} - +\usetikzlibrary{shadows} \surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% roundcorner=10pt,innertopmargin=0pt,% leftmargin=1cm,rightmargin=1cm,% innerleftmargin=-15pt,innerrightmargin=-15pt,% ignorelastdescenders,% settings={\lstset{resetmargins}},% - skipbelow=\topskip,skipabove=\topskip, - innerbottommargin=0pt,backgroundcolor=gray!10]{tltxmdfexample} + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} \EnableCrossrefs \CodelineIndex +\OnlyDescription %%\RecordChanges \begin{document} \DocInput{mdframed.dtx} @@ -302,14 +305,12 @@ Have fun! % roundcorner = 10pt ,% % leftmargin = 40 ,% % rightmargin = 40 ,% -% backgroundcolor = yellow ,% -% outerlinecolor = blue ,% +% backgroundcolor = yellow!40 ,% +% outerlinecolor = blue!70!black ,% % innertopmargin = \topskip ,% % splittopskip = \topskip ,% % ntheorem = true ,% -% skipabove = \baselineskip ,% -% skipbelow = \baselineskip] -% {theorem}{Theorem}[section] +% ]{theorem}{Theorem}[section] % % \begin{theorem}[Pythagorean theorem] % In any right triangle, the area of the square whose side is the hypotenuse @@ -327,16 +328,15 @@ Have fun! \begin{tltxmdfexample}[columns=fixed,fontadjust=false] \newmdtheoremenv[% outerlinewidth = 2 ,% + roundcorner = 10pt ,% leftmargin = 40 ,% rightmargin = 40 ,% - backgroundcolor = yellow ,% - outerlinecolor = blue ,% + backgroundcolor = yellow!40 ,% + outerlinecolor = blue!70!black ,% innertopmargin = \topskip ,% splittopskip = \topskip ,% ntheorem = true ,% - skipabove = \baselineskip ,% - skipbelow = \baselineskip] - {theorem}{Theorem}[section] + ]{theorem}{Theorem}[section] \begin{theorem}[Pythagorean theorem] ... \end{theorem} @@ -348,20 +348,16 @@ Have fun! % % \section{Syntax}\label{sec:syntax} % -% \minisec{Loadings \Pack{mdframed}} +% \minisec{Required packages by \Pack{mdframed}} % The package itself loads the packages -% \begin{itemize} -% \item \Pack{kvoptions}, -% \item \Pack{xparse} (new), -% \item \Pack{etoolbox} and -% \item \Pack{color}. -% \end{itemize} -% Depending on the options \Pack{mdframed} will load -% \begin{itemize} -% \item \Pack{xcolor}, -% \item \Pack{tikz} or -% \item \Pack{pstricks}. -% \end{itemize} +% \begin{center} +% \Pack{kvoptions}\qquad\Pack{xparse}\qquad\Pack{etoolbox} +% \quad\Pack{color}. +% \end{center} +% Depending on the option \Opt{framemthod} \Pack{mdframed} will load +% \begin{center} +% \Pack{xcolor}\qquad\Pack{tikz}\qquad\Pack{pstricks}. +% \end{center} % % Load the package as usual: % \iffalse @@ -399,21 +395,16 @@ Have fun! % an environment \Pack{mdframed} will use the option \Opt{nobreak} % automatically. % -% \minisec{Twoside-mode} -% If you are using \Pack{mdframed} inside \Pack{twoside}-mode you can set -% the option \Opt{innermargin} and \Opt{outermargin} (see section % -% \ref{optlength}). The length will be ignored if you use the option -% \Opt{usetwoside}. % % % %%%%%%%%%%%%%%%%%%%%%%% -% \section{The frames}\label{sec:cmds} +% \section{The frames}\label{sec:frames} % % Normally you can say \Pack{mdframed} draws only some lines. % To allow page breaks the following designs are supported. % If you load the package with \Opt{framemethod=default} you -% can only draw a single line. Inside the gray box the text -% will be printed. +% can only draw a single line. Inside the gray boxes of the images below +% the text will be printed. % \newcommand\Punkt[2][below]{% % \node[label=#1:#2] at (#2){\tikz\fill(0,0)circle(0.05);};} % \newcommand\Single[1][]{\path[#1] (O)--(O|-P)--(P)--(P|-O)--cycle;} @@ -496,10 +487,12 @@ Have fun! %\end{center} % %%%%%%%%%%%%%%%%%%%%%%% % \section{Commands}\label{sec:cmds} +% % The following commands should countenance your by the handling with % \Pack{mdframed}. % -% \ExplCmd{newmdenv} The command has the following syntax: +% \ExplCmd{newmdenv[options]\{env-name\}} The command allows the definition of a new environment +% which is surrounded by \Env{mdframed}. The command has the following syntax: % \iffalse %<*example> % \fi @@ -509,29 +502,29 @@ Have fun! % \iffalse %</example> % \fi -% In this way you can simply use: +% In this way you can say: % \iffalse %<*example> % \fi \begin{tltxmdfexample} \newmdenv[linecolor=red,frametitle=Infobox]{infobox} - ... + \begin{infobox}[backgroundcolor=yellow] - foo foo foo foo foo foo + Some Infos\ldots \end{infobox} \end{tltxmdfexample} % \iffalse %</example> % \fi -% \ExplCmd{renewmdenv} +% \ExplCmd{renewmdenv[options]\{env-name\}} % By using this command you can redefine environments which are created by % \Cmd{newmdenv}. % -% \ExplCmd{surroundwithmdframed} +% \ExplCmd{surroundwithmdframed[options]\{environment\}} % Sometimes you have predefined environments. This commands allows you to -% set an \Env{environment} surround this predefined environment. To set a -% \Env{mdframed} around the environment \Env{verbatim} you can simple say -% without changing the original name. +% surround an predefined \Env{environment} with \Env{mdframed} without +% changing the original name. To set a \Env{mdframed} around the +% environment \Env{verbatim} you can simple say. % \iffalse %<*example> % \fi @@ -543,9 +536,9 @@ Have fun! % \fi % % -% \ExplCmd{mdflength} +% \ExplCmd{mdflength\{options\}} % If you want to work with length defined by \Pack{mdframed} (for example -% \Opt{innerleftmargin}) you can now simple use the command \Cmd{mdflength}. +% \Opt{innerleftmargin}) you can use the command \Cmd{mdflength}. % \iffalse %<*example> % \fi @@ -562,7 +555,7 @@ Have fun! % \end{center} % % -% \ExplCmd{mdfsetup}To set the options +% \ExplCmd{mdfsetup\{options\}}To set the options % you can use the optional argument of \Cmd{usepackage} or % you can use the command \Cmd{mdfsetup} which is not limited to the preamble. % Inside a group the settings work only local.\par @@ -577,19 +570,32 @@ Have fun! % The sole exception is the option \Opt{framemethod} which must given as an optional % argument of \Cmd{usepackage}. % -% \ExplCmd{mdfdefinestyle} -% \Cmd{mdfdefinestyle} allows the user to define different styles and use -% as an option of \Pack{mdframed} via \Opt{style}. The option \Opt{style} -% is explained in section \ref{genopt}. % +% +% +% \section{Defining your own style} +% In the next section all options are introduced. However instead of +% passing them global or as an optional argument of the environment +% you can define your own styles. The method is as follows +% \ExplCmd{mdfdefinestyle\{style name\}\{options\}} +% \Cmd{mdfdefinestyle} allows the user to define different styles which can +% be used as an option of \Pack{mdframed} via \Opt{style}. +% \ExplCmd{mdfapptodefinestyle\{style name\}\{options\}} +% This commands add options to a defined style.\footnote{Thanks +% to Martin Scharrer and Enrico Gregorio:\newline +% \href{http://tex.stackexchange.com/questions/34684/argument-of-setkeys} +% {http://tex.stackexchange.com/questions/34684/argument-of-setkeys}} +% \ExplOpt{style} +% If you define a special style with \Cmd{mdfdefinestyle} you can use +% the key \Opt{style} to load the style. \Pack{mdframed} has +% no predefined styles yet. +% % Here a small example: % \iffalse %<*example> % \fi \begin{tltxmdfexample}[morekeywords={mystyle}] - \mdfdefinestyle{mystyle}{leftmargin=0pt,% - linecolor=blue} - .... + \mdfdefinestyle{mystyle}{leftmargin=1cm,linecolor=blue} \begin{mdframed}[style=mystyle] foo \end{mdframed} @@ -598,13 +604,6 @@ Have fun! %</example> % \fi % -% \ExplCmd{mdfapptodefinestyle} -% This commands allows to expand a defined style.\footnote{Thanks -% to Martin Scharrer and Enrico Gregorio:\newline -% \href{http://tex.stackexchange.com/questions/34684/argument-of-setkeys} -% {http://tex.stackexchange.com/questions/34684/argument-of-setkeys}} -% -% % % %%%%%%%%%%%%%%%%%%%%%%% % \section{Options} @@ -634,10 +633,9 @@ Have fun! % \end{enumerate} % The option \Opt{framemethod} requires a string. Allowed combinations are % listed in the following table. -% \begin{table}[!ht] -% \centering +% \begin{center} % \renewcommand*\arraystretch{1.3} -% \caption{Allowed keys for \Opt{framemethod}} +% \captionof{table}{Allowed keys for \Opt{framemethod}} % \begin{tabular}{@{}>{\small\bfseries}l>{\small\ttfamily}l@{}} % \toprule % \multicolumn{1}{@{}l}{\textbf{Method}} & \multicolumn{1}{l}{Allowed keys}\\ @@ -647,30 +645,70 @@ Have fun! % \Pack{PSTricks} & pstricks, ps, postscript, 2 \\ % \bottomrule % \end{tabular} -% \end{table} -% +% \end{center} +% +% If you are lazy you can also work with the following short forms: +% \Opt{tikz}, \Opt{TikZ}, \Opt{pstricks}, \Opt{PSTricks} or \Opt{ps}. Of +% course for the default method exists no key. +% % \minisec{FYI} % It is independently whether the \texttt{method} is % written with no, one or more capital letter. % -% \minisec{Note} -% The manipulation of the frames depends on the option \Opt{framemethod}. -% For further information see below. -% -% \subsection{Global and Local Options} -% The options listed below can be set globally or locally and they are not -% limited to the preamble. -% I tried to define self explained names. +% All other options listed below can be set globally or locally and they are not +% limited to the preamble. I was trying to define self explained names. +% +% \subsection{Restoring the settings} +% Sometimes it's useful to remove all done settings. Every default value +% is saved in a style wich can be called by the option \Opt{default} or +% a more suitable +% name \Opt{style=defaultoptions}. Both do the same. +% +% Here a small example: +% \iffalse +%<*example> +% \fi +\begin{tltxmdfexample}[morekeywords={mystyle}] + \mdfsetup{% + middlelinecolor=red, + middlelinewidth=2pt, + backgroundcolor=red!10, + roundcorner=10pt} + \begin{mdframed} + Text\par Text + \end{mdframed} + + \begin{mdframed}[default] + Text\par Text + \end{mdframed} +\end{tltxmdfexample} +% \iffalse +%</example> +% \fi % -% \subsubsection{Options with lengths}\label{optlength} +% \begin{mdframed}[% +% backgroundcolor=yellow!70!brown,linewidth=1.5pt, +% roundcorner=8pt,linecolor=brown!70!black,innerleftmargin=10pt] +% \mdfsetup{default, +% middlelinecolor=red, +% middlelinewidth=2pt, +% backgroundcolor=red!10, +% roundcorner=10pt} +% \begin{mdframed} +% Text\par Text +% \end{mdframed} +% +% \begin{mdframed}[default] +% Text\par Text +% \end{mdframed} +% \end{mdframed} +% +% +% +% \subsection{Options with lengths}\label{optlength} % % In figure \eqref{fig:laengen} you can see the adjustable lengths -% (compare also figure \eqref{fig:basicframes}) which will be described below. -% All lengths accept two kinds of input. The first one is a length (e.g. 2pt) -% and the second one is a number (e.g. 2) which will be multiplied by -% \Opt{1 defaultunit}. The figure shows three different colored frames. -% -% \ExplOpt[pt]{defaultunit} see the sentence above. +% (compare also figure \eqref{fig:basicframes}). % % \begin{center} % \begin{tikzpicture}[scale=0.9] @@ -782,231 +820,253 @@ Have fun! % \label{fig:laengen} % \end{center} % -% \ExplOpt[0\,pt]{skipabove} -% Sets an additional skip above the frame. -% \ExplOpt[0\,pt]{skipbelow} -% Sets an additional skip below the frame. -% \ExplOpt[]{margin} -% This option is not longer supported. Use \Opt{leftmargin} -% and \Opt{rightmargin} instead. -% \ExplOpt[0pt]{leftmargin} -% Sets the length of the left margin of the environment. This option has -% an effect only in singleside-mode or, in twoside-mode, if the option -% \Opt{usetwoside=false} has been given. -% See also options \Opt{outermargin} and \Opt{innermargin}. -% \ExplOpt[0\,pt]{rightmargin} -% Sets the length of the right margin of the environment. This option has -% an effect only in singleside-mode or, in twoside-mode, if the option -% \Opt{usetwoside=false} has been given. -% See also options \Opt{outermargin} and \Opt{innermargin}. -% \ExplOpt[10\,pt]{innerleftmargin} -% Sets the length of the inner left margin of the environment. -% \ExplOpt[10\,pt]{innerrightmargin} -% Sets the length of the inner right margin of the environment. -% \ExplOpt[.4\textbackslash baselineskip]{innertopmargin} -% Sets the length of the inner top margin of the environment. -% \ExplOpt[.4\textbackslash baselineskip]{innerbottommargin} -% Sets the length of the inner bottom margin of the environment. -% -% \paragraph*{The following lengths are not shown in figure -% \eqref{fig:laengen}.} -% -% \mbox{} -% \ExplOpt[\textbackslash linewidth]{userdefinedwidth} -% Sets the width of the whole \Pack{mdframed} environment. -% The width represent the width including the line width and -% the inner margins. The outer margins will be ignored. -% \ExplOpt[0\,pt]{outermargin} -% Sets the length of the outer margin. This option is only available -% in \texttt{twoside}-mode. -% \ExplOpt[0\,pt]{innermargin} -% Sets the length of the inner margin. This option is only available -% in \texttt{twoside}-mode. -% \ExplOpt[0\,pt]{splittopskip} -% Sets the length of the skip above the split part of the environment. -% \ExplOpt[0\,pt]{splitbottomskip} -% Sets the length of the skip below the split part of the environment. -% \ExplOpt[0.4\,pt]{linewidth} -% Sets the width of the line around the environment. -% \limitation[\Opt{default}] -% \ExplOpt[0\,pt]{roundcorner} -% Sets the size of the radius of the corners of the frames. -% \limitation[TikZ or PSTricks] -% \ExplOpt[0\,pt]{innerlinewidth} -% Sets the width of the inner line around the environment. -% \limitation[TikZ or PSTricks] -% \ExplOpt[0\,pt]{outerlinewidth} -% Sets the width of the outer line around the environment. -% \limitation[TikZ or PSTricks] -% \ExplOpt[0.4\,pt]{middlelinewidth} -% Sets the width of the middle line around the environment. -% \limitation[TikZ or PSTricks] +% \ExplOpt[pt]{defaultunit} +% All lengths accept two kinds of input. The first one is a length (e.g. 2pt) +% and the second one is a number (e.g. 2) which will be multiplied by +% \Opt{1 defaultunit}. To get a better overview, all length options with their +% default value are listet in a table. I think the names are self explained +% so that don't describe it anymore. Although special hints and length are +% described below +% % -% \subsubsection{Colored Options} -% \ExplOpt[black]{linecolor} -% Sets the color of the line around the environment. -% \ExplOpt[white]{backgroundcolor} -% Sets the color of the background of the environment. -% \ExplOpt[black]{fontcolor} -% Sets the color of the contents of the environment. -% \ExplOpt[linecolor]{innerlinecolor} -% Sets the color of the inner line around the environment. -% \limitation[TikZ or PSTricks] -% \ExplOpt[linecolor]{middlelinecolor} -% Sets the color of the middle line around the environment. -% \limitation[TikZ or PSTricks] -% \ExplOpt[linecolor]{outerlinecolor} -% Sets the color of the outer line around the environment. -% \limitation[TikZ or PSTricks] +% The first table lists the length for the geometry of the frame. +% \begin{center} +% \def\arraystretch{1.4} +% \begin{tabular}{@{}% +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{\qquad} +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{}} +% \hline +% skipabove & 0pt & skipbelow & 0pt \\ +% leftmargin & 0pt & rightmargin & 0pt \\ +% innerleftmargin & 10pt & innerrightmargin & 10pt \\ +% innertopmargin & 5pt & innerbottommargin & 5pt \\ +% \hline +% \end{tabular} +% \end{center} +% Before the next options are introduced here an example where the described +% length are used. +% \iffalse +%<*example> +% \fi +\begin{tltxmdfexample}[morekeywords={mystyle}] + \mdfdefinestyle{mdfexample1}{leftmargin=1cm,rightmargin=2cm,% + innerleftmargin=1cm,innerrightmargin=1cm,roundcorner=10pt} + \begin{mdframed}[style=mdfexample1] + In any right triangle, the area of the square whose side is the hypotenuse + is equal to the sum of the areas of the squares whose sides are the two + legs. + \end{mdframed} +\end{tltxmdfexample} +% \iffalse +%</example> +% \fi +% \begin{mdframed}[% +% backgroundcolor=yellow!70!brown,linewidth=1.5pt, +% roundcorner=8pt,linecolor=brown!70!black,innerleftmargin=10pt] +% \mdfdefinestyle{mdfexample1}{default,leftmargin=1cm,rightmargin=2cm,% +% innerleftmargin=2cm,innerrightmargin=1cm,roundcorner=10pt} +% \begin{mdframed}[style=mdfexample1] +% In any right triangle, the area of the square whose side is the hypotenuse +% is equal to the sum of the areas of the squares whose sides are the two +% legs. +% \end{mdframed} +% \end{mdframed} +% +% +% The next table lists the options to manipulate the lines of \Env{mdframed}. +% If you are working with \Opt{framemethod=default} you have only one line +% for framing. +% \begin{center} +% \def\arraystretch{1.4} +% \begin{tabular}{@{}% +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{\qquad} +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{\qquad} +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{}} +% \hline +% linewidth & 0.4pt & innerlinewidth & 0pt & +% middlelinewidth & 0.4pt \\ +% outerlinewidth & 0pt & roundcorner & 0pt & +% \multicolumn{2}{c}{} \\ +% \hline +% \end{tabular} +% \end{center} +% If you are working width \Opt{framemethod=tikz} or \Opt{framemethod=pstricks} +% the option \Opt{linewidth} is an alias for the option \Opt{middlelinewidth}. % -% \subsubsection{General options}\label{genopt} % +% \subsection{Colored Options} +% Now we want to bring some color on your frames. The limitation is equal +% the the length options. For \Opt{framemethod=default} you have only one +% line. +% \begin{center} +% \def\arraystretch{1.4} +% \begin{tabular}{@{}% +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{\qquad} +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{}} +% \hline +% linecolor & black & innerlinecolor & black \\ +% middlelinecolor & black & outerlinecolor & black \\ +% backgroundcolor & white & fontcolor & black \\ +% \hline +% \end{tabular} +% \end{center} % -% \ExplOpt[false]{everyline} -% Allows to draw a bottom and a top line at splitted frames. % \ExplOpt[\{\}]{font} -% Sets the font of the environment. -% \ExplOpt[false]{ntheorem} -% Before setting this boolean key, you have to load -% the package \Pack{ntheorem}. With this option you set the -% values \Cmd{theorempreskipamount} and -% \Cmd{theorempostskipamount} to 0\,pt. -% \ExplOpt[false]{nobreak} -% Sometimes it is useful to prevent a frame from splitting. -% The \Opt{nobreak} option is used for this purpose. -% If you activate this option you can enable it by -% setting \Opt{nobreak=false}. -% \ExplOpt[true]{usetwoside} -% If you set the twoside option you can work with \Opt{outermargin}. -% This option disable this and you work with -% \Opt{leftmargin} and \Opt{rightmargin}. -% \ExplOpt[0\,pt]{needspace} -% Sometimes it is useful to set a minimum height before a -% frame should be splitted. For such cases you can use \Opt{needspace}. -% The option requires a length which sets the minimum height before -% a frame will be splitted. -% \ExplOpt{style} -% If you define a special style with \Cmd{mdfdefinestyle} you can use -% the key \Opt{style} to load the style. \Pack{mdframed} has -% no predefined styles yet. -% \ExplOpt[none]{settings} -% This option allows the user to commit some macros. An example is shown -% in the example files. -% \ExplOpt[left]{align} -% Sometimes it is useful to align the environment itself. -% For this you have the option \Opt{align} which can be set to the -% following strings: -% \begin{itemize} -% \item \Opt{left}, -% \item \Opt{right} and -% \item \Opt{center}. -% \end{itemize} -% The alignments \Opt{left} or \Opt{right} depend on the given lengths -% \Opt{leftmargin} and \Opt{rightmargin}. Later I will present an example -% to demonstrate my bad English explanation. -% -% \ExplOpt[false]{ignorelastdescenders} -% Try to ignore the last descenders of the environment \Env{mdframed}. The -% complete idea was inspired by Tobias Weh and the solution was provided -% by Stefan Lemke. See -% \href{http://tex.stackexchange.com/questions/47584/how-to-make-^^A -% mdframed-ignore-descenders-in-last-line}^^A -% {How to make mdframed ignore descenders in last line} +% Although it's no really a color options you can also specify the font +% of the contents. Therefor the option \Opt{font} can be used. % +% Ok after we have some lengths and some colors we can improve our example. +% \iffalse +%<*example> +% \fi +\begin{tltxmdfexample}[morekeywords={example1}] + \mdfapptodefinestyle{example1}{backgroundcolor=brown!20,% + linecolor=red!40!black,linewidth=4pt} + \begin{mdframed}[style=mdfexample1] + In any right triangle, the area of the square whose side is the hypotenuse + is equal to the sum of the areas of the squares whose sides are the two + legs. + \end{mdframed} +\end{tltxmdfexample} +% \iffalse +%</example> +% \fi +% \begin{mdframed}[% +% backgroundcolor=yellow!70!brown,linewidth=1.5pt, +% roundcorner=8pt,linecolor=brown!70!black,innerleftmargin=10pt] +% \mdfdefinestyle{mdfexample1}{default,leftmargin=1cm,rightmargin=2cm,% +% innerleftmargin=2cm,innerrightmargin=1cm,roundcorner=10pt,% +% backgroundcolor=brown!20,linecolor=red!40!black, linewidth=4pt} +% \begin{mdframed}[style=mdfexample1] +% In any right triangle, the area of the square whose side is the hypotenuse +% is equal to the sum of the areas of the squares whose sides are the two +% legs. +% \end{mdframed} +% \end{mdframed} +% +% +% +% \subsection{Shadows}\label{sec:shadow} +% Another possibility to highlight a frame can be a shadow. The package +% \Pack{mdframed} supports some elementary options to add a shadow. For +% \Opt{framemethod=tikz} the library \Pack{shadows} is needed which must be +% loaded by the user by \verb+\usetikzlibrary{shadows}+. +% \ExplOpt[8\,pt]{shadowsize} +% \ExplOpt[black!50]{shadowcolor} +% If a shadow is used depends on the option \Opt{shadow} which can be either +% \texttt{true} or \texttt{false}. The option shadows enables two new options +% \Opt{shadowsize} and \Opt{shadowcolor}. +% \iffalse +%<*example> +% \fi +\begin{tltxmdfexample}[morekeywords={example1}] + \begin{mdframed}[backgroundcolor=gray!40,shadow=true,roundcorner=8pt] + In any right triangle, the area of the square whose side is the hypotenuse + is equal to the sum of the areas of the squares whose sides are the two + legs. + \end{mdframed} +\end{tltxmdfexample} +% \iffalse +%</example> +% \fi +% \begin{mdframed}[backgroundcolor=gray!40!white,shadow=true,roundcorner=8pt] +% In any right triangle, the area of the square whose side is the hypotenuse +% is equal to the sum of the areas of the squares whose sides are the two +% legs. +% \end{mdframed} % % -% \ExplOpt[false]{draft} -% Activate the draft mode for the package. This option is useful for -% \Opt{framemethod=tikz} which clips the contents related to the surrounded -% frame. The options is motivated by the question -% \href{http://tex.stackexchange.com/questions/73059/^^A -% mdframedtikz-to-display-overfullrule}^^A -% {mdframed+tikz to display overfullrule} -% at \href{http://tex.stackexchange.com/}{tex.stackexchange}. +% \subsection{Hidden Lines} +% The default behaoiur of the output was shown in a previous picture. +% \Pack{mdframed} offers the possibility to print only requested lines. If +% you don't want any right line you can say \Opt{rightline=false}. The +% table below listed all keys to this topic and shows their default setting. +% \begin{center} +% \def\arraystretch{1.4} +% \begin{tabular}{@{}% +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{\qquad} +% >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l% +% @{}} +% \hline +% topline & true & rightline & true \\ +% leftline & true & bottomline & true \\ +% \hline +% \end{tabular} +% \end{center} +% \ExplOpt[false]{hidealllines} +% If you want to disable all lines you can use the short from +% \Opt{hidealllines}. % % -% \ExplOpt[false]{shadow} -% Draw a shadow. The shadow doesn't influence the bounding box so the -% shadow can be drawn in the margin without any overfull box. -% Note if you are using the TikZ you must load the library. -% \Pack{mdframed} doesn't do the job to avoid double loading of a library. +% \subsection{Working in twoside-mode} +% +% Many books are written in \texttt{twoside} mode. In those cases it's +% better to set the margins related to the site. Instead of the +% explained options \Opt{leftmargin} and \Opt{rightmargin} you can work with the +% options \Opt{outermargin} and \Opt{innermargin}. Of course if you working +% in \texttt{oneside} mode the options have no effect. If you don't want to +% work with \Opt{outermargin} and \Opt{innermargin} whether the document is +% done in \texttt{twoside} mode you can disable the behaviour by the option +% \Opt{usetwoside}. Allowed values for this key are \texttt{true} or +% \texttt{false}. +% % -% \ExplOpt[8\,pt]{shadowsize} -% Specify the size of the shadow. -% \ExplOpt[black!50]{shadowcolor} -% Specify the color of the shadow. -% +% \subsection{Footnotes} +% Inside the environment you can use the command \Cmd{footnote} as usual. +% \Pack{mdframed} uses the syntax of environment \Pack{minipage} with +% the same counter. % -% \ExplOpt[\{\}]{pstrickssetting} -% With this key you can pass several options to \Cmd{psset}. -% For example if you want all lines dashed you will have to set -% \Opt{pstrickssetting=\{linestyle=dashed\}}. It is very important -% to put the options of \Opt{pstrickssetting} in brackets. -% \limitation[PSTricks] -% \ExplOpt[\{\}]{pstricksappsetting} -% \Pack{mdframed} works with defined style for the different elements. By -% using \Cmd{addtopsstyle} in combination with this option -% you can expand the definition. The predefined styles are -% \begin{itemize} -% \item \Opt{mdfbackgroundstyle} -% \item \Opt{mdfframetitlebackgroundstyle} -% \item \Opt{mdfouterlinestyle} -% \item \Opt{mdfinnerlinestyle} -% \item \Opt{mdfmiddlelinestyle} -% \end{itemize} -% \textbf{Before you change one please have a look at the file -% \texttt{md-frame-2.mdf} to see the settings.} -% \limitation[PSTricks] -% \ExplOpt[\{\}]{tikzsetting} -% With this key you can pass several options to \Cmd{tikzset}. -% Some examples are listed in the next section. It is very important -% to put the options of \Opt{tikzsetting} in brackets. -% \limitation -% \ExplOpt[\{\}]{apptotikzsetting} -% With this key you can add several options to \Opt{tikzsetting}. -% This key based on the idea of manipulation of predefined keys -% of \Pack{mdframed}. The package \Pack{mdframed} defines via -% \Cmd{tikzset} the following keys to draw frames. -% \begin{itemize} -% \item \Cmd{tikzset\{mdfbox/.style\}} -% \item \Cmd{tikzset\{mdfcorners/.style\}} -% \item \Cmd{tikzset\{mdfbackground/.style\}} -% \item \Cmd{tikzset\{mdfinnerline/.style\}} -% \item \Cmd{tikzset\{mdfouterline/.style\}} -% \item \Cmd{tikzset\{mdfmiddleline/.style\}} -% \item \Cmd{tikzset\{mdfframetitlerule/.style\}} -% \item \Cmd{tikzset\{mdfframetitlebackground/.style\}} -% \item \Cmd{tikzset\{mdfshadow/.style\}} -% \end{itemize} -% \textbf{Before you change one please have a look at the -% file \texttt{md-frame-1.mdf} to see the settings.} -% \limitation -% \ExplOpt[\{\}]{singleextra} -% With this key you can put extra material to the drawing environment of -% \Pack{mdframed} only for a non splitted frame. -% \limitation[TikZ and PSTricks] -% \ExplOpt[\{\}]{firstextra} -% With this key you can put extra material to the drawing environment of -% \Pack{mdframed} only for the first part of the splitted frame. -% \limitation[TikZ and PSTricks] -% \ExplOpt[\{\}]{middleextra} -% With this key you can put extra material to the drawing environment of -% \Pack{mdframed} only for the middle part of the splitted frame. -% \limitation[TikZ and PSTricks] -% \ExplOpt[\{\}]{secondextra} -% With this key you can put extra material to the drawing environment of -% \Pack{mdframed} only for the second part of the splitted frame. -% \limitation[TikZ and PSTricks] +% Every footnote text will be collected inside a box and will be displayed +% at the end of the environment \Pack{mdframed}. +% +% \ExplOpt[\mbox{} \Cmd{bigskipamount}]{footnotedistance} +% The length is the distance between the end of the environment +% \Pack{mdframed} and the displaying of the \Cmd{footnoterule}. +% \ExplOpt[true]{footnoteinside} +% The position of the footnotes can be changed with the option +% \Opt{footnoteinside}. The footnotes will be displayed at the end +% of the environment but you can decide whether the output is inside +% \Pack{mdframed} or after. +% +% \minisec{Note} +% The output of the footnotes with the option \Opt{footnoteinside=false} +% are not in a splitted frame. I think it isn't useful because the first line +% of a new page shouldn't be a footnote. +% +% +% % +%\subsection{Page breaks} +% The package \Pack{mdframed} splits its content if neccessary. In figure +% \ref{fig:basicframes} the default style for splitting is presented. However +% there a sevaral situations where no page preak should occur. +% \ExplOpt[false]{nobreak} +% For this case you can use the option \Opt{nobreak} which is either +% \texttt{true} or \texttt{false}. As you can see in figure +% \ref{fig:basicframes} the different elements have different ways of drawing. +% E.g. the middle part of \Pack{mdframed} has only a left and a right line. % -% \subsection{Hidden Lines} -% \ExplOpt[true]{topline} Draws a line at the top. -% \ExplOpt[true]{bottomline} Draws a line at the bottom. -% \ExplOpt[true]{leftline} Draws a line on the left. -% \ExplOpt[true]{rightline} Draws a line on the right. -% \ExplOpt[false]{hidealllines} -% With this option you can decide whether all lines should be drawn or -% not. +% \ExplOpt[false]{everyline} +% If you want that all parts of \Pack{mdframed} get a whole frame you can work +% with the option \Opt{everyline}. Then all parts are displayed as a single +% frame. +% +% In a previous section the options \Opt{innertopmargin} and +% \Opt{innerbottommaring} were introduced. However if a page break occurs +% you have two new length options which influence the space at the breaking +% point. +% \ExplOpt[0\,pt]{splittopskip} +% Sets the length of the skip above the split part of the environment. +% \ExplOpt[0\,pt]{splitbottomskip} +% Sets the length of the skip below the split part of the environment. % % \subsection{Frametitle} % In this section all relevant options of the frame title will be presented. @@ -1035,11 +1095,6 @@ Have fun! % \ExplOpt[false]{repeatframetitle} % Repeat the frame title on every frame. % -% \minisec{FYI and Note} -% The splitting of the frame title is really a fiddly issue. If you want to use -% the option \Opt{repeatframetitle} a splitting is more than wrong. On the -% other hand if you use the option \Opt{repeatframetitle} the user must prepare -% the contents well. % % The following picture demonstrates the behaviour of the lengths if the option % \Opt{frametitle} is used. @@ -1088,22 +1143,27 @@ Have fun! % \end{center} % % +% \minisec{FYI and Note} +% The splitting of the frame title is really a fiddly issue. If you want to use +% the option \Opt{repeatframetitle} a splitting is more than wrong. On the +% other hand if you use the option \Opt{repeatframetitle} the user must prepare +% the contents well. +% % \subsection{Title commands inside the environment} % -% To provide titles inside the environment \Pack{mdframed} you can one of the -% two following commands. The relavant options are listed below. +% To provide titles inside the environment \Pack{mdframed} you can use +% \Cmd{mdfsubtitle}. The relavant options are listed below. % % \ExplCmd{mdfsubtitle} % Set a title inside \Pack{mdframed} of the internal level 1. % -% \ExplCmd{mdfsubsubtitle} -% Set a title inside \Pack{mdframed} of the internal level 2. -% -% Both commands have the same syntax. They accept one optional and one +% The command accepts one optional and one % mandatory argument. The optional argument sets the option of \Pack{mdframed} % whereby everything will be local. The second argument of subtitle also allows % paragraph breaking. % +% Breaks inside the \Cmd{mdfsubtitle} are not supported. +% % \iffalse %<*example> % \fi @@ -1142,39 +1202,204 @@ Have fun! % \ExplOpt[0.5\string\baselineskip]{subtitleinnerbelowskip} % Sets the skip after the subtitle and the line below. % +% Here an example to demonstrate the behaviour: % +%\newmdenv[% +% roundcorner=5pt,nobreak=true, +% subtitlebelowline=true,subtitleaboveline=true, +% subtitlebackgroundcolor=yellow!70!white, +% backgroundcolor=blue!20!white, +% frametitle={Theorem},frametitlerule=true, +% frametitlebackgroundcolor=yellow!70!white, +% ]{subtitleenv} % -% \subsubsection{Options related to the title of level 2} +% \begin{subtitleenv} +% Some Text \ldots +% \mdfsubtitle{Notes} +% Some Text \ldots +% \end{subtitleenv} % -% \ExplOpt[false]{subsubtitleaboveline} -% Decide to draw a line above the subsubtile. -% \ExplOpt[false]{subtitlebelowline} -% Decide to draw a line below the subsubtitle. -% \ExplOpt[\string\normalfont]{subsubtitlefont} -% Sets the font for subsubtitles. -% \ExplOpt[white]{subsubtitlebackgroundcolor} -% Sets the background color of the subsubtitle between the above and below -% line. -% \ExplOpt[black]{subsubtitleabovelinecolor} -% Sets the line color of the line above. -% \ExplOpt[black]{subsubtitlebelowlinecolor} -% Sets the line color of the line below. -% \ExplOpt[0.8\,pt]{subsubtitleabovelinewidth} -% Sets the line width of the line above. -% \ExplOpt[0.6\,pt]{subsubtitlebelowlinewidth} -% Sets the line width of the line below. -% \ExplOpt[\string\baselineskip]{subsubtitleaboveskip} -% Sets the skip before the subsubtitle line above will be drawn. -% \ExplOpt[1.2\string\baselineskip]{subsubtitlebelowskip} -% Sets the skip after the subsubtitle line below is drawn. -% \ExplOpt[0.5\string\baselineskip]{subsubtitleinneraboveskip} -% Sets the skip after the line above and the subsubtitle itself. -% \ExplOpt[0.5\string\baselineskip]{subsubtitleinnerbelowskip} -% Sets the skip after the subsubtitle and the line below. +% \iffalse +%<*example> +% \fi +\begin{tltxmdfexample} +\newmdenv[% + roundcorner=5pt, + subtitlebelowline=true,subtitleaboveline=true, + subtitlebackgroundcolor=yellow!70!white, + backgroundcolor=blue!20!white, + frametitle={Theorem},frametitlerule=true, + frametitlebackgroundcolor=yellow!70!white, + ]{subtitleenv} +\begin{subtitleenv} + Some Text \ldots + \mdfsubtitle{Notes} + Some Text \ldots +\end{subtitleenv} +\end{tltxmdfexample} +% \iffalse +%</example> +% \fi % % +% +% \subsection{General options}\label{genopt} +% Some options can't be classified. Such options are listed in this section. +% \ExplOpt[false]{ntheorem} +% Before setting this boolean key, you have to load +% the package \Pack{ntheorem}. With this option you set the +% values \Cmd{theorempreskipamount} and +% \Cmd{theorempostskipamount} to 0\,pt to avoid extra vertical skip. +% \ExplOpt[0\,pt]{needspace} +% Sometimes it is useful to set a minimum height before a +% frame should be splitted. For such cases you can use \Opt{needspace}. +% The option requires a length which sets the minimum height before +% a frame will be splitted. +% \ExplOpt[false]{ignorelastdescenders} +% Try to ignore the last descenders of the environment \Env{mdframed}. The +% complete idea was inspired by Tobias Weh and the solution was provided +% by Stefan Lemke. See +% \href{http://tex.stackexchange.com/questions/47584/how-to-make-^^A +% mdframed-ignore-descenders-in-last-line}^^A +% {How to make mdframed ignore descenders in last line} +% Of course you have some more length which can be manipulate. +% \ExplOpt[\textbackslash linewidth]{userdefinedwidth} +% Sets the width of the whole \Pack{mdframed} environment. +% The width represent the width including the line width and +% the inner margins. The outer margins will be ignored. % -% \subsection{Theorems} +% \ExplOpt[left]{align} +% Sometimes it is useful to align the environment itself. +% For this you have the option \Opt{align} which can be set to the +% following strings: +% \begin{itemize} +% \item \Opt{left}, +% \item \Opt{right} and +% \item \Opt{center}. +% \end{itemize} +% The alignments \Opt{left} or \Opt{right} depend on the given lengths +% \Opt{leftmargin} and \Opt{rightmargin}. Later I will present an example +% to demonstrate my bad English explanation. +% +% Be aware of using this option please. +% +% +% \subsection{TikZ options}\label{tikzopt} +% \mbox{} +% \ExplOpt[\{\}]{tikzsetting} +% With this key you can pass several options to \Cmd{tikzset}. +% Some examples are listed in the next section. It is very important +% to put the options of \Opt{tikzsetting} in brackets. +% \ExplOpt[\{\}]{apptotikzsetting} +% With this key you can add several options to \Opt{tikzsetting}. +% This key based on the idea of manipulation of predefined keys +% of \Pack{mdframed}. The package \Pack{mdframed} defines via +% \Cmd{tikzset} the following keys to draw frames. +% \begin{itemize} +% \item \Cmd{tikzset\{mdfbox/.style\}} +% \item \Cmd{tikzset\{mdfcorners/.style\}} +% \item \Cmd{tikzset\{mdfbackground/.style\}} +% \item \Cmd{tikzset\{mdfinnerline/.style\}} +% \item \Cmd{tikzset\{mdfouterline/.style\}} +% \item \Cmd{tikzset\{mdfmiddleline/.style\}} +% \item \Cmd{tikzset\{mdfframetitlerule/.style\}} +% \item \Cmd{tikzset\{mdfframetitlebackground/.style\}} +% \item \Cmd{tikzset\{mdfshadow/.style\}} +% \end{itemize} +% \textbf{Before you change one please have a look at the +% file \texttt{md-frame-1.mdf} to see the settings.} +% +% +% \subsection{PSTricks options}\label{pstricksopt} +% \mbox{} +% \ExplOpt[\{\}]{pstrickssetting} +% With this key you can pass several options to \Cmd{psset}. +% For example if you want all lines dashed you will have to set +% \Opt{pstrickssetting=\{linestyle=dashed\}}. It is very important +% to put the options of \Opt{pstrickssetting} in brackets. +% \ExplOpt[\{\}]{pstricksappsetting} +% \Pack{mdframed} works with defined styles for the different elements. By +% using \Cmd{addtopsstyle} in combination with this option +% you can expand the definition. The predefined styles are +% \begin{itemize} +% \item \Opt{mdfbackgroundstyle} +% \item \Opt{mdfframetitlebackgroundstyle} +% \item \Opt{mdfouterlinestyle} +% \item \Opt{mdfinnerlinestyle} +% \item \Opt{mdfmiddlelinestyle} +% \end{itemize} +% \textbf{Before you change one please have a look at the file +% \texttt{md-frame-2.mdf} to see the settings.} +% +% +% \section{Hooks and Bools}\label{hooksandbools} +% The following options and bool flags can be used by the any user. Of course +% some needs more experience than other. + +% \ExplOpt[\{\}]{settings} +% This option allows the user to commit some macros at the beginning of +% \Pack{mdframed}. The given material is executed before the savebox starts. +% +% \ExplOpt[\{\}]{extra} +% Add material to every drawn frame. +% \ExplOpt[\{\}]{singleextra} +% With this key you can put extra material to the drawing environment of +% \Pack{mdframed} only for a non splitted frame. +% \ExplOpt[\{\}]{firstextra} +% With this key you can put extra material to the drawing environment of +% \Pack{mdframed} only for the first part of the splitted frame. +% \ExplOpt[\{\}]{middleextra} +% With this key you can put extra material to the drawing environment of +% \Pack{mdframed} only for the middle part of the splitted frame. +% \limitation[TikZ and PSTricks] +% \ExplOpt[\{\}]{secondextra} +% With this key you can put extra material to the drawing environment of +% \Pack{mdframed} only for the second part of the splitted frame. +% +% +% After you can add material to any part of the frame you can also detect which +% part of the frame is drawn. Therefor the bool flags are defined which can be +% test by \Cmd{ifbool\{boolflag\}}. All flags are set to true before the output +% of the content occurs. +% \ExplOpt[false]{mdfsingleframe} +% This bool is only true for a non splitting frame. +% \ExplOpt[false]{mdffirstframe} +% This bool is only for the first part of the frame true. +% \ExplOpt[false]{mdfmiddleframe} +% see above. +% \ExplOpt[false]{mdflastframe} +% see above. +% +% For the advanced users there are also some other hooks which can be used +% to manipulate the output: +% \ExplOpt[\{\}]{beforesingleframe} +% Every given code to this option is executed before a single frame is +% is printed. +% \ExplOpt[\{\}]{aftersingleframe} +% Every given code to this option is executed after a single frame is +% is printed. +% \ExplOpt[\{\}]{beforebreak} +% The value of this option is only executed at breakable frames. Related to +% the introduction the first and middle frame can be manipulated. +% \ExplOpt[\{\}]{afterbreak} +% The value of this option is only executed at breakable frames. Related to +% the introduction the first and middle frame can be manipulated. +% \ExplOpt[\{\}]{beforelastframe} +% The option is executed only for the last frame of a splitted frame. +% \ExplOpt[\{\}]{afterlastframe} +% The option is executed only for the last frame of a splitted frame. +% +% \ExplOpt[\{\}]{startcode} +% Every code given to this option is executed at the beginning of the +% environment. +% \ExplOpt[\{\}]{startinnercode} +% This option is executed at the beginning of the save box. +% \ExplOpt[\{\}]{endinnercode} +% This option is executed at the end of the save box. +% \ExplOpt[\{\}]{endcode} +% The code is executed at the end of the environment. +% +% \section{Theorems} % In this section is described which commands can help you to define % theorem environments with \Pack{mdframed}. % @@ -1265,32 +1490,107 @@ Have fun! % Sets the space after \Opt{theoremseparator}. % % Examples can be found in the attached files. -% -% \subsection{Footnotes} -% Inside the environment you can use the command \Cmd{footnote} as usual. -% \Pack{mdframed} uses the syntax of environment \Pack{minipage} with -% the same counter. +% +% +% +% +% \section{complexe example -- Matlab Terminal} +% The following example was inspiered by a question on TeX.SX. +% \definecolor{DarkBlue}{rgb}{.11,.23,.60} +% \mdfdefinestyle{commandline}% +% {leftmargin=5pt, rightmargin=10pt,innerleftmargin=15pt, +% middlelinecolor=DarkBlue, +% middlelinewidth=2pt, +% frametitlerule=false, +% backgroundcolor=black!10!white, +% frametitle={Command Window}, +% frametitlefont={\normalfont\sffamily\color{white}\hspace{-1em}}, +% frametitlebackgroundcolor=DarkBlue, +% singleextra={\draw[black!20,line width=12pt] +% ($(O)+(7pt,1pt)$) -- +% ($(O|-P)+(7pt,-\mdfframetitleboxtotalheight)-(0,1pt)$); +% \node[inner sep=0pt,color=black]at ($(O)+(7pt,9pt)$)% +% {$\scriptstyle f\!x$}; }, +% nobreak=true, +% } % -% Every footnote text will be collected inside a box and will be displayed -% at the end of the environment \Pack{mdframed}. +% \lstnewenvironment{script} {% +% \lstset{language=Matlab,basicstyle=\tiny\ttfamily,breaklines=true,% +% aboveskip=0pt,belowskip=0pt}}{} +% \surroundwithmdframed[style=commandline]{script} +% \begin{script} +% >> help sin +% sin Sine of argument in radians. +% sin(X) is the sine of the elements of X. +% +% See also asin, sind. +% +% Overloaded methods: +% sdpvar/sin +% codistributed/sin +% gpuArray/sin +% +% Reference page in Help browser +% doc sin +% +% >> +% \end{script} +% +% The code for this result is: +% \iffalse +%<*example> +% \fi +\begin{tltxmdfexample}[moretexcs={lstnewenvironment,definecolor,lstset}] + \definecolor{DarkBlue}{rgb}{.11,.23,.60} + \mdfdefinestyle{commandline}% + {leftmargin=5pt, rightmargin=10pt,innerleftmargin=15pt, + middlelinecolor=DarkBlue, + middlelinewidth=2pt, + frametitlerule=false, + backgroundcolor=black!10!white, + frametitle={Command Window}, + frametitlefont={\normalfont\sffamily\color{white}\hspace{-1em}}, + frametitlebackgroundcolor=DarkBlue, + singleextra={\draw[black!20,line width=12pt] + ($(O)+(7pt,1pt)$) -- + ($(O|-P)+(7pt,-\mdfframetitleboxtotalheight)-(0,1pt)$); + \node[inner sep=0pt,color=black]at ($(O)+(7pt,9pt)$)% + {$\scriptstyle f\!x$}; }, + nobreak, + } + + \lstnewenvironment{script} {% + \lstset{language=Matlab,basicstyle=\tiny\ttfamily,breaklines=true,% + aboveskip=0pt,belowskip=0pt}}{} + \surroundwithmdframed[style=commandline]{script} + \begin{script} + >> help sin + sin Sine of argument in radians. + sin(X) is the sine of the elements of X. + + See also asin, sind. + + Overloaded methods: + sdpvar/sin + codistributed/sin + gpuArray/sin + + Reference page in Help browser + doc sin + + >> + \end{script} +\end{tltxmdfexample} +% \iffalse +%</example> +% \fi +% % -% \ExplOpt[\mbox{} \Cmd{bigskipamount}]{footnotedistance} -% The length is the distance between the end of the environment -% \Pack{mdframed} and the displaying of the \Cmd{footnoterule}. -% \ExplOpt[true]{footnoteinside} -% The position of the footnotes can be changed with the option -% \Opt{footnoteinside}. The footnotes will be displayed at the end -% of the environment but you can decide whether the output is inside -% \Pack{mdframed} or after. % -% \minisec{Note} -% The output of the footnotes with the option \Opt{footnoteinside=false} -% are not in a splitted frame. I think it isn't useful because the first line -% of a new page shouldn't be a footnote. % % \section{Examples} % -% I outsource the examples in four files to limit the documentation. The files +% I outsource the examples in four files documentation. The files % are % \begin{description}[style=nextline] % \item[\texttt{mdframed-example-default}] @@ -1312,6 +1612,16 @@ Have fun! % \href{http://prezi.com/zc355i9tcsgz/talk-kts-2012-mdframed/}^^A % {kts 2012 mdframed}. % +% +% \IfFileExists{mdframed-example-default.pdf}% +% {\includepdf[pages=-]{mdframed-example-default.pdf}}{} +% \IfFileExists{mdframed-example-tikz.pdf}% +% {\includepdf[pages=-]{mdframed-example-tikz.pdf}}{} +% \IfFileExists{mdframed-example-texsx.pdf}% +% {\includepdf[pages=-]{mdframed-example-texsx.pdf}}{} +% \IfFileExists{mdframed-example-pstricks.pdf}% +% {\includepdf[pages=-]{mdframed-example-pstricks.pdf}}{} +% % \section{Errors, Warnings and Messages} % % The package \Pack{mdframed} provides different errors, warnings and @@ -1449,8 +1759,8 @@ Have fun! % If you set a global option inside the document % body you will get this warning. % -% \section{Known Problems} -% In this section I will collect known problems. In case you encounter +% \section{Known Limitations} +% In this section I will collect known issues. In case you encounter % any further problems, please drop me an email, % \href{mailto:marco.daniel@mada-nada.de}{marco.daniel at mada-nada.de}. % @@ -1687,12 +1997,19 @@ Have fun! % In this way you can use the option \Opt{framemethod} to % load the file by setting \Opt{framemethod=X}. % +%\iffalse % \clearpage % % \subsection{Revision history}\label{rev} % \raggedright % % +% \minisec{Version 1.8X submitted XX Mar 2013} +% \begin{itemize*} +% \item added \Cmd{topskip=0pt} to remove unwanted space after \Cmd{newpage} or \Cmd{clearpage} +% \end{itemize*} +% +% \footnotesize % \minisec{Version 1.8 submitted 09 Mar 2013} % \begin{itemize*} % \item fixed bugs (e.g. related to \Cmd{parskip} of KOMA) @@ -1700,8 +2017,6 @@ Have fun! % \item fixed some typos % \end{itemize*} % -% -% \footnotesize % \minisec{Version 1.6d submitted 21 Sep 2012} % \begin{itemize*} % \item fixed bugs @@ -1916,16 +2231,22 @@ Have fun! % % \clearpage % +% +% +% +% % \section{Implementation}\label{implementation} % % And finally, here's how it all works\ldots % +%\fi %\StopEventually{^^A -% %%\clearpage -% %%\PrintChanges^^A -% \clearpage -% \PrintIndex^^A +% ^^A\clearpage +% ^^A\PrintChanges^^A +% ^^A\clearpage +% ^^A\PrintIndex^^A %} +% %\iffalse % \begin{macrocode} %<*package> @@ -1937,18 +2258,17 @@ Have fun! % \begin{macro}{mdversion,mdframedpackagename,mdfmaindate} % Set package information % \begin{macrocode} -\def\mdversion{1.8} +\def\mdversion{1.9a} \def\mdframedpackagename{mdframed} -\def\mdfmaindate{2013/03/09} -\def\mdfrevision{ 172}% Done by github: git rev-list HEAD | wc -l +\def\mdfmaindate{2013/06/21} +\def\mdfrevision{ 208}% Done by github: git rev-list HEAD | wc -l % \end{macrocode} % \end{macro} % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mdframed}% - [\mdfmaindate\ % - \mdversion: \mdframedpackagename] + [\mdfmaindate\space \mdversion: \mdframedpackagename] % \end{macrocode} % % \begin{macro}{mdf@PackageWarning,mdf@PackageInfo,mdf@LoadFile@IfExist} @@ -1966,7 +2286,7 @@ Have fun! but needed by \mdframedpackagename\MessageBreak see documentation fo further information }% - } + }% } % \end{macrocode} % \end{macro} @@ -1984,7 +2304,16 @@ Have fun! % \begin{macrocode} \SetupKeyvalOptions{family=mdf,prefix=mdf@} % \end{macrocode} - +% +% \begin{macro}{mdf@definestyle@defaultoptions} +% Save all keys in a macro which can be used by \Opt{style} or +% as an option +% \begin{macrocode} +\def\mdf@definestyle@defaultoptions{}% +% \end{macrocode} +% \end{macro} +% +% % \begin{macro}{mdf@iflength,mdf@iflength@check,mdf@iflength@check} % Command which checks the input of length options. If the length option is % only a number the |defaultunit| will be used. Syntax: @@ -2011,24 +2340,32 @@ Have fun! % % % \begin{macro}{mdf@dolist} -% Loop used by \Pack{mdframed}. +% Loop used by \Pack{mdframed}. I can handle comma separated list. The command +% \Cmd{DeclareListParser} is provided by `etoolbox`. % \begin{macrocode} \DeclareListParser*{\mdf@dolist}{,} % \end{macrocode} % \end{macro} % -% \begin{macro}{mdf@option@length,mdf@define@key@length} -% Command to define a new length width a default value. -%| \mdf@option@length{<name of length>}{<Defaultwert>}| +% \begin{macro}{mdf@do@lengthoption} +% We need lots of length options. So the declaration is simplified. % \begin{macrocode} +% \mdf@dolist{\mdf@do@lengthoption}{{option name ==default value},...}% +% resulst to the length \mdf@<option name>@length +\def\mdf@do@lengthoption#1{% + \mdf@lengthoption@doubledo#1\@nil% +} +\def\mdf@lengthoption@doubledo#1==#2\@nil{% + \mdf@option@length{#1}{#2}% + \mdf@define@key@length{#1}% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% +} + \newrobustcmd*{\mdf@option@length}[2]{% \expandafter\newlength\csname mdf@#1@length\endcsname% \expandafter\setlength\csname mdf@#1@length\endcsname{#2}% } -% \end{macrocode} -% Command to create a new length option. -% |\mdf@define@key@length{<name of length option>}| -% \begin{macrocode} + \newrobustcmd*{\mdf@define@key@length}[1]{% \define@key{mdf}{#1}{% \def\@tempa{##1} @@ -2038,29 +2375,18 @@ Have fun! \setlength{\csname mdf@#1@length\endcsname}{\csname mdfl@#1\endcsname}% }% } + + % \end{macrocode} % \end{macro} % % -% \begin{macro}{mdf@do@lengthoption,mdf@lengthoption@doubledo} -% The loop of |\mdf@dolist| expected one argument. So I have to define a -% command to allow a loop with two arguments. The separation for the input is -% |==|. -% \begin{macrocode} -\def\mdf@do@lengthoption#1{% - \mdf@lengthoption@doubledo#1\@nil% -} -\def\mdf@lengthoption@doubledo#1==#2\@nil{% - \mdf@option@length{#1}{#2}% - \mdf@define@key@length{#1}% -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{mdf@do@stringoption,mdf@stringoption@doubledo} -% Same as |\mdf@do@lengthoption| and |\mdf@lengthoption@doubledo|. +% \begin{macro}{mdf@do@stringoption} +% We need lots of string options which are saved in a macro.% +% So the declaration is simplified. % \begin{macrocode} +% \mdf@dolist{\mdf@do@stringoption}{{option name ==default value},...}% +% resulst to the macro \mdf@<option name> \def\mdf@do@stringoption#1{% \mdf@stringoption@doubledo#1\@nil% } @@ -2069,14 +2395,17 @@ Have fun! \define@key{mdf}{#1}{% \csdef{mdf@#1}{##1}% }% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% } % \end{macrocode} % \end{macro} % % -% \begin{macro}{mdf@do@booloption,mdf@booloption@doubledo} -% Same as |\mdf@do@lengthoption| and |\mdf@lengthoption@doubledo|. +% \begin{macro}{mdf@do@booloption} +% We need lots of bool options. So the declaration is simplified. % \begin{macrocode} +% \mdf@dolist{\mdf@do@booloption}{{option name ==default value},...}% +% resulst to the bool flag \mdf@<option name> \def\mdf@do@booloption#1{% \mdf@booloption@doubledo#1\@nil% } @@ -2085,53 +2414,24 @@ Have fun! \define@key{mdf}{#1}[#2]{% \setbool{mdf@#1}{##1}% }% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% } % \end{macrocode} % \end{macro} % % -% \begin{macro}{mdf@do@alignoption,mdf@alignoption@tripledo} -% Same as |\mdf@do@lengthoption| and |\mdf@lengthoption@doubledo|. Here -% three arguments are required. -% \begin{macrocode} -\def\mdf@do@alignoption#1{% - \mdf@alignoption@tripledo#1\@nil% -} -\def\mdf@alignoption@tripledo#1==#2==#3\@nil{% - \csdef{mdf@align@#1@left}{\null\hspace*{#2}}% - \csdef{mdf@align@#1@right}{\hspace*{#3}\null}% -} -% \end{macrocode} -% \end{macro} -% % Start declaration of options % \begin{macrocode} \newcounter{mdf@globalstyle@cnt} -\defcounter{mdf@globalstyle@cnt}{0} -\newcommand*\mdfglobal@style{0} -% \end{macrocode} +\defcounter{mdf@globalstyle@cnt}{-99} + % Only provide to be backward compatible -% \begin{macrocode} \define@key{mdf}{style}{% \mdf@PackageWarning{package option style is depreciated^^J + at this point and will be ignored^^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% } -% \end{macrocode} -% -% \begin{macro}{mdf@framemethod} -% Definining the global option \Opt{framemethod}. -% \begin{macrocode} + \providecommand*\mdf@framemethod{} \def\mdf@framemethod@i{}% \def\mdf@framemethod@ii{}% @@ -2148,34 +2448,52 @@ Have fun! \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}}% + {\def\mdf@@framemethod{tikz}% + \defcounter{mdf@globalstyle@cnt}{1}\mdf@LoadFile@IfExist{tikz}}% {\xifinlist{\mdf@tempa}{\mdf@framemethod@iii}% - {\def\mdf@@framemethod{pstricks}\defcounter{mdf@globalstyle@cnt}{2}}% + {\def\mdf@@framemethod{pstricks}% + \defcounter{mdf@globalstyle@cnt}{2}\mdf@LoadFile@IfExist{pst-node}}% {\mdf@LoadFile@IfExist{#1}}% }% }% \ifcase\value{mdf@globalstyle@cnt}\relax% - \or\mdf@LoadFile@IfExist{tikz}%=1 - \or\mdf@LoadFile@IfExist{pst-node}%=2 - \or\mdf@LoadFile@IfExist{pst-node}%=3 + \input{md-frame-0.mdf}% + \or\input{md-frame-1.mdf}% + \or\input{md-frame-2.mdf}% + \or\input{md-frame-3.mdf}% + \else% + \IfFileExists{md-frame-\value{mdf@globalstyle@cnt}.mdf}% + {\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}% + }% \fi% } +\DeclareVoidOption{tikz}{\setkeys{mdf}{framemethod=tikz}} +\DeclareVoidOption{TikZ}{\setkeys{mdf}{framemethod=tikz}} +\DeclareVoidOption{ps}{\setkeys{mdf}{framemethod=pstricks}} +\DeclareVoidOption{pstricks}{\setkeys{mdf}{framemethod=pstricks}} +\DeclareVoidOption{PSTricks}{\setkeys{mdf}{framemethod=pstricks}} + % \end{macrocode} % % \begin{macro}{mdf@do@lengthoption} % Here the declaration of all length options. % \begin{macrocode} \mdf@dolist{\mdf@do@lengthoption}{% - {skipabove==\z@},% - {skipbelow==\z@},% + {skipabove==\topsep},% + {skipbelow==\topsep},% {leftmargin==\z@},% {rightmargin==\z@},% {innerleftmargin==10pt},% {innerrightmargin==10pt},% {innertopmargin==0.4\baselineskip},% {innerbottommargin==0.4\baselineskip},% - {splittopskip==\z@},% - {splitbottomskip==\z@},% + {splittopskip==10pt},% + {splitbottomskip==10pt},% {outermargin==\z@},% {innermargin==\z@},% {linewidth==0.4pt},% @@ -2192,9 +2510,6 @@ Have fun! {frametitlerightmargin==10pt},% {shadowsize==8pt},% {extratopheight==\z@},% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% %%subtitle / subsubtitle added 29.05.12%% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % {subtitleabovelinewidth==.8pt},% {subtitlebelowlinewidth==.6pt},% {subtitleaboveskip==\baselineskip},% @@ -2202,6 +2517,7 @@ Have fun! {subtitleinneraboveskip==.5\baselineskip},% {subtitleinnerbelowskip==.5\baselineskip},% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% NOT IMPLEMENTED {subsubtitleabovelinewidth==.8pt},% {subsubtitlebelowlinewidth==.6pt},% {subsubtitleaboveskip==\baselineskip},% @@ -2217,6 +2533,9 @@ Have fun! % \begin{macrocode} \mdf@dolist{\mdf@do@stringoption}{% {frametitle=={}},% + {firstframetitle=={}},% + {framefoot=={}},% + {lastframefoot=={}},% {defaultunit==pt},% {linecolor==black},% {backgroundcolor==white},% @@ -2240,10 +2559,21 @@ Have fun! {theoremcountersep=={.}},% {theoremtitlefont=={}},% {theoremspace=={\space}},% - {singleextra=={}}, - {firstextra=={}}, - {middleextra=={}}, - {secondextra=={}}, + {extra=={}},% + {singleextra=={}},% + {firstextra=={}},% + {middleextra=={}},% + {secondextra=={}},% + {beforesingleframe=={}},% + {aftersingleframe=={}},% + {beforebreak=={}},% + {afterbreak=={}},% + {beforelastframe=={}},% + {afterlastframe=={}},% + {startcode=={}},% + {startinnercode=={}},% + {endinnercode=={}},% + {endcode=={}},% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % %%subtitle / subsubtitle added 29.05.12%% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -2280,9 +2610,6 @@ Have fun! {shadow==false},% {everyline==false},% {ignorelastdescenders==false},% -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% %%subtitle / subsubtitle added 29.05.12%% % -% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % {subtitleaboveline==false}, {subtitlebelowline==false}, {subsubtitleaboveline==false}, @@ -2297,14 +2624,29 @@ Have fun! \ifbool{mdf@hidealllines}{% \kvsetkeys{mdf}{leftline=false,topline=false,% rightline=false,bottomline=false}% - }{}% + }{% + \kvsetkeys{mdf}{leftline=true,topline=true,% + rightline=true,bottomline=true}% + }% } +\appto\mdf@definestyle@defaultoptions{hidealllines=false,}% % \end{macrocode} % \end{macro} % % \begin{macro}{mdf@do@alignoption} % Here the declaration of all align options. % \begin{macrocode} +%USELESS +%USELESS +%USELESS +% This part must be worked over. +\def\mdf@do@alignoption#1{% + \mdf@alignoption@tripledo#1\@nil% +} +\def\mdf@alignoption@tripledo#1==#2==#3\@nil{% + \csdef{mdf@align@#1@left}{\null\hspace*{#2}}% + \csdef{mdf@align@#1@right}{\hspace*{#3}\null}% +} \mdf@dolist{\mdf@do@alignoption}{% {left==\mdf@leftmargin@length==\z@},% {center==\fill==\fill},% @@ -2312,13 +2654,6 @@ Have fun! {outer==\fill==\mdf@rightmargin@length},%not supported yet {outer==\mdf@leftmargin@length==\fill},%not supported yet } -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{mdf@align,mdf@makeboxalign@left, -% mdf@makeboxalign@right,mdf@makeboxalign@right} -% Set the alignment. -% \begin{macrocode} \newcommand*\mdf@align{}% \newcommand*\mdf@makeboxalign@left{\null\hspace*{\mdf@leftmargin@length}}% \newcommand*\mdf@makeboxalign@right{}% @@ -2332,6 +2667,9 @@ Have fun! \def\mdf@makeboxalign@right{\csuse{mdf@align@#1@right}}% }% } +%USELESS +%USELESS +%USELESS % \end{macrocode} % \end{macro} % @@ -2395,6 +2733,9 @@ Have fun! \DeclareDefaultOption{% \mdf@PackageError{Unknown Option '\CurrentOption' for mdframed}} \ProcessKeyvalOptions*\relax +\ifnum\c@mdf@globalstyle@cnt<0 + \kvsetkeys{mdf}{framemethod=default,} +\fi % \end{macrocode} % % \begin{macro}{mdfsetup} @@ -2418,6 +2759,28 @@ Have fun! {\expandafter\expandafter\expandafter\mdfsetup\expandafter% \expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}% }% +\DeclareVoidOption{default}{% + \expandafter\expandafter\expandafter\mdfsetup\expandafter% + \expandafter\expandafter{\csname mdf@definestyle@defaultoptions\endcsname}% +}% +% \end{macrocode} +% \end{macro} + +% \begin{macro}{linewidth} +% make linewidth available for all styles: +% |mdfdefinedstyle|. +% \begin{macrocode} +\ifnum\c@mdf@globalstyle@cnt>0 + \define@key{mdf}{linewidth}{% + \def\@tempa{#1} + \mdf@iflength{\@tempa}% + {\csxdef{mdfl@linewidth}{\the\mdf@templength}}% + {\csxdef{mdfl@linewidth}{\the\mdf@templength}}% + \setlength{\csname mdf@middlelinewidth@length\endcsname}% + {\csname mdfl@linewidth\endcsname}% + }% +\fi + % \end{macrocode} % \end{macro} % @@ -2456,6 +2819,7 @@ Have fun! \newsavebox\mdf@splitbox@one \newsavebox\mdf@splitbox@two \newsavebox\mdf@splitbox@save + \newlength\mdfsplitboxwidth \newlength\mdfsplitboxtotalwidth \newlength\mdfsplitboxheight @@ -2471,41 +2835,41 @@ Have fun! \newlength\mdffootnoteboxheight \newlength\mdffootnoteboxdepth \newlength\mdffootnoteboxtotalheight - \newlength\mdftotallinewidth - \newlength\mdfboundingboxwidth \newlength\mdfboundingboxtotalwidth - \newlength\mdfboundingboxheight \newlength\mdfboundingboxdepth \newlength\mdfboundingboxtotalheight - \newlength\mdf@freevspace@length \newlength\mdf@horizontalwidthofbox@length \newlength\mdf@verticalmarginwhole@length +\newlength\mdf@horizontalspaceofbox +\newlength\mdfsubtitleheight +\newlength\mdfsubsubtitleheight + -\newtoggle{mdf@notfirstframetitle}% -\togglefalse{mdf@notfirstframetitle}% +\newbool{mdfsingleframe}\boolfalse{mdfsingleframe} +\newbool{mdffirstframe}\boolfalse{mdffirstframe} +\newbool{mdfmiddleframe}\boolfalse{mdfmiddleframe} +\newbool{mdflastframe}\boolfalse{mdflastframe} +\newtoggle{mdf@notfirstframetitle}\togglefalse{mdf@notfirstframetitle}% +\newtoggle{mdflastframe}\togglefalse{mdflastframe} +\newcounter{mdfcountframes}\setcounter{mdfcountframes}{0} % Command to expand the tikz code. (see md-frame-1.mdf) \newrobustcmd\mdfcreateextratikz{} % \end{macrocode} % \end{macro} % -% \changes{v1.6}{2012/05/11}{Changes the complete definition of -% \protect\Cmd{mdf@lrbox} to fix problem with \protect\Env{itemize}} +% % \begin{macro}{mdf@lrbox,endmdf@lrbox} % Modification of the default |\lrbox| and |\endlrbox| % \begin{macrocode} \def\mdf@lrbox#1{% -%%patch to work with amsthm - \mdf@patchamsthm -%%%end patch - \edef\mdf@restoreparams{% - \parindent=\the\parindent\relax \parskip=\the\parskip\relax}% + \mdf@patchamsthm%patch amsthm \setbox#1\vbox\bgroup% \color@begingroup% \mdf@horizontalmargin@equation% @@ -2524,26 +2888,23 @@ Have fun! \baselineskip\normalbaselineskip% %% \sloppy% \let\\\@normalcr% - \mdf@restoreparams\relax% + \mdf@par@local%New feature to restore parskip/parindent local in save box + \ifbool{mdf@suppressfirstparskip}{\vspace*{-\parskip}}{}% \@afterindentfalse% - \@afterheading% + %\@afterheading% } - \def\endmdf@lrbox{\color@endgroup\egroup} - % \end{macrocode} % \end{macro} % -% \begin{macro}{mdf@ignorevbadness,mdf@restorevbadness} +% \begin{macro}{mdf@ignorevbadness} % Avoiding warnings during the splitting process by \Cmd{vsplit}. -% see \href{http://tex.stackexchange.com/questions/38496/how-to-avoid-^^A -% underfull-vbox-in-combination-with-vsplit/38499#38499}^^A -% {How to avoid underfull vbox in combination with \Cmd{vsplit}?} % \begin{macrocode} \newrobustcmd*\mdf@ignorevbadness{% \edef\mdf@currentvbadness{\the\vbadness}% \vbadness=\@M% \afterassignment\mdf@restorevbadness} + \newrobustcmd*\mdf@restorevbadness{\vbadness=\mdf@currentvbadness\relax} % \end{macrocode} % \end{macro} @@ -2552,10 +2913,12 @@ Have fun! % The package \Pack{amsthm} provides a not compatible starting of theorem. So I % have to change the header of amsthm. % \begin{macrocode} +\let\mdf@patchamsthm\relax +\AtBeginDocument{% \@ifpackageloaded{amsthm}% -{% - \newrobustcmd\mdf@patchamsthm{% - \let\mdf@deferred@thm@head\deferred@thm@head + {% + \newrobustcmd\mdf@patchamsthm{% + \let\mdf@deferred@thm@head\deferred@thm@head% \pretocmd{\deferred@thm@head}{\@inlabelfalse}% {\mdf@PackageInfo{mdframed detected package amsthm ^^J changed the theorem header of amsthm\MessageBreak}% @@ -2565,7 +2928,8 @@ Have fun! failed\MessageBreak}% }% }% -}{\let\mdf@patchamsthm\relax}% + }{}% +} % \end{macrocode} % \end{macro} % @@ -2574,8 +2938,13 @@ Have fun! % Modification of the default |\trivlist| and |\endtrivlist|. % \begin{macrocode} \def\mdf@trivlist#1{% - \edef\x{\topsep=\the\topsep\relax\partopsep=\the\partopsep\relax\parsep=\the\parsep\relax} + \edef\mdf@temp{% + \topsep=\the\topsep\relax% + \partopsep=\the\partopsep\relax% + \parsep=\the\parsep\relax% + }% \setlength{\topsep}{#1}% + \topskip\z@% \partopsep\z@% \parsep\z@% \@nmbrlistfalse% @@ -2585,9 +2954,7 @@ Have fun! \itemindent\z@% \let\@itemlabel\@empty% \def\makelabel##1{##1}% - \item\relax\x\relax\leavevmode\hrule \@height\z@ \@width\linewidth\relax% -%% \item\mbox{}\relax% second version -%% \item\relax\x% first Version + \item\relax\mdf@temp\relax% } \let\endmdf@trivlist\endtrivlist \patchcmd\endmdf@trivlist\@endparenv\mdf@endparenv{% @@ -2599,7 +2966,6 @@ Have fun! } \def\mdf@endparenv{% \addpenalty\@endparpenalty\addvspace\mdf@skipbelow@length\@endpetrue} - % \end{macrocode} % \end{macro} % @@ -2660,7 +3026,7 @@ Have fun! \expandafter\let\csname #2\endcsname\relax% \expandafter\let\csname end#2\endcsname\relax% \newmdenv[#1]{#2}% - }% +}% % \end{macrocode} % Definitions of the standard Theoerems surrounded by \Pack{mdframed}. % \begin{macrocode} @@ -2684,6 +3050,24 @@ Have fun! {\renewrobustcmd*\mdf@thm@caption{\thm@thmcaption}}{}% } % \end{macrocode} +% +% +% \begin{macro}{mdf@checkntheorem} +% Command which checks only |ntheorem|. Later I will support also +% |thmtools|. +% \begin{macrocode} +\newrobustcmd*\mdf@checkntheorem{% + \ifbool{mdf@ntheorem}% + {\ifundef{\theorempreskipamount}% + {\mdf@PackageWarning{You have not loaded ntheorem yet}}% + {\setlength{\theorempreskipamount}{\z@}% + \setlength{\theorempostskipamount}{\z@}% + }% + }{}% +} +% \end{macrocode} +% \end{macro} +% % Defining a complete new theorem set by \Pack{mdframed} % \begin{macrocode} \DeclareDocumentCommand{\mdtheorem}{ O{} m o m o }% @@ -2782,46 +3166,38 @@ Have fun! % \textcolor{red}{\bfseries Need a better documenation and must be improved!!!} % \begin{macrocode} \newrobustcmd\mdfframedtitleenv[1]{% - \mdf@lrbox{\mdf@frametitlebox}% + \mdf@lrbox{\mdf@frametitlebox}% + \begingroup + %%\parindent\z@\parskip\z@% + \@afterheading \mdf@frametitlealignment% - \leavevmode\color{\mdf@frametitlefontcolor}% - \normalfont\mdf@frametitlefont{#1} -% \end{macrocode} -% Trying to ignore last descenders of the environment. -% \begin{macrocode} - \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%% -% \end{macrocode} -% -% \begin{macrocode} - \endmdf@lrbox\relax% - \mdf@ignorevbadness% - \setbox\mdf@frametitlebox=\vbox{\unvbox\mdf@frametitlebox}% - \mdfframetitleboxwidth=\wd\mdf@frametitlebox\relax% - \mdfframetitleboxheight=\ht\mdf@frametitlebox\relax% - \mdfframetitleboxdepth=\dp\mdf@frametitlebox\relax% - \mdfframetitleboxtotalheight=\dimexpr + \leavevmode\color{\mdf@frametitlefontcolor}% + \normalfont\mdf@frametitlefont{#1}% + \mdf@@ignorelastdescenders% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%% + \endgroup + \endmdf@lrbox\relax% + \mdf@ignorevbadness% + \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% + \setbox\mdf@frametitlebox=%prevent frametitle to expand glue + \vbox to \dimexpr\mdfframetitleboxheight+\mdfframetitleboxdepth\relax% + {\unvbox\mdf@frametitlebox}% } -\newrobustcmd*\mdf@@frametitle{% - \mdfframedtitleenv{\mdf@frametitle}% -} - -\newrobustcmd*\mdf@@frametitle@use{% - \parskip\z@\relax% - \parindent\z@\relax% +\newrobustcmd\mdf@@frametitle@use{% \mdf@ignorevbadness% \setbox\mdf@splitbox@one=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% \offinterlineskip\relax% \unvcopy\mdf@frametitlebox\relax% \mdf@@frametitlerule\relax% @@ -2834,28 +3210,13 @@ Have fun! % \end{macrocode} % \end{macro} % -% \begin{macro}{mdf@checkntheorem} -% Command which checks only |ntheorem|. Later I will support also -% |thmtools|. -% \begin{macrocode} -\newrobustcmd*\mdf@checkntheorem{% - \ifbool{mdf@ntheorem}% - {\ifundef{\theorempreskipamount}% - {\mdf@PackageWarning{You have not loaded ntheorem yet}}% - {\setlength{\theorempreskipamount}{\z@}% - \setlength{\theorempostskipamount}{\z@}% - }% - }{}% -} -% \end{macrocode} -% \end{macro} -% % \begin{macro}{mdf@footnoterule,mdf@footnoteoutput,mdf@footnoteinput} % Support for footnotes. See source2e. % \begin{macrocode} \newrobustcmd*\mdf@footnoterule{% \kern0\p@% \hrule \@width 1in \kern 2.6\p@} + \newrobustcmd*\mdf@footnoteoutput{% \ifvoid\@mpfootins\else% \nobreak% @@ -2865,6 +3226,7 @@ Have fun! \unvbox\@mpfootins% \fi% } + \newrobustcmd*\mdf@footnoteinput{% \def\@mpfn{mpfootnote}% \def\thempfn{\thempfootnote}% @@ -2874,29 +3236,6 @@ Have fun! % \end{macrocode} % \end{macro} % -% \begin{macro}{mdf@load@style} -% Load the method to draw the frame and set style definition. -% \begin{macrocode} -\newrobustcmd*\mdf@load@style{% -\ifcase\value{mdf@globalstyle@cnt}\relax% - \input{md-frame-0.mdf}% - \or\input{md-frame-1.mdf}% - \or\input{md-frame-2.mdf}% - \or\input{md-frame-3.mdf}% - \else% - \IfFileExists{md-frame-\value{mdf@globalstyle@cnt}.mdf}% - {\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}% - }% -\fi% -}% -\mdf@load@style -% \end{macrocode} -% \end{macro} % % \begin{macro}{mdf@styledefinition} % The default frame method needs special handling. @@ -2921,15 +3260,15 @@ Have fun! \newrobustcmd*\detected@mdf@put@frame{% \ifmdf@nobreak%Option nobreak=true? \def\mdf@reserved@a{\mdf@put@frame@standalone}% - \else + \else% \def\mdf@reserved@a{\mdf@put@frame}% - \ifx\@captype\@undefined + \ifx\@captype\@undefined% \def\mdf@reserved@a{\mdf@put@frame}% - \else + \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}% @@ -2961,95 +3300,93 @@ Have fun! % \end{macro} % % -% \begin{macro}{mdframed} -% The user environement. -% \begin{macrocode} -\newenvironment{mdframed}[1][]{% -% \end{macrocode} -% Make everything local -% \begin{macrocode} -\color@begingroup% -% \end{macrocode} -% Set all options +% \begin{macro}{mdf@preenvsetting} +% Collect all definitions at the beginning of \Env{mdframed} % \begin{macrocode} - \mdfsetup{userdefinedwidth=\linewidth,#1}% +\newrobustcmd*\mdf@preenvsetting{% \mdf@twoside@checklength% + \edef\mdf@par@local{% + \parskip=\the\parskip\relax% + \parindent=\the\parindent\relax}% + \parskip\z@% + \parindent\z@% \let\width\z@% \let\height\z@% \mdf@checkntheorem% -% \end{macrocode} -% Draft mode -% \begin{macrocode} - \ifbool{mdf@draft}% - {% - \ifdimgreater{\overfullrule}{0pt}{}{\setlength\overfullrule{5pt}}% - }{}% -% \end{macrocode} -% Nesting environments and provide an extra counter. -% \begin{macrocode} - \ifnum\mdf@envdepth >\tw@\@toodeep\else + \ifbool{mdf@draft}{% + \ifdimgreater{\overfullrule}{0pt}{}{\setlength\overfullrule{5pt}}}{}% + %% Nested environments and provide an extra counter. + \ifnum\mdf@envdepth >\tw@\@toodeep\else% \advance\mdf@envdepth\@ne \edef\mdf@depthctr{mdf@env@\romannumeral\the\mdf@envdepth}% \fi -% \end{macrocode} -% \begin{macrocode} \mdf@styledefinition% \mdf@footnoteinput% \color{\mdf@fontcolor}% \mdf@font% - \ifvmode\nointerlineskip\fi% - \mdf@trivlist{\mdf@skipabove@length}%% - \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle}% -% \end{macrocode} -% Special command to allow extra user definitions by the option \Opt{settings}. -% \begin{macrocode} - \mdf@settings% -% \end{macrocode} -% \Cmd{parskip} is added to the first skip. Here the first skip will be removed from -% the length \Opt{innertopmargin}. See -% \url{http://tex.stackexchange.com/questions/100570/why-is-parskip-half-messing-up-the-spacing-in-mdframed} -% \begin{macrocode} - \ifbool{mdf@suppressfirstparskip}{\addtolength{\mdf@innertopmargin@length}{-\parskip}}{}% -% \end{macrocode} -% Start save box and save the whole contens in the box \Cmd{mdf@splitbox@one} -% \begin{macrocode} - \mdf@lrbox{\mdf@splitbox@one}% - }% - {% +} % \end{macrocode} -% Trying to ignore last descenders of the environment. +% \end{macro} +% +% \begin{macro}{mdf@@ignorelastdescenders} +% Collect all definitions at the beginning of \Env{mdframed} % \begin{macrocode} +\newrobustcmd*\mdf@@ignorelastdescenders{% \ifbool{mdf@ignorelastdescenders}% {% - \par\strut\par + \par\strut\par% \unskip\unskip\setbox0=\lastbox \vspace*{\dimexpr\ht\strutbox-\baselineskip\relax}% }{}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%% +} % \end{macrocode} -% End save box in relation to footnotes +% \end{macro} +% +% +% +% \begin{macro}{mdframed} +% The user environement. % \begin{macrocode} - \ifmdf@footnoteinside% +\newenvironment{mdframed}[1][]{% + \color@begingroup% + \mdfsetup{userdefinedwidth=\linewidth,#1}% + \mdf@startcode% + \mdf@preenvsetting% + \ifdefempty{\mdf@firstframetitle}{}% + {\let\mdf@frametitlesave\mdf@frametitle% + \let\mdf@frametitle\mdf@firstframetitle% + }% + \ifvmode\nointerlineskip\fi% + \mdf@trivlist{\mdf@skipabove@length}%% + \mdf@settings% + \mdf@lrbox{\mdf@splitbox@one}% + \mdf@startinnercode% + }% + {% + \mdf@@ignorelastdescenders% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%% + \ifmdf@footnoteinside% \def\mdf@reserveda{% \mdf@footnoteoutput% + \mdf@endinnercode% \endmdf@lrbox% - \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle@use}% + \ifdefempty{\mdf@frametitle}{}% + {\mdfframedtitleenv{\mdf@frametitle}\mdf@@frametitle@use}% \detected@mdf@put@frame}% - \else% + \else% \def\mdf@reserveda{% + \mdf@endinnercode% \endmdf@lrbox% - \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle@use}% + \ifdefempty{\mdf@frametitle}{}% + {\mdfframedtitleenv{\mdf@frametitle}\mdf@@frametitle@use}% \detected@mdf@put@frame% \mdf@footnoteoutput% }% - \fi% - \mdf@reserveda% - \endmdf@trivlist% -% \end{macrocode} -% End group and set the command \Cmd{@doendpe} to behave like -% \Cmd{end\{center\}} -% \begin{macrocode} -\color@endgroup\@doendpe% + \fi% + \mdf@reserveda% + \aftergroup\endmdf@trivlist% + \color@endgroup% + \mdf@endcode% } % \end{macrocode} @@ -3063,7 +3400,7 @@ Have fun! \newtoggle{md:checktwoside} \settoggle{md:checktwoside}{false} \newrobustcmd*\mdf@twoside@checklength{% - \if@twoside + \if@twoside% \ifbool{mdf@usetwoside}% {\mdf@PackageInfo{mdframed works in twoside mode}% \settoggle{md:checktwoside}{true}% @@ -3081,7 +3418,7 @@ Have fun! \zref@newprop*{mdf@pagevalue}[0]{\number\value{page}} \zref@addprop{\ZREF@mainlist}{mdf@pagevalue} \newrobustcmd*\mdf@zref@label{% - \stepcounter{mdf@zref@counter} + \stepcounter{mdf@zref@counter}% \zref@label{mdf@pagelabel-\number\value{mdf@zref@counter}}% } \newrobustcmd*\if@mdf@pageodd{% @@ -3102,15 +3439,11 @@ Have fun! % \end{macro} % % \begin{macro}{mdf@freepagevspace} +% The following lines are added by an inspiration of the great package +% \Pack{multicol}. % \begin{macrocode} \newrobustcmd*\mdf@freepagevspace{% -% \end{macrocode} -% The following lines are added by an inspiration of the great package -% \Pack{multicol}. -% \begin{macrocode} \bgroup\@nobreakfalse\addpenalty\z@\egroup%added 29.5.12 -% \end{macrocode} -% \begin{macrocode} \penalty\@M\relax\vskip 2\baselineskip\relax% \penalty9999\relax\vskip -2\baselineskip\relax% \penalty9999% @@ -3124,38 +3457,39 @@ Have fun! % \end{macrocode} % \end{macro} % -% \begin{macro}{mdf@advancelength@horizontalmargin@add, -% mdf@horizontalspaceofbox,mdf@horizontalmargin@equation} -% Command used for loop +% \begin{macro}{mdf@advancelength@sub,mdf@advancelength@add} +% Command used for loop calculation % \begin{macrocode} -\newrobustcmd*\mdf@advancelength@horizontalmargin@sub[1]{% - \advance\mdf@horizontalspaceofbox by -\csname mdf@#1@length\endcsname\relax% +\newrobustcmd*\mdf@advancelength@sub[2]{% + \advance #1 by -\csname mdf@#2@length\endcsname\relax% +} +\newrobustcmd*\mdf@advancelength@add[2]{% + \advance #1 by \csname mdf@#2@length\endcsname\relax% } % \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{mdf@horizontalmargin@equation} % Compute the width of the box % \begin{macrocode} -\newlength\mdf@horizontalspaceofbox \newrobustcmd*\mdf@horizontalmargin@equation{% \setlength{\mdf@horizontalspaceofbox}{\mdf@userdefinedwidth@length}% - \mdf@dolist{\mdf@advancelength@horizontalmargin@sub}{% + \mdf@dolist{\mdf@advancelength@sub{\mdf@horizontalspaceofbox}}{% leftmargin,outerlinewidth,middlelinewidth,% 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% - }{}% + {% + \mdf@dolist{\mdf@advancelength@add{\mdf@horizontalspaceofbox}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% \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@dolist{\mdf@advancelength@add{\mdf@horizontalspaceofbox}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% \hsize=\mdf@horizontalspaceofbox% } % \end{macrocode} @@ -3167,50 +3501,23 @@ Have fun! \newrobustcmd*\mdf@keeplines@single{% \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% + \mdf@dolist{\mdf@advancelength@sub{\mdf@verticalmarginwhole@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% \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% + \mdf@dolist{\mdf@advancelength@sub{\mdf@verticalmarginwhole@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% } % \end{macrocode} % \end{macro} % % -% \begin{macro}{mdf@advancelength@verticalmarginwhole, -% mdf@advancelength@freevspace@sub, -% mdf@advancelength@freevspace@add} -% Loop macros to calculate the height. Used by |\mdf@dolist|. -% \begin{macrocode} -\newrobustcmd*\mdf@advancelength@verticalmarginwhole[1]{% - \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% -} -\newrobustcmd*\mdf@advancelength@freevspace@add[1]{% - \advance\dimen@ by \csname mdf@#1@length\endcsname\relax% -} -% \end{macrocode} -% \end{macro} -% -% % \begin{macro}{mdf@reset} % Reset changes % \begin{macrocode} -\protected@edef\mdf@reset{\boxmaxdepth\the\boxmaxdepth +\protected@edef\mdf@reset{\boxmaxdepth\the\boxmaxdepth% \splittopskip\the\splittopskip}% % \end{macrocode} % \end{macro} @@ -3219,21 +3526,25 @@ Have fun! % Output of |mdframed| inside a non breakable environement. % \begin{macrocode} \newrobustcmd*\mdf@put@frame@standalone{\relax% - \ifvoid\mdf@splitbox@one\relax + \ifvoid\mdf@splitbox@one\relax% \mdf@PackageWarning{The environment is empty\MessageBreak}% - \let\mdf@reserved@a\relax% - \else + \else% %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}{% + \mdf@dolist{\mdf@advancelength@add{\mdf@verticalmarginwhole@length}}{% outerlinewidth,middlelinewidth,innerlinewidth,% innertopmargin,innerbottommargin,innerlinewidth,% - middlelinewidth,outerlinewidth}% + middlelinewidth,outerlinewidth,extratopheight}% \mdf@keeplines@single% - \def\mdf@reserved@a{\mdf@putbox@single}% - \fi - \mdf@reserved@a% + \begingroup% + \mdf@@setzref% + \booltrue{mdfsingleframe}% + \mdf@beforesingleframe% + \mdf@putbox@single% + \mdf@aftersingleframe% + \endgroup%Output no break + \fi% } % \end{macrocode} % \end{macro} @@ -3253,31 +3564,37 @@ Have fun! \mdf@PackageInfoSpace{\the\mdf@freevspace@length before the beginning of \MessageBreak the environment ending on input line \MessageBreak}% - \ifdimless{\mdf@freevspace@length}{2\baselineskip} + \ifdimless{\mdf@freevspace@length}{2\baselineskip}% {% - \mdf@PackageInfo{Not enough space on this page} + \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}% + \mdf@dolist{\mdf@advancelength@add{\mdf@verticalmarginwhole@length}}% {% outerlinewidth,middlelinewidth,innerlinewidth,% innertopmargin,innerbottommargin,% - innerlinewidth,middlelinewidth,outerlinewidth}% + innerlinewidth,middlelinewidth,outerlinewidth,extratopheight}% \mdf@keeplines@single% \ifdimless{\mdf@verticalmarginwhole@length}{\mdf@freevspace@length}% - {%passt auf Seite% - \begingroup\mdf@@setzref\mdf@putbox@single\endgroup%Output no break + {%enough space / no break + \begingroup% + \mdf@@setzref% + \booltrue{mdfsingleframe}% + \mdf@beforesingleframe% + \mdf@putbox@single% + \mdf@aftersingleframe% + \endgroup%Output no break \let\mdf@reserved@a\relax% }% {% - \def\mdf@reserved@a{\mdf@put@frame@i}%passt nicht auf Seite - } + \def\mdf@reserved@a{\mdf@put@frame@i}%need to split + }% }% -\fi +\fi% \mdf@reserved@a% } % \end{macrocode} @@ -3287,110 +3604,59 @@ Have fun! % Output of the first splitted box. % \begin{macrocode} \def\mdf@put@frame@i{%Box must be splitted -% \end{macrocode} -% Compute the vertical free space of the current page -% \begin{macrocode} \mdf@freepagevspace%gives \mdf@freevspace@length -% \end{macrocode} -% Compute whether the width of the lines plus 2 \Cmd{baselineskips} can -% only be set on the current page. -% \begin{macrocode} +% minimum 2 lines for one page: \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% + \mdf@dolist{\mdf@advancelength@add{\dimen@i}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% \advance\dimen@i by 2\baselineskip\relax% \ifdimless{\dimen@}{\dimen@i}% -% \end{macrocode} -% force a page / column break and restart printing of the environment -% \begin{macrocode} {\hrule \@height\z@ \@width\hsize% - \vfill\eject% + \vfill\eject%no room for two lines \def\mdf@reserved@a{\mdf@put@frame}% }% -% \end{macrocode} -% The page has enough space. -% \begin{macrocode} - {% -% \end{macrocode} -% compute the needed vertical space of the first frame. Subtract the dimension -% of the bottom frame -% \begin{macrocode} - \mdf@dolist{\mdf@advancelength@freevspace@sub}{%calculate with \dimen@ - outerlinewidth,middlelinewidth,innerlinewidth,% - innertopmargin,splitbottomskip}% -% \end{macrocode} -% Reduce vertical space if option \Opt{everyline} is set to \Opt{true} -% \begin{macrocode} - \ifbool{mdf@everyline}% - {% - \ifbool{mdf@bottomline}% - {% - \advance\dimen@ by -\mdf@innerlinewidth@length% - \advance\dimen@ by -\mdf@middlelinewidth@length% - \advance\dimen@ by -\mdf@outerlinewidth@length% - }{}% + {%enough space for first part + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}{%calculate with \dimen@ + outerlinewidth,middlelinewidth,innerlinewidth,%width of top rule + innertopmargin,splitbottomskip}%width of length + \ifboolexpr{ bool {mdf@everyline} and bool {mdf@bottomline} }% + {%need space for bottomline + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% -% \end{macrocode} -% Add vertical space if option \Opt{topline} is set to \Opt{false} -% \begin{macrocode} - \notbool{mdf@topline}% + \notbool{mdf@topline}%no top line {% - \advance\dimen@ by \mdf@innerlinewidth@length% - \advance\dimen@ by \mdf@middlelinewidth@length% - \advance\dimen@ by \mdf@outerlinewidth@length% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% -% \end{macrocode} -% Add a length of 0.8\Cmd{pageshrink}. I don't know whether it's needed! -% \begin{macrocode} - \advance\dimen@.8\pageshrink -% \end{macrocode} -% Test whether the contents has enough space and the last frame will be empty -% \begin{macrocode} + \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}% + you have to change it manually\MessageBreak + by changing the text, the space\MessageBreak + or something else}% \advance\dimen@ by -1.8\baselineskip\relax%needed???????????????????? }{}% -% \end{macrocode} -% \begin{itemize} -% \item save the orginal contents in a new save box, -% \item set the dimension for splitting -% \item ignore bad boxes and split -% \end{itemize} -% \begin{macrocode} - \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}% + \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}%save original \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% \mdf@ignorevbadness% - \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@ + \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@\relax% \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}% \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}% -% \end{macrocode} -% Test whether the splitted box fits the required dimension -% \begin{macrocode} \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}{\dimen@}% {%splitted wrong \mdf@PackageInfo{Box was splittet wrong^^J starting loop to iterate the splitting point\MessageBreak}% -% \end{macrocode} -% restore save box \Cmd{mdf@splitbox@one} by the save one -% \Cmd{mdf@splitbox@save} -% \begin{macrocode} \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% -% \end{macrocode} -% Start loop until splitting fits -- break after 100 attempts -% \begin{macrocode} - \dimen@i=\dimen@%\relax - \@tempcnta=\z@\relax + \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 + \advance\dimen@i by -\p@\relax% + \advance\@tempcnta by \@ne\relax% %% \wlog{***mdframed \string\@tempcnta=\the\@tempcnta***} %% \wlog{***mdframed \string\dimen@i=\the\dimen@i***} \mdf@ignorevbadness% @@ -3401,19 +3667,16 @@ Have fun! \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}% \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}% \ifnum\@tempcnta>100 - \let\iterate\relax + \let\iterate\relax% \mdf@PackageWarning{correct box splittet fails^^J It seems you are using a non splittable - contents\MessageBreak} + 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% }{}% -% \end{macrocode} -% Test if the last frame is empty -% \begin{macrocode} \ifvoid\mdf@splitbox@one\relax% \mdf@PackageWarning{You got a bad break because the splittet box is empty^^J @@ -3425,45 +3688,44 @@ Have fun! \enlargethispage{\baselineskip}% \def\mdf@reserved@a{\mdf@put@frame}% \fi% -% \end{macrocode} -% Test if first splitted frame doesn't have the original with. -% \begin{macrocode} + % Test if first splitted frame doesn't have the original with. + % occurs with math \ifdim\wd\mdf@splitbox@two=\wd\mdf@splitbox@one\relax \else% \mdf@PackageInfo{You first box width is to small^^J mdframed fixed it\MessageBreak}% \setbox\mdf@splitbox@two=\vbox% {% - \hrule \@height\z@ \@width\mdfboundingboxwidth\relax + \hrule \@height\z@ \@width\mdfboundingboxwidth\relax% \unvcopy\mdf@splitbox@two% }% \fi% -% \end{macrocode} -% Test if the first frame is empty -% \begin{macrocode} \ifvoid\mdf@splitbox@two\relax% - {\hrule \@height\f@size pt \@width\z@% + {% + \hrule \@height\f@size pt \@width\z@% \hrule \@height\z@ \@width\hsize}% \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% - \def\mdf@reserved@a{\mdf@put@frame}% + \def\mdf@reserved@a{\mdf@put@frame% + }% \else% \ifdimequal{\ht\mdf@splitbox@two}{0pt}% - {\hrule \@height\z@ \@width\hsize% + {% + \hrule \@height\z@ \@width\hsize% \vfill\eject% \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% \def\mdf@reserved@a{\mdf@put@frame}% }% {% -% \end{macrocode} -% Output of the first frame -% \begin{macrocode} - \begingroup\mdf@@setzref\mdf@putbox@first\endgroup% - \hrule \@height\z@ \@width\hsize% - \vfill\eject% - \def\mdf@reserved@a{\mdf@put@frame@ii}% -% \end{macrocode} -% -% \begin{macrocode} + \begingroup% + \mdf@@setzref% + \mdf@beforebreak% + \booltrue{mdffirstframe}% + \mdf@putbox@first% + \mdf@afterbreak% + \endgroup% + \hrule \@height\z@ \@width\hsize% + \vfill\eject% + \def\mdf@reserved@a{\mdf@put@frame@ii}% }% \fi% }% @@ -3477,127 +3739,69 @@ Have fun! % Output of the middle and last box. % \begin{macrocode} \def\mdf@put@frame@ii{% -% \end{macrocode} -% After splitting the vertical free space is \Cmd{vsize} so you can set it -% directly. -% \begin{macrocode} \setlength{\mdf@freevspace@length}{\vsize}% -% \end{macrocode} -% \textcolor{red}{\bfseries repeating frame title must be improved} -% \begin{macrocode} \ifbool{mdf@repeatframetitle}% - {% -% \end{macrocode} -% Remember that the first title was printed -% \begin{macrocode} + {%repeating title -- more robust using hooks. \toggletrue{mdf@notfirstframetitle}% -% \end{macrocode} -% remove the vertical skip added by option \Opt{splittopskip} to connect the -% boxes -% \begin{macrocode} \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} -% \end{macrocode} -% combine frame title with the contents of mdframed -% \begin{macrocode} + \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}% \setbox\mdf@splitbox@one\vbox% {% - \vbox to \mdf@frametitleaboveskip@length{} + \parskip\z@\relax% + \parindent\z@\relax% +% \offinterlineskip\relax% + \vskip\mdf@frametitleaboveskip@length% \unvcopy\mdf@frametitlebox\relax% \mdf@@frametitlerule\relax% \unvbox\mdf@splitbox@one\relax% }% \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}% }{}% -% \end{macrocode} -% \Cmd{dimen@} is equal to the natural height of the rest -% \begin{macrocode} \setlength{\dimen@}{\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% -% \end{macrocode} -% Assume no middle box -- add bottom length to the natural height of the -% contents -% \begin{macrocode} - \mdf@dolist{\mdf@advancelength@freevspace@add}% - {%used \dimen@ - innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth,% - }% -% \end{macrocode} -% add top length of lines if \Opt{everyline} is set to \Opt{true} -% \begin{macrocode} - \ifbool{mdf@everyline}% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}% + \ifboolexpr { bool {mdf@everyline} and bool {mdf@topline} }% {% - \ifbool{mdf@topline}% - {% - \advance\dimen@ by \mdf@innerlinewidth@length\relax% - \advance\dimen@ by \mdf@middlelinewidth@length\relax% - \advance\dimen@ by \mdf@outerlinewidth@length\relax% - }{}% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% -% \end{macrocode} -% remove length of bottom if \Opt{bottomline} is set to \Opt{false} -% \begin{macrocode} - \notbool{mdf@bottomline}% + \notbool{mdf@bottomline}%remove bottom if neccessary {% - \advance\dimen@ by -\mdf@innerlinewidth@length\relax% - \advance\dimen@ by -\mdf@middlelinewidth@length\relax% - \advance\dimen@ by -\mdf@outerlinewidth@length\relax% - \relax% + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% -% \end{macrocode} % Test whether the complete height of the frame fits on the current page -% \begin{macrocode} \ifdimgreater{\dimen@}{\mdf@freevspace@length}% {%have a middle box -% \end{macrocode} -% Use \Cmd{mdf@freevspace@length} to compute the splitting dimension. The -% conditionals \Opt{everyline}, \Opt{topline} and \Opt{bottomline} work -% like the test above. -% \begin{macrocode} \advance\mdf@freevspace@length by -\mdf@splitbottomskip@length\relax% - \ifbool{mdf@everyline}% + \ifbool{mdf@everyline}%regard top and bottom if everyline is used {% \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% + \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% \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 + \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% }{}% -% \end{macrocode} -% \begin{itemize} -% \item save the orginal contents in a new save box, -% \item set the dimension for splitting -% \item ignore bad boxes and split -% \end{itemize} -% \begin{macrocode} \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} -% \end{macrocode} -% Test whether the splitted box fits the required dimension -% \begin{macrocode} + \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}% {\mdf@freevspace@length}% {%splitted wrong \mdf@PackageInfo{Box was splittet wrong^^J starting loop to iterate the splitting point\MessageBreak}% -% \end{macrocode} -% Start loop until splitting fits -- break after 100 attempts -% \begin{macrocode} \dimen@i=\mdf@freevspace@length%\relax \@tempcnta=\z@\relax \loop @@ -3605,8 +3809,6 @@ Have fun! \mdf@freevspace@length\relax \advance\dimen@i by -\p@\relax% \advance\@tempcnta by \@ne\relax% -%% \wlog{***mdframed \string\@tempcnta=\the\@tempcnta***} -%% \wlog{***mdframed \string\dimen@i=\the\dimen@i***} \ifnum\@tempcnta>100 \let\iterate\relax% \mdf@PackageWarning{correct box splittet fails^^J @@ -3622,9 +3824,6 @@ Have fun! \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}% \repeat% }{}% -% \end{macrocode} -% Test whether last frame is empty -% \begin{macrocode} \ifvoid\mdf@splitbox@one\relax% \mdf@PackageWarning{You got a bad break because the splittet box is empty^^J @@ -3635,29 +3834,24 @@ Have fun! \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% \enlargethispage{\baselineskip}% \def\mdf@reserved@a{\mdf@put@frame@ii}% -% \end{macrocode} -% Output of the middle frame -% \begin{macrocode} \else -% Test if first splitted frame doesn't have the original with. -% \begin{macrocode} \setbox\mdf@splitbox@two=\vbox% {% - \hrule \@height\z@ \@width\mdfboundingboxwidth\relax + \hrule \@height\z@ \@width\mdfboundingboxwidth\relax% \unvcopy\mdf@splitbox@two% }% -% \end{macrocode} -% -% \begin{macrocode} - \begingroup\mdf@@setzref\mdf@putbox@middle\endgroup% - \hrule \@height\z@ \@width\hsize% + \begingroup% + \mdf@@setzref% + \booltrue{mdfmiddleframe}% + \mdf@beforebreak% + \mdf@putbox@middle% + \mdf@afterbreak% + \endgroup% + \hrule \@height\z@ \@width\hsize% \vfill\eject% \def\mdf@reserved@a{\mdf@put@frame@ii}% \fi }%End middle box case -% \end{macrocode} -% Starting output of last frame -% \begin{macrocode} {%start last box case \ifvoid\mdf@splitbox@one \mdf@PackageWarning{You got a bad break\MessageBreak @@ -3669,9 +3863,6 @@ Have fun! \hrule \@height\z@ \@width\mdfboundingboxwidth }% \fi% -% \end{macrocode} -% \Cmd{ifvoid} isn't enough -- need to test the height -% \begin{macrocode} \ifdimless{\ht\mdf@splitbox@one}{1sp}% {% \mdf@PackageWarning{You got a bad break\MessageBreak @@ -3685,11 +3876,19 @@ Have fun! \hrule \@height\z@ \@width\mdfboundingboxwidth }% }{}% -% \end{macrocode} -% Output of the last frame -% \begin{macrocode} - \begingroup\mdf@@setzref\mdf@putbox@second\endgroup% + \begingroup% + \toggletrue{mdflastframe}% + \mdf@beforebreak% + \begingroup% + \mdf@@setzref% + \booltrue{mdflastframe}% + \mdf@beforelastframe% + \mdf@putbox@second% + \mdf@afterlastframe% + \endgroup% \hrule \@height\z@ \@width\hsize% + \mdf@afterbreak% + \endgroup% \let\mdf@reserved@a\relax% }% \mdf@reserved@a% @@ -3698,6 +3897,93 @@ Have fun! % \end{macrocode} % \end{macro} % +% +% +% \begin{macro}{mdfsubtitle} +% +% \begin{macrocode} +\newrobustcmd\mdfsubtitle[2][]% +{% + \begingroup + \penalty-9995%set a breakpoint before the subtitle + \parindent\z@\relax% + \parskip\z@\relax% + \mdfsetup{#1}%only for subtitle options + \par\addvspace{\mdf@subtitleaboveskip@length}% + \setbox\z@=\vbox{% + \mdf@frametitlealignment% + \mdf@subtitlefont{#2}% + \mdf@@ignorelastdescenders% + \relax}% + \setbox\z@=\vbox{\unvbox\z@}% + \setbox\z@=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% + \offinterlineskip\relax% + \vbox to \mdf@subtitleinneraboveskip@length{}% + \unvbox\z@\relax% + \vbox to \mdf@subtitleinnerbelowskip@length{}% + }%\z@ contains the subtitle+required length + \setlength{\mdfsubtitleheight}{\dimexpr\ht\z@+\dp\z@\relax} + \setbox\z@=\vbox to \mdfsubtitleheight {\unvbox\z@}% + % \dimen@ is now the complete width + \mdf@templength=\linewidth\relax% + \mdf@dolist{\mdf@advancelength@add{\mdf@templength}}% + {innerleftmargin,innerrightmargin}% + \offinterlineskip\relax% + \ifbool{mdf@subtitleaboveline}{\mdf@drawsubtitleaboveline\par}{}% + \mdf@drawsubtitlebackground% + \box\z@% + \ifbool{mdf@subtitlebelowline}{\mdf@drawsubtitlebelowline}{}% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% + \penalty 9995% + \addvspace{\mdf@subtitlebelowskip@length}% + \endgroup% + \@afterheading% +} + +\newrobustcmd\mdfsubsubtitle[2][]% +{% + \begingroup + \penalty-9995%set a breakpoint before the subtitle + \parindent\z@\relax% + \parskip\z@\relax% + \mdfsetup{#1}%only for subtitle options + \par\addvspace{\mdf@subsubtitleaboveskip@length}% + \setbox\z@=\vbox{% + \mdf@frametitlealignment% + \mdf@subsubtitlefont{#2}% + \mdf@@ignorelastdescenders% + \relax}% + \setbox\z@=\vbox{\unvbox\z@}% + \setbox\z@=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% + \offinterlineskip\relax% + \vbox to \mdf@subsubtitleinneraboveskip@length{}% + \unvbox\z@\relax% + \vbox to \mdf@subsubtitleinnerbelowskip@length{}% + }%\z@ contains the subtitle+required length + \setlength{\mdfsubsubtitleheight}{\dimexpr\ht\z@+\dp\z@\relax} + \setbox\z@=\vbox to \mdfsubsubtitleheight {\unvbox\z@}% + % \dimen@ is now the complete width + \mdf@templength=\linewidth\relax% + \mdf@dolist{\mdf@advancelength@add{\mdf@templength}}% + {innerleftmargin,innerrightmargin}% + \offinterlineskip\relax% + \ifbool{mdf@subsubtitleaboveline}{\mdf@drawsubtitleaboveline\par}{}% + \mdf@drawsubtitlebackground% + \box\z@% + \ifbool{mdf@subsubtitlebelowline}{\mdf@drawsubtitlebelowline}{}% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% + \penalty 9995% + \addvspace{\mdf@subsubtitlebelowskip@length}% + \endgroup% + \@afterheading% +} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{mdf@test@ltrb,mdf@test@ltr,mdf@test@ltb,mdf@test@trb,^^A % mdf@test@lrb,mdf@test@lb,mdf@test@rb,^^A % mdf@test@tr,mdf@test@lt,mdf@test@lr,mdf@test@tb,mdf@test@l,^^A @@ -3713,11 +3999,11 @@ Have fun! %%%% | | %%%% |___________| %%%% b -%%Zusammenhaenge abfragen: +%all lines \newrobustcmd*\mdf@test@ltrb{% \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline}) and (bool {mdf@leftline}) and (bool {mdf@rightline})}} -%3-set +%three lines \newrobustcmd*\mdf@test@ltr{% \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline}) and (bool {mdf@leftline}) and (bool {mdf@rightline})}} @@ -3730,7 +4016,7 @@ Have fun! \newrobustcmd*\mdf@test@lrb{% \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline}) and (bool {mdf@leftline}) and (bool {mdf@rightline})}} -%2-set +%two lines \newrobustcmd*\mdf@test@lb{% \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline}) and (bool {mdf@leftline}) and not (bool {mdf@rightline})}} @@ -3749,7 +4035,7 @@ Have fun! \newrobustcmd*\mdf@test@tb{% \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline}) and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}} -%Einzellinien +%single lines \newrobustcmd*\mdf@test@l{% \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline}) and (bool {mdf@leftline}) and not (bool {mdf@rightline})}} @@ -3762,7 +4048,7 @@ Have fun! \newrobustcmd*\mdf@test@b{% \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline}) and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}} -%keine Linien +%no lines \newrobustcmd*\mdf@test@noline{% \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline}) and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}} @@ -3779,7 +4065,7 @@ Have fun! % % % \begin{macrocode} -\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{framemethod}% +% % %\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{framemethod}% \DisableKeyvalOption[action=warning,package=mdframed]{mdf}{xcolor}% \endinput @@ -3865,217 +4151,36 @@ Have fun! % % % -% \begin{macro}{mdfsubtitle} -% Definition of the command \Cmd{mdfsubtitle}. -% \begin{macrocode} -\newrobustcmd\mdfsubtitle[2][]% -{% -% \end{macrocode} -% Make everything local. +% \begin{macro}{mdf@drawsubtitleaboveline,mdf@drawsubtitlebelowline,^^A +% mdf@drawsubtitlebackground} +% % \begin{macrocode} - \begingroup - \penalty-9995%set a breakpoint before the subtitle -% \end{macrocode} -% Inside the title we don't need any \Cmd{parindent}. Next set the options of -% the optional argument of \Cmd{mdfsubtitle}. -% \begin{macrocode} - \parindent\z@\relax% - \mdfsetup{#1}%only for subtitle options -% \end{macrocode} -% Save the complete subtitle inside the save box \Cmd{z@}. -% \begin{marcocode} - \setbox\z@=\vbox{\mdf@subtitlefont{#2}\relax}% -% \end{macrocode} -% Compute the width of the current line including the inner left margin and -% inner right margin (using \Cmd{dimen@}. In the nest step the height and the -% depth of the save box will be saved in \Cmd{dimen@i}. -% \begin{marcocode} - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subtitleinnerbelowskip@length\relax - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% -% \end{macrocode} -% Test if rules should be drawn. otherwise set the line width to 0\,pt. -% \begin{macrocode} - \ifbool{mdf@subtitleaboveline}{}% - {\mdfsetup{subtitleabovelinewidth=\z@}}% - \ifbool{mdf@subtitlebelowline}{}% - {\mdfsetup{subtitlebelowlinewidth=\z@}}% -% \end{macrocode} -% Start a new line with the given skip \Opt{subtitleaboveskip}. -% \begin{macrocode} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleaboveskip@length -% \end{macrocode} -% Drawing the above line of the subtitle. -% \begin{macrocode} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subtitleabovelinecolor}% - \rule{\dimen@}{\mdf@subtitleabovelinewidth@length}% - \endgroup% - }% -% \end{macrocode} -% space between rule above and subtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinneraboveskip@length -% \end{macrocode} -% output of subtitle with a backround. Must think about the \Cmd{hspace} -% combination. -% \begin{macrocde} - \leavevmode\rlap% - {% - \smash{% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subtitlebackgroundcolor}% - \rule[\dimexpr-\dp\z@-\mdf@subtitleinnerbelowskip@length\relax] - {\dimen@}{\dimen@i}% - \endgroup% - }% - }% - \box\z@\relax% -% \end{macrocode} -% Skip after subtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinnerbelowskip@length -% \end{macrocode} -% Draw rule below of the subtitle. -% \begin{macrocde} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subtitlebelowlinecolor}% - \rule{\dimen@}{\mdf@subtitlebelowlinewidth@length}% - \color@endgroup - }% -% \end{macrocode} -% Last skip and set a non breaking point. -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitlebelowskip@length - \penalty 9995 - \endgroup +%default: +\def\mdf@drawsubtitleaboveline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitleabovelinecolor}% + \rule{\mdf@templength}{\mdf@subtitleabovelinewidth@length}% + }% } - -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{mdfsubsubtitle} -% Definition of the command \Cmd{mdfsubsubtitle}. -% \begin{macrocode} -\newrobustcmd\mdfsubsubtitle[2][]% -{% -% \end{macrocode} -% Make everything local. -% \begin{macrocode} - \begingroup - \penalty-9995%set a breakpoint before the subsubtitle -% \end{macrocode} -% Inside the title we don't need any \Cmd{parindent}. Next set the options of -% the optional argument of \Cmd{mdfsubsubtitle}. -% \begin{macrocode} - \parindent\z@\relax% - \mdfsetup{#1}%only for subsubtitle options -% \end{macrocode} -% Save the complete subsubtitle inside the save box \Cmd{z@}. -% \begin{marcocode} - \setbox\z@=\vbox{\mdf@subsubtitlefont{#2}\relax}% -% \end{macrocode} -% Compute the width of the current line including the inner left margin and -% inner right margin (using \Cmd{dimen@}. In the nest step the height and the -% depth of the save box will be saved in \Cmd{dimen@i}. -% \begin{marcocode} - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subsubtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subsubtitleinnerbelowskip@length\relax - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% -% \end{macrocode} -% Test if rules should be drawn. otherwise set the line width to 0\,pt. -% \begin{macrocode} - \ifbool{mdf@subsubtitleaboveline}{}% - {\mdfsetup{subsubtitleabovelinewidth=\z@}}% - \ifbool{mdf@subsubtitlebelowline}{}% - {\mdfsetup{subsubtitlebelowlinewidth=\z@}}% -% \end{macrocode} -% Start a new line with the given skip \Opt{subsubtitleaboveskip}. -% \begin{macrocode} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleaboveskip@length -% \end{macrocode} -% Drawing the above line of the subsubtitle. -% \begin{macrocode} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subsubtitleabovelinecolor}% - \rule{\dimen@}{\mdf@subsubtitleabovelinewidth@length}% - \endgroup% - }% -% \end{macrocode} -% space between rule above and subsubtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinneraboveskip@length -% \end{macrocode} -% output of subsubtitle with a backround. Must think about the \Cmd{hspace} -% combination. -% \begin{macrocde} - \leavevmode\rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \smash{% - \begingroup% - \color{\mdf@subsubtitlebackgroundcolor}% - \rule[\dimexpr-\dp\z@-\mdf@subtitleinnerbelowskip@length\relax] - {\dimen@}{\dimen@i}% - \endgroup% - }% - }% - \box\z@\relax% -% \end{macrocode} -% Skip after subsubtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinnerbelowskip@length -% \end{macrocode} -% Draw rule below of the subsubtitle. -% \begin{macrocde} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subsubtitlebelowlinecolor}% - \rule{\dimen@}{\mdf@subsubtitlebelowlinewidth@length}% - \endgroup% - }% -% \end{macrocode} -% Last skip and set a non breaking point. -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitlebelowskip@length - \penalty 9995 - \endgroup +\def\mdf@drawsubtitlebelowline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitlebelowlinecolor}% + \rule{\mdf@templength}{\mdf@subtitlebelowlinewidth@length}% + }% +} +\def\mdf@drawsubtitlebackground{% + \rlap{\smash{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitlebackgroundcolor}% + \rule[-\mdfsubtitleheight]{\mdf@templength}{\mdfsubtitleheight}% + }}% } - % \end{macrocode} % \end{macro} % % -% % \begin{macro}{mdf@putbox@single,mdf@frame@background@single,^^A % mdf@frame@topandbottomline@single,mdf@frame@leftline@single,^^A % mdf@frame@rightline@single,mdf@frame@rightline@single} @@ -4258,6 +4363,8 @@ Have fun! }{}% {\box\mdf@splitbox@one}% }% + \mdf@extra% + \mdf@singleextra \mdf@makeboxalign@right% }% \fi% @@ -4479,6 +4586,8 @@ Have fun! }{}% {\box\mdf@splitbox@two}% }% + \mdf@extra% + \mdf@firstextra% \mdf@makeboxalign@right% }% \fi% @@ -4682,6 +4791,8 @@ Have fun! }{}% {\box\mdf@splitbox@one}% }% + \mdf@extra% + \mdf@secondextra% \mdf@makeboxalign@right% }% \fi% @@ -4885,6 +4996,8 @@ Have fun! }{}% {\box\mdf@splitbox@two}% }% + \mdf@extra% + \mdf@middleextra% \mdf@makeboxalign@right% }% \fi% @@ -4977,7 +5090,7 @@ Have fun! fill=\mdf@shadowcolor, every shadow }}}% % - \mdf@tikzset@local + \mdf@tikzset@local% \tikzset{mdfmiddleline/.style={}}% % nur wenn middlelinewidth>0 wird mittlere Linie gezeichnet \ifdimgreater{\mdf@middlelinewidth@length}{\z@} @@ -5019,53 +5132,113 @@ Have fun! % % % -% \begin{macro}{mdf@testdraftmode} -% draftmode test +% \begin{macro}{mdf@drawframe@whole} +% Befehle fuer Ausgabe von Rahmen und Hintergrund % \begin{macrocode} -%%\newrobustcmd*\mdf@testdraftmode{% -%% \ifbool{mdf@draft}% -%% {% -%% \renewrobustcmd*\mdf@tikzbox@tfl[1]{%three or four borders -%% \path(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);% -%% \begin{scope}[mdfcorners]% -%% \clip[preaction=mdfouterline]% -%% [postaction=mdfbackground]% -%% [postaction=mdfinnerline]##1;% -%% \end{scope}% -%% \path[mdfmiddleline,mdfcorners]##1; -%% }% -%% \renewrobustcmd*\mdf@tikzbox@otl[2]{%one or two borders -%% \path(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);% -%% \begin{scope} -%% \path[mdfouterline,mdfcorners]##1;% -%% \clip[postaction=mdfbackground]##2;% -%% \path[mdfinnerline,mdfcorners]##1;% -%% \end{scope}% -%% \path[mdfmiddleline,mdfcorners]##1;% -%% }% -%% }{% -%% \ifdimgreater{\overfullrule}{0pt}{% -%% \renewrobustcmd*\mdf@tikzbox@tfl[1]{%three or four borders -%% \path(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);% -%% \begin{scope}[mdfcorners]% -%% \clip[preaction=mdfouterline]% -%% [postaction=mdfbackground]% -%% [postaction=mdfinnerline]##1;% -%% \end{scope}% -%% \path[mdfmiddleline,mdfcorners]##1; -%% }% -%% \renewrobustcmd*\mdf@tikzbox@otl[2]{%one or two borders -%% \path(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);% -%% \begin{scope} -%% \path[mdfouterline,mdfcorners]##1;% -%% \clip[postaction=mdfbackground]##2;% -%% \path[mdfinnerline,mdfcorners]##1;% -%% \end{scope}% -%% \path[mdfmiddleline,mdfcorners]##1;% -%% }% -%% }{}% -%% }% -%%} +\newrobustcmd*\mdf@drawframe@whole{% + \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% + \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% + \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% + \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% + \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% + \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% + {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% + }{}% + \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% + {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% + }{}% + \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% + {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% + }{}% + \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% + {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% + }{}% + \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% +} +% \end{macrocode} +% \end{macro} +% +% +% \begin{macro}{mdf@predtikzcalc,mdf@innertikzcalc} +% Before the output can start some calculations before \Env{tikzpicture} +% starts are neccessary. +% \begin{macrocode} +\newrobustcmd*\mdf@predtikzcalc{% + %%width + \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}% + {innerleftmargin,innerrightmargin}% + \ifbool{mdf@leftline}{% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + \ifbool{mdf@rightline}{% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + %%height + \setlength\mdfboundingboxheight% + {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}% + {innertopmargin,innerbottommargin}% + \ifbool{mdf@topline}{% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + \ifbool{mdf@bottomline}{% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% +} + +\newrobustcmd*\mdf@innertikzcalc{% + \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% + \pgfmathsetlengthmacro\mdf@Ay{+\mdf@innerbottommargin@length}% + \pgfmathsetlengthmacro\mdf@Ox{+0pt}% + \pgfmathsetlengthmacro\mdf@Oy{+0pt}% + \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% + \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% + \ifbool{mdf@leftline}% + {% + \pgfmathsetlengthmacro\mdf@Ax% + {\mdf@Ax+\mdf@outerlinewidth@length+% + \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% + \pgfmathsetlengthmacro\mdf@Ox% + {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@rightline}% + {% + \pgfmathsetlengthmacro\mdf@Px% + {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@bottomline}% + {% + \pgfmathsetlengthmacro\mdf@Ay% + {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length% + +\mdf@innerlinewidth@length}% + \pgfmathsetlengthmacro\mdf@Oy% + {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@topline}% + {% + \pgfmathsetlengthmacro\mdf@Py% + {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% + }{}% +} % \end{macrocode} % \end{macro} % @@ -5109,256 +5282,6 @@ Have fun! % \end{macrocode} % \end{macro} % -% -% \begin{macro}{mdfsubtitle} -% Definition of the command \Cmd{mdfsubtitle}. Starting with the definition of -% the tikz style for the rule above the subtitle. -% \begin{macrocode}% -\tikzset{mdfsubtitleaboverule/.style={% - draw=none, - fill=\mdf@subtitleabovelinecolor, - }% -} -% \end{macrocode} -% Definition of the default style of rule below the subtitle. -% \begin{macrocode} -\tikzset{mdfsubtitlebelowrule/.style={% - draw=none, - fill=\mdf@subtitlebelowlinecolor, - }% -} -% \end{macrocode} -% Definition of the default style of the background of the subtitle. -% \begin{macrocode} -\tikzset{mdfsubtitlebackground/.style={% - draw=\mdf@subtitlebackgroundcolor, - fill=\mdf@subtitlebackgroundcolor, - }% -} -% \end{macrocode} -% Definition of the command \Cmd{mdfsubtitle}. -% \begin{macrocode} -\newrobustcmd\mdfsubtitle[2][]% -{% -% \end{macrocode} -% Make everything local. -% \begin{macrocode} - \begingroup - \penalty-9995%set a breakpoint before the subtitle -% \end{macrocode} -% Inside the title we don't need any \Cmd{parindent}. Next set the options of -% the optional argument of \Cmd{mdfsubtitle}. -% \begin{macrocode} - \parindent\z@\relax% - \mdfsetup{#1}%only for subtitle options -% \end{macrocode} -% Save the complete subtitle inside the save box \Cmd{z@}. -% \begin{marcocode} - \setbox\z@=\vbox{\mdf@subtitlefont{#2}\relax}% -% \end{macrocode} -% Compute the width of the current line including the inner left margin and -% inner right margin (using \Cmd{dimen@}. In the nest step the height and the -% depth of the save box will be saved in \Cmd{dimen@i}. -% \begin{marcocode} - \pgfmathsetlength{\dimen@}% - {% - \linewidth% - +\mdf@innerleftmargin@length% - +\mdf@innerrightmargin@length% - }% -% \end{macrocode} -% Test if rules should be drawn. otherwise set the line width to 0\,pt. -% \begin{macrocode} - \ifbool{mdf@subtitleaboveline}{}% - {\mdfsetup{subtitleabovelinewidth=\z@}}% - \ifbool{mdf@subtitlebelowline}{}% - {\mdfsetup{subtitlebelowlinewidth=\z@}}% -% \end{macrocode} -% Start a new line with the given skip \Opt{subtitleaboveskip}. -% \begin{macrocode} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleaboveskip@length -% \end{macrocode} -% Drawing the above line of the subtitle. -% \begin{macrocode} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \tikz\draw[mdfsubtitleaboverule] (0,0)% - rectangle (\dimen@,\mdf@subtitleabovelinewidth@length); - \endgroup% - }% -% \end{macrocode} -% space between rule above and subtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinneraboveskip@length -% \end{macrocode} -% output of subtitle with a backround. Must think about the \Cmd{hspace} -% combination. -% \begin{macrocde} - \leavevmode\hspace*{-\mdf@innerleftmargin@length}% - \tikz[overlay]% - \draw[mdfsubtitlebackground] - (0,-\mdf@subtitleinnerbelowskip@length-\dp\z@) - rectangle(\dimen@,\ht\z@+\mdf@subtitleinneraboveskip@length);% - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% -% \end{macrocode} -% Skip after subtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinnerbelowskip@length -% \end{macrocode} -% Draw rule below of the subtitle. -% \begin{macrocde} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \tikz\draw[mdfsubtitlebelowrule] (0,0)% - rectangle (\dimen@,\mdf@subtitlebelowlinewidth@length); - \endgroup% - }% -% \end{macrocode} -% Last skip and set a non breaking point. -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitlebelowskip@length - \penalty 9995 - \endgroup -} - -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{mdfsubsubtitle} -% Definition of the command \Cmd{mdfsubsubtitle}. Starting with the definition of -% the tikz style for the rule above the subsubtitle. -% \begin{macrocode}% -\tikzset{mdfsubsubtitleaboverule/.style={% - draw=none, - fill=\mdf@subsubtitleabovelinecolor, - }% -} -% \end{macrocode} -% Definition of the default style of rule below the subsubtitle. -% \begin{macrocode} -\tikzset{mdfsubsubtitlebelowrule/.style={% - draw=none, - fill=\mdf@subsubtitlebelowlinecolor, - }% -} -% \end{macrocode} -% Definition of the default style of the background of the subsubtitle. -% \begin{macrocode} -\tikzset{mdfsubsubtitlebackground/.style={% - draw=\mdf@subsubtitlebackgroundcolor, - fill=\mdf@subsubtitlebackgroundcolor, - }% -} -% \end{macrocode} -% Definition of the command \Cmd{mdfsubsubtitle}. -% \begin{macrocode} -\newrobustcmd\mdfsubsubtitle[2][]% -{% -% \end{macrocode} -% Make everything local. -% \begin{macrocode} - \begingroup - \penalty-9995%set a breakpoint before the subsubtitle -% \end{macrocode} -% Inside the title we don't need any \Cmd{parindent}. Next set the options of -% the optional argument of \Cmd{mdfsubsubtitle}. -% \begin{macrocode} - \parindent\z@\relax% - \mdfsetup{#1}%only for subsubtitle options -% \end{macrocode} -% Save the complete subsubtitle inside the save box \Cmd{z@}. -% \begin{marcocode} - \setbox\z@=\vbox{\mdf@subsubtitlefont{#2}\relax}% -% \end{macrocode} -% Compute the width of the current line including the inner left margin and -% inner right margin (using \Cmd{dimen@}. In the nest step the height and the -% depth of the save box will be saved in \Cmd{dimen@i}. -% \begin{marcocode} - \pgfmathsetlength{\dimen@}% - {% - \linewidth% - +\mdf@innerleftmargin@length% - +\mdf@innerrightmargin@length% - }% -% \end{macrocode} -% Test if rules should be drawn. otherwise set the line width to 0\,pt. -% \begin{macrocode} - \ifbool{mdf@subsubtitleaboveline}{}% - {\mdfsetup{subsubtitleabovelinewidth=\z@}}% - \ifbool{mdf@subsubtitlebelowline}{}% - {\mdfsetup{subsubtitlebelowlinewidth=\z@}}% -% \end{macrocode} -% Start a new line with the given skip \Opt{subsubtitleaboveskip}. -% \begin{macrocode} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleaboveskip@length -% \end{macrocode} -% Drawing the above line of the subsubtitle. -% \begin{macrocode} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \tikz\draw[mdfsubsubtitleaboverule] (0,0)% - rectangle (\dimen@,\mdf@subsubtitleabovelinewidth@length); - \endgroup% - }% -% \end{macrocode} -% space between rule above and subsubtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinneraboveskip@length -% \end{macrocode} -% output of subsubtitle with a backround. Must think about the \Cmd{hspace} -% combination. -% \begin{macrocde} - \hspace*{-\mdf@innerleftmargin@length}% - \tikz[overlay]% - \draw[mdfsubtitlebackground] - (0,-\mdf@subsubtitleinnerbelowskip@length-\dp\z@) - rectangle(\dimen@,\ht\z@+\mdf@subsubtitleinneraboveskip@length);% - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% -% \end{macrocode} -% Skip after subsubtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinnerbelowskip@length -% \end{macrocode} -% Draw rule below of the subsubtitle. -% \begin{macrocde} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \tikz\draw[mdfsubsubtitlebelowrule] (0,0)% - rectangle (\dimen@,\mdf@subsubtitlebelowlinewidth@length); - \endgroup% - }% -% \end{macrocode} -% Last skip and set a non breaking point. -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitlebelowskip@length - \penalty 9995 - \endgroup -} - -% \end{macrocode} -% \end{macro} -% -% -% % \begin{macro}{mdf@putbox@single} % Output of the non breakable contents. % \begin{macrocode} @@ -5373,156 +5296,57 @@ Have fun! \mdf@makebox@out{% \mdf@makeboxalign@left% \mdf@tikz@settings% -% - \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}% - \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax% - \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax% - \ifbool{mdf@leftline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@rightline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% -% - \setlength\mdfboundingboxheight% - {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% - \advance\mdfboundingboxheight by \mdf@innertopmargin@length\relax% - \advance\mdfboundingboxheight by \mdf@innerbottommargin@length\relax% - \ifbool{mdf@topline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@bottomline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% + \mdf@predtikzcalc% \mdf@makebox@in[\mdfboundingboxwidth]{% \null% \begin{tikzpicture}[remember picture]% - \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% - \pgfmathsetlengthmacro\mdf@Ay{+\mdf@innerbottommargin@length}% - \pgfmathsetlengthmacro\mdf@Ox{+0pt}% - \pgfmathsetlengthmacro\mdf@Oy{+0pt}% - \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% - \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% - \ifbool{mdf@leftline}% - {% - \pgfmathsetlengthmacro\mdf@Ax% - {\mdf@Ax+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@rightline}% - {% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@bottomline}% - {% - \pgfmathsetlengthmacro\mdf@Ay% - {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length% - +\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Oy% - {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@topline}% - {% - \pgfmathsetlengthmacro\mdf@Py% - {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% -% + \mdf@innertikzcalc \coordinate(O)at(\mdf@Ox,\mdf@Oy);% \coordinate(P)at(\mdf@Px,\mdf@Py);% -% \ifbool{mdf@shadow} {\path[mdfshadow,mdfcorners](O) rectangle (P);}{}% -% - \begin{scope} - \begin{scope}[use as bounding box] - \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% -% - \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% - \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% - \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% - \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% -% - \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }{}% - \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }{}% - \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% - }{}% - \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% - }{}% - \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% -% - \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% - {(O)rectangle(P)}% - }{}% -% - \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% -% - %Frametitlebackground + \begin{scope} + \begin{scope}[use as bounding box] + \mdf@drawframe@whole \drawbrackgroundframetitle@single - \end{scope} -% - \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};%output - \end{scope} - %HIER KOMMT EIN WEITERES MAKRO - \mdf@singleextra - \mdfcreateextratikz + \end{scope} + \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one}; + \end{scope} + %HIER KOMMT EIN WEITERES MAKRO + \mdf@extra% + \mdf@singleextra% + \mdfcreateextratikz \end{tikzpicture}% }% \mdf@makeboxalign@right% }% - \fi + \fi% }% + \def\drawbrackgroundframetitle@single{% \ifdefempty{\mdf@frametitle}{}{% \drawbrackgroundframetitle@@single% }% }% \def\drawbrackgroundframetitle@@single{% - \begin{scope}%background frame title - \ifbool{mdf@leftline}{ - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length} - }{}% - \ifbool{mdf@rightline}{% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length} - }{}% - \ifbool{mdf@topline}{% - \pgfmathsetlengthmacro\mdf@Py% - {\mdf@Py-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length} - }{}% - \pgfmathsetlengthmacro\mdf@Fy - {\mdf@Py-\mdfframetitleboxtotalheight} - \path[mdfframetitlebackground] - (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)% - --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy); - \end{scope} + \begin{scope}%background frame title + \ifbool{mdf@leftline}{ + \pgfmathsetlengthmacro\mdf@Ox% + {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@rightline}{% + \pgfmathsetlengthmacro\mdf@Px% + {\mdf@Px-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@topline}{% + \pgfmathsetlengthmacro\mdf@Py% + {\mdf@Py-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length}% + }{}% + \pgfmathsetlengthmacro\mdf@Fy% + {\mdf@Py-\mdfframetitleboxtotalheight}% + \path[mdfframetitlebackground]% + (\mdf@Ox,\mdf@Fy)--(\mdf@Ox,\mdf@Py)--(\mdf@Px,\mdf@Py)--(\mdf@Px,\mdf@Fy); + \end{scope} } % \end{macrocode} % \end{macro} @@ -5574,7 +5398,7 @@ Have fun! +\mdf@frametitlebelowskip@length +\mdf@splitbottomskip@length %% +\mdf@splittopskip@length - -\dp\strutbox% +%% -\dp\strutbox% }% }% }% @@ -5609,156 +5433,54 @@ Have fun! \else% \mdf@makebox@out{% \mdf@makeboxalign@left% + %Special for first frame -- used other savebox + \let\mdf@splitbox@one\mdf@splitbox@two% \mdf@tikz@settings% - \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@two}% - \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax% - \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax% - \ifbool{mdf@leftline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@rightline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \setlength\mdfboundingboxheight% - {\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax}% - \advance\mdfboundingboxheight by \mdf@innertopmargin@length\relax% - \advance\mdfboundingboxheight by \mdf@splitbottomskip@length\relax% - \ifbool{mdf@topline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% -%%%%%%%%% - \ifbool{mdf@everyline}{% + %Special for first frame -- no innerbottommargin but splitbottomskip + \let\mdf@innerbottommargin@length\mdf@splitbottomskip@length + \mdf@predtikzcalc%calc with all lines + %Special for first frame -- no bottom line without everyline true + % if every line false -- test if bottomline is in use and remove the width + \ifbool{mdf@everyline}{}{% \ifbool{mdf@bottomline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - }{}% -%%%%%%%%%%%%%% - %\ifdimequal{\pagegoal}{\maxdimen}{\enlargethispage{\baselineskip}}{}% ??? + \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + }% \ifdimgreater{\pagegoal-\maxdimen}{0pt}{}{\enlargethispage{\baselineskip}}% \mdf@makebox@in[\mdfboundingboxwidth]{% \null% \begin{tikzpicture}[remember picture] - \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% - \pgfmathsetlengthmacro\mdf@Ay{+\mdf@splitbottomskip@length}% - \pgfmathsetlengthmacro\mdf@Ox{+0pt}% - \pgfmathsetlengthmacro\mdf@Oy{+0pt}% - \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% - \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% - \ifbool{mdf@leftline} - {% - \pgfmathsetlengthmacro\mdf@Ax% - {\mdf@Ax+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@rightline}{% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@topline}{% - \pgfmathsetlengthmacro\mdf@Py% - {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% -%% - \ifbool{mdf@everyline}{% - \ifbool{mdf@bottomline}% - {% - \pgfmathsetlengthmacro\mdf@Ay% - {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length% - +\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Oy% - {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - }{}% -%% + \mdf@innertikzcalc + %Special for first frame -- no bottom line without everyline true + \ifbool{mdf@everyline}{}{% + \ifbool{mdf@bottomline}% + {% + \pgfmathsetlengthmacro\mdf@Ay% + {\mdf@Ay-\mdf@outerlinewidth@length-\mdf@middlelinewidth@length% + -\mdf@innerlinewidth@length}% + \pgfmathsetlengthmacro\mdf@Oy% + {\mdf@Oy-\mdf@outerlinewidth@length + -0.5\mdf@middlelinewidth@length}% + }{}% + }% \coordinate(O)at(\mdf@Ox,\mdf@Oy);% \coordinate(P)at(\mdf@Px,\mdf@Py);% \ifbool{mdf@shadow} {\path[mdfshadow] (O) -- (O|-P) to[mdfcorners] (P) -- (P|-O) -- (O);}{}% - \begin{scope} - \begin{scope}[use as bounding box] -%%%%%%%%%%%% - \ifbool{mdf@everyline}{% - \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% - \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% - \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% - \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% - \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% - \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }{}% - \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }{}% - \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% - }{}% - \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% - }{}% - \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% - }{ - \ifboolexpr{test {\mdf@test@ltrb} or test {\mdf@test@ltr}}% - {\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}% - {}% - \ifboolexpr{test {\mdf@test@ltb} or test {\mdf@test@lt}}% - {% - \mdf@tikzbox@otl{(O)--(O|-P)--(P)} - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)} - }% - {}% - \ifboolexpr{test {\mdf@test@trb} or test {\mdf@test@tr}}% - {% - \mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}}% - {}% - \ifboolexpr{test {\mdf@test@lrb} or test {\mdf@test@lr}}% - {\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@tb} or test {\mdf@test@t}}% - {\mdf@tikzbox@otl{(O|-P)--(P)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@lb} or test {\mdf@test@l}}% - {\mdf@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@rb} or test {\mdf@test@r}}% - {\mdf@tikzbox@otl{(O-|P)--(P)}{(O)rectangle(P)}}% - {}% - \mdf@test@b{\path[mdfbackground](O)rectangle(P);}{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners]% - (O)--(O|-P)--(P)--(P|-O);}% - {}% - } -%%%%%%%%%%%% + \begin{scope} + \begin{scope}[use as bounding box] + %Special for first frame + \ifbool{mdf@everyline}{}{% + \mdfsetup{bottomline=false}% + } + \mdf@drawframe@whole \drawbrackgroundframetitle@first \end{scope} - \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% + \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% \end{scope} %HIER KOMMT EIN WEITERES MAKRO - \mdf@firstextra + \mdf@extra% + \mdf@firstextra% \mdfcreateextratikz% \end{tikzpicture}% }% @@ -5850,136 +5572,62 @@ Have fun! \def\mdf@putbox@middle{% \ifvoid\mdf@splitbox@two \else% - \mdf@makebox@out{% + \mdf@makebox@out{% \mdf@makeboxalign@left% \mdf@tikz@settings% - \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@two}% - \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax% - \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax% - \ifbool{mdf@leftline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@rightline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \setlength\mdfboundingboxheight% - {\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax}% - \advance\mdfboundingboxheight by \mdf@splitbottomskip@length\relax% -%%%%%%%%% - \ifbool{mdf@everyline}{% - \ifbool{mdf@topline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@bottomline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - }{}% -%%%%%%%%%%%%%% + %Special for middle frame -- used other savebox + \let\mdf@splitbox@one\mdf@splitbox@two% + %Special for middle frame -- no innertopmargin -- done by splittopskip + % in box and no bottommargin instead splitbottomskip + \setlength{\mdf@innertopmargin@length}{\z@}% + \let\mdf@innerbottommargin@length\mdf@splitbottomskip@length + \mdf@predtikzcalc% + %Special for middle frame -- remove topline and bottomline if no everyline + \ifbool{mdf@everyline}{}{% + \ifbool{mdf@topline}{% + \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + \ifbool{mdf@bottomline}{% + \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + }% \mdf@makebox@in[\mdfboundingboxwidth]{% \null% \begin{tikzpicture}[remember picture] - \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% - \pgfmathsetlengthmacro\mdf@Ay{+\mdf@splitbottomskip@length}% - \pgfmathsetlengthmacro\mdf@Ox{+0pt}% - \pgfmathsetlengthmacro\mdf@Oy{+0pt}% - \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% - \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% - \ifbool{mdf@leftline}% - {% - \pgfmathsetlengthmacro\mdf@Ax% - {\mdf@Ax+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@rightline}% - {% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% -%% - \ifbool{mdf@everyline}{% - \ifbool{mdf@bottomline}% - {% - \pgfmathsetlengthmacro\mdf@Ay% - {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length% - +\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Oy% - {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% + \mdf@innertikzcalc% + %Special for middle frame + \ifbool{mdf@everyline}{}{% + \ifbool{mdf@bottomline}% + {% + \pgfmathsetlengthmacro\mdf@Ay% + {\mdf@Ay-\mdf@outerlinewidth@length-\mdf@middlelinewidth@length% + -\mdf@innerlinewidth@length}% + \pgfmathsetlengthmacro\mdf@Oy% + {\mdf@Oy-\mdf@outerlinewidth@length + -0.5\mdf@middlelinewidth@length}% + }{}% \ifbool{mdf@topline}% {% \pgfmathsetlengthmacro\mdf@Py% {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% }{}% - }{}% -%% + }{}% \coordinate(O)at(\mdf@Ox,\mdf@Oy);% \coordinate(P)at(\mdf@Px,\mdf@Py);% - \ifbool{mdf@shadow} - {\path[mdfshadow](O) rectangle (P);}{}% - \begin{scope} - \begin{scope}[use as bounding box] -%%%%%%%%%%%% - \ifbool{mdf@everyline}{% - \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% - \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% - \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% - \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% - \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% - \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }{}% - \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }{}% - \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% - }{}% - \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% - }{}% - \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% - }{ - \ifboolexpr{bool {mdf@leftline} and bool {mdf@rightline}}% - {\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}{}% - \ifboolexpr{bool {mdf@leftline} and not (bool {mdf@rightline})}% - {\mdf@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}{}% - \ifboolexpr{not (bool {mdf@leftline}) and bool {mdf@rightline}}% - {\mdf@tikzbox@otl{(P)--(P|-O)}{(O)rectangle(P)}}{}% - \ifboolexpr{not (bool {mdf@leftline}) and not (bool {mdf@rightline})}% - {\path[mdfbackground](O)rectangle(P);}{}% - } -%%%%%%%% - \drawbrackgroundframetitle@middle - \end{scope} - \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% - \end{scope} - \mdf@middleextra - %HIER KOMMT EIN WEITERES MAKRO - \mdfcreateextratikz + \ifbool{mdf@shadow}{\path[mdfshadow](O) rectangle (P);}{}% + \begin{scope} + \begin{scope}[use as bounding box] + %%Special for middle frame + \ifbool{mdf@everyline}{}{\mdfsetup{topline=false,bottomline=false}}% + \mdf@drawframe@whole + \drawbrackgroundframetitle@middle + \end{scope} + \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% + \end{scope} + \mdf@extra% + \mdf@middleextra% + %HIER KOMMT EIN WEITERES MAKRO + \mdfcreateextratikz \end{tikzpicture}% }% \mdf@makeboxalign@right% @@ -6034,16 +5682,16 @@ Have fun! % \def\drawbrackgroundframetitle@@second{% \begin{scope}%background frame title - \ifbool{mdf@leftline}{ + \ifbool{mdf@leftline}{% \pgfmathsetlengthmacro\mdf@Ox% {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length} }{}% \ifbool{mdf@rightline}{% \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length} + {\mdf@Px-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length}% }{}% \pgfmathsetlengthmacro\mdf@Fy - {\mdf@Py-\mdfframetitleboxtotalheight} + {\mdf@Py-\mdfframetitleboxtotalheight}% \path[mdfframetitlebackground,rounded corners=\z@] (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)% --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy); @@ -6052,167 +5700,121 @@ Have fun! \def\mdf@putbox@second{% \ifvoid\mdf@splitbox@one \else% - \mdf@makebox@out{% + \mdf@makebox@out{% \mdf@makeboxalign@left% \mdf@tikz@settings% - \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}% - \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax% - \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax% - \ifbool{mdf@leftline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@rightline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \setlength\mdfboundingboxheight% - {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% - \advance\mdfboundingboxheight by \mdf@innerbottommargin@length\relax% - \ifbool{mdf@bottomline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% -%%%%%%%%% - \ifbool{mdf@everyline}{% + %Special for middle frame -- no innertopmargin -- done by splittopskip + \setlength{\mdf@innertopmargin@length}{\z@}% + \mdf@predtikzcalc% + %Special for second frame -- no top line without everyline true + \ifbool{mdf@everyline}{}{% \ifbool{mdf@topline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - }{}% -%%%%%%%%%%%%%% + \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + }% \mdf@makebox@in[\mdfboundingboxwidth]{% \null% \begin{tikzpicture}[remember picture] - \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% - \pgfmathsetlengthmacro\mdf@Ay{+\mdf@innerbottommargin@length}% - \pgfmathsetlengthmacro\mdf@Ox{+0pt}% - \pgfmathsetlengthmacro\mdf@Oy{+0pt}% - \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% - \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% - \ifbool{mdf@leftline}% - {% - \pgfmathsetlengthmacro\mdf@Ax% - {\mdf@Ax+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@rightline}% - {% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@bottomline}% - {% - \pgfmathsetlengthmacro\mdf@Ay% - {\mdf@Ay+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Oy% - {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% -%% - \ifbool{mdf@everyline}{% - \ifbool{mdf@topline}% + \mdf@innertikzcalc + %Special for second frame + \ifbool{mdf@everyline}{}{% + \ifbool{mdf@topline}% {% \pgfmathsetlengthmacro\mdf@Py% - {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% + {\mdf@Py+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% }{}% - }{}% -%% + }% \coordinate(O)at(\mdf@Ox,\mdf@Oy);% \coordinate(P)at(\mdf@Px,\mdf@Py);% \ifbool{mdf@shadow} {% - \path[mdfshadow] (O|-P) to[mdfcorners] (O) - to[mdfcorners] (P|-O) -- (P) -- (O|-P);% + \path[mdfshadow] (O|-P) to[mdfcorners] (O) to[mdfcorners] (P|-O) + -- (P) -- (O|-P);% }{}% - \begin{scope} - \begin{scope}[use as bounding box] -%%%%%%%%%%%% - \ifbool{mdf@everyline}{% - \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% - \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% - \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% - \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% - \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% - \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }{}% - \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }{}% - \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% - }{}% - \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% - }{}% - \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% - }{% - \ifboolexpr{test {\mdf@test@ltrb} or test {\mdf@test@lrb}}% - {\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}% - {}% - \ifboolexpr{test {\mdf@test@ltb} or test {\mdf@test@lb}}% - {% - \mdf@tikzbox@otl{(P-|O)--(O)--(O-|P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }% - {}% - \ifboolexpr{test {\mdf@test@trb} or test {\mdf@test@rb}}% - {% - \mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }% - {}% - \ifboolexpr{test {\mdf@test@ltr} or test {\mdf@test@lr}}% - {\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@tb} or test {\mdf@test@b}}% - {\mdf@tikzbox@otl{(O)--(O-|P)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@lt} or test {\mdf@test@l}}% - {\mdf@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@tr} or test {\mdf@test@r}}% - {\mdf@tikzbox@otl{(O-|P)--(P)}{(O)rectangle(P)}}% - {}% - \mdf@test@t{\path[mdfbackground,mdfcorners](O|-P)--(O)--(O-|P)--(P);}{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners]% - (O|-P)--(O)--(O-|P)--(P);}% - {}% - }% - \drawbrackgroundframetitle@second - \end{scope} - \node[mdfbox] at (\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};% - \end{scope} - \mdf@secondextra - %HIER KOMMT EIN WEITERES MAKRO - \mdfcreateextratikz + \begin{scope} + \begin{scope}[use as bounding box] + \ifbool{mdf@everyline}{}{\mdfsetup{topline=false}}% + \mdf@drawframe@whole + \drawbrackgroundframetitle@second + \end{scope} + \node[mdfbox] (mdfframe) at (\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};% + \end{scope} + \mdf@extra% + \mdf@secondextra% + %HIER KOMMT EIN WEITERES MAKRO + \mdfcreateextratikz \end{tikzpicture}% }% \mdf@makeboxalign@right% }% - \fi + \fi% }% + + +% +% \begin{macro}{mdf@drawsubtitleaboveline,mdf@drawsubtitlebelowline,^^A +% mdf@drawsubtitlebackground} +% +% \begin{macrocode}% +\tikzset{mdfsubtitleaboverule/.style={% + draw=none, + fill=\mdf@subtitleabovelinecolor, + }% +} + +\tikzset{mdfsubtitlebelowrule/.style={% + draw=none, + fill=\mdf@subtitlebelowlinecolor, + }% +} + +\tikzset{mdfsubtitlebackground/.style={% + draw=\mdf@subtitlebackgroundcolor, + fill=\mdf@subtitlebackgroundcolor, + }% +} + +\tikzset{mdfsubsubtitleaboverule/.style={% + draw=none, + fill=\mdf@subsubtitleabovelinecolor, + }% +} + +\tikzset{mdfsubsubtitlebelowrule/.style={% + draw=none, + fill=\mdf@subsubtitlebelowlinecolor, + }% +} + +\tikzset{mdfsubsubtitlebackground/.style={% + draw=none, + fill=\mdf@subsubtitlebackgroundcolor, + }% +} + +%default: +\def\mdf@drawsubtitleaboveline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \tikz\draw[mdfsubsubtitleaboverule](0,0) rectangle + (\mdf@templength,\mdf@subtitleabovelinewidth@length);% + }% +} +\def\mdf@drawsubtitlebelowline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \tikz\draw[mdfsubsubtitleaboverule](0,0) rectangle + (\mdf@templength,\mdf@subtitlebelowlinewidth@length);% + }% +} +\def\mdf@drawsubtitlebackground{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \tikz\draw[overlay,mdfsubtitlebackground](0,0) rectangle + (\mdf@templength,-\mdfsubtitleheight);% + }% +} + % \end{macrocode} % \end{macro} % @@ -6426,281 +6028,74 @@ Have fun! }% % % -% -% -% -% \begin{macro}{mdfsubtitle} -% Definition of the command \Cmd{mdfsubtitle}. Starting with the definition of -% the tikz style for the rule above the subtitle. -% \begin{macrocode}% +% \begin{macro}{mdf@drawsubtitleaboveline,mdf@drawsubtitlebelowline,^^A +% mdf@drawsubtitlebackground} +% +% \begin{macrocode} +%default: +\def\mdf@drawsubtitleaboveline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length) + \psframe[style=mdfsubtitleaboverule]% + (0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)% + \end{psicture}% + }% +} +\def\mdf@drawsubtitlebelowline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(\mdf@templength,\mdf@subtitlebelowlinewidth@length) + \psframe[style=mdfsubtitlebelowrule]% + (0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)% + \end{psicture}% + }% +} +\def\mdf@drawsubtitlebackground{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(0,0) + \psframe[style=mdfsubtitlebackground]% + (0,0)(\mdf@templength,-\mdfsubtitleheight)% + \end{psicture}% + }% +} + \newpsstyle{mdfsubtitleaboverule}{% linecolor=\mdf@subtitleabovelinecolor, fillcolor=\mdf@subtitleabovelinecolor, fillstyle=solid,dimen=outer,% } -% \end{macrocode} -% Definition of the default style of rule below the subtitle. -% \begin{macrocode} + \newpsstyle{mdfsubtitlebelowrule}{% linecolor=\mdf@subtitlebelowlinecolor, fillcolor=\mdf@subtitlebelowlinecolor, fillstyle=solid,dimen=outer,% } -% \end{macrocode} -% Definition of the default style of the background of the subtitle. -% \begin{macrocode} + \newpsstyle{mdfsubtitlebackground}{% linecolor=\mdf@subtitlebackgroundcolor, fillcolor=\mdf@subtitlebackgroundcolor, fillstyle=solid,linestyle=none, } -% \end{macrocode} -% Definition of the command \Cmd{mdfsubtitle}. -% \begin{macrocode} -\newrobustcmd\mdfsubtitle[2][]% -{% -% \end{macrocode} -% Make everything local. -% \begin{macrocode} - \begingroup - \penalty-9995%set a breakpoint before the subtitle -% \end{macrocode} -% Inside the title we don't need any \Cmd{parindent}. Next set the options of -% the optional argument of \Cmd{mdfsubtitle}. -% \begin{macrocode} - \parindent\z@\relax% - \mdfsetup{#1}%only for subtitle options -% \end{macrocode} -% Save the complete subtitle inside the save box \Cmd{z@}. -% \begin{marcocode} - \setbox\z@=\vbox{\mdf@subtitlefont{#2}\relax}% -% \end{macrocode} -% Compute the width of the current line including the inner left margin and -% inner right margin (using \Cmd{dimen@}. In the nest step the height and the -% depth of the save box will be saved in \Cmd{dimen@i}. -% \begin{marcocode} - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subtitleinnerbelowskip@length\relax% - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% -% \end{macrocode} -% Test if rules should be drawn. otherwise set the line width to 0\,pt. -% \begin{macrocode} - \ifbool{mdf@subtitleaboveline}{}% - {\mdfsetup{subtitleabovelinewidth=\z@}}% - \ifbool{mdf@subtitlebelowline}{}% - {\mdfsetup{subtitlebelowlinewidth=\z@}}% -% \end{macrocode} -% Start a new line with the given skip \Opt{subtitleaboveskip}. -% \begin{macrocode} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleaboveskip@length -% \end{macrocode} -% Drawing the above line of the subtitle. -% \begin{macrocode} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subtitleabovelinewidth@length) - \ifbool{mdf@subtitleaboveline}% - {% - \psframe[style=mdfsubtitleaboverule]% - (0,0)(\dimen@,\mdf@subtitleabovelinewidth@length)% - }{} - \end{pspicture} - \endgroup% - }% -% \end{macrocode} -% space between rule above and subtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinneraboveskip@length -% \end{macrocode} -% output of subtitle with a backround. Must think about the \Cmd{hspace} -% combination. -% \begin{macrocde} - \hspace*{-\mdf@innerleftmargin@length}% - \begin{pspicture}% - (0,0)% - (0,\ht\z@) - \psframe[style=mdfsubtitlebackground]% - (0,\dimexpr-\dp\z@-\mdf@subtitleinnerbelowskip@length\relax)% - (\dimen@,\dimen@i) - \end{pspicture} - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% -% \end{macrocode} -% Skip after subtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinnerbelowskip@length -% \end{macrocode} -% Draw rule below of the subtitle. -% \begin{macrocde} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subtitlebelowlinewidth@length) - \ifbool{mdf@subtitlebelowline}% - {% - \psframe[style=mdfsubtitlebelowrule]% - (0,0)(\dimen@,\mdf@subtitlebelowlinewidth@length)% - }{}% - \end{pspicture} - \endgroup% - }% -% \end{macrocode} -% Last skip and set a non breaking point. -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitlebelowskip@length - \penalty 9995 - \endgroup -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{mdfsubsubtitle} -% Definition of the command \Cmd{mdfsubsubtitle}. Starting with the definition of -% the tikz style for the rule above the subsubtitle. -% \begin{macrocode}% \newpsstyle{mdfsubsubtitleaboverule}{% linecolor=\mdf@subtitleabovelinecolor, fillcolor=\mdf@subtitleabovelinecolor, fillstyle=solid,dimen=outer,% } -% \end{macrocode} -% Definition of the default style of rule below the subtitle. -% \begin{macrocode} + \newpsstyle{mdfsubsubtitlebelowrule}{% linecolor=\mdf@subtitlebelowlinecolor, fillcolor=\mdf@subtitlebelowlinecolor, fillstyle=solid,dimen=outer,% } -% \end{macrocode} -% Definition of the default style of the background of the subtitle. -% \begin{macrocode} + \newpsstyle{mdfsubsubtitlebackground}{% linecolor=\mdf@subtitlebackgroundcolor, fillcolor=\mdf@subtitlebackgroundcolor, fillstyle=solid,linestyle=none, } -% \end{macrocode} -% Definition of the command \Cmd{mdfsubsubtitle}. -% \begin{macrocode} -\newrobustcmd\mdfsubsubtitle[2][]% -{% -% \end{macrocode} -% Make everything local. -% \begin{macrocode} - \begingroup - \penalty-9995%set a breakpoint before the subsubtitle -% \end{macrocode} -% Inside the title we don't need any \Cmd{parindent}. Next set the options of -% the optional argument of \Cmd{mdfsubsubtitle}. -% \begin{macrocode} - \parindent\z@\relax% - \mdfsetup{#1}%only for subsubtitle options -% \end{macrocode} -% Save the complete subsubtitle inside the save box \Cmd{z@}. -% \begin{marcocode} - \setbox\z@=\vbox{\mdf@subsubtitlefont{#2}\relax}% -% \end{macrocode} -% Compute the width of the current line including the inner left margin and -% inner right margin (using \Cmd{dimen@}. In the nest step the height and the -% depth of the save box will be saved in \Cmd{dimen@i}. -% \begin{marcocode} - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subsubtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subsubtitleinnerbelowskip@length\relax% - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% -% \end{macrocode} -% Test if rules should be drawn. otherwise set the line width to 0\,pt. -% \begin{macrocode} - \ifbool{mdf@subsubtitleaboveline}{}% - {\mdfsetup{subsubtitleabovelinewidth=\z@}}% - \ifbool{mdf@subsubtitlebelowline}{}% - {\mdfsetup{subsubtitlebelowlinewidth=\z@}}% -% \end{macrocode} -% Start a new line with the given skip \Opt{subsubtitleaboveskip}. -% \begin{macrocode} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleaboveskip@length -% \end{macrocode} -% Drawing the above line of the subsubtitle. -% \begin{macrocode} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subsubtitleabovelinewidth@length) - \ifbool{mdf@subsubtitleaboveline}% - {% - \psframe[style=mdfsubsubtitleaboverule]% - (0,0)(\dimen@,\mdf@subsubtitleabovelinewidth@length)% - }{} - \end{pspicture} - \endgroup% - }% -% \end{macrocode} -% space between rule above and subsubtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinneraboveskip@length -% \end{macrocode} -% output of subsubtitle with a backround. Must think about the \Cmd{hspace} -% combination. -% \begin{macrocde} - \hspace*{-\mdf@innerleftmargin@length}% - \begin{pspicture}(0,-\dp\z@)(0,\dimen@i - \begin{pspicture}% - (0,0)% - (0,\ht\z@) - \psframe[style=mdfsubsubtitlebackground]% - (0,\dimexpr-\dp\z@-\mdf@subsubtitleinnerbelowskip@length\relax)% - (\dimen@,\dimen@i) - \end{pspicture} - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% -% \end{macrocode} -% Skip after subsubtitle -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinnerbelowskip@length -% \end{macrocode} -% Draw rule below of the subsubtitle. -% \begin{macrocde} - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subsubtitlebelowlinewidth@length) - \ifbool{mdf@subsubtitlebelowline}% - {% - \psframe[style=mdfsubsubtitlebelowrule]% - (0,0)(\dimen@,\mdf@subsubtitlebelowlinewidth@length)% - }{}% - \end{pspicture} - \endgroup% - }% -% \end{macrocode} -% Last skip and set a non breaking point. -% \begin{macrocde} - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitlebelowskip@length - \penalty 9995 - \endgroup -} % \end{macrocode} % \end{macro} @@ -6840,6 +6235,7 @@ Have fun! % \psdot(mdf@O)\uput[90](mdf@O){mdf at O} % % \endpsclip + \mdf@extra% \mdf@singleextra \end{pspicture}% }% @@ -7037,7 +6433,8 @@ Have fun! % \psdot(mdf@P)\uput[90](mdf@P){mdf at P} % \psdot(mdf@O)\uput[90](mdf@O){mdf at O} % \endpsclip - \mdf@firstextra + \mdf@extra% + \mdf@firstextra% \end{pspicture} }% \mdf@makeboxalign@right% @@ -7252,7 +6649,8 @@ Have fun! %\psdot(mdf@A)\uput[90](mdf@A){mdf at A} %\psdot(mdf@P)\uput[90](mdf@P){mdf at P} %\psdot(mdf@O)\uput[90](mdf@O){mdf at O} - \mdf@middleextra + \mdf@extra% + \mdf@middleextra% \end{pspicture}% }% \mdf@makeboxalign@right% @@ -7468,6 +6866,7 @@ Have fun! \drawbrackgroundframetitle@second %output% \rput[bl](mdf@A){\box\mdf@splitbox@one} + \mdf@extra% \mdf@secondextra % \psdot(mdf@A)\uput[90](mdf@A){mdf at A} % \psdot(mdf@P)\uput[90](mdf@P){mdf at P} @@ -7557,12 +6956,36 @@ Have fun! \documentclass[parskip=false,english,11pt]{ltxmdf} -\usepackage{showexpl} -\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} + +\lstset{style=lstltxmdf} \newcommand\Loadedframemethod{default} \usepackage[framemethod=\Loadedframemethod]{mdframed} + +\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} + + +\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfhighlight} +\def\highlightinputenv{tltxmdfhighlight} + + \title{The \Pack{mdframed} package} \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} \author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}} @@ -7599,8 +7022,8 @@ In the preamble only the package \Pack{mdframed} with the option done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}. {\large\color{red!50!black} -\NOTE Every \Cmd{global} inside the examples is necessary to work with the -package \Pack{showexpl}.} +\NOTE Every \Cmd{global} inside the examples is necessary to work with my own +created environment \Env{tltxmdfexample*}.} \section{Examples} All examples have the following settings: @@ -7608,19 +7031,19 @@ All examples have the following settings: \begin{tltxmdfexample} \mdfsetup{skipabove=\topskip,skipbelow=\topskip} \newrobustcmd\ExampleText{% -An \textit{inhomogeneous linear} differential equation -has the form -\begin{align} -L[v ] = f, -\end{align} -where $L$ is a linear differential operator, $v$ is -the dependent variable, and $f$ is a given non-zero -function of the independent variables alone. + An \textit{inhomogeneous linear} differential equation has the form + \begin{align} + L[v ] = f, + \end{align} + where $L$ is a linear differential operator, $v$ is the dependent + variable, and $f$ is a given non-zero function of the independent + variables alone. } \end{tltxmdfexample} + \clearpage \Examplesec{very simple} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfdefinestyle{exampledefault}{% linecolor=red,linewidth=3pt,% leftmargin=1cm,rightmargin=1cm @@ -7628,20 +7051,19 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{hidden line + frame title} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfapptodefinestyle{exampledefault}{% topline=false,bottomline=false} \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] \ExampleText \end{mdframed} -\end{LTXexample} -\clearpage +\end{tltxmdfexample*} \Examplesec{colored frame title} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfapptodefinestyle{exampledefault}{% rightline=true,innerleftmargin=10,innerrightmargin=10, @@ -7651,21 +7073,21 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{framed picture which is centered} -\begin{LTXexample}[morekeywords=width] +\begin{tltxmdfexample*}[morekeywords=width] \begin{mdframed}[userdefinedwidth=6cm,align=center, linecolor=blue,linewidth=4pt] -\IfFileExists{donald-duck.jpg}% - {\includegraphics[width=\linewidth]{donald-duck}}% +\textit{CTAN lion drawing by Duane Bibby; thanks to \url{www.ctan.org}} +\IfFileExists{ctan-lion.png}% + {\includegraphics[width=\linewidth]{ctan-lion.png}}% {\rule{\linewidth}{4cm}}% \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{Theorem environments} -\begin{LTXexample}[morekeywords={theoremstyle,definition}] +\begin{tltxmdfexample*}[morekeywords={theoremstyle,definition}] \mdfdefinestyle{theoremstyle}{% linecolor=red,linewidth=2pt,% frametitlerule=true,% @@ -7682,11 +7104,10 @@ function of the independent variables alone. \begin{definition*}[Inhomogeneous linear] \ExampleText \end{definition*} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{theorem with separate header and the help of TikZ (complex)} -\begin{LTXexample}[% +\begin{tltxmdfexample*}[% morekeywords={theo,baseline,anchor,outer,sep,current,bounding,box,east},% moretexcs=tikz] \newcounter{theo}[section] @@ -7717,15 +7138,15 @@ function of the independent variables alone. \begin{theo} \ExampleText \end{theo} -\end{LTXexample} +\end{tltxmdfexample*} + -\clearpage \Examplesec{hide only a part of a line} The example below is inspired by the following post on StackExchange \href{http://tex.stackexchange.com/questions/24101/theorem-decorations^^A -that-stay-with-theorem-environment}% {Theorem decorations that stay with theorem environment} -\begin{LTXexample}[morekeywords={mdf@frame@leftline@single,mdf@frame@rightline@single,% +\begin{tltxmdfexample*}[morekeywords={mdf@frame@leftline@single,mdf@frame@rightline@single,% mdf@frame@leftline@first,mdf@frame@rightline@first,% mdf@frame@leftline@second,mdf@frame@rightline@second,% mdf@frame@leftline@middle,mdf@frame@rightline@middle,% @@ -7735,8 +7156,10 @@ The example below is inspired by the following post on StackExchange \newlength{\interruptlength} \newrobustcmd\interruptrule[3]{% \color{#1}% - \hspace*{\dimexpr\mdfboundingboxwidth+\mdf@innerrightmargin@length\relax}% - \rule[\dimexpr-\mdfboundingboxdepth+#2\interruptlength\relax]% + \hspace*{\dimexpr\mdfboundingboxwidth+ + \mdf@innerrightmargin@length\relax}% + \rule[\dimexpr-\mdfboundingboxdepth+ + #2\interruptlength\relax]% {\mdf@middlelinewidth@length}% {\dimexpr\mdfboundingboxtotalheight-#3\interruptlength\relax}% } @@ -7762,7 +7185,7 @@ The example below is inspired by the following post on StackExchange \begin{mdframed}[linecolor=blue,linewidth=8pt] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \end{document} \endinput % \end{macrocode} @@ -7786,12 +7209,32 @@ The example below is inspired by the following post on StackExchange \setcounter{errorcontextlines}{999} \documentclass[parskip=false,english,11pt]{ltxmdf} -\usepackage{showexpl} -\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} - \newcommand\Loadedframemethod{TikZ} \usepackage[framemethod=\Loadedframemethod]{mdframed} +\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} + + +\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfhighlight} +\def\highlightinputenv{tltxmdfhighlight} + + \title{The \Pack{mdframed} package} \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} \author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}} @@ -7828,8 +7271,8 @@ In the preamble only the package \Pack{mdframed} width the option done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}. {\large\color{red!50!black} -\NOTE Every \Cmd{global} inside the examples is necessary to work with the -package \Pack{showexpl}.} +\NOTE Every \Cmd{global} inside the examples is necessary to work with my own +created environment \Env{tltxmdfexample*}.} \section{Examples} All examples have the following settings: @@ -7837,19 +7280,19 @@ All examples have the following settings: \begin{tltxmdfexample} \mdfsetup{skipabove=\topskip,skipbelow=\topskip} \newrobustcmd\ExampleText{% -An \textit{inhomogeneous linear} differential equation -has the form -\begin{align} -L[v ] = f, -\end{align} -where $L$ is a linear differential operator, $v$ is -the dependent variable, and $f$ is a given non-zero -function of the independent variables alone. + An \textit{inhomogeneous linear} differential equation has the form + \begin{align} + L[v ] = f, + \end{align} + where $L$ is a linear differential operator, $v$ is the dependent + variable, and $f$ is a given non-zero function of the independent + variables alone. } \end{tltxmdfexample} + \clearpage \Examplesec{round corner} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfdefinestyle{exampledefault}{% outerlinewidth=5pt,innerlinewidth=0pt, outerlinecolor=red,roundcorner=5pt @@ -7857,29 +7300,31 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{hidden line + frame title} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfapptodefinestyle{exampledefault}{% topline=false,leftline=false,} \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] \ExampleText \end{mdframed} -\end{LTXexample} -\clearpage +\end{tltxmdfexample*} + + \Examplesec{framed picture which is centered} -\begin{LTXexample} +\begin{tltxmdfexample*} \begin{mdframed}[userdefinedwidth=6cm,align=center, linecolor=blue,middlelinewidth=4pt,roundcorner=5pt] -\IfFileExists{donald-duck.jpg}% - {\includegraphics[width=\linewidth]{donald-duck}}% +\textit{CTAN lion drawing by Duane Bibby; thanks to \url{www.ctan.org}} +\IfFileExists{ctan-lion.png}% + {\includegraphics[width=\linewidth]{ctan-lion.png}}% {\rule{\linewidth}{4cm}}% \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{Gimmick} -\begin{LTXexample}[morekeywords={line,width,dash,dashed,pattern}] +\begin{tltxmdfexample*}[morekeywords={line,width,dash,dashed,pattern}] \mdfsetup{splitbottomskip=0.8cm,splittopskip=0cm, innerrightmargin=2cm,innertopmargin=1cm,% innerlinewidth=2pt,outerlinewidth=2pt, @@ -7892,15 +7337,16 @@ function of the independent variables alone. \begin{mdframed} \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} + \clearpage \Examplesec{complex example with TikZ} -\begin{tltxmdfexample}[morekeywords={mdf}] -\tikzstyle{titregris} = - [draw=gray, thick, fill=white, shading = exersicetitle, % - text=gray, rectangle, rounded corners, right,minimum height=.7cm] +\begin{tltxmdfexample*}[morekeywords={mdf}] +\tikzset{titregris/.style = + {draw=gray, thick, fill=white, shading = exersicetitle, % + text=gray, rectangle, rounded corners, right,minimum height=.7cm}} \pgfdeclarehorizontalshading{exersicebackground}{100bp} {color(0bp)=(green!40); color(100bp)=(black!5)} \pgfdeclarehorizontalshading{exersicetitle}{100bp} @@ -7926,19 +7372,19 @@ function of the independent variables alone. settings={\global\stepcounter{exercise}}, singleextra={% \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}~}; + {~\mdf@frametitlefont{\theexercise}\hbox{~}}; \ifdefempty{\mdf@@exercisepoints}% {}% {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}% + {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}% }, firstextra={% \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}~}; + {~\mdf@frametitlefont{\theexercise}\hbox{~}}; \ifdefempty{\mdf@@exercisepoints}% {}% {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}% + {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}% }, } \makeatother @@ -7950,64 +7396,13 @@ function of the independent variables alone. \begin{mdframed}[style=exercisestyle,exercisepoints=10] \ExampleText \end{mdframed} -\end{tltxmdfexample} +\end{tltxmdfexample*} -\tikzstyle{titregris} = - [draw=gray, thick, fill=white, shading = exersicetitle, % - text=gray, rectangle, rounded corners, right,minimum height=.7cm] -\pgfdeclarehorizontalshading{exersicebackground}{100bp} - {color(0bp)=(green!40); color(100bp)=(black!5)} -\pgfdeclarehorizontalshading{exersicetitle}{100bp} - {color(0bp)=(red!40);color(100bp)=(black!5)} -\newcounter{exercise} -\renewcommand*\theexercise{Exercise~n\arabic{exercise}} -\makeatletter -\def\mdf@@exercisepoints{}%new mdframed key: -\define@key{mdf}{exercisepoints}{% - \def\mdf@@exercisepoints{#1} -} -\mdfdefinestyle{exercisestyle}{% - outerlinewidth=1em,outerlinecolor=white,% - leftmargin=-1em,rightmargin=-1em,% - middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray, - apptotikzsetting={\tikzset{mdfbackground/.append style ={% - shading = exersicebackground}}}, - innertopmargin=1.2\baselineskip, - skipabove={\dimexpr0.5\baselineskip+\topskip\relax}, - skipbelow={-1em}, - needspace=3\baselineskip, - frametitlefont=\sffamily\bfseries, - settings={\global\stepcounter{exercise}}, - singleextra={% - \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}~}; - \ifdefempty{\mdf@@exercisepoints}% - {}% - {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}% - }, - firstextra={% - \node[titregris,xshift=1cm] at (P-|O) % - {~\mdf@frametitlefont{\theexercise}~}; - \ifdefempty{\mdf@@exercisepoints}% - {}% - {\node[titregris,left,xshift=-1cm] at (P)% - {~\mdf@frametitlefont{\mdf@@exercisepoints points}~};}% - }, -} -\makeatother - -\begin{mdframed}[style=exercisestyle] -\ExampleText -\end{mdframed} -\begin{mdframed}[style=exercisestyle,exercisepoints=10] -\ExampleText -\end{mdframed} \clearpage \Examplesec{Theorem environments} -\begin{LTXexample}[morekeywords={theoremstyle,definition}] +\begin{tltxmdfexample*}[morekeywords={theoremstyle,definition}] \mdfdefinestyle{theoremstyle}{% linecolor=red,middlelinewidth=2pt,% frametitlerule=true,% @@ -8024,10 +7419,10 @@ function of the independent variables alone. \begin{definition*}[Inhomogeneous linear] \ExampleText \end{definition*} -\end{LTXexample} - +\end{tltxmdfexample*} \end{document} \endinput + % \end{macrocode} % %\iffalse @@ -8053,8 +7448,28 @@ function of the independent variables alone. \newcommand\Loadedframemethod{PSTricks} \usepackage[framemethod=\Loadedframemethod]{mdframed} -\usepackage{showexpl} -\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} +\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} + +\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfhighlight} +\def\highlightinputenv{tltxmdfhighlight} + + \title{The \Pack{mdframed} package} \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} @@ -8092,8 +7507,9 @@ In the preamble only the package \Pack{mdframed} width the option done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}. {\large\color{red!50!black} -\NOTE Every \Cmd{global} inside the examples is necessary to work with the -package \Pack{showexpl}.} +\NOTE Every \Cmd{global} inside the examples is necessary to work with my own +created environment \Env{tltxmdfexample*}.} + \section{Examples} All examples have the following settings: @@ -8101,20 +7517,20 @@ All examples have the following settings: \begin{tltxmdfexample} \mdfsetup{skipabove=\topskip,skipbelow=\topskip} \newrobustcmd\ExampleText{% -An \textit{inhomogeneous linear} differential equation -has the form -\begin{align} -L[v ] = f, -\end{align} -where $L$ is a linear differential operator, $v$ is -the dependent variable, and $f$ is a given non-zero -function of the independent variables alone. + An \textit{inhomogeneous linear} differential equation has the form + \begin{align} + L[v ] = f, + \end{align} + where $L$ is a linear differential operator, $v$ is the dependent + variable, and $f$ is a given non-zero function of the independent + variables alone. } \end{tltxmdfexample} + \clearpage \Examplesec{very simple} -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfdefinestyle{exampledefault}{% linecolor=red,middlelinewidth=3pt,% leftmargin=1cm,rightmargin=1cm @@ -8122,10 +7538,11 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault,roundcorner=5] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} + \Examplesec{hidden line + frame title} -\begin{LTXexample}[morekeywords={innerlinecolor,addtopsstyle,mdfouterlinestyle, +\begin{tltxmdfexample*}[morekeywords={innerlinecolor,addtopsstyle,mdfouterlinestyle, linestyle}] \global\mdfapptodefinestyle{exampledefault}{% topline=false,rightline=false,bottomline=false, @@ -8136,21 +7553,19 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}] \ExampleText \end{mdframed} -\end{LTXexample} - -\clearpage +\end{tltxmdfexample*} \Examplesec{Dash Lines}[morekeywords={pstrickssetting,linestyle,dashed}] -\begin{LTXexample} +\begin{tltxmdfexample*} \global\mdfdefinestyle{exampledefault}{% pstrickssetting={linestyle=dashed,},linecolor=red,middlelinewidth=2pt} \begin{mdframed}[style=exampledefault] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} \Examplesec{Double Lines} -\begin{LTXexample}[morekeywords={addtopsstyle,mdfmiddlelinestyle, +\begin{tltxmdfexample*}[morekeywords={addtopsstyle,mdfmiddlelinestyle, doubleline,doublesep}] \global\mdfdefinestyle{exampledefault}{% pstricksappsetting={\addtopsstyle{mdfmiddlelinestyle}{% @@ -8159,11 +7574,10 @@ function of the independent variables alone. \begin{mdframed}[style=exampledefault] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{Shadow frame} -\begin{LTXexample}[morekeywords={shadow,shadowsize,myshadowbox}] +\begin{tltxmdfexample*}[morekeywords={shadow,shadowsize,myshadowbox}] \newmdenv[shadow=true, shadowsize=11pt, linewidth=8pt, @@ -8173,7 +7587,7 @@ function of the independent variables alone. \begin{myshadowbox}[frametitle={Inhomogeneous linear}] \ExampleText \end{myshadowbox} -\end{LTXexample} +\end{tltxmdfexample*} \end{document} \endinput % \end{macrocode} @@ -8197,13 +7611,35 @@ function of the independent variables alone. \setcounter{errorcontextlines}{999} \documentclass[parskip=false,english,11pt,lipsum=true]{ltxmdf} -\usepackage{showexpl} -\lstset{style=lstltxmdf,explpreset={pos=b,rframe={}},} \usepackage{tikz} \usetikzlibrary{calc,arrows,shadings,shadows} \newcommand\Loadedframemethod{tikz} \usepackage[framemethod=\Loadedframemethod]{mdframed} + + +\surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfexample} + + +\newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,% + roundcorner=10pt,innertopmargin=0pt,% + leftmargin=1cm,rightmargin=1cm,% + innerleftmargin=-15pt,innerrightmargin=-15pt,% + ignorelastdescenders,% + settings={\lstset{resetmargins}},% + skipbelow=\topskip,skipabove=\topskip,% + innerbottommargin=0pt,backgroundcolor=gray!10]% + {tltxmdfhighlight} +\def\highlightinputenv{tltxmdfhighlight} + \title{The \Pack{mdframed} package} \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}} \author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}} @@ -8240,8 +7676,8 @@ In the preamble only the package \Pack{mdframed} width the option done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}. {\large\color{red!50!black} -\NOTE Every \Cmd{global} inside the examples is necessary to work with the -package \Pack{showexpl}.} +\NOTE Every \Cmd{global} inside the examples is necessary to work with my own +created environment \Env{tltxmdfexample*}.} \section{Examples} All examples have the following settings: @@ -8249,14 +7685,13 @@ All examples have the following settings: \begin{tltxmdfexample} \mdfsetup{skipabove=\topskip,skipbelow=\topskip} \newrobustcmd\ExampleText{% -An \textit{inhomogeneous linear} differential equation -has the form -\begin{align} -L[v ] = f, -\end{align} -where $L$ is a linear differential operator, $v$ is -the dependent variable, and $f$ is a given non-zero -function of the independent variables alone. + An \textit{inhomogeneous linear} differential equation has the form + \begin{align} + L[v ] = f, + \end{align} + where $L$ is a linear differential operator, $v$ is the dependent + variable, and $f$ is a given non-zero function of the independent + variables alone. } \end{tltxmdfexample} \clearpage @@ -8285,24 +7720,26 @@ With the new command \Cmd{surroundwithmdframed} you can use \surroundwithmdframed{listings} \end{tltxmdfexample} +\clearpage \Examplesec{Package multicol} How I wrote in \enquote{Known Problems} you can't combine \Pack{multicol} with \Pack{mdframed}. In a simple way without any breaks you can use: -\begin{LTXexample}[morekeywords={multicols}] -\begin{multicols}{2} -\lipsum[1] -\begin{mdframed} -\ExampleText -\end{mdframed} -\lipsum[2] -\end{multicols} -\end{LTXexample} + +\begin{tltxmdfexample*}[morekeywords={multicols}] + \begin{multicols}{2} + \lipsum[1] + \begin{mdframed} + \ExampleText + \end{mdframed} + \lipsum[2] + \end{multicols} +\end{tltxmdfexample*} + \clearpage \twocolumn[\Examplesec{Working in twocolumn mode}] -\begin{tltxmdfexample} -\twocolumn[% - \Examplesec{Working in - twocolumn mode}] +\begin{tltxmdfexample*}[moretexcs={Examplesec}] +%\twocolumn[% +% \Examplesec{Working in twocolumn mode}] \lipsum[1]\lipsum[2] \begin{mdframed}[% leftmargin=10pt,% @@ -8312,19 +7749,14 @@ How I wrote in \enquote{Known Problems} you can't combine \Pack{multicol} with \ExampleText \end{mdframed} \lipsum[2] -\end{tltxmdfexample} -\lipsum[1]\lipsum[2] -\begin{mdframed}[leftmargin=10pt,% - rightmargin=10pt,% - linecolor=red, - backgroundcolor=yellow] -\ExampleText -\end{mdframed} -\lipsum[2] +\end{tltxmdfexample*} + + + \clearpage \onecolumn \Examplesec{Working inside enumerate} -\begin{LTXexample}[morekeywords={enumerate}] +\begin{tltxmdfexample*}[morekeywords={enumerate}] Text Text Text Text Text Text Text Text \begin{enumerate} \item in the following \ldots @@ -8334,10 +7766,11 @@ Text Text Text Text Text Text Text Text \item \lipsum[2] \end{enumerate} Text Text Text Text Text Text -\end{LTXexample} -\clearpage +\end{tltxmdfexample*} + + \Examplesec{Position a specific symbol at a line} -\begin{LTXexample} +\begin{tltxmdfexample*} \tikzset{ warningsymbol/.style={ rectangle,draw=red, @@ -8367,11 +7800,10 @@ Text Text Text Text Text Text \begin{mdframed}[style=warning] \ExampleText \end{mdframed} -\end{LTXexample} +\end{tltxmdfexample*} -\clearpage \Examplesec{digression-environement inspired by Tobias Weh} -\begin{lstlisting}[morekeywords={% +\begin{tltxmdfexample*}[morekeywords={% font,anchor,let,in,arrow,round,cap,controls,coordinate,% excursus,head,arrows,calc,line,width,and,to,digressionarrows,% base,west},% @@ -8427,71 +7859,23 @@ Text Text Text Text Text Text \begin{mdframed}[style=digressionarrows] \ExampleText \end{mdframed} -\end{lstlisting} +\end{tltxmdfexample*} -\tikzset{ - excursus arrow/.style={% - line width=2pt, - draw=gray!40, - rounded corners=2ex, - }, - excursus head/.style={ - fill=white, - font=\bfseries\sffamily, - text=gray!80, - anchor=base west, - }, -} -\mdfdefinestyle{digressionarrows}{% - singleextra={% - \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q); - \path let \p1=(Q), \p2=(O) in (\x1,{(\y1-\y2)/2}) coordinate (M); - \path [excursus arrow, round cap-to] - ($(O)+(5em,0ex)$) -| (M) |- % - ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. % - ++(23em,2ex); - \node [excursus head] at ($(Q)+(2.5em,-0.75pt)$) {Digression};}, - firstextra={% - \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q); - \path [excursus arrow,-to] - (O) |- % - ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. % - ++(23em,2ex); - \node [excursus head] at ($(Q)+(2.5em,-2pt)$) {Digression};}, - secondextra={% - \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q); - \path [excursus arrow,round cap-] - ($(O)+(5em,0ex)$) -| (Q);}, - middleextra={% - \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q); - \path [excursus arrow] - (O) -- (Q);}, - middlelinewidth=2.5em,middlelinecolor=white, - hidealllines=true,topline=true, - innertopmargin=0.5ex, - innerbottommargin=2.5ex, - innerrightmargin=2pt, - innerleftmargin=2ex, - skipabove=0.87\baselineskip, - skipbelow=0.62\baselineskip, -} - -\begin{mdframed}[style=digressionarrows] - \ExampleText -\end{mdframed} \Examplesec{Theorem style shading background} -\begin{LTXexample}[morekeywords={top,bottom,Theorem,shadow,alternativtheorem}] +\begin{tltxmdfexample*}[morekeywords={top,bottom,Theorem,shadow,alternativtheorem}] %\usetikzlibrary{shadings,shadows}% loaded in the header \mdtheorem[% - apptotikzsetting={\tikzset{mdfbackground/.append style =% - {top color=yellow!40!white, - bottom color=yellow!80!black}, - mdfframetitlebackground/.append style =% - {top color=purple!40!white, - bottom color=purple!80!black} - }% - }, + apptotikzsetting={% + \tikzset{mdfbackground/.append style ={% + top color=yellow!40!white, + bottom color=yellow!80!black}, + mdfframetitlebackground/.append style={ + top color=purple!40!white, + bottom color=purple!80!black + } + }% + }, ,roundcorner=10pt,middlelinewidth=2pt, shadow=true,frametitlerule=true,frametitlerulewidth=4pt, innertopmargin=10pt,% @@ -8499,7 +7883,7 @@ Text Text Text Text Text Text \begin{alternativtheorem}[Inhomogeneous linear] \ExampleText \end{alternativtheorem} -\end{LTXexample} +\end{tltxmdfexample*} \end{document} \endinput % \end{macrocode} diff --git a/Master/texmf-dist/source/latex/mdframed/mdframed.ins b/Master/texmf-dist/source/latex/mdframed/mdframed.ins index 9070551d611..3724fdbdeb4 100644 --- a/Master/texmf-dist/source/latex/mdframed/mdframed.ins +++ b/Master/texmf-dist/source/latex/mdframed/mdframed.ins @@ -20,7 +20,7 @@ License type: lppl HEIKO OBERDIEK HERBERT VOSS - Copyright (c) 2010 Marco Daniel + Copyright (c) 2010-2013 Marco Daniel This package may be distributed under the terms of the LaTeX Project Public License, as described in lppl.txt in the base LaTeX distribution. @@ -97,3 +97,4 @@ Have fun! \Msg{* Happy TeXing!} \Msg{*********************************************************} \endbatchfile + diff --git a/Master/texmf-dist/tex/latex/mdframed/ltxmdf.cls b/Master/texmf-dist/tex/latex/mdframed/ltxmdf.cls index d5d59e938fb..cad31bf5c8e 100644 --- a/Master/texmf-dist/tex/latex/mdframed/ltxmdf.cls +++ b/Master/texmf-dist/tex/latex/mdframed/ltxmdf.cls @@ -59,7 +59,7 @@ \RequirePackage{fontspec} \setmonofont[Mapping=tex-text]{DejaVu Sans} } - +\ExplSyntaxOff \RequirePackage[french=quotes]{csquotes} \RequirePackage{xspace} \begingroup @@ -69,14 +69,15 @@ \xspaceaddexceptions{\xspace@check@icr} \RequirePackage{multicol}\columnseprule0.4pt \RequirePackage{scrpage2} -\RequirePackage{listings} \RequirePackage[inline]{enumitem} \RequirePackage{amsmath} +\RequirePackage{listings} \RequirePackage[amsmath]{ntheorem} \RequirePackage{array,booktabs} \RequirePackage{xcolor,tikz} \RequirePackage{graphicx} \RequirePackage[numbered]{hypdoc} +\ExplSyntaxOn %set columns of index \c@IndexColumns = 2 @@ -112,76 +113,6 @@ \providecommand\mdfrevision{1} \ifoot{{\mdfmaindate}\qquad revision:~{\mdfrevision}\qquad{\jobname}} - -%Tikz und Farbe -%tikzlibrary needs special handling -\ExplSyntaxOff -\usetikzlibrary{calc,backgrounds,arrows,matrix} -\ExplSyntaxOn -\colorlet{ltxmdfblue}{blue!30!black} - -\lstset{keywordstyle=\bfseries} -\lstdefinestyle{lstltxmdf}{% - basicstyle=\small\ttfamily, - language={[LaTeX]TeX}, - basicstyle=\small,% - xleftmargin=20pt,% - xrightmargin=20pt,% - frame=none,% - rulecolor=\color{ltxmdfblue},% - framesep=5pt,% - framerule=1.2pt,% - texcsstyle=*\color{red!50!black}\bfseries, - moretexcs=intertext, - keywordstyle=\color{blue!60!black}\bfseries,% - columns=fullflexible,% - fontadjust=true,% - basewidth=0.65em,% - breakatwhitespace=true, - morekeywords=[2]{@length}, - keywordstyle=[2]\color{red!50!black}\bfseries, - morekeywords={outerlinewidth,leftmargin,rightmargin,backgroundcolor, - outerlinecolor,innertopmargin,splittopskip,skipbelow, - skipabove,ntheorem,theorem,lemma,mdframed,linecolor, - frametitle,infobox,innerlinewidth,roundcorner,leftline, - topline,splitbottomskip,middlelinewidth,middlelinecolor, - tikzsetting,rightline,bottomline,innerrightmargin,style, - linewidth,lem,section,definedstyle,mdfapptodefinestyle, - needspace,mdf@globalstyle@cnt,framemethod,ExampleText, - titregris,draw,gray,thick,fill,white,shading,exersicetitle, - exersicebackground,color,green,black,exercise,exercisepoints, - text,rectangle,rounded,corners,right,minimum,height,xshift, - at,exercisestyle,settings,frametitlefont,innerbottommargin, - innerleftmargin,frametitlerule,frametitlebelowskip, - frametitleaboveskip,frametitlebackgroundcolor, - frametitlerulecolor,picins,figure,hidealllines,fontcolor, - firstextra,secondextra,middleextra,singleextra,overlay,node, - pstricksappsetting,apptotikzsetting,frametitlerulewidth, - userdefinedwidth,mdfbackground,append,mdfframetitlebackground, - left,shade,align,exampledefault}, - moretexcs={newmdtheoremenv,newmdenv,theoremstyle,mdfsetup,@length, - md@putbox@single,@tempboxa,mdf@,mdf@linewidth, - mdf@leftmargin@length,interruptlength,setlength,newrobustcmd, - overlaplines,appto,md@frame@leftline@singe,color, - md@frame@leftline@single,mdf@innerbottommargin@length, - mdf@middlelinewidth@length,mdfboundingboxheight, - md@frame@rightline@single,mdfboundingboxwidth, - mdf@innerrightmargin@length,mdfdefinestyle, - mdfapptodefinestyle,defcounter,tikzstyle, - pgfdeclarehorizontalshading,theexercise,mdf@@exercisepoints, - define@key,renewrobustcmd,mdfcreateextratikz,node,ifdefempty, - mdf@frametitlefont,dimexpr,mdframedtitleenv,ifstrempty, - @undefined,mdtheorem,surroundwithmdframed,@captype,@dblarg, - @newcaption,newcaption,mdflength,tikzset,path,p1,p2, - IfFileExists,includegraphics,mdfsubtitle,% - },% -} - - -\lstnewenvironment{tltxmdfexample}[1][] - {\lstset{style=lstltxmdf,#1}}% - {} - %%Maketitle angepasst: \prop_new:N \l_ltxmdf_maketitleinformation_prop \cs_set:Npn \title #1 @@ -258,7 +189,10 @@ \tl_gput_left:Nn \theCodelineNo { \color{gray} } \dim_set:Nn \MacroTopsep { 10pt } \tl_gput_right:Nn \MacroFont { \color{ltxmdfblue} } - +\NewDocumentCommand \MacroFontExpl {} + { + \MacroFont\color{ltxmdfblue}\bfseries + } %Anweisung zur Darstellung @@ -292,7 +226,6 @@ \newline{\small~This~works~only~with~\Opt{framemethod=#1}.} } - \NewDocumentCommand \ExplOpt { o m } { \par @@ -302,7 +235,7 @@ { \skip_horizontal:n { -2em } \@bsphack - \MacroFont #2 + \MacroFontExpl #2 \SpecialOptIndex{#2} \@esphack } @@ -325,7 +258,7 @@ { \skip_horizontal:n { -2em } \@bsphack - \MacroFont #2 + \MacroFontExpl #2 \SpecialEnvIndex{#2} \@esphack } @@ -348,7 +281,7 @@ { \skip_horizontal:n { -2em } \@bsphack - \MacroFont\textbackslash #2 + \MacroFontExpl\textbackslash #2 \SpecialUsageIndex{#2} \@esphack } @@ -371,6 +304,109 @@ \ExplSyntaxOff +%Tikz und Farbe +%tikzlibrary needs special handling + + + +\usetikzlibrary{calc,backgrounds,arrows,matrix} + +\colorlet{ltxmdfblue}{blue!30!black} + + +\lst@RequireAspects{writefile} + +\lstset{keywordstyle=\bfseries} +\lstdefinestyle{lstltxmdf}{% + basicstyle=\small\ttfamily, + language={[LaTeX]TeX}, + basicstyle=\small,% + xleftmargin=20pt,% + xrightmargin=20pt,% + frame=none,% + rulecolor=\color{ltxmdfblue},% + framesep=5pt,% + framerule=1.2pt,% + texcsstyle=*\color{red!50!black}\bfseries, + moretexcs=intertext, + keywordstyle=\color{blue!60!black}\bfseries,% + columns=fullflexible,% + fontadjust=true,% + basewidth=0.65em,% + breakatwhitespace=true, + morekeywords=[2]{@length}, + keywordstyle=[2]\color{red!50!black}\bfseries, + morekeywords={outerlinewidth,leftmargin,rightmargin,backgroundcolor, + outerlinecolor,innertopmargin,splittopskip,skipbelow, + skipabove,ntheorem,theorem,lemma,mdframed,linecolor, + frametitle,infobox,innerlinewidth,roundcorner,leftline, + topline,splitbottomskip,middlelinewidth,middlelinecolor, + tikzsetting,rightline,bottomline,innerrightmargin,style, + linewidth,lem,section,definedstyle,mdfapptodefinestyle, + needspace,mdf@globalstyle@cnt,framemethod,ExampleText, + titregris,draw,gray,thick,fill,white,shading,exersicetitle, + exersicebackground,color,green,black,exercise,exercisepoints, + text,rectangle,rounded,corners,right,minimum,height,xshift, + at,exercisestyle,settings,frametitlefont,innerbottommargin, + innerleftmargin,frametitlerule,frametitlebelowskip, + frametitleaboveskip,frametitlebackgroundcolor, + frametitlerulecolor,picins,figure,hidealllines,fontcolor, + firstextra,secondextra,middleextra,singleextra,overlay,node, + pstricksappsetting,apptotikzsetting,frametitlerulewidth, + userdefinedwidth,mdfbackground,append,mdfframetitlebackground, + left,shade,align,exampledefault}, + moretexcs={newmdtheoremenv,newmdenv,theoremstyle,mdfsetup,@length, + md@putbox@single,@tempboxa,mdf@,mdf@linewidth, + mdf@leftmargin@length,interruptlength,setlength,newrobustcmd, + overlaplines,appto,md@frame@leftline@singe,color, + md@frame@leftline@single,mdf@innerbottommargin@length, + mdf@middlelinewidth@length,mdfboundingboxheight, + md@frame@rightline@single,mdfboundingboxwidth, + mdf@innerrightmargin@length,mdfdefinestyle, + mdfapptodefinestyle,defcounter,tikzstyle, + pgfdeclarehorizontalshading,theexercise,mdf@@exercisepoints, + define@key,renewrobustcmd,mdfcreateextratikz,node,ifdefempty, + mdf@frametitlefont,dimexpr,mdframedtitleenv,ifstrempty, + @undefined,mdtheorem,surroundwithmdframed,@captype,@dblarg, + @newcaption,newcaption,mdflength,tikzset,path,p1,p2, + IfFileExists,includegraphics,mdfsubtitle,lipsum,kant,% + Examplesec,% + },% +} + + +\lstnewenvironment{tltxmdfexample}[1][] + {\lstset{style=lstltxmdf,#1}}% + {} + +\def\mdf@sampleInput#1{% + \MakePercentComment\catcode`\^^M=10\relax% + {\setkeys{lst}{SelectCharTable=\lst@ReplaceInput{\^\^I}% + {\lst@ProcessTabulator}}% + \leavevmode \input{#1}}\MakePercentIgnore} +\def\highlightinputenv{flushleft} +\lstnewenvironment{tltxmdfexample*}[1][]% + {% + \begingroup% + \lstset{style=lstltxmdf,#1}% + \setbox\@tempboxa\hbox\bgroup + \lst@BeginWriteFile{\jobname.tmp}% + }% + { + \lst@EndWriteFile\egroup% + \begin{\highlightinputenv} + \lstinputlisting{\jobname.tmp}% + \end{\highlightinputenv} + \mdf@sampleInput{\jobname.tmp}% + \endgroup% + } + + +\lstnewenvironment{exltxmdfexample}[1][] + {\lstset{style=lstltxmdf,#1}}% + {} + + \lstMakeShortInline[basicstyle=\small\ttfamily\color{blue!60!black}]{|} \def\macro#1{% \MakePrivateLetters @@ -408,7 +444,6 @@ (option)\encapchar usage}% \index{options:\levelchar#1\actualchar{\protect\ttfamily#1}\encapchar usage}\@esphack} -\ExplSyntaxOn @@ -498,6 +533,6 @@ %%%% - -\tex_endinput:D +\endinput +%\tex_endinput:D diff --git a/Master/texmf-dist/tex/latex/mdframed/md-frame-0.mdf b/Master/texmf-dist/tex/latex/mdframed/md-frame-0.mdf index ae92366d67b..1c79a61cf66 100644 --- a/Master/texmf-dist/tex/latex/mdframed/md-frame-0.mdf +++ b/Master/texmf-dist/tex/latex/mdframed/md-frame-0.mdf @@ -1,3 +1,4 @@ + %% Style file for mdframed for package option `framemethod=default` %% %% This package may be distributed under the terms of the LaTeX Project @@ -47,122 +48,27 @@ }% }% -\newrobustcmd\mdfsubtitle[2][]% -{% - \begingroup - \penalty-9995%set a breakpoint before the subtitle - \parindent\z@\relax% - \mdfsetup{#1}%only for subtitle options - \setbox\z@=\vbox{\mdf@subtitlefont{#2}\relax}% - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subtitleinnerbelowskip@length\relax - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% - \ifbool{mdf@subtitleaboveline}{}% - {\mdfsetup{subtitleabovelinewidth=\z@}}% - \ifbool{mdf@subtitlebelowline}{}% - {\mdfsetup{subtitlebelowlinewidth=\z@}}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleaboveskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subtitleabovelinecolor}% - \rule{\dimen@}{\mdf@subtitleabovelinewidth@length}% - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinneraboveskip@length - \leavevmode\rlap% - {% - \smash{% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subtitlebackgroundcolor}% - \rule[\dimexpr-\dp\z@-\mdf@subtitleinnerbelowskip@length\relax] - {\dimen@}{\dimen@i}% - \endgroup% - }% - }% - \box\z@\relax% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinnerbelowskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subtitlebelowlinecolor}% - \rule{\dimen@}{\mdf@subtitlebelowlinewidth@length}% - \color@endgroup - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitlebelowskip@length - \penalty 9995 - \endgroup +\def\mdf@drawsubtitleaboveline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitleabovelinecolor}% + \rule{\mdf@templength}{\mdf@subtitleabovelinewidth@length}% + }% } - -\newrobustcmd\mdfsubsubtitle[2][]% -{% - \begingroup - \penalty-9995%set a breakpoint before the subsubtitle - \parindent\z@\relax% - \mdfsetup{#1}%only for subsubtitle options - \setbox\z@=\vbox{\mdf@subsubtitlefont{#2}\relax}% - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subsubtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subsubtitleinnerbelowskip@length\relax - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% - \ifbool{mdf@subsubtitleaboveline}{}% - {\mdfsetup{subsubtitleabovelinewidth=\z@}}% - \ifbool{mdf@subsubtitlebelowline}{}% - {\mdfsetup{subsubtitlebelowlinewidth=\z@}}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleaboveskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subsubtitleabovelinecolor}% - \rule{\dimen@}{\mdf@subsubtitleabovelinewidth@length}% - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinneraboveskip@length - \leavevmode\rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \smash{% - \begingroup% - \color{\mdf@subsubtitlebackgroundcolor}% - \rule[\dimexpr-\dp\z@-\mdf@subtitleinnerbelowskip@length\relax] - {\dimen@}{\dimen@i}% - \endgroup% - }% - }% - \box\z@\relax% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinnerbelowskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \color{\mdf@subsubtitlebelowlinecolor}% - \rule{\dimen@}{\mdf@subsubtitlebelowlinewidth@length}% - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitlebelowskip@length - \penalty 9995 - \endgroup +\def\mdf@drawsubtitlebelowline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitlebelowlinecolor}% + \rule{\mdf@templength}{\mdf@subtitlebelowlinewidth@length}% + }% +} +\def\mdf@drawsubtitlebackground{% + \rlap{\smash{% + \hspace*{-\mdf@innerleftmargin@length}% + \color{\mdf@subtitlebackgroundcolor}% + \rule[-\mdfsubtitleheight]{\mdf@templength}{\mdfsubtitleheight}% + }}% } - \def\mdf@frame@background@single{% \ifbool{mdf@shadow}% {% @@ -340,6 +246,8 @@ }{}% {\box\mdf@splitbox@one}% }% + \mdf@extra% + \mdf@singleextra \mdf@makeboxalign@right% }% \fi% @@ -551,6 +459,8 @@ }{}% {\box\mdf@splitbox@two}% }% + \mdf@extra% + \mdf@firstextra% \mdf@makeboxalign@right% }% \fi% @@ -745,6 +655,8 @@ }{}% {\box\mdf@splitbox@one}% }% + \mdf@extra% + \mdf@secondextra% \mdf@makeboxalign@right% }% \fi% @@ -940,6 +852,8 @@ }{}% {\box\mdf@splitbox@two}% }% + \mdf@extra% + \mdf@middleextra% \mdf@makeboxalign@right% }% \fi% diff --git a/Master/texmf-dist/tex/latex/mdframed/md-frame-1.mdf b/Master/texmf-dist/tex/latex/mdframed/md-frame-1.mdf index ec948c974a0..db84ca8c611 100644 --- a/Master/texmf-dist/tex/latex/mdframed/md-frame-1.mdf +++ b/Master/texmf-dist/tex/latex/mdframed/md-frame-1.mdf @@ -1,3 +1,4 @@ + %% Style file for mdframed for package option `framemethod=tikz` %% %% This package may be distributed under the terms of the LaTeX Project @@ -46,7 +47,7 @@ shadow yshift=-\mdf@shadowsize@length+2pt, fill=\mdf@shadowcolor, every shadow }}}% - \mdf@tikzset@local + \mdf@tikzset@local% \tikzset{mdfmiddleline/.style={}}% \ifdimgreater{\mdf@middlelinewidth@length}{\z@} {\tikzset{mdfmiddleline/.append style={% @@ -74,50 +75,102 @@ \path[mdfinnerline,mdfcorners]#1;% \end{scope}% \path[mdfmiddleline,mdfcorners]#1;}% -%%\newrobustcmd*\mdf@testdraftmode{% -%% \ifbool{mdf@draft}% -%% {% -%% \renewrobustcmd*\mdf@tikzbox@tfl[1]{%three or four borders -%% \path(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);% -%% \begin{scope}[mdfcorners]% -%% \clip[preaction=mdfouterline]% -%% [postaction=mdfbackground]% -%% [postaction=mdfinnerline]##1;% -%% \end{scope}% -%% \path[mdfmiddleline,mdfcorners]##1; -%% }% -%% \renewrobustcmd*\mdf@tikzbox@otl[2]{%one or two borders -%% \path(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);% -%% \begin{scope} -%% \path[mdfouterline,mdfcorners]##1;% -%% \clip[postaction=mdfbackground]##2;% -%% \path[mdfinnerline,mdfcorners]##1;% -%% \end{scope}% -%% \path[mdfmiddleline,mdfcorners]##1;% -%% }% -%% }{% -%% \ifdimgreater{\overfullrule}{0pt}{% -%% \renewrobustcmd*\mdf@tikzbox@tfl[1]{%three or four borders -%% \path(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);% -%% \begin{scope}[mdfcorners]% -%% \clip[preaction=mdfouterline]% -%% [postaction=mdfbackground]% -%% [postaction=mdfinnerline]##1;% -%% \end{scope}% -%% \path[mdfmiddleline,mdfcorners]##1; -%% }% -%% \renewrobustcmd*\mdf@tikzbox@otl[2]{%one or two borders -%% \path(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);% -%% \begin{scope} -%% \path[mdfouterline,mdfcorners]##1;% -%% \clip[postaction=mdfbackground]##2;% -%% \path[mdfinnerline,mdfcorners]##1;% -%% \end{scope}% -%% \path[mdfmiddleline,mdfcorners]##1;% -%% }% -%% }{}% -%% }% -%%} +\newrobustcmd*\mdf@drawframe@whole{% + \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% + \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% + \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% + \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% + \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% + \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% + {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% + }{}% + \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% + {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% + }{}% + \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% + {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% + }{}% + \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% + {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% + }{}% + \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% + {(O)rectangle(P)}% + }{}% + \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% +} +\newrobustcmd*\mdf@predtikzcalc{% + %%width + \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}% + {innerleftmargin,innerrightmargin}% + \ifbool{mdf@leftline}{% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + \ifbool{mdf@rightline}{% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + %%height + \setlength\mdfboundingboxheight% + {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}% + {innertopmargin,innerbottommargin}% + \ifbool{mdf@topline}{% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + \ifbool{mdf@bottomline}{% + \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% +} + +\newrobustcmd*\mdf@innertikzcalc{% + \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% + \pgfmathsetlengthmacro\mdf@Ay{+\mdf@innerbottommargin@length}% + \pgfmathsetlengthmacro\mdf@Ox{+0pt}% + \pgfmathsetlengthmacro\mdf@Oy{+0pt}% + \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% + \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% + \ifbool{mdf@leftline}% + {% + \pgfmathsetlengthmacro\mdf@Ax% + {\mdf@Ax+\mdf@outerlinewidth@length+% + \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% + \pgfmathsetlengthmacro\mdf@Ox% + {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@rightline}% + {% + \pgfmathsetlengthmacro\mdf@Px% + {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@bottomline}% + {% + \pgfmathsetlengthmacro\mdf@Ay% + {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length% + +\mdf@innerlinewidth@length}% + \pgfmathsetlengthmacro\mdf@Oy% + {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@topline}% + {% + \pgfmathsetlengthmacro\mdf@Py% + {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% + }{}% +} \tikzset{mdfframetitlerule/.style={% draw=none, fill=\mdf@frametitlerulecolor, @@ -151,285 +204,63 @@ }% }% -\tikzset{mdfsubtitleaboverule/.style={% - draw=none, - fill=\mdf@subtitleabovelinecolor, - }% -} -\tikzset{mdfsubtitlebelowrule/.style={% - draw=none, - fill=\mdf@subtitlebelowlinecolor, - }% -} -\tikzset{mdfsubtitlebackground/.style={% - draw=\mdf@subtitlebackgroundcolor, - fill=\mdf@subtitlebackgroundcolor, - }% -} -\newrobustcmd\mdfsubtitle[2][]% -{% - \begingroup - \penalty-9995%set a breakpoint before the subtitle - \parindent\z@\relax% - \mdfsetup{#1}%only for subtitle options - \setbox\z@=\vbox{\mdf@subtitlefont{#2}\relax}% - \pgfmathsetlength{\dimen@}% - {% - \linewidth% - +\mdf@innerleftmargin@length% - +\mdf@innerrightmargin@length% - }% - \ifbool{mdf@subtitleaboveline}{}% - {\mdfsetup{subtitleabovelinewidth=\z@}}% - \ifbool{mdf@subtitlebelowline}{}% - {\mdfsetup{subtitlebelowlinewidth=\z@}}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleaboveskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \tikz\draw[mdfsubtitleaboverule] (0,0)% - rectangle (\dimen@,\mdf@subtitleabovelinewidth@length); - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinneraboveskip@length - \leavevmode\hspace*{-\mdf@innerleftmargin@length}% - \tikz[overlay]% - \draw[mdfsubtitlebackground] - (0,-\mdf@subtitleinnerbelowskip@length-\dp\z@) - rectangle(\dimen@,\ht\z@+\mdf@subtitleinneraboveskip@length);% - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinnerbelowskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \tikz\draw[mdfsubtitlebelowrule] (0,0)% - rectangle (\dimen@,\mdf@subtitlebelowlinewidth@length); - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitlebelowskip@length - \penalty 9995 - \endgroup -} - -\tikzset{mdfsubsubtitleaboverule/.style={% - draw=none, - fill=\mdf@subsubtitleabovelinecolor, - }% -} -\tikzset{mdfsubsubtitlebelowrule/.style={% - draw=none, - fill=\mdf@subsubtitlebelowlinecolor, - }% -} -\tikzset{mdfsubsubtitlebackground/.style={% - draw=\mdf@subsubtitlebackgroundcolor, - fill=\mdf@subsubtitlebackgroundcolor, - }% -} -\newrobustcmd\mdfsubsubtitle[2][]% -{% - \begingroup - \penalty-9995%set a breakpoint before the subsubtitle - \parindent\z@\relax% - \mdfsetup{#1}%only for subsubtitle options - \setbox\z@=\vbox{\mdf@subsubtitlefont{#2}\relax}% - \pgfmathsetlength{\dimen@}% - {% - \linewidth% - +\mdf@innerleftmargin@length% - +\mdf@innerrightmargin@length% - }% - \ifbool{mdf@subsubtitleaboveline}{}% - {\mdfsetup{subsubtitleabovelinewidth=\z@}}% - \ifbool{mdf@subsubtitlebelowline}{}% - {\mdfsetup{subsubtitlebelowlinewidth=\z@}}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleaboveskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \tikz\draw[mdfsubsubtitleaboverule] (0,0)% - rectangle (\dimen@,\mdf@subsubtitleabovelinewidth@length); - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinneraboveskip@length - \hspace*{-\mdf@innerleftmargin@length}% - \tikz[overlay]% - \draw[mdfsubtitlebackground] - (0,-\mdf@subsubtitleinnerbelowskip@length-\dp\z@) - rectangle(\dimen@,\ht\z@+\mdf@subsubtitleinneraboveskip@length);% - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinnerbelowskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \tikz\draw[mdfsubsubtitlebelowrule] (0,0)% - rectangle (\dimen@,\mdf@subsubtitlebelowlinewidth@length); - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitlebelowskip@length - \penalty 9995 - \endgroup -} - \def\mdf@putbox@single{% \ifvoid\mdf@splitbox@one \else% \mdf@makebox@out{% \mdf@makeboxalign@left% \mdf@tikz@settings% - \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}% - \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax% - \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax% - \ifbool{mdf@leftline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@rightline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \setlength\mdfboundingboxheight% - {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% - \advance\mdfboundingboxheight by \mdf@innertopmargin@length\relax% - \advance\mdfboundingboxheight by \mdf@innerbottommargin@length\relax% - \ifbool{mdf@topline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@bottomline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% + \mdf@predtikzcalc% \mdf@makebox@in[\mdfboundingboxwidth]{% \null% \begin{tikzpicture}[remember picture]% - \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% - \pgfmathsetlengthmacro\mdf@Ay{+\mdf@innerbottommargin@length}% - \pgfmathsetlengthmacro\mdf@Ox{+0pt}% - \pgfmathsetlengthmacro\mdf@Oy{+0pt}% - \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% - \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% - \ifbool{mdf@leftline}% - {% - \pgfmathsetlengthmacro\mdf@Ax% - {\mdf@Ax+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@rightline}% - {% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@bottomline}% - {% - \pgfmathsetlengthmacro\mdf@Ay% - {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length% - +\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Oy% - {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@topline}% - {% - \pgfmathsetlengthmacro\mdf@Py% - {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% + \mdf@innertikzcalc \coordinate(O)at(\mdf@Ox,\mdf@Oy);% \coordinate(P)at(\mdf@Px,\mdf@Py);% \ifbool{mdf@shadow} {\path[mdfshadow,mdfcorners](O) rectangle (P);}{}% - \begin{scope} - \begin{scope}[use as bounding box] - \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% - \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% - \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% - \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% - \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% - \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }{}% - \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }{}% - \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% - }{}% - \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% - }{}% - \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% - %Frametitlebackground + \begin{scope} + \begin{scope}[use as bounding box] + \mdf@drawframe@whole \drawbrackgroundframetitle@single - \end{scope} - \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};%output - \end{scope} - %HIER KOMMT EIN WEITERES MAKRO - \mdf@singleextra - \mdfcreateextratikz + \end{scope} + \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one}; + \end{scope} + %HIER KOMMT EIN WEITERES MAKRO + \mdf@extra% + \mdf@singleextra% + \mdfcreateextratikz \end{tikzpicture}% }% \mdf@makeboxalign@right% }% - \fi + \fi% }% + \def\drawbrackgroundframetitle@single{% \ifdefempty{\mdf@frametitle}{}{% \drawbrackgroundframetitle@@single% }% }% \def\drawbrackgroundframetitle@@single{% - \begin{scope}%background frame title - \ifbool{mdf@leftline}{ - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length} - }{}% - \ifbool{mdf@rightline}{% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length} - }{}% - \ifbool{mdf@topline}{% - \pgfmathsetlengthmacro\mdf@Py% - {\mdf@Py-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length} - }{}% - \pgfmathsetlengthmacro\mdf@Fy - {\mdf@Py-\mdfframetitleboxtotalheight} - \path[mdfframetitlebackground] - (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)% - --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy); - \end{scope} + \begin{scope}%background frame title + \ifbool{mdf@leftline}{ + \pgfmathsetlengthmacro\mdf@Ox% + {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@rightline}{% + \pgfmathsetlengthmacro\mdf@Px% + {\mdf@Px-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length}% + }{}% + \ifbool{mdf@topline}{% + \pgfmathsetlengthmacro\mdf@Py% + {\mdf@Py-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length}% + }{}% + \pgfmathsetlengthmacro\mdf@Fy% + {\mdf@Py-\mdfframetitleboxtotalheight}% + \path[mdfframetitlebackground]% + (\mdf@Ox,\mdf@Fy)--(\mdf@Ox,\mdf@Py)--(\mdf@Px,\mdf@Py)--(\mdf@Px,\mdf@Fy); + \end{scope} } \def\drawbrackgroundframetitle@first{% {% @@ -475,7 +306,7 @@ +\mdf@frametitlebelowskip@length +\mdf@splitbottomskip@length %% +\mdf@splittopskip@length - -\dp\strutbox% +%% -\dp\strutbox% }% }% }% @@ -508,156 +339,54 @@ \else% \mdf@makebox@out{% \mdf@makeboxalign@left% + %Special for first frame -- used other savebox + \let\mdf@splitbox@one\mdf@splitbox@two% \mdf@tikz@settings% - \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@two}% - \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax% - \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax% - \ifbool{mdf@leftline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@rightline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \setlength\mdfboundingboxheight% - {\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax}% - \advance\mdfboundingboxheight by \mdf@innertopmargin@length\relax% - \advance\mdfboundingboxheight by \mdf@splitbottomskip@length\relax% - \ifbool{mdf@topline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% -%%%%%%%%% - \ifbool{mdf@everyline}{% + %Special for first frame -- no innerbottommargin but splitbottomskip + \let\mdf@innerbottommargin@length\mdf@splitbottomskip@length + \mdf@predtikzcalc%calc with all lines + %Special for first frame -- no bottom line without everyline true + % if every line false -- test if bottomline is in use and remove the width + \ifbool{mdf@everyline}{}{% \ifbool{mdf@bottomline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - }{}% -%%%%%%%%%%%%%% - %\ifdimequal{\pagegoal}{\maxdimen}{\enlargethispage{\baselineskip}}{}% ??? + \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + }% \ifdimgreater{\pagegoal-\maxdimen}{0pt}{}{\enlargethispage{\baselineskip}}% \mdf@makebox@in[\mdfboundingboxwidth]{% \null% \begin{tikzpicture}[remember picture] - \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% - \pgfmathsetlengthmacro\mdf@Ay{+\mdf@splitbottomskip@length}% - \pgfmathsetlengthmacro\mdf@Ox{+0pt}% - \pgfmathsetlengthmacro\mdf@Oy{+0pt}% - \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% - \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% - \ifbool{mdf@leftline} - {% - \pgfmathsetlengthmacro\mdf@Ax% - {\mdf@Ax+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@rightline}{% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@topline}{% - \pgfmathsetlengthmacro\mdf@Py% - {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% -%% - \ifbool{mdf@everyline}{% - \ifbool{mdf@bottomline}% - {% - \pgfmathsetlengthmacro\mdf@Ay% - {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length% - +\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Oy% - {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - }{}% -%% + \mdf@innertikzcalc + %Special for first frame -- no bottom line without everyline true + \ifbool{mdf@everyline}{}{% + \ifbool{mdf@bottomline}% + {% + \pgfmathsetlengthmacro\mdf@Ay% + {\mdf@Ay-\mdf@outerlinewidth@length-\mdf@middlelinewidth@length% + -\mdf@innerlinewidth@length}% + \pgfmathsetlengthmacro\mdf@Oy% + {\mdf@Oy-\mdf@outerlinewidth@length + -0.5\mdf@middlelinewidth@length}% + }{}% + }% \coordinate(O)at(\mdf@Ox,\mdf@Oy);% \coordinate(P)at(\mdf@Px,\mdf@Py);% \ifbool{mdf@shadow} {\path[mdfshadow] (O) -- (O|-P) to[mdfcorners] (P) -- (P|-O) -- (O);}{}% - \begin{scope} - \begin{scope}[use as bounding box] -%%%%%%%%%%%% - \ifbool{mdf@everyline}{% - \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% - \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% - \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% - \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% - \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% - \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }{}% - \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }{}% - \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% - }{}% - \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% - }{}% - \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% - }{ - \ifboolexpr{test {\mdf@test@ltrb} or test {\mdf@test@ltr}}% - {\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}% - {}% - \ifboolexpr{test {\mdf@test@ltb} or test {\mdf@test@lt}}% - {% - \mdf@tikzbox@otl{(O)--(O|-P)--(P)} - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)} - }% - {}% - \ifboolexpr{test {\mdf@test@trb} or test {\mdf@test@tr}}% - {% - \mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}}% - {}% - \ifboolexpr{test {\mdf@test@lrb} or test {\mdf@test@lr}}% - {\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@tb} or test {\mdf@test@t}}% - {\mdf@tikzbox@otl{(O|-P)--(P)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@lb} or test {\mdf@test@l}}% - {\mdf@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@rb} or test {\mdf@test@r}}% - {\mdf@tikzbox@otl{(O-|P)--(P)}{(O)rectangle(P)}}% - {}% - \mdf@test@b{\path[mdfbackground](O)rectangle(P);}{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners]% - (O)--(O|-P)--(P)--(P|-O);}% - {}% - } -%%%%%%%%%%%% + \begin{scope} + \begin{scope}[use as bounding box] + %Special for first frame + \ifbool{mdf@everyline}{}{% + \mdfsetup{bottomline=false}% + } + \mdf@drawframe@whole \drawbrackgroundframetitle@first \end{scope} - \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% + \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% \end{scope} %HIER KOMMT EIN WEITERES MAKRO - \mdf@firstextra + \mdf@extra% + \mdf@firstextra% \mdfcreateextratikz% \end{tikzpicture}% }% @@ -742,136 +471,62 @@ \def\mdf@putbox@middle{% \ifvoid\mdf@splitbox@two \else% - \mdf@makebox@out{% + \mdf@makebox@out{% \mdf@makeboxalign@left% \mdf@tikz@settings% - \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@two}% - \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax% - \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax% - \ifbool{mdf@leftline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@rightline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \setlength\mdfboundingboxheight% - {\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax}% - \advance\mdfboundingboxheight by \mdf@splitbottomskip@length\relax% -%%%%%%%%% - \ifbool{mdf@everyline}{% - \ifbool{mdf@topline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@bottomline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - }{}% -%%%%%%%%%%%%%% + %Special for middle frame -- used other savebox + \let\mdf@splitbox@one\mdf@splitbox@two% + %Special for middle frame -- no innertopmargin -- done by splittopskip + % in box and no bottommargin instead splitbottomskip + \setlength{\mdf@innertopmargin@length}{\z@}% + \let\mdf@innerbottommargin@length\mdf@splitbottomskip@length + \mdf@predtikzcalc% + %Special for middle frame -- remove topline and bottomline if no everyline + \ifbool{mdf@everyline}{}{% + \ifbool{mdf@topline}{% + \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + \ifbool{mdf@bottomline}{% + \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + }% \mdf@makebox@in[\mdfboundingboxwidth]{% \null% \begin{tikzpicture}[remember picture] - \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% - \pgfmathsetlengthmacro\mdf@Ay{+\mdf@splitbottomskip@length}% - \pgfmathsetlengthmacro\mdf@Ox{+0pt}% - \pgfmathsetlengthmacro\mdf@Oy{+0pt}% - \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% - \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% - \ifbool{mdf@leftline}% - {% - \pgfmathsetlengthmacro\mdf@Ax% - {\mdf@Ax+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@rightline}% - {% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% -%% - \ifbool{mdf@everyline}{% - \ifbool{mdf@bottomline}% - {% - \pgfmathsetlengthmacro\mdf@Ay% - {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length% - +\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Oy% - {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% + \mdf@innertikzcalc% + %Special for middle frame + \ifbool{mdf@everyline}{}{% + \ifbool{mdf@bottomline}% + {% + \pgfmathsetlengthmacro\mdf@Ay% + {\mdf@Ay-\mdf@outerlinewidth@length-\mdf@middlelinewidth@length% + -\mdf@innerlinewidth@length}% + \pgfmathsetlengthmacro\mdf@Oy% + {\mdf@Oy-\mdf@outerlinewidth@length + -0.5\mdf@middlelinewidth@length}% + }{}% \ifbool{mdf@topline}% {% \pgfmathsetlengthmacro\mdf@Py% {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% }{}% - }{}% -%% + }{}% \coordinate(O)at(\mdf@Ox,\mdf@Oy);% \coordinate(P)at(\mdf@Px,\mdf@Py);% - \ifbool{mdf@shadow} - {\path[mdfshadow](O) rectangle (P);}{}% - \begin{scope} - \begin{scope}[use as bounding box] -%%%%%%%%%%%% - \ifbool{mdf@everyline}{% - \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% - \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% - \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% - \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% - \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% - \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }{}% - \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }{}% - \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% - }{}% - \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% - }{}% - \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% - }{ - \ifboolexpr{bool {mdf@leftline} and bool {mdf@rightline}}% - {\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}{}% - \ifboolexpr{bool {mdf@leftline} and not (bool {mdf@rightline})}% - {\mdf@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}{}% - \ifboolexpr{not (bool {mdf@leftline}) and bool {mdf@rightline}}% - {\mdf@tikzbox@otl{(P)--(P|-O)}{(O)rectangle(P)}}{}% - \ifboolexpr{not (bool {mdf@leftline}) and not (bool {mdf@rightline})}% - {\path[mdfbackground](O)rectangle(P);}{}% - } -%%%%%%%% - \drawbrackgroundframetitle@middle - \end{scope} - \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% - \end{scope} - \mdf@middleextra - %HIER KOMMT EIN WEITERES MAKRO - \mdfcreateextratikz + \ifbool{mdf@shadow}{\path[mdfshadow](O) rectangle (P);}{}% + \begin{scope} + \begin{scope}[use as bounding box] + %%Special for middle frame + \ifbool{mdf@everyline}{}{\mdfsetup{topline=false,bottomline=false}}% + \mdf@drawframe@whole + \drawbrackgroundframetitle@middle + \end{scope} + \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% + \end{scope} + \mdf@extra% + \mdf@middleextra% + %HIER KOMMT EIN WEITERES MAKRO + \mdfcreateextratikz \end{tikzpicture}% }% \mdf@makeboxalign@right% @@ -919,16 +574,16 @@ }% \def\drawbrackgroundframetitle@@second{% \begin{scope}%background frame title - \ifbool{mdf@leftline}{ + \ifbool{mdf@leftline}{% \pgfmathsetlengthmacro\mdf@Ox% {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length} }{}% \ifbool{mdf@rightline}{% \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length} + {\mdf@Px-\mdf@innerlinewidth@length-0.5\mdf@middlelinewidth@length}% }{}% \pgfmathsetlengthmacro\mdf@Fy - {\mdf@Py-\mdfframetitleboxtotalheight} + {\mdf@Py-\mdfframetitleboxtotalheight}% \path[mdfframetitlebackground,rounded corners=\z@] (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)% --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy); @@ -937,165 +592,112 @@ \def\mdf@putbox@second{% \ifvoid\mdf@splitbox@one \else% - \mdf@makebox@out{% + \mdf@makebox@out{% \mdf@makeboxalign@left% \mdf@tikz@settings% - \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}% - \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax% - \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax% - \ifbool{mdf@leftline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \ifbool{mdf@rightline}{% - \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}% - \setlength\mdfboundingboxheight% - {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}% - \advance\mdfboundingboxheight by \mdf@innerbottommargin@length\relax% - \ifbool{mdf@bottomline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% -%%%%%%%%% - \ifbool{mdf@everyline}{% + %Special for middle frame -- no innertopmargin -- done by splittopskip + \setlength{\mdf@innertopmargin@length}{\z@}% + \mdf@predtikzcalc% + %Special for second frame -- no top line without everyline true + \ifbool{mdf@everyline}{}{% \ifbool{mdf@topline}{% - \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax% - \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}% - }{}% -%%%%%%%%%%%%%% + \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}% + {innerlinewidth,middlelinewidth,outerlinewidth}}{}% + }% \mdf@makebox@in[\mdfboundingboxwidth]{% \null% \begin{tikzpicture}[remember picture] - \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}% - \pgfmathsetlengthmacro\mdf@Ay{+\mdf@innerbottommargin@length}% - \pgfmathsetlengthmacro\mdf@Ox{+0pt}% - \pgfmathsetlengthmacro\mdf@Oy{+0pt}% - \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}% - \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}% - \ifbool{mdf@leftline}% - {% - \pgfmathsetlengthmacro\mdf@Ax% - {\mdf@Ax+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Ox% - {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@rightline}% - {% - \pgfmathsetlengthmacro\mdf@Px% - {\mdf@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% - }{}% - \ifbool{mdf@bottomline}% - {% - \pgfmathsetlengthmacro\mdf@Ay% - {\mdf@Ay+\mdf@outerlinewidth@length+% - \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}% - \pgfmathsetlengthmacro\mdf@Oy% - {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% - }{}% -%% - \ifbool{mdf@everyline}{% - \ifbool{mdf@topline}% + \mdf@innertikzcalc + %Special for second frame + \ifbool{mdf@everyline}{}{% + \ifbool{mdf@topline}% {% \pgfmathsetlengthmacro\mdf@Py% - {\mdf@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}% + {\mdf@Py+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}% }{}% - }{}% -%% + }% \coordinate(O)at(\mdf@Ox,\mdf@Oy);% \coordinate(P)at(\mdf@Px,\mdf@Py);% \ifbool{mdf@shadow} {% - \path[mdfshadow] (O|-P) to[mdfcorners] (O) - to[mdfcorners] (P|-O) -- (P) -- (O|-P);% + \path[mdfshadow] (O|-P) to[mdfcorners] (O) to[mdfcorners] (P|-O) + -- (P) -- (O|-P);% }{}% - \begin{scope} - \begin{scope}[use as bounding box] -%%%%%%%%%%%% - \ifbool{mdf@everyline}{% - \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}% - \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}% - \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}% - \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}% - \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}% - \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }{}% - \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }{}% - \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}% - {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}% - }{}% - \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}% - {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}% - }{}% - \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}% - {(O)rectangle(P)}% - }{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}% - }{% - \ifboolexpr{test {\mdf@test@ltrb} or test {\mdf@test@lrb}}% - {\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}% - {}% - \ifboolexpr{test {\mdf@test@ltb} or test {\mdf@test@lb}}% - {% - \mdf@tikzbox@otl{(P-|O)--(O)--(O-|P)}% - {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}% - }% - {}% - \ifboolexpr{test {\mdf@test@trb} or test {\mdf@test@rb}}% - {% - \mdf@tikzbox@otl{(P)--(P|-O)--(O)}% - {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}% - }% - {}% - \ifboolexpr{test {\mdf@test@ltr} or test {\mdf@test@lr}}% - {\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@tb} or test {\mdf@test@b}}% - {\mdf@tikzbox@otl{(O)--(O-|P)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@lt} or test {\mdf@test@l}}% - {\mdf@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}% - {}% - \ifboolexpr{test {\mdf@test@tr} or test {\mdf@test@r}}% - {\mdf@tikzbox@otl{(O-|P)--(P)}{(O)rectangle(P)}}% - {}% - \mdf@test@t{\path[mdfbackground,mdfcorners](O|-P)--(O)--(O-|P)--(P);}{}% - \mdf@test@noline{\path[mdfbackground,mdfcorners]% - (O|-P)--(O)--(O-|P)--(P);}% - {}% - }% - \drawbrackgroundframetitle@second - \end{scope} - \node[mdfbox] at (\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};% - \end{scope} - \mdf@secondextra - %HIER KOMMT EIN WEITERES MAKRO - \mdfcreateextratikz + \begin{scope} + \begin{scope}[use as bounding box] + \ifbool{mdf@everyline}{}{\mdfsetup{topline=false}}% + \mdf@drawframe@whole + \drawbrackgroundframetitle@second + \end{scope} + \node[mdfbox] (mdfframe) at (\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};% + \end{scope} + \mdf@extra% + \mdf@secondextra% + %HIER KOMMT EIN WEITERES MAKRO + \mdfcreateextratikz \end{tikzpicture}% }% \mdf@makeboxalign@right% }% - \fi + \fi% }% + +\tikzset{mdfsubtitleaboverule/.style={% + draw=none, + fill=\mdf@subtitleabovelinecolor, + }% +} + +\tikzset{mdfsubtitlebelowrule/.style={% + draw=none, + fill=\mdf@subtitlebelowlinecolor, + }% +} + +\tikzset{mdfsubtitlebackground/.style={% + draw=\mdf@subtitlebackgroundcolor, + fill=\mdf@subtitlebackgroundcolor, + }% +} + +\tikzset{mdfsubsubtitleaboverule/.style={% + draw=none, + fill=\mdf@subsubtitleabovelinecolor, + }% +} + +\tikzset{mdfsubsubtitlebelowrule/.style={% + draw=none, + fill=\mdf@subsubtitlebelowlinecolor, + }% +} + +\tikzset{mdfsubsubtitlebackground/.style={% + draw=none, + fill=\mdf@subsubtitlebackgroundcolor, + }% +} + +\def\mdf@drawsubtitleaboveline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \tikz\draw[mdfsubsubtitleaboverule](0,0) rectangle + (\mdf@templength,\mdf@subtitleabovelinewidth@length);% + }% +} +\def\mdf@drawsubtitlebelowline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \tikz\draw[mdfsubsubtitleaboverule](0,0) rectangle + (\mdf@templength,\mdf@subtitlebelowlinewidth@length);% + }% +} +\def\mdf@drawsubtitlebackground{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \tikz\draw[overlay,mdfsubtitlebackground](0,0) rectangle + (\mdf@templength,-\mdfsubtitleheight);% + }% +} + \endinput diff --git a/Master/texmf-dist/tex/latex/mdframed/md-frame-2.mdf b/Master/texmf-dist/tex/latex/mdframed/md-frame-2.mdf index 52eb36485a6..86e4d4c1145 100644 --- a/Master/texmf-dist/tex/latex/mdframed/md-frame-2.mdf +++ b/Master/texmf-dist/tex/latex/mdframed/md-frame-2.mdf @@ -1,3 +1,4 @@ + %% Style file for mdframed for package option `framemethod=pstricks` %% %% This package may be distributed under the terms of the LaTeX Project @@ -158,168 +159,69 @@ \par\unskip\vskip\mdf@innertopmargin@length% }% }% +\def\mdf@drawsubtitleaboveline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length) + \psframe[style=mdfsubtitleaboverule]% + (0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)% + \end{psicture}% + }% +} +\def\mdf@drawsubtitlebelowline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(\mdf@templength,\mdf@subtitlebelowlinewidth@length) + \psframe[style=mdfsubtitlebelowrule]% + (0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)% + \end{psicture}% + }% +} +\def\mdf@drawsubtitlebackground{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(0,0) + \psframe[style=mdfsubtitlebackground]% + (0,0)(\mdf@templength,-\mdfsubtitleheight)% + \end{psicture}% + }% +} + \newpsstyle{mdfsubtitleaboverule}{% linecolor=\mdf@subtitleabovelinecolor, fillcolor=\mdf@subtitleabovelinecolor, fillstyle=solid,dimen=outer,% } + \newpsstyle{mdfsubtitlebelowrule}{% linecolor=\mdf@subtitlebelowlinecolor, fillcolor=\mdf@subtitlebelowlinecolor, fillstyle=solid,dimen=outer,% } + \newpsstyle{mdfsubtitlebackground}{% linecolor=\mdf@subtitlebackgroundcolor, fillcolor=\mdf@subtitlebackgroundcolor, fillstyle=solid,linestyle=none, } -\newrobustcmd\mdfsubtitle[2][]% -{% - \begingroup - \penalty-9995%set a breakpoint before the subtitle - \parindent\z@\relax% - \mdfsetup{#1}%only for subtitle options - \setbox\z@=\vbox{\mdf@subtitlefont{#2}\relax}% - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subtitleinnerbelowskip@length\relax% - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% - \ifbool{mdf@subtitleaboveline}{}% - {\mdfsetup{subtitleabovelinewidth=\z@}}% - \ifbool{mdf@subtitlebelowline}{}% - {\mdfsetup{subtitlebelowlinewidth=\z@}}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleaboveskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subtitleabovelinewidth@length) - \ifbool{mdf@subtitleaboveline}% - {% - \psframe[style=mdfsubtitleaboverule]% - (0,0)(\dimen@,\mdf@subtitleabovelinewidth@length)% - }{} - \end{pspicture} - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinneraboveskip@length - \hspace*{-\mdf@innerleftmargin@length}% - \begin{pspicture}% - (0,0)% - (0,\ht\z@) - \psframe[style=mdfsubtitlebackground]% - (0,\dimexpr-\dp\z@-\mdf@subtitleinnerbelowskip@length\relax)% - (\dimen@,\dimen@i) - \end{pspicture} - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinnerbelowskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subtitlebelowlinewidth@length) - \ifbool{mdf@subtitlebelowline}% - {% - \psframe[style=mdfsubtitlebelowrule]% - (0,0)(\dimen@,\mdf@subtitlebelowlinewidth@length)% - }{}% - \end{pspicture} - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitlebelowskip@length - \penalty 9995 - \endgroup -} \newpsstyle{mdfsubsubtitleaboverule}{% linecolor=\mdf@subtitleabovelinecolor, fillcolor=\mdf@subtitleabovelinecolor, fillstyle=solid,dimen=outer,% } + \newpsstyle{mdfsubsubtitlebelowrule}{% linecolor=\mdf@subtitlebelowlinecolor, fillcolor=\mdf@subtitlebelowlinecolor, fillstyle=solid,dimen=outer,% } + \newpsstyle{mdfsubsubtitlebackground}{% linecolor=\mdf@subtitlebackgroundcolor, fillcolor=\mdf@subtitlebackgroundcolor, fillstyle=solid,linestyle=none, } -\newrobustcmd\mdfsubsubtitle[2][]% -{% - \begingroup - \penalty-9995%set a breakpoint before the subsubtitle - \parindent\z@\relax% - \mdfsetup{#1}%only for subsubtitle options - \setbox\z@=\vbox{\mdf@subsubtitlefont{#2}\relax}% - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subsubtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subsubtitleinnerbelowskip@length\relax% - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% - \ifbool{mdf@subsubtitleaboveline}{}% - {\mdfsetup{subsubtitleabovelinewidth=\z@}}% - \ifbool{mdf@subsubtitlebelowline}{}% - {\mdfsetup{subsubtitlebelowlinewidth=\z@}}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleaboveskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subsubtitleabovelinewidth@length) - \ifbool{mdf@subsubtitleaboveline}% - {% - \psframe[style=mdfsubsubtitleaboverule]% - (0,0)(\dimen@,\mdf@subsubtitleabovelinewidth@length)% - }{} - \end{pspicture} - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinneraboveskip@length - \hspace*{-\mdf@innerleftmargin@length}% - \begin{pspicture}(0,-\dp\z@)(0,\dimen@i - \begin{pspicture}% - (0,0)% - (0,\ht\z@) - \psframe[style=mdfsubsubtitlebackground]% - (0,\dimexpr-\dp\z@-\mdf@subsubtitleinnerbelowskip@length\relax)% - (\dimen@,\dimen@i) - \end{pspicture} - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinnerbelowskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subsubtitlebelowlinewidth@length) - \ifbool{mdf@subsubtitlebelowline}% - {% - \psframe[style=mdfsubsubtitlebelowrule]% - (0,0)(\dimen@,\mdf@subsubtitlebelowlinewidth@length)% - }{}% - \end{pspicture} - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitlebelowskip@length - \penalty 9995 - \endgroup -} \def\mdf@putbox@single{% \ifvoid\mdf@splitbox@one\relax @@ -431,6 +333,7 @@ \drawbrackgroundframetitle@single %output% \rput[bl](mdf@A){\box\mdf@splitbox@one} + \mdf@extra% \mdf@singleextra \end{pspicture}% }% @@ -616,7 +519,8 @@ \drawbrackgroundframetitle@first %output% \rput[bl](mdf@A){\box\mdf@splitbox@two} - \mdf@firstextra + \mdf@extra% + \mdf@firstextra% \end{pspicture} }% \mdf@makeboxalign@right% @@ -824,7 +728,8 @@ %\psdot(mdf@A)\uput[90](mdf@A){mdf at A} %\psdot(mdf@P)\uput[90](mdf@P){mdf at P} %\psdot(mdf@O)\uput[90](mdf@O){mdf at O} - \mdf@middleextra + \mdf@extra% + \mdf@middleextra% \end{pspicture}% }% \mdf@makeboxalign@right% @@ -1033,6 +938,7 @@ \drawbrackgroundframetitle@second %output% \rput[bl](mdf@A){\box\mdf@splitbox@one} + \mdf@extra% \mdf@secondextra \end{pspicture}% }% diff --git a/Master/texmf-dist/tex/latex/mdframed/md-frame-3.mdf b/Master/texmf-dist/tex/latex/mdframed/md-frame-3.mdf index 52eb36485a6..86e4d4c1145 100644 --- a/Master/texmf-dist/tex/latex/mdframed/md-frame-3.mdf +++ b/Master/texmf-dist/tex/latex/mdframed/md-frame-3.mdf @@ -1,3 +1,4 @@ + %% Style file for mdframed for package option `framemethod=pstricks` %% %% This package may be distributed under the terms of the LaTeX Project @@ -158,168 +159,69 @@ \par\unskip\vskip\mdf@innertopmargin@length% }% }% +\def\mdf@drawsubtitleaboveline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length) + \psframe[style=mdfsubtitleaboverule]% + (0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)% + \end{psicture}% + }% +} +\def\mdf@drawsubtitlebelowline{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(\mdf@templength,\mdf@subtitlebelowlinewidth@length) + \psframe[style=mdfsubtitlebelowrule]% + (0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)% + \end{psicture}% + }% +} +\def\mdf@drawsubtitlebackground{% + \rlap{% + \hspace*{-\mdf@innerleftmargin@length}% + \begin{pspicture}(0,0)(0,0) + \psframe[style=mdfsubtitlebackground]% + (0,0)(\mdf@templength,-\mdfsubtitleheight)% + \end{psicture}% + }% +} + \newpsstyle{mdfsubtitleaboverule}{% linecolor=\mdf@subtitleabovelinecolor, fillcolor=\mdf@subtitleabovelinecolor, fillstyle=solid,dimen=outer,% } + \newpsstyle{mdfsubtitlebelowrule}{% linecolor=\mdf@subtitlebelowlinecolor, fillcolor=\mdf@subtitlebelowlinecolor, fillstyle=solid,dimen=outer,% } + \newpsstyle{mdfsubtitlebackground}{% linecolor=\mdf@subtitlebackgroundcolor, fillcolor=\mdf@subtitlebackgroundcolor, fillstyle=solid,linestyle=none, } -\newrobustcmd\mdfsubtitle[2][]% -{% - \begingroup - \penalty-9995%set a breakpoint before the subtitle - \parindent\z@\relax% - \mdfsetup{#1}%only for subtitle options - \setbox\z@=\vbox{\mdf@subtitlefont{#2}\relax}% - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subtitleinnerbelowskip@length\relax% - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% - \ifbool{mdf@subtitleaboveline}{}% - {\mdfsetup{subtitleabovelinewidth=\z@}}% - \ifbool{mdf@subtitlebelowline}{}% - {\mdfsetup{subtitlebelowlinewidth=\z@}}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleaboveskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subtitleabovelinewidth@length) - \ifbool{mdf@subtitleaboveline}% - {% - \psframe[style=mdfsubtitleaboverule]% - (0,0)(\dimen@,\mdf@subtitleabovelinewidth@length)% - }{} - \end{pspicture} - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinneraboveskip@length - \hspace*{-\mdf@innerleftmargin@length}% - \begin{pspicture}% - (0,0)% - (0,\ht\z@) - \psframe[style=mdfsubtitlebackground]% - (0,\dimexpr-\dp\z@-\mdf@subtitleinnerbelowskip@length\relax)% - (\dimen@,\dimen@i) - \end{pspicture} - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitleinnerbelowskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subtitlebelowlinewidth@length) - \ifbool{mdf@subtitlebelowline}% - {% - \psframe[style=mdfsubtitlebelowrule]% - (0,0)(\dimen@,\mdf@subtitlebelowlinewidth@length)% - }{}% - \end{pspicture} - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subtitlebelowskip@length - \penalty 9995 - \endgroup -} \newpsstyle{mdfsubsubtitleaboverule}{% linecolor=\mdf@subtitleabovelinecolor, fillcolor=\mdf@subtitleabovelinecolor, fillstyle=solid,dimen=outer,% } + \newpsstyle{mdfsubsubtitlebelowrule}{% linecolor=\mdf@subtitlebelowlinecolor, fillcolor=\mdf@subtitlebelowlinecolor, fillstyle=solid,dimen=outer,% } + \newpsstyle{mdfsubsubtitlebackground}{% linecolor=\mdf@subtitlebackgroundcolor, fillcolor=\mdf@subtitlebackgroundcolor, fillstyle=solid,linestyle=none, } -\newrobustcmd\mdfsubsubtitle[2][]% -{% - \begingroup - \penalty-9995%set a breakpoint before the subsubtitle - \parindent\z@\relax% - \mdfsetup{#1}%only for subsubtitle options - \setbox\z@=\vbox{\mdf@subsubtitlefont{#2}\relax}% - \dimen@=\linewidth\relax% - \advance\dimen@ by \mdf@innerleftmargin@length\relax% - \advance\dimen@ by \mdf@innerrightmargin@length\relax% - \dimen@i=\mdf@subsubtitleinneraboveskip@length\relax% - \advance\dimen@i by \mdf@subsubtitleinnerbelowskip@length\relax% - \advance\dimen@i by \ht\z@\relax% - \advance\dimen@i by \dp\z@\relax% - \ifbool{mdf@subsubtitleaboveline}{}% - {\mdfsetup{subsubtitleabovelinewidth=\z@}}% - \ifbool{mdf@subsubtitlebelowline}{}% - {\mdfsetup{subsubtitlebelowlinewidth=\z@}}% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleaboveskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subsubtitleabovelinewidth@length) - \ifbool{mdf@subsubtitleaboveline}% - {% - \psframe[style=mdfsubsubtitleaboverule]% - (0,0)(\dimen@,\mdf@subsubtitleabovelinewidth@length)% - }{} - \end{pspicture} - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinneraboveskip@length - \hspace*{-\mdf@innerleftmargin@length}% - \begin{pspicture}(0,-\dp\z@)(0,\dimen@i - \begin{pspicture}% - (0,0)% - (0,\ht\z@) - \psframe[style=mdfsubsubtitlebackground]% - (0,\dimexpr-\dp\z@-\mdf@subsubtitleinnerbelowskip@length\relax)% - (\dimen@,\dimen@i) - \end{pspicture} - \hspace*{+\mdf@innerleftmargin@length}% - \box\z@\relax% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitleinnerbelowskip@length - \rlap% - {% - \hspace*{-\mdf@innerleftmargin@length}% - \begingroup% - \begin{pspicture}(0,0)(\dimen@,\mdf@subsubtitlebelowlinewidth@length) - \ifbool{mdf@subsubtitlebelowline}% - {% - \psframe[style=mdfsubsubtitlebelowrule]% - (0,0)(\dimen@,\mdf@subsubtitlebelowlinewidth@length)% - }{}% - \end{pspicture} - \endgroup% - }% - \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% - \vskip\mdf@subsubtitlebelowskip@length - \penalty 9995 - \endgroup -} \def\mdf@putbox@single{% \ifvoid\mdf@splitbox@one\relax @@ -431,6 +333,7 @@ \drawbrackgroundframetitle@single %output% \rput[bl](mdf@A){\box\mdf@splitbox@one} + \mdf@extra% \mdf@singleextra \end{pspicture}% }% @@ -616,7 +519,8 @@ \drawbrackgroundframetitle@first %output% \rput[bl](mdf@A){\box\mdf@splitbox@two} - \mdf@firstextra + \mdf@extra% + \mdf@firstextra% \end{pspicture} }% \mdf@makeboxalign@right% @@ -824,7 +728,8 @@ %\psdot(mdf@A)\uput[90](mdf@A){mdf at A} %\psdot(mdf@P)\uput[90](mdf@P){mdf at P} %\psdot(mdf@O)\uput[90](mdf@O){mdf at O} - \mdf@middleextra + \mdf@extra% + \mdf@middleextra% \end{pspicture}% }% \mdf@makeboxalign@right% @@ -1033,6 +938,7 @@ \drawbrackgroundframetitle@second %output% \rput[bl](mdf@A){\box\mdf@splitbox@one} + \mdf@extra% \mdf@secondextra \end{pspicture}% }% diff --git a/Master/texmf-dist/tex/latex/mdframed/mdframed.sty b/Master/texmf-dist/tex/latex/mdframed/mdframed.sty index 36295b6ca84..112c389e61c 100644 --- a/Master/texmf-dist/tex/latex/mdframed/mdframed.sty +++ b/Master/texmf-dist/tex/latex/mdframed/mdframed.sty @@ -23,7 +23,7 @@ %% HEIKO OBERDIEK %% HERBERT VOSS %% -%% Copyright (c) 2010 Marco Daniel +%% Copyright (c) 2010-2013 Marco Daniel %% %% This package may be distributed under the terms of the LaTeX Project %% Public License, as described in lppl.txt in the base LaTeX distribution. @@ -48,14 +48,14 @@ %% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> %% ================================================== %% -\def\mdversion{1.8} + +\def\mdversion{1.9a} \def\mdframedpackagename{mdframed} -\def\mdfmaindate{2013/03/09} -\def\mdfrevision{ 172}% Done by github: git rev-list HEAD | wc -l +\def\mdfmaindate{2013/06/21} +\def\mdfrevision{ 208}% Done by github: git rev-list HEAD | wc -l \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mdframed}% - [\mdfmaindate\ % - \mdversion: \mdframedpackagename] + [\mdfmaindate\space \mdversion: \mdframedpackagename] \newcommand*\mdf@PackageError[1]{\PackageError{\mdframedpackagename}{#1}} \newcommand*\mdf@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}} \newcommand*\mdf@PackageInfo[1]{\PackageInfo{\mdframedpackagename}{#1}} @@ -67,7 +67,7 @@ but needed by \mdframedpackagename\MessageBreak see documentation fo further information }% - } + }% } \RequirePackage{kvoptions} \RequirePackage{xparse} @@ -75,7 +75,7 @@ \RequirePackage{zref-abspage} \RequirePackage{color} \SetupKeyvalOptions{family=mdf,prefix=mdf@} - +\def\mdf@definestyle@defaultoptions{}% \newlength{\mdf@templength} \def\mdf@iflength#1{% \afterassignment\mdf@iflength@check% @@ -93,10 +93,20 @@ } \def\mdf@iflength@cleanup#1\relax{} \DeclareListParser*{\mdf@dolist}{,} +\def\mdf@do@lengthoption#1{% + \mdf@lengthoption@doubledo#1\@nil% +} +\def\mdf@lengthoption@doubledo#1==#2\@nil{% + \mdf@option@length{#1}{#2}% + \mdf@define@key@length{#1}% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% +} + \newrobustcmd*{\mdf@option@length}[2]{% \expandafter\newlength\csname mdf@#1@length\endcsname% \expandafter\setlength\csname mdf@#1@length\endcsname{#2}% } + \newrobustcmd*{\mdf@define@key@length}[1]{% \define@key{mdf}{#1}{% \def\@tempa{##1} @@ -106,13 +116,7 @@ \setlength{\csname mdf@#1@length\endcsname}{\csname mdfl@#1\endcsname}% }% } -\def\mdf@do@lengthoption#1{% - \mdf@lengthoption@doubledo#1\@nil% -} -\def\mdf@lengthoption@doubledo#1==#2\@nil{% - \mdf@option@length{#1}{#2}% - \mdf@define@key@length{#1}% -} + \def\mdf@do@stringoption#1{% \mdf@stringoption@doubledo#1\@nil% } @@ -121,6 +125,7 @@ \define@key{mdf}{#1}{% \csdef{mdf@#1}{##1}% }% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% } \def\mdf@do@booloption#1{% \mdf@booloption@doubledo#1\@nil% @@ -130,32 +135,17 @@ \define@key{mdf}{#1}[#2]{% \setbool{mdf@#1}{##1}% }% -} -\def\mdf@do@alignoption#1{% - \mdf@alignoption@tripledo#1\@nil% -} -\def\mdf@alignoption@tripledo#1==#2==#3\@nil{% - \csdef{mdf@align@#1@left}{\null\hspace*{#2}}% - \csdef{mdf@align@#1@right}{\hspace*{#3}\null}% + \gappto\mdf@definestyle@defaultoptions{#1=#2,}% } \newcounter{mdf@globalstyle@cnt} -\defcounter{mdf@globalstyle@cnt}{0} -\newcommand*\mdfglobal@style{0} +\defcounter{mdf@globalstyle@cnt}{-99} + \define@key{mdf}{style}{% \mdf@PackageWarning{package option style is depreciated^^J + at this point and will be ignored^^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{}% @@ -168,29 +158,47 @@ \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}}% + {\def\mdf@@framemethod{tikz}% + \defcounter{mdf@globalstyle@cnt}{1}\mdf@LoadFile@IfExist{tikz}}% {\xifinlist{\mdf@tempa}{\mdf@framemethod@iii}% - {\def\mdf@@framemethod{pstricks}\defcounter{mdf@globalstyle@cnt}{2}}% + {\def\mdf@@framemethod{pstricks}% + \defcounter{mdf@globalstyle@cnt}{2}\mdf@LoadFile@IfExist{pst-node}}% {\mdf@LoadFile@IfExist{#1}}% }% }% \ifcase\value{mdf@globalstyle@cnt}\relax% - \or\mdf@LoadFile@IfExist{tikz}%=1 - \or\mdf@LoadFile@IfExist{pst-node}%=2 - \or\mdf@LoadFile@IfExist{pst-node}%=3 + \input{md-frame-0.mdf}% + \or\input{md-frame-1.mdf}% + \or\input{md-frame-2.mdf}% + \or\input{md-frame-3.mdf}% + \else% + \IfFileExists{md-frame-\value{mdf@globalstyle@cnt}.mdf}% + {\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}% + }% \fi% } +\DeclareVoidOption{tikz}{\setkeys{mdf}{framemethod=tikz}} +\DeclareVoidOption{TikZ}{\setkeys{mdf}{framemethod=tikz}} +\DeclareVoidOption{ps}{\setkeys{mdf}{framemethod=pstricks}} +\DeclareVoidOption{pstricks}{\setkeys{mdf}{framemethod=pstricks}} +\DeclareVoidOption{PSTricks}{\setkeys{mdf}{framemethod=pstricks}} + \mdf@dolist{\mdf@do@lengthoption}{% - {skipabove==\z@},% - {skipbelow==\z@},% + {skipabove==\topsep},% + {skipbelow==\topsep},% {leftmargin==\z@},% {rightmargin==\z@},% {innerleftmargin==10pt},% {innerrightmargin==10pt},% {innertopmargin==0.4\baselineskip},% {innerbottommargin==0.4\baselineskip},% - {splittopskip==\z@},% - {splitbottomskip==\z@},% + {splittopskip==10pt},% + {splitbottomskip==10pt},% {outermargin==\z@},% {innermargin==\z@},% {linewidth==0.4pt},% @@ -222,6 +230,9 @@ } \mdf@dolist{\mdf@do@stringoption}{% {frametitle=={}},% + {firstframetitle=={}},% + {framefoot=={}},% + {lastframefoot=={}},% {defaultunit==pt},% {linecolor==black},% {backgroundcolor==white},% @@ -245,10 +256,21 @@ {theoremcountersep=={.}},% {theoremtitlefont=={}},% {theoremspace=={\space}},% - {singleextra=={}}, - {firstextra=={}}, - {middleextra=={}}, - {secondextra=={}}, + {extra=={}},% + {singleextra=={}},% + {firstextra=={}},% + {middleextra=={}},% + {secondextra=={}},% + {beforesingleframe=={}},% + {aftersingleframe=={}},% + {beforebreak=={}},% + {afterbreak=={}},% + {beforelastframe=={}},% + {afterlastframe=={}},% + {startcode=={}},% + {startinnercode=={}},% + {endinnercode=={}},% + {endcode=={}},% {subtitlefont==\normalfont\bfseries},% {subsubtitlefont==\normalfont},% {subtitlebackgroundcolor==white},% @@ -290,7 +312,18 @@ \ifbool{mdf@hidealllines}{% \kvsetkeys{mdf}{leftline=false,topline=false,% rightline=false,bottomline=false}% - }{}% + }{% + \kvsetkeys{mdf}{leftline=true,topline=true,% + rightline=true,bottomline=true}% + }% +} +\appto\mdf@definestyle@defaultoptions{hidealllines=false,}% +\def\mdf@do@alignoption#1{% + \mdf@alignoption@tripledo#1\@nil% +} +\def\mdf@alignoption@tripledo#1==#2==#3\@nil{% + \csdef{mdf@align@#1@left}{\null\hspace*{#2}}% + \csdef{mdf@align@#1@right}{\hspace*{#3}\null}% } \mdf@dolist{\mdf@do@alignoption}{% {left==\mdf@leftmargin@length==\z@},% @@ -353,6 +386,9 @@ \DeclareDefaultOption{% \mdf@PackageError{Unknown Option '\CurrentOption' for mdframed}} \ProcessKeyvalOptions*\relax +\ifnum\c@mdf@globalstyle@cnt<0 + \kvsetkeys{mdf}{framemethod=default,} +\fi \newrobustcmd*{\mdfsetup}{\kvsetkeys{mdf}} \define@key{mdf}{style}{% \ifcsundef{mdf@definestyle@#1}{% @@ -364,6 +400,22 @@ {\expandafter\expandafter\expandafter\mdfsetup\expandafter% \expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}% }% +\DeclareVoidOption{default}{% + \expandafter\expandafter\expandafter\mdfsetup\expandafter% + \expandafter\expandafter{\csname mdf@definestyle@defaultoptions\endcsname}% +}% + +\ifnum\c@mdf@globalstyle@cnt>0 + \define@key{mdf}{linewidth}{% + \def\@tempa{#1} + \mdf@iflength{\@tempa}% + {\csxdef{mdfl@linewidth}{\the\mdf@templength}}% + {\csxdef{mdfl@linewidth}{\the\mdf@templength}}% + \setlength{\csname mdf@middlelinewidth@length\endcsname}% + {\csname mdfl@linewidth\endcsname}% + }% +\fi + \let\mdf@PackageNoInfo\@gobble \newrobustcmd*\mdf@ifstrequal@expand{% \expandafter\ifstrequal\expandafter{\mdf@printheight}% @@ -389,6 +441,7 @@ \newsavebox\mdf@splitbox@one \newsavebox\mdf@splitbox@two \newsavebox\mdf@splitbox@save + \newlength\mdfsplitboxwidth \newlength\mdfsplitboxtotalwidth \newlength\mdfsplitboxheight @@ -404,31 +457,32 @@ \newlength\mdffootnoteboxheight \newlength\mdffootnoteboxdepth \newlength\mdffootnoteboxtotalheight - \newlength\mdftotallinewidth - \newlength\mdfboundingboxwidth \newlength\mdfboundingboxtotalwidth - \newlength\mdfboundingboxheight \newlength\mdfboundingboxdepth \newlength\mdfboundingboxtotalheight - \newlength\mdf@freevspace@length \newlength\mdf@horizontalwidthofbox@length \newlength\mdf@verticalmarginwhole@length +\newlength\mdf@horizontalspaceofbox +\newlength\mdfsubtitleheight +\newlength\mdfsubsubtitleheight -\newtoggle{mdf@notfirstframetitle}% -\togglefalse{mdf@notfirstframetitle}% +\newbool{mdfsingleframe}\boolfalse{mdfsingleframe} +\newbool{mdffirstframe}\boolfalse{mdffirstframe} +\newbool{mdfmiddleframe}\boolfalse{mdfmiddleframe} +\newbool{mdflastframe}\boolfalse{mdflastframe} +\newtoggle{mdf@notfirstframetitle}\togglefalse{mdf@notfirstframetitle}% +\newtoggle{mdflastframe}\togglefalse{mdflastframe} + +\newcounter{mdfcountframes}\setcounter{mdfcountframes}{0} \newrobustcmd\mdfcreateextratikz{} \def\mdf@lrbox#1{% -%%patch to work with amsthm - \mdf@patchamsthm -%%%end patch - \edef\mdf@restoreparams{% - \parindent=\the\parindent\relax \parskip=\the\parskip\relax}% + \mdf@patchamsthm%patch amsthm \setbox#1\vbox\bgroup% \color@begingroup% \mdf@horizontalmargin@equation% @@ -447,22 +501,24 @@ \baselineskip\normalbaselineskip% %% \sloppy% \let\\\@normalcr% - \mdf@restoreparams\relax% + \mdf@par@local%New feature to restore parskip/parindent local in save box + \ifbool{mdf@suppressfirstparskip}{\vspace*{-\parskip}}{}% \@afterindentfalse% - \@afterheading% + %\@afterheading% } - \def\endmdf@lrbox{\color@endgroup\egroup} - \newrobustcmd*\mdf@ignorevbadness{% \edef\mdf@currentvbadness{\the\vbadness}% \vbadness=\@M% \afterassignment\mdf@restorevbadness} + \newrobustcmd*\mdf@restorevbadness{\vbadness=\mdf@currentvbadness\relax} +\let\mdf@patchamsthm\relax +\AtBeginDocument{% \@ifpackageloaded{amsthm}% -{% - \newrobustcmd\mdf@patchamsthm{% - \let\mdf@deferred@thm@head\deferred@thm@head + {% + \newrobustcmd\mdf@patchamsthm{% + \let\mdf@deferred@thm@head\deferred@thm@head% \pretocmd{\deferred@thm@head}{\@inlabelfalse}% {\mdf@PackageInfo{mdframed detected package amsthm ^^J changed the theorem header of amsthm\MessageBreak}% @@ -472,10 +528,16 @@ failed\MessageBreak}% }% }% -}{\let\mdf@patchamsthm\relax}% + }{}% +} \def\mdf@trivlist#1{% - \edef\x{\topsep=\the\topsep\relax\partopsep=\the\partopsep\relax\parsep=\the\parsep\relax} + \edef\mdf@temp{% + \topsep=\the\topsep\relax% + \partopsep=\the\partopsep\relax% + \parsep=\the\parsep\relax% + }% \setlength{\topsep}{#1}% + \topskip\z@% \partopsep\z@% \parsep\z@% \@nmbrlistfalse% @@ -485,9 +547,7 @@ \itemindent\z@% \let\@itemlabel\@empty% \def\makelabel##1{##1}% - \item\relax\x\relax\leavevmode\hrule \@height\z@ \@width\linewidth\relax% -%% \item\mbox{}\relax% second version -%% \item\relax\x% first Version + \item\relax\mdf@temp\relax% } \let\endmdf@trivlist\endtrivlist \patchcmd\endmdf@trivlist\@endparenv\mdf@endparenv{% @@ -499,7 +559,6 @@ } \def\mdf@endparenv{% \addpenalty\@endparpenalty\addvspace\mdf@skipbelow@length\@endpetrue} - \newrobustcmd*\mdf@makebox@out[2][\linewidth]{% \noindent\hb@xt@\z@{% \noindent\makebox[\dimexpr #1\relax][l]{#2}% @@ -534,7 +593,7 @@ \expandafter\let\csname #2\endcsname\relax% \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}}{% @@ -551,6 +610,15 @@ \@ifpackageloaded{ntheorem}% {\renewrobustcmd*\mdf@thm@caption{\thm@thmcaption}}{}% } +\newrobustcmd*\mdf@checkntheorem{% + \ifbool{mdf@ntheorem}% + {\ifundef{\theorempreskipamount}% + {\mdf@PackageWarning{You have not loaded ntheorem yet}}% + {\setlength{\theorempreskipamount}{\z@}% + \setlength{\theorempostskipamount}{\z@}% + }% + }{}% +} \DeclareDocumentCommand{\mdtheorem}{ O{} m o m o }% {\ifcsdef{#2}% {\mdf@PackageWarning{Environment #2 already exits\MessageBreak}}% @@ -639,40 +707,38 @@ } \newrobustcmd\mdfframedtitleenv[1]{% - \mdf@lrbox{\mdf@frametitlebox}% + \mdf@lrbox{\mdf@frametitlebox}% + \begingroup + %%\parindent\z@\parskip\z@% + \@afterheading \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% - \setbox\mdf@frametitlebox=\vbox{\unvbox\mdf@frametitlebox}% - \mdfframetitleboxwidth=\wd\mdf@frametitlebox\relax% - \mdfframetitleboxheight=\ht\mdf@frametitlebox\relax% - \mdfframetitleboxdepth=\dp\mdf@frametitlebox\relax% - \mdfframetitleboxtotalheight=\dimexpr + \leavevmode\color{\mdf@frametitlefontcolor}% + \normalfont\mdf@frametitlefont{#1}% + \mdf@@ignorelastdescenders% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%% + \endgroup + \endmdf@lrbox\relax% + \mdf@ignorevbadness% + \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% + \setbox\mdf@frametitlebox=%prevent frametitle to expand glue + \vbox to \dimexpr\mdfframetitleboxheight+\mdfframetitleboxdepth\relax% + {\unvbox\mdf@frametitlebox}% } -\newrobustcmd*\mdf@@frametitle{% - \mdfframedtitleenv{\mdf@frametitle}% -} - -\newrobustcmd*\mdf@@frametitle@use{% - \parskip\z@\relax% - \parindent\z@\relax% +\newrobustcmd\mdf@@frametitle@use{% \mdf@ignorevbadness% \setbox\mdf@splitbox@one=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% \offinterlineskip\relax% \unvcopy\mdf@frametitlebox\relax% \mdf@@frametitlerule\relax% @@ -682,18 +748,10 @@ \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}% \mdfsetup{innertopmargin=\mdf@frametitleaboveskip@length}% } -\newrobustcmd*\mdf@checkntheorem{% - \ifbool{mdf@ntheorem}% - {\ifundef{\theorempreskipamount}% - {\mdf@PackageWarning{You have not loaded ntheorem yet}}% - {\setlength{\theorempreskipamount}{\z@}% - \setlength{\theorempostskipamount}{\z@}% - }% - }{}% -} \newrobustcmd*\mdf@footnoterule{% \kern0\p@% \hrule \@width 1in \kern 2.6\p@} + \newrobustcmd*\mdf@footnoteoutput{% \ifvoid\@mpfootins\else% \nobreak% @@ -703,30 +761,13 @@ \unvbox\@mpfootins% \fi% } + \newrobustcmd*\mdf@footnoteinput{% \def\@mpfn{mpfootnote}% \def\thempfn{\thempfootnote}% \c@mpfootnote\z@% \let\@footnotetext\@mpfootnotetext% } -\newrobustcmd*\mdf@load@style{% -\ifcase\value{mdf@globalstyle@cnt}\relax% - \input{md-frame-0.mdf}% - \or\input{md-frame-1.mdf}% - \or\input{md-frame-2.mdf}% - \or\input{md-frame-3.mdf}% - \else% - \IfFileExists{md-frame-\value{mdf@globalstyle@cnt}.mdf}% - {\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}% - }% -\fi% -}% -\mdf@load@style \newrobustcmd*\mdf@styledefinition{%AVOID!!!Needed for framemethod=default \ifnumequal{\value{mdf@globalstyle@cnt}}{0}% {\deflength{\mdf@innerlinewidth@length}{\z@}% @@ -741,15 +782,15 @@ \newrobustcmd*\detected@mdf@put@frame{% \ifmdf@nobreak%Option nobreak=true? \def\mdf@reserved@a{\mdf@put@frame@standalone}% - \else + \else% \def\mdf@reserved@a{\mdf@put@frame}% - \ifx\@captype\@undefined + \ifx\@captype\@undefined% \def\mdf@reserved@a{\mdf@put@frame}% - \else + \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}% @@ -766,18 +807,20 @@ \newcount\mdf@envdepth \mdf@envdepth=0 \@definecounter{mdf@env@i} \@definecounter{mdf@env@ii} -\newenvironment{mdframed}[1][]{% -\color@begingroup% - \mdfsetup{userdefinedwidth=\linewidth,#1}% +\newrobustcmd*\mdf@preenvsetting{% \mdf@twoside@checklength% + \edef\mdf@par@local{% + \parskip=\the\parskip\relax% + \parindent=\the\parindent\relax}% + \parskip\z@% + \parindent\z@% \let\width\z@% \let\height\z@% \mdf@checkntheorem% - \ifbool{mdf@draft}% - {% - \ifdimgreater{\overfullrule}{0pt}{}{\setlength\overfullrule{5pt}}% - }{}% - \ifnum\mdf@envdepth >\tw@\@toodeep\else + \ifbool{mdf@draft}{% + \ifdimgreater{\overfullrule}{0pt}{}{\setlength\overfullrule{5pt}}}{}% + %% Nested environments and provide an extra counter. + \ifnum\mdf@envdepth >\tw@\@toodeep\else% \advance\mdf@envdepth\@ne \edef\mdf@depthctr{mdf@env@\romannumeral\the\mdf@envdepth}% \fi @@ -785,44 +828,61 @@ \mdf@footnoteinput% \color{\mdf@fontcolor}% \mdf@font% +} +\newrobustcmd*\mdf@@ignorelastdescenders{% + \ifbool{mdf@ignorelastdescenders}% + {% + \par\strut\par% + \unskip\unskip\setbox0=\lastbox + \vspace*{\dimexpr\ht\strutbox-\baselineskip\relax}% + }{}% +} +\newenvironment{mdframed}[1][]{% + \color@begingroup% + \mdfsetup{userdefinedwidth=\linewidth,#1}% + \mdf@startcode% + \mdf@preenvsetting% + \ifdefempty{\mdf@firstframetitle}{}% + {\let\mdf@frametitlesave\mdf@frametitle% + \let\mdf@frametitle\mdf@firstframetitle% + }% \ifvmode\nointerlineskip\fi% \mdf@trivlist{\mdf@skipabove@length}%% - \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle}% \mdf@settings% - \ifbool{mdf@suppressfirstparskip}{\addtolength{\mdf@innertopmargin@length}{-\parskip}}{}% \mdf@lrbox{\mdf@splitbox@one}% + \mdf@startinnercode% }% {% - \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% + \mdf@@ignorelastdescenders% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%% + \ifmdf@footnoteinside% \def\mdf@reserveda{% \mdf@footnoteoutput% + \mdf@endinnercode% \endmdf@lrbox% - \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle@use}% + \ifdefempty{\mdf@frametitle}{}% + {\mdfframedtitleenv{\mdf@frametitle}\mdf@@frametitle@use}% \detected@mdf@put@frame}% - \else% + \else% \def\mdf@reserveda{% + \mdf@endinnercode% \endmdf@lrbox% - \ifdefempty{\mdf@frametitle}{}{\mdf@@frametitle@use}% + \ifdefempty{\mdf@frametitle}{}% + {\mdfframedtitleenv{\mdf@frametitle}\mdf@@frametitle@use}% \detected@mdf@put@frame% \mdf@footnoteoutput% }% - \fi% - \mdf@reserveda% - \endmdf@trivlist% -\color@endgroup\@doendpe% + \fi% + \mdf@reserveda% + \aftergroup\endmdf@trivlist% + \color@endgroup% + \mdf@endcode% } \newtoggle{md:checktwoside} \settoggle{md:checktwoside}{false} \newrobustcmd*\mdf@twoside@checklength{% - \if@twoside + \if@twoside% \ifbool{mdf@usetwoside}% {\mdf@PackageInfo{mdframed works in twoside mode}% \settoggle{md:checktwoside}{true}% @@ -840,7 +900,7 @@ \zref@newprop*{mdf@pagevalue}[0]{\number\value{page}} \zref@addprop{\ZREF@mainlist}{mdf@pagevalue} \newrobustcmd*\mdf@zref@label{% - \stepcounter{mdf@zref@counter} + \stepcounter{mdf@zref@counter}% \zref@label{mdf@pagelabel-\number\value{mdf@zref@counter}}% } \newrobustcmd*\if@mdf@pageodd{% @@ -869,81 +929,65 @@ \addtolength\mdf@freevspace@length{\dimexpr-\parskip\relax}\relax% }% } -\newrobustcmd*\mdf@advancelength@horizontalmargin@sub[1]{% - \advance\mdf@horizontalspaceofbox by -\csname mdf@#1@length\endcsname\relax% +\newrobustcmd*\mdf@advancelength@sub[2]{% + \advance #1 by -\csname mdf@#2@length\endcsname\relax% +} +\newrobustcmd*\mdf@advancelength@add[2]{% + \advance #1 by \csname mdf@#2@length\endcsname\relax% } -\newlength\mdf@horizontalspaceofbox \newrobustcmd*\mdf@horizontalmargin@equation{% \setlength{\mdf@horizontalspaceofbox}{\mdf@userdefinedwidth@length}% - \mdf@dolist{\mdf@advancelength@horizontalmargin@sub}{% + \mdf@dolist{\mdf@advancelength@sub{\mdf@horizontalspaceofbox}}{% leftmargin,outerlinewidth,middlelinewidth,% 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% - }{}% + {% + \mdf@dolist{\mdf@advancelength@add{\mdf@horizontalspaceofbox}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% \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@dolist{\mdf@advancelength@add{\mdf@horizontalspaceofbox}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% + }{}% \hsize=\mdf@horizontalspaceofbox% } \newrobustcmd*\mdf@keeplines@single{% \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% + \mdf@dolist{\mdf@advancelength@sub{\mdf@verticalmarginwhole@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% \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% + \mdf@dolist{\mdf@advancelength@sub{\mdf@verticalmarginwhole@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% } -\newrobustcmd*\mdf@advancelength@verticalmarginwhole[1]{% - \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% -} -\newrobustcmd*\mdf@advancelength@freevspace@add[1]{% - \advance\dimen@ by \csname mdf@#1@length\endcsname\relax% -} -\protected@edef\mdf@reset{\boxmaxdepth\the\boxmaxdepth +\protected@edef\mdf@reset{\boxmaxdepth\the\boxmaxdepth% \splittopskip\the\splittopskip}% \newrobustcmd*\mdf@put@frame@standalone{\relax% - \ifvoid\mdf@splitbox@one\relax + \ifvoid\mdf@splitbox@one\relax% \mdf@PackageWarning{The environment is empty\MessageBreak}% - \let\mdf@reserved@a\relax% - \else + \else% %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}{% + \mdf@dolist{\mdf@advancelength@add{\mdf@verticalmarginwhole@length}}{% outerlinewidth,middlelinewidth,innerlinewidth,% innertopmargin,innerbottommargin,innerlinewidth,% - middlelinewidth,outerlinewidth}% + middlelinewidth,outerlinewidth,extratopheight}% \mdf@keeplines@single% - \def\mdf@reserved@a{\mdf@putbox@single}% - \fi - \mdf@reserved@a% + \begingroup% + \mdf@@setzref% + \booltrue{mdfsingleframe}% + \mdf@beforesingleframe% + \mdf@putbox@single% + \mdf@aftersingleframe% + \endgroup%Output no break + \fi% } \def\mdf@put@frame{\relax% \ifvoid\mdf@splitbox@one\relax @@ -956,78 +1000,78 @@ \mdf@PackageInfoSpace{\the\mdf@freevspace@length before the beginning of \MessageBreak the environment ending on input line \MessageBreak}% - \ifdimless{\mdf@freevspace@length}{2\baselineskip} + \ifdimless{\mdf@freevspace@length}{2\baselineskip}% {% - \mdf@PackageInfo{Not enough space on this page} + \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}% + \mdf@dolist{\mdf@advancelength@add{\mdf@verticalmarginwhole@length}}% {% outerlinewidth,middlelinewidth,innerlinewidth,% innertopmargin,innerbottommargin,% - innerlinewidth,middlelinewidth,outerlinewidth}% + innerlinewidth,middlelinewidth,outerlinewidth,extratopheight}% \mdf@keeplines@single% \ifdimless{\mdf@verticalmarginwhole@length}{\mdf@freevspace@length}% - {%passt auf Seite% - \begingroup\mdf@@setzref\mdf@putbox@single\endgroup%Output no break + {%enough space / no break + \begingroup% + \mdf@@setzref% + \booltrue{mdfsingleframe}% + \mdf@beforesingleframe% + \mdf@putbox@single% + \mdf@aftersingleframe% + \endgroup%Output no break \let\mdf@reserved@a\relax% }% {% - \def\mdf@reserved@a{\mdf@put@frame@i}%passt nicht auf Seite - } + \def\mdf@reserved@a{\mdf@put@frame@i}%need to split + }% }% -\fi +\fi% \mdf@reserved@a% } \def\mdf@put@frame@i{%Box must be splitted \mdf@freepagevspace%gives \mdf@freevspace@length \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% + \mdf@dolist{\mdf@advancelength@add{\dimen@i}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% \advance\dimen@i by 2\baselineskip\relax% \ifdimless{\dimen@}{\dimen@i}% {\hrule \@height\z@ \@width\hsize% - \vfill\eject% + \vfill\eject%no room for two lines \def\mdf@reserved@a{\mdf@put@frame}% }% - {% - \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% - }{}% + {%enough space for first part + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}{%calculate with \dimen@ + outerlinewidth,middlelinewidth,innerlinewidth,%width of top rule + innertopmargin,splitbottomskip}%width of length + \ifboolexpr{ bool {mdf@everyline} and bool {mdf@bottomline} }% + {%need space for bottomline + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% - \notbool{mdf@topline}% + \notbool{mdf@topline}%no top line {% - \advance\dimen@ by \mdf@innerlinewidth@length% - \advance\dimen@ by \mdf@middlelinewidth@length% - \advance\dimen@ by \mdf@outerlinewidth@length% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% - \advance\dimen@.8\pageshrink + \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}% + you have to change it manually\MessageBreak + by changing the text, the space\MessageBreak + or something else}% \advance\dimen@ by -1.8\baselineskip\relax%needed???????????????????? }{}% - \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}% + \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}%save original \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% \mdf@ignorevbadness% - \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@ + \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@\relax% \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@}% @@ -1036,12 +1080,12 @@ starting loop to iterate the splitting point\MessageBreak}% \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% - \dimen@i=\dimen@%\relax - \@tempcnta=\z@\relax + \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 + \advance\dimen@i by -\p@\relax% + \advance\@tempcnta by \@ne\relax% %% \wlog{***mdframed \string\@tempcnta=\the\@tempcnta***} %% \wlog{***mdframed \string\dimen@i=\the\dimen@i***} \mdf@ignorevbadness% @@ -1052,10 +1096,10 @@ \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}% \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}% \ifnum\@tempcnta>100 - \let\iterate\relax + \let\iterate\relax% \mdf@PackageWarning{correct box splittet fails^^J It seems you are using a non splittable - contents\MessageBreak} + contents\MessageBreak}% \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% \setbox\mdf@splitbox@two=\vbox{}% \def\mdf@reserved@a{\mdf@put@frame}% @@ -1073,33 +1117,44 @@ \enlargethispage{\baselineskip}% \def\mdf@reserved@a{\mdf@put@frame}% \fi% + % Test if first splitted frame doesn't have the original with. + % occurs with math \ifdim\wd\mdf@splitbox@two=\wd\mdf@splitbox@one\relax \else% \mdf@PackageInfo{You first box width is to small^^J mdframed fixed it\MessageBreak}% \setbox\mdf@splitbox@two=\vbox% {% - \hrule \@height\z@ \@width\mdfboundingboxwidth\relax + \hrule \@height\z@ \@width\mdfboundingboxwidth\relax% \unvcopy\mdf@splitbox@two% }% \fi% \ifvoid\mdf@splitbox@two\relax% - {\hrule \@height\f@size pt \@width\z@% + {% + \hrule \@height\f@size pt \@width\z@% \hrule \@height\z@ \@width\hsize}% \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% - \def\mdf@reserved@a{\mdf@put@frame}% + \def\mdf@reserved@a{\mdf@put@frame% + }% \else% \ifdimequal{\ht\mdf@splitbox@two}{0pt}% - {\hrule \@height\z@ \@width\hsize% + {% + \hrule \@height\z@ \@width\hsize% \vfill\eject% \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% \def\mdf@reserved@a{\mdf@put@frame}% }% {% - \begingroup\mdf@@setzref\mdf@putbox@first\endgroup% - \hrule \@height\z@ \@width\hsize% - \vfill\eject% - \def\mdf@reserved@a{\mdf@put@frame@ii}% + \begingroup% + \mdf@@setzref% + \mdf@beforebreak% + \booltrue{mdffirstframe}% + \mdf@putbox@first% + \mdf@afterbreak% + \endgroup% + \hrule \@height\z@ \@width\hsize% + \vfill\eject% + \def\mdf@reserved@a{\mdf@put@frame@ii}% }% \fi% }% @@ -1108,16 +1163,18 @@ \def\mdf@put@frame@ii{% \setlength{\mdf@freevspace@length}{\vsize}% \ifbool{mdf@repeatframetitle}% - {% + {%repeating title -- more robust using hooks. \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{\unvbox\mdf@splitbox@one}% \setbox\mdf@splitbox@one\vbox% {% - \vbox to \mdf@frametitleaboveskip@length{} + \parskip\z@\relax% + \parindent\z@\relax% + \vskip\mdf@frametitleaboveskip@length% \unvcopy\mdf@frametitlebox\relax% \mdf@@frametitlerule\relax% \unvbox\mdf@splitbox@one\relax% @@ -1125,51 +1182,40 @@ \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@ - innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth,% - }% - \ifbool{mdf@everyline}% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}% + \ifboolexpr { bool {mdf@everyline} and bool {mdf@topline} }% {% - \ifbool{mdf@topline}% - {% - \advance\dimen@ by \mdf@innerlinewidth@length\relax% - \advance\dimen@ by \mdf@middlelinewidth@length\relax% - \advance\dimen@ by \mdf@outerlinewidth@length\relax% - }{}% + \mdf@dolist{\mdf@advancelength@add{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% - \notbool{mdf@bottomline}% + \notbool{mdf@bottomline}%remove bottom if neccessary {% - \advance\dimen@ by -\mdf@innerlinewidth@length\relax% - \advance\dimen@ by -\mdf@middlelinewidth@length\relax% - \advance\dimen@ by -\mdf@outerlinewidth@length\relax% - \relax% + \mdf@dolist{\mdf@advancelength@sub{\dimen@}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% \ifdimgreater{\dimen@}{\mdf@freevspace@length}% {%have a middle box \advance\mdf@freevspace@length by -\mdf@splitbottomskip@length\relax% - \ifbool{mdf@everyline}% + \ifbool{mdf@everyline}%regard top and bottom if everyline is used {% \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% + \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% \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 + \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}% + {innerlinewidth,middlelinewidth,outerlinewidth}% }{}% }{}% \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} + \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}% {\mdf@freevspace@length}% {%splitted wrong @@ -1183,8 +1229,6 @@ \mdf@freevspace@length\relax \advance\dimen@i by -\p@\relax% \advance\@tempcnta by \@ne\relax% -%% \wlog{***mdframed \string\@tempcnta=\the\@tempcnta***} -%% \wlog{***mdframed \string\dimen@i=\the\dimen@i***} \ifnum\@tempcnta>100 \let\iterate\relax% \mdf@PackageWarning{correct box splittet fails^^J @@ -1213,10 +1257,16 @@ \else \setbox\mdf@splitbox@two=\vbox% {% - \hrule \@height\z@ \@width\mdfboundingboxwidth\relax + \hrule \@height\z@ \@width\mdfboundingboxwidth\relax% \unvcopy\mdf@splitbox@two% }% - \begingroup\mdf@@setzref\mdf@putbox@middle\endgroup% + \begingroup% + \mdf@@setzref% + \booltrue{mdfmiddleframe}% + \mdf@beforebreak% + \mdf@putbox@middle% + \mdf@afterbreak% + \endgroup% \hrule \@height\z@ \@width\hsize% \vfill\eject% \def\mdf@reserved@a{\mdf@put@frame@ii}% @@ -1246,13 +1296,103 @@ \hrule \@height\z@ \@width\mdfboundingboxwidth }% }{}% - \begingroup\mdf@@setzref\mdf@putbox@second\endgroup% + \begingroup% + \toggletrue{mdflastframe}% + \mdf@beforebreak% + \begingroup% + \mdf@@setzref% + \booltrue{mdflastframe}% + \mdf@beforelastframe% + \mdf@putbox@second% + \mdf@afterlastframe% + \endgroup% \hrule \@height\z@ \@width\hsize% + \mdf@afterbreak% + \endgroup% \let\mdf@reserved@a\relax% }% \mdf@reserved@a% } +\newrobustcmd\mdfsubtitle[2][]% +{% + \begingroup + \penalty-9995%set a breakpoint before the subtitle + \parindent\z@\relax% + \parskip\z@\relax% + \mdfsetup{#1}%only for subtitle options + \par\addvspace{\mdf@subtitleaboveskip@length}% + \setbox\z@=\vbox{% + \mdf@frametitlealignment% + \mdf@subtitlefont{#2}% + \mdf@@ignorelastdescenders% + \relax}% + \setbox\z@=\vbox{\unvbox\z@}% + \setbox\z@=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% + \offinterlineskip\relax% + \vbox to \mdf@subtitleinneraboveskip@length{}% + \unvbox\z@\relax% + \vbox to \mdf@subtitleinnerbelowskip@length{}% + }%\z@ contains the subtitle+required length + \setlength{\mdfsubtitleheight}{\dimexpr\ht\z@+\dp\z@\relax} + \setbox\z@=\vbox to \mdfsubtitleheight {\unvbox\z@}% + % \dimen@ is now the complete width + \mdf@templength=\linewidth\relax% + \mdf@dolist{\mdf@advancelength@add{\mdf@templength}}% + {innerleftmargin,innerrightmargin}% + \offinterlineskip\relax% + \ifbool{mdf@subtitleaboveline}{\mdf@drawsubtitleaboveline\par}{}% + \mdf@drawsubtitlebackground% + \box\z@% + \ifbool{mdf@subtitlebelowline}{\mdf@drawsubtitlebelowline}{}% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% + \penalty 9995% + \addvspace{\mdf@subtitlebelowskip@length}% + \endgroup% + \@afterheading% +} + +\newrobustcmd\mdfsubsubtitle[2][]% +{% + \begingroup + \penalty-9995%set a breakpoint before the subtitle + \parindent\z@\relax% + \parskip\z@\relax% + \mdfsetup{#1}%only for subtitle options + \par\addvspace{\mdf@subsubtitleaboveskip@length}% + \setbox\z@=\vbox{% + \mdf@frametitlealignment% + \mdf@subsubtitlefont{#2}% + \mdf@@ignorelastdescenders% + \relax}% + \setbox\z@=\vbox{\unvbox\z@}% + \setbox\z@=\vbox{% + \parskip\z@\relax% + \parindent\z@\relax% + \offinterlineskip\relax% + \vbox to \mdf@subsubtitleinneraboveskip@length{}% + \unvbox\z@\relax% + \vbox to \mdf@subsubtitleinnerbelowskip@length{}% + }%\z@ contains the subtitle+required length + \setlength{\mdfsubsubtitleheight}{\dimexpr\ht\z@+\dp\z@\relax} + \setbox\z@=\vbox to \mdfsubsubtitleheight {\unvbox\z@}% + % \dimen@ is now the complete width + \mdf@templength=\linewidth\relax% + \mdf@dolist{\mdf@advancelength@add{\mdf@templength}}% + {innerleftmargin,innerrightmargin}% + \offinterlineskip\relax% + \ifbool{mdf@subsubtitleaboveline}{\mdf@drawsubtitleaboveline\par}{}% + \mdf@drawsubtitlebackground% + \box\z@% + \ifbool{mdf@subsubtitlebelowline}{\mdf@drawsubtitlebelowline}{}% + \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi% + \penalty 9995% + \addvspace{\mdf@subsubtitlebelowskip@length}% + \endgroup% + \@afterheading% +} %%%% _____t_____ %%%% | | %%%% | | @@ -1262,7 +1402,6 @@ %%%% | | %%%% |___________| %%%% b -%%Zusammenhaenge abfragen: \newrobustcmd*\mdf@test@ltrb{% \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline}) and (bool {mdf@leftline}) and (bool {mdf@rightline})}} @@ -1317,7 +1456,6 @@ 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 |