diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/mdframed/mdframed.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/mdframed/mdframed.sty | 635 |
1 files changed, 214 insertions, 421 deletions
diff --git a/Master/texmf-dist/tex/latex/mdframed/mdframed.sty b/Master/texmf-dist/tex/latex/mdframed/mdframed.sty index 9303173956d..e708bbe99bb 100644 --- a/Master/texmf-dist/tex/latex/mdframed/mdframed.sty +++ b/Master/texmf-dist/tex/latex/mdframed/mdframed.sty @@ -1,51 +1,60 @@ -%%==================================================%% -%%========Is based on the idea of framed.sty========%% -%%==================================================%% -%%===== Currently the package has a beta-Status ====%% -%%==================================================%% -%% WITH THANKS TO (alphabetically): -%% ROLF NIEPRASCHK -%% HEIKO OBERDIEK -%% HERBERT VOSS - -%% Copyright (c) 2010 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. -%% Either version 1.0 or, at your option, any later version. %% +%% This is file `mdframed.sty', +%% generated with the docstrip utility. %% -%%==================================================%% -%% Erstellung eines Rahmens, der am Seitenende keine -%% horizontale Linie einfuegt -%%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>%% -%% _______________ %% -%% | page 1 | %% -%% | Text | %% -%% | __Text__ | %% -%% | | Text | | %% -%% P A G E B R E A K %% -%% | | Text | | %% -%% | |_Text_| | %% -%% | Text | %% -%% |____page 2___| %% -%% %% -%%>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>%% - -%%$Id: mdframed.sty 220 2011-11-13 17:39:13Z marco $ -%%$Rev: 220 $ -%%$Author: marco $ -%%$Date: 2011-11-13 18:39:13 +0100 (So, 13. Nov 2011) $ - -%% Allgemeine Angaben -\def\mdversion{v1.0} +%% The original source files were: +%% +%% mdframed.dtx (with options: `package') +%% ---------------------------------------------------------------- +%% Working with the command fbox or fcolorbox, one has to +%% handle page breaks by hand. The present package defines the +%% environment mdframed which automatically deals with page breaks. +%% +%% Author's name: Marco Daniel and Elke Schubert (!new) +%% License type: lppl +%% +%% ================================================== +%% ========Is based on the idea of framed.sty======== +%% ================================================== +%% ===== Currently the package has a beta-Status ==== +%% ================================================== +%% WITH THANKS TO (alphabetically): +%% ROLF NIEPRASCHK +%% HEIKO OBERDIEK +%% HERBERT VOSS +%% +%% Copyright (c) 2010 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. +%% Either version 1.0 or, at your option, any later version. +%% +%% +%% ================================================= +%% Erstellung eines Rahmens, der am Seitenende keine +%% horizontale Linie einfuegt +%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +%% _______________ +%% | page 1 | +%% | Text | +%% | __Text__ | +%% | | Text | | +%% P A G E B R E A K +%% | | Text | | +%% | |_Text_| | +%% | Text | +%% |____page 2___| +%% +%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +%% ================================================== +%% +\def\mdversion{v1.0b} \def\mdframedpackagename{mdframed} \def\md@maindate@svn$#1: #2 #3 #4-#5-#6 #7 #8${#4/#5/#6\space } \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{mdframed}[\md@maindate@svn$Id: mdframed.sty 220 2011-11-13 17:39:13Z marco $ \mdversion: \mdframedpackagename] -%%==================================================%% -%%=============== Benoetigte Pakete ================%% -%%==================================================%% +\ProvidesPackage{mdframed}% + [\md@maindate@svn$Id: mdframed.dtx 271 2011-12-09 12:25:08Z marco $% + \mdversion: \mdframedpackagename] \newcommand*\md@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}} \newcommand*\md@PackageInfo[1]{\PackageInfo{\mdframedpackagename}{#1}} \newcommand*\md@LoadFile@IfExist[1]{% @@ -58,25 +67,13 @@ }% } } - \RequirePackage{kvoptions} \RequirePackage{etex} \RequirePackage{etoolbox}[2011/01/03] \RequirePackage{zref-abspage} - -%separate Handhabung color -\md@LoadFile@IfExist{color} - - - - +\RequirePackage{color} \SetupKeyvalOptions{family=mdf,prefix=mdf@} -%%==================================================%% -%%============Hilfsmakros fuer Optionen=============%% -%%==================================================%% - -%%%\md@iflength{<EINGABE>}{<IST LAENGE>}{<IST KEINE LAENGE>} \newlength{\md@templength} \def\md@iflength#1{% \afterassignment\md@iflength@check% @@ -93,13 +90,10 @@ \fi } \def\md@iflength@cleanup#1\relax{} - -%%\mdf@option@length{<Laengenbezeichnung>}{<Defaultwert>} \newrobustcmd*{\mdf@option@length}[2]{% \expandafter\newlength\csname mdf@#1@length\endcsname% \expandafter\setlength\csname mdf@#1@length\endcsname{#2}% } -%%\mdf@define@key@length{<Bezeichnungder Option der Laenge>} \newrobustcmd*{\mdf@define@key@length}[1]{% \define@key{mdf}{#1}{% \def\@tempa{##1} @@ -109,10 +103,7 @@ \expandafter\setlength\csname mdf@#1@length\endcsname{\csname mdfl@#1\endcsname}% }% } -%%Schleifenmakro zur Optioneneingabe \DeclareListParser*{\mdf@dolist}{,} - -%Laengenoptionen \def\mdf@do@lengthoption#1{% \mdf@lengthoption@doubledo#1\@nil% } @@ -120,7 +111,6 @@ \mdf@option@length{#1}{#2}% \mdf@define@key@length{#1}% } -%Stringoptionen \def\mdf@do@stringoption#1{% \mdf@stringoption@doubledo#1\@nil% } @@ -130,9 +120,6 @@ \csdef{mdf@#1}{##1}% }% } - - -%Booloptionen \def\mdf@do@booloption#1{% \mdf@booloption@doubledo#1\@nil% } @@ -142,8 +129,6 @@ \setbool{mdf@#1}{##1}% }% } - -%Alignoptionen \def\mdf@do@alignoption#1{% \mdf@alignoption@tripledo#1\@nil% } @@ -151,21 +136,9 @@ \csdef{mdf@align@#1@left}{\null\hspace*{#2}}% \csdef{mdf@align@#1@right}{\hspace*{#3}\null}% } - -%%==================================================%% -%%=====================Optionen=====================%% -%%==================================================%% - - -%Festlegung welcher Stildatei -%% 0 := tex-Kommandos -- rule -%% 1 := tikz -%% 2 := pstricks -%% 3 := pstricks <- veraltet \newcounter{mdf@globalstyle@cnt} \defcounter{mdf@globalstyle@cnt}{0} \newcommand*\mdfglobal@style{0} - \define@key{mdf}{style}{% \md@PackageWarning{package option style is depreciated^^J use framemethod instead\MessageBreak}% @@ -173,14 +146,14 @@ \defcounter{mdf@globalstyle@cnt}{#1}% \ifcase\value{mdf@globalstyle@cnt}\relax %0 <- kein Grafikpaket - \or\md@LoadFile@IfExist{tikz}%1 <- tikz wird benoetigt - \or\md@LoadFile@IfExist{pstricks-add}%2 <- tikz wird benoetigt - \or\defcounter{mdf@globalstyle@cnt}{2}\md@LoadFile@IfExist{pstricks-add}%3 <- pstricks wird benoetigt - \or\md@LoadFile@IfExist{pstricks-add}%4 <- pstricks wird benoetigt + \or\md@LoadFile@IfExist{tikz}% + \or\md@LoadFile@IfExist{pstricks-add}% + \or\defcounter{mdf@globalstyle@cnt}{2}% + \md@LoadFile@IfExist{pstricks-add}% + \or\md@LoadFile@IfExist{pstricks-add}% \else\md@PackageWarning{Unknown global style \value{mdf@globalstyle@cnt}}% \fi% } - \providecommand*\mdf@framemethod{} \def\md@framemethod@i{}% \def\md@framemethod@ii{}% @@ -203,13 +176,11 @@ }% \ifcase\value{mdf@globalstyle@cnt}\relax% %0 <- kein Grafikpaket - \or\md@LoadFile@IfExist{tikz}%1 <- tikz wird benoetigt - \or\md@LoadFile@IfExist{pstricks-add}%2 <- pstricks wird benoetigt - \or\md@LoadFile@IfExist{pstricks-add}%3 <- pstricks wird benoetigt <- support old style + \or\md@LoadFile@IfExist{tikz}% + \or\md@LoadFile@IfExist{pstricks-add}% + \or\md@LoadFile@IfExist{pstricks-add}% \fi% } - -%%%%Optionen mit Laengen \mdf@dolist{\mdf@do@lengthoption}{% {skipabove==\z@},% {skipbelow==\z@},% @@ -231,8 +202,7 @@ {roundcorner==\z@},% {footenotedistance==\medskipamount}, {userdefinedwidth==\linewidth} -} -%%%%Optionen mit String +} \mdf@dolist{\mdf@do@stringoption}{% {defaultunit==pt},% {settings=={}},% @@ -247,7 +217,6 @@ {frametitlefont==\bfseries\large},% {printheight==none},% } -%%%%Optionen mit Boolflag \mdf@dolist{\mdf@do@booloption}{% {ntheorem==false},% {topline==true},% @@ -258,9 +227,6 @@ {nobreak==false},% {footnoteinside==true},% } - - -%Alignoptionen: \mdf@dolist{\mdf@do@alignoption}{% {left==\mdf@leftmargin@length==\z@},% {center==\fill==\fill},% @@ -268,7 +234,6 @@ {outer==\fill==\mdf@rightmargin@length},%not supported yet {outer==\mdf@leftmargin@length==\fill},%not supported yet } - \newcommand*\mdf@align{}% \newcommand*\mdf@makeboxalign@left{\null\hspace*{\mdf@leftmargin@length}}% \newcommand*\mdf@makeboxalign@right{}% @@ -282,8 +247,6 @@ \def\mdf@makeboxalign@right{\csuse{mdf@align@#1@right}}% }% } - -%Unterstuetzung der Optionen fuer tikz \def\mdf@tikzset@local{\tikzset{tikzsetting/.style={}}} \define@key{mdf}{tikzsetting}{% \def\mdf@tikzset@local{\tikzset{tikzsetting/.style={#1}}}% @@ -291,14 +254,10 @@ \define@key{mdf}{apptotikzsetting}{% \appto\mdf@tikzset@local{#1}% } - -%Unterstuetzung der Optionen fuer pstricks \def\mdf@psset@local{} \define@key{mdf}{pstrickssetting}{% \def\mdf@psset@local{#1} } - -%Unterstuetzung der xcolor fuer pstricks \def\mdf@xcolor{} \define@key{mdf}{xcolor}[none]{% \@ifpackageloaded{xcolor}{% @@ -308,13 +267,10 @@ \ifx\mdf@xcolor\@tempa \else \PassOptionsToPackage{\mdf@xcolor}{xcolor}% - \RequirePackage{xcolor}% + \RequirePackage{xcolor}% \fi% }% } - - -%Nutzung des Paketes needspace \define@key{mdf}{needspace}[\z@]{% \begingroup% \setlength{\dimen@}{#1}% @@ -326,29 +282,20 @@ \vskip\z@skip % hide the previous |\vskip| from |\addvspace| \endgroup% } - \DeclareDefaultOption{% \md@PackageWarning{Unknown Option '\CurrentOption' for mdframed}} - - \ProcessKeyvalOptions*\relax \newcommand*{\mdfsetup}{\setkeys{mdf}} - - -%Erlauben von mdfdefinestyle sowie redefinition von style \define@key{mdf}{style}{% \ifcsundef{mdf@definestyle@#1}{% - \md@PackageWarning{Unknown definedstyle #1^^J - You have to define a style via \string\mdfdefinedstyle\MessageBreak - }% - }% - {\expandafter\expandafter\expandafter\mdfsetup% - \expandafter\expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}% + \md@PackageWarning{Unknown definedstyle #1^^J + You have to define a style ^^J + via \string\mdfdefinedstyle\MessageBreak + }% + }% + {\expandafter\expandafter\expandafter\mdfsetup% + \expandafter\expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}% }% - -%%==================================================%% -%%==========Ausgabe des Platzes auf Seite===========%% -%%==================================================%% \let\md@PackageNoInfo\@gobble \newrobustcmd*\md@ifstrequal@expand{% \expandafter\ifstrequal\expandafter{\mdf@printheight}% @@ -361,64 +308,57 @@ %case "warning" \md@ifstrequal@expand{warning}{\def\md@tempa{Warning}}{% %case "unknown" - \md@PackageWarning{Unknown key for printheight=\mdf@printheight %^^J + \md@PackageWarning{Unknown key for printheight=\mdf@printheight^^J use none, info or warning}% \def\md@tempa{none}% }% }% }% -\def\md@PackageInfoSpace{\csname md@Package\md@tempa\endcsname} -} -%%==================================================%% -%%========Angepasste lrbox sowie trivlist===========%% -%%==================================================%% -%Anpassung lrbox -\let\md@lrbox\lrbox -\patchcmd\md@lrbox\hbox\vbox{}{} -\patchcmd\md@lrbox\color@setgroup{% -\color@setgroup\color{\mdf@fontcolor}% -\hsize=\md@horizontalspaceofbox% -\columnwidth=\hsize% -\textwidth=\hsize% -\linewidth=\hsize% -\bgroup\md@@frametitle\egroup\noindent% -}{}{} -\def\endmd@lrbox{\unskip\color@endgroup} +\def\md@PackageInfoSpace{\csname md@Package\md@tempa\endcsname}% +} +\def\md@lrbox#1{% + \edef\reserved@a{% + \endgroup + \setbox#1\vbox{% + \begingroup\aftergroup}% + \def\noexpand\@currenvir{\@currenvir}% + \def\noexpand\@currenvline{\on@line}}% + \reserved@a + \@endpefalse + \@parboxrestore + \begingroup% + \color@setgroup + \color{\mdf@fontcolor}% + \hsize=\md@horizontalspaceofbox% + \columnwidth=\hsize% + \textwidth=\hsize% + \linewidth=\hsize% + \@parboxrestore + \bgroup\md@@frametitle\egroup\noindent% + \ignorespaces} -%Anpassung trivlist +\def\endmd@lrbox{\endgroup\unskip\color@endgroup} \let\md@trivlist\trivlist \let\endmd@trivlist\endtrivlist \patchcmd\endmd@trivlist\@endparenv\md@endparenv{}{} \def\md@endparenv{% \addpenalty\@endparpenalty\addvspace\mdf@skipbelow@length\@endpetrue} - - -%%==================================================%% -%%==============leftline anpassen===================%% -%%==================================================%% -\newrobustcmd*\mdf@makebox[2][\mdf@userdefinedwidth@length]{% - \noindent\makebox[#1][l]{#2}% +\newrobustcmd*\mdf@makebox@out[2][\linewidth]{% + \noindent\hb@xt@\z@{% + \noindent\makebox[\dimexpr #1\relax][l]{#2}% + \hss}% +}% +\newrobustcmd*\mdf@makebox@in[2][\mdf@userdefinedwidth@length]{% + \noindent\makebox[\dimexpr #1\relax][l]{#2}% } - - -%%==================================================%% -%%==================framestyle======================%% -%%==================================================%% -%inspired by Lars Madsen \newrobustcmd*\mdfdefinestyle[2]{% \csdef{mdf@definestyle@#1}{#2}% } - \newrobustcmd*\mdfapptodefinestyle[2]{% \ifcsundef{mdf@definestyle@#1}% {\md@PackageWarning{Unknown style #1}}% {\csappto{mdf@definestyle@#1}{,#2}}% } - -%%==================================================%% -%%=============Umgebungdefinition===================%% -%%==================================================%% -%\newmdenv[<mdframed-options>]{<environmen>} \newrobustcmd*\newmdenv[2][]{% \newenvironment{#2}{% \mdfsetup{#1}% @@ -427,98 +367,41 @@ \end{mdframed}% }% } -%\renewmdenv[<mdframed-options>]{<environmen>} \newrobustcmd*\renewmdenv[2][]{% \expandafter\let\csname #2\endcsname\relax% \expandafter\let\csname end#2\endcsname\relax% \newmdenv[#1]{#2}% }% - -%http://tex.stackexchange.com/questions/26298/own-command-to-create-new-environment -%\newtheorem{<envname>}[<numberedlike>]{<caption>}[<within>] -%\newmdtheoremenv[<mdframed-options>]{<envname>}[<numberedlike>]{<caption>}[<within>] -%\md@tempa[<mdframed-options>] -%\md@tempb{<envname>}% -%\md@tempc[<numberedlike>]% -%\md@tempd{<caption>}% -%\md@tempe[<within>]% \newrobustcmd*\newmdtheoremenv{% \kernel@ifnextchar[%] {\newmdtheoremenv@i}{\newmdtheoremenv@i[]}% } \def\newmdtheoremenv@i[#1]#2{% - \def\md@tempa{#1}% - \def\md@tempb{#2}% - \kernel@ifnextchar[%] - {\newmdtheoremenv@ii}{\newmdtheoremenv@ii[]}% + \kernel@ifnextchar[%] + {\newmdtheoremenv@ii[#1]#2}{\newmdtheoremenv@ii[#1]#2[]}% } - -\def\newmdtheoremenv@ii[#1]#2{% - \def\md@tempc{#1}% - \ifboolexpr{ test {\ifcsundef{c@\md@tempc}} and test {\ifcsundef{c@md@@\md@tempc}} and not (test {\ifdefempty{\md@tempc}}) }% - {\md@PackageWarning{No Counter \md@tempc defined\MessageBreak}% - \edef\md@reserved@a{}}% - {\ifcsundef{c@\md@tempc}% - {\ifdefempty{\md@tempc}{\edef\md@reserved@a{}}{\edef\md@reserved@a{md@@\md@tempc}}}% - {\edef\md@reserved@a{\md@tempc}}% - } - \edef\md@tempc{\md@reserved@a} - \def\md@tempd{#2}% +\def\newmdtheoremenv@ii[#1]#2[#3]#4{% \kernel@ifnextchar[%] - {\newmdtheoremenv@iii}{\newmdtheoremenv@iii[]}% + {\newmdtheoremenv@iii[#1]#2[#3]#4}{\newmdtheoremenv@iii[#1]#2[#3]#4[]}% } - -\def\newmdtheoremenv@iii[#1]{% - \def\md@tempe{#1}% - \ifboolexpr{ test {\ifcsundef{c@\md@tempe}} and test {\ifcsundef{c@md@@\md@tempe}} and not (test {\ifdefempty{\md@tempe}}) }% - {\md@PackageWarning{No Counter \md@tempe defined\MessageBreak}% - \edef\md@reserved@a{}}% - {\ifcsundef{c@\md@tempe}% - {\ifdefempty{\md@tempe}{\edef\md@reserved@a{}}{\edef\md@reserved@a{md@@\md@tempe}}}% - {\edef\md@reserved@a{\md@tempe}}% - } - \edef\md@tempe{\md@reserved@a} - \ifboolexpr{ not (test {\ifdefempty{\md@tempc}}) - and - not (test {\ifdefempty{\md@tempe}}) - }{% - \md@PackageWarning{You defined {\string\newtheorem} with ^^J - both optional arguments^^J - <numeredlike> and <within>. This isn't allowed^^J - \mdframedpackagename will use <numeredlike>\MessageBreak}% - \begingroup\edef\md@reserved@a{% - \endgroup\noexpand\newtheorem{md@@\md@tempb}[\md@tempc]{\md@tempd}}% - }% - {\ifdefempty{\md@tempc}{}{% - \begingroup% - \edef\md@reserved@a{\endgroup% - \noexpand\newtheorem{md@@\md@tempb}[\md@tempc]{\md@tempd}}}% - \ifdefempty{\md@tempe}{}{% - \begingroup% - \edef\md@reserved@a{\endgroup% - \noexpand\newtheorem{md@@\md@tempb}{\md@tempd}[\md@tempe]}}% - } - \ifboolexpr{test {\ifdefempty{\md@tempc}} - and - test {\ifdefempty{\md@tempe}} - }{% - \begingroup% - \edef\md@reserved@a{\endgroup% - \noexpand\newtheorem{md@@\md@tempb}{\md@tempd}% - } - }{}% - \md@reserved@a% - \protected@csxdef{\md@tempb}{\noexpand\mdfsetup{\md@tempa}% - \noexpand\begin{mdframed}[]\noexpand\begin{md@@\md@tempb}% - }% - \protected@csxdef{end\md@tempb}{% - \noexpand\end{md@@\md@tempb}\noexpand\end{mdframed}% +\def\newmdtheoremenv@iii[#1]#2[#3]#4[#5]{% + \ifboolexpr{ test {\ifblank {#3}} and test {\ifblank {#5}} }% + {% + \newtheorem{#2}{#4}% + }{% + \ifboolexpr{ not (test {\ifblank {#3}}) and not (test {\ifblank {#5}}) }% + {\md@PackageWarning{You can't such a comibination for newmdtheoremenv^^J + Instead mdframed uses newtheorem{#2}{#4}}% + \newtheorem{#2}{#4}% + }% + {% + \notblank{#3}{\newtheorem{#2}[#3]{#4}}{}% + \notblank{#5}{\newtheorem{#2}{#4}[#5]}{}% + }% }% + \BeforeBeginEnvironment{#2}{\begin{mdframed}[#1]}% + \AfterEndEnvironment{#2}{\end{mdframed}}% } - -%%==================================================%% -%%=================== Frametitle ===================%% -%%==================================================%% \let\mdraggedtitle\raggedright \providecommand*\mdframedtitleenv[1]{% \@afterindentfalse @@ -527,7 +410,7 @@ \mdraggedtitle\nobreak\mdf@frametitlefont#1\relax% \par}% \@afterheading} -% + \newrobustcmd*\md@@frametitle{% \ifx\mdf@frametitle\@empty\relax% \else @@ -536,7 +419,6 @@ \color@endgroup \fi% } - \newrobustcmd*\md@checkntheorem{% \ifbool{mdf@ntheorem}% %%% Pruefen ob ntheorem gesetzt ist {\ifundef{\theorempreskipamount}% @@ -546,16 +428,9 @@ }% }{}% } - - -%%==================================================%% -%%=================== Fussnoten ====================%% -%%==================================================%% \newrobustcmd*\md@footnoterule{% \kern0\p@% \hrule \@width 1in \kern 2.6\p@} - - \newrobustcmd*\md@footnoteoutput{% \ifvoid\@mpfootins\else \nobreak% @@ -565,53 +440,32 @@ \unvbox\@mpfootins \fi% } - \newrobustcmd*\md@footnoteinput{% \def\@mpfn{mpfootnote}% \def\thempfn{\thempfootnote}% \c@mpfootnote\z@% \let\@footnotetext\@mpfootnotetext% } - -\def\thempfootnote{{\itshape\@alph\c@mpfootnote}} -\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}} -\long\def\@mpfootnotetext#1{% - \global\setbox\@mpfootins\vbox{% - \unvbox\@mpfootins - \reset@font\footnotesize - \hsize\columnwidth - \@parboxrestore - \protected@edef\@currentlabel - {\csname p@mpfootnote\endcsname\@thefnmark}% - \color@begingroup - \@makefntext{% - \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% - \color@endgroup}} - - -%%==================================================%% -%%======= Laden der gewuenschten Style-Datei =======%% -%%==================================================%% \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}% - \md@PackageWarning{The style number \value{mdf@globalstyle@cnt} does not exist^^J - mdframed ues instead style=0 \mdframedpackagename}% - }% + \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}% + \md@PackageWarning{The style number \value{mdf@globalstyle@cnt} does not exist^^J + mdframed ues instead style=0 \mdframedpackagename}% + }% \fi% }% \mdf@load@style -%%==================================================%% -%%========= style-abhaengige Modifikation ==========%% -%%==================================================%% + \newrobustcmd*\md@styledefinition{% - \ifnumequal{\value{mdf@globalstyle@cnt}}{0}% + \ifnumequal{\value{mdf@globalstyle@cnt}}{0}% {\deflength{\mdf@innerlinewidth@length}{\z@}% \deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}% \deflength{\mdf@outerlinewidth@length}{\z@}% @@ -619,62 +473,53 @@ \let\mdf@middlelinecolor\mdf@linecolor% \let\mdf@outerlinecolor\mdf@linecolor% }{}% - \ifnumequal{\value{mdf@globalstyle@cnt}}{2}% + \ifnumequal{\value{mdf@globalstyle@cnt}}{2}% {\deflength{\mdf@innerlinewidth@length}{\z@}% \deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}% \deflength{\mdf@outerlinewidth@length}{\z@}% \let\mdf@innerlinecolor\mdf@linecolor% }{}% - \ifnumequal{\value{mdf@globalstyle@cnt}}{3}% + \ifnumequal{\value{mdf@globalstyle@cnt}}{3}% {\deflength{\mdf@innerlinewidth@length}{\z@}% \deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}% \deflength{\mdf@outerlinewidth@length}{\z@}% \let\mdf@innerlinecolor\mdf@linecolor% }{}% } - -%%==================================================%% -%%Modifikation zur Nutzung innerhalb float/minipage=%% -%%==================================================%% -%option nobreak \let\md@reserved@a\@empty \newrobustcmd*\detected@md@put@frame{% \ifmdf@nobreak%Option nobreak=true? - \def\md@reserved@a{\md@put@frame@standalone}% - \else - \def\md@reserved@a{\md@put@frame}% - \ifnum\@floatpenalty<0\relax%Detecting float - \if@twocolumn% - \ifx\@captype\@undefined - \def\md@reserved@a{\md@put@frame}% - \else - \md@PackageInfo{mdframed inside float ^^J - mdframed uses option nobreak \mdframedpackagename}% - \def\md@reserved@a{\md@put@frame@standalone}% - \fi - \else - \md@PackageInfo{mdframed inside float ^^J - mdframed uses option nobreak \mdframedpackagename}% - \def\md@reserved@a{\md@put@frame@standalone}% - \fi% - \fi% - \if@minipage% - \md@PackageInfo{mdframed inside minipage ^^J - mdframed uses option nobreak \mdframedpackagename}% - \def\md@reserved@a{\md@put@frame@standalone}% - \fi% - \ifinner% - \md@PackageInfo{mdframed inside a box ^^J - mdframed uses option nobreak \mdframedpackagename}% - \def\md@reserved@a{\md@put@frame@standalone}% - \fi% + \def\md@reserved@a{\md@put@frame@standalone}% + \else + \def\md@reserved@a{\md@put@frame}% + \ifnum\@floatpenalty<0\relax%Detecting float + \if@twocolumn% + \ifx\@captype\@undefined + \def\md@reserved@a{\md@put@frame}% + \else + \md@PackageInfo{mdframed inside float ^^J + mdframed uses option nobreak \mdframedpackagename}% + \def\md@reserved@a{\md@put@frame@standalone}% + \fi + \else + \md@PackageInfo{mdframed inside float ^^J + mdframed uses option nobreak \mdframedpackagename}% + \def\md@reserved@a{\md@put@frame@standalone}% + \fi% + \fi% + \if@minipage% + \md@PackageInfo{mdframed inside minipage ^^J + mdframed uses option nobreak \mdframedpackagename}% + \def\md@reserved@a{\md@put@frame@standalone}% + \fi% + \ifinner% + \md@PackageInfo{mdframed inside a box ^^J + mdframed uses option nobreak \mdframedpackagename}% + \def\md@reserved@a{\md@put@frame@standalone}% + \fi% \fi% \md@reserved@a% } - -%%==================================================%% -%%======keine Linien anzeigen - hidealllines =======%% -%%==================================================%% \newrobustcmd*\md@hidealllines@check{% \ifbool{mdf@hidealllines}{% \setbool{mdf@leftline}{false}% @@ -683,40 +528,22 @@ \setbool{mdf@bottomline}{false}% }{}% } - - -%%==================================================%% -%%==Deklaration diverser Eingabe und Hilfsparameter=%% -%%==================================================%% -%X-Laengen \newlength\mdfboundingboxwidth \newlength\mdfboundingboxtotalwidth -%Y-Laengen \newlength\mdfboundingboxheight \newlength\mdfboundingboxdepth \newlength\mdfboundingboxtotalheight - - - \newlength\md@freevspace@length \newlength\md@horizontalwidthofbox@length \newlength\md@verticalmarginwhole@length - \providecommand*\ptTps{} - -%Kommando in tikz mit relax belegt: \newrobustcmd\mdfcreateextratikz{} - - -%%==================================================%% -%%==================Umgebung========================%% -%%==================================================%% \def\mdframed{\@ifnextchar[\mdframed@i\mdframed@ii}% \def\mdframed@ii{\mdframed@i[]}% \def\mdframed@i[#1]{% default-Umgebung \begingroup -%check is needed? - \mdfsetup{userdefinedwidth=\linewidth,#1}%% +%%Ueberlegung- wie es besser geht!!!! WICHTIG + \mdfsetup{userdefinedwidth=\linewidth,#1} \md@hidealllines@check% \mdf@settings% \md@twoside@checklength% @@ -725,26 +552,23 @@ \setlength{\topsep}{\mdf@skipabove@length}% \begingroup% \let\partopsep\z@% - \expandafter\endgroup% + \expandafter\endgroup% \begin{md@trivlist}\item\relax% \md@checkntheorem% \md@styledefinition% - \md@horizontalmargin@equation% \md@footnoteinput% + \md@horizontalmargin@equation% \begin{md@lrbox}{\@tempboxa}% }% - \def\endmdframed{% \ifmdf@footnoteinside% \def\md@reserveda{% \md@footnoteoutput% \end{md@lrbox}% - \let\hsize\linewidth \detected@md@put@frame}% \else% \def\md@reserveda{% - \end{md@lrbox} - \let\hsize\linewidth + \end{md@lrbox}% \detected@md@put@frame% \md@footnoteoutput% }% @@ -754,9 +578,6 @@ \hrule \@height\z@ \@width\hsize \endgroup\@endparenv% } -%%==================================================%% -%%================== Twoside-Modus =================%% -%%==================================================%% \newtoggle{md:checktwoside} \settoggle{md:checktwoside}{false} \newrobustcmd*\md@twoside@checklength{% @@ -781,16 +602,13 @@ }{}% \fi% } - \newcounter{md@zref@counter}%keine doppelten laebes \zref@newprop*{md@pagevalue}[0]{\number\value{page}} \zref@addprop{\ZREF@mainlist}{md@pagevalue} - \newrobustcmd*\md@zref@label{% \stepcounter{md@zref@counter} \zref@label{md@pagelabel-\number\value{md@zref@counter}}% } - \newrobustcmd*\if@md@pageodd{% \zref@refused{md@pagelabel-\the\value{md@zref@counter}}% \ifodd\zref@extract{md@pagelabel-\the\value{md@zref@counter}}{md@pagevalue}% @@ -800,7 +618,6 @@ \fi \md@reserveda% } - \newrobustcmd*\md@pageisodd{% \ifdimequal{\mdf@outermargin@length}{-999pt}% {\setlength\mdf@rightmargin@length{\z@}}% @@ -817,12 +634,7 @@ {\setlength\mdf@rightmargin@length{\z@}}% {\setlength\mdf@rightmargin@length{\mdf@innermargin@length}}% } - \newrobustcmd*\md@@setzref{\md@zref@label\if@md@pageodd} - -%%==================================================%% -%%================= Platz auf Seite ================%% -%%==================================================%% \newrobustcmd*\md@freepagevspace{% \penalty\@M \vskip 2\baselineskip \vskip\height \penalty9999 \vskip -2\baselineskip \vskip-\height @@ -833,14 +645,9 @@ \advance\md@freevspace@length by -\pagetotal\relax% }% } - -%%==================================================%% -%================= Breite der Box =================%% -%%==================================================%% \newrobustcmd*\md@advancelength@orizontalmargin@add[1]{% \advance\md@horizontalspaceofbox by -\csname mdf@#1@length\endcsname\relax% } - \newlength\md@horizontalspaceofbox \newrobustcmd*\md@horizontalmargin@equation{% \setlength{\md@horizontalspaceofbox}{\mdf@userdefinedwidth@length}% @@ -853,21 +660,17 @@ \advance\md@horizontalspaceofbox by \mdf@innerlinewidth@length\relax% \advance\md@horizontalspaceofbox by \mdf@middlelinewidth@length\relax% \advance\md@horizontalspaceofbox by \mdf@outerlinewidth@length\relax% - }{}% + }{}% \notbool{mdf@rightline}{% \advance\md@horizontalspaceofbox by \mdf@innerlinewidth@length\relax% \advance\md@horizontalspaceofbox by \mdf@middlelinewidth@length\relax% - \advance\md@horizontalspaceofbox by \mdf@outerlinewidth@length\relax% + \advance\md@horizontalspaceofbox by \mdf@outerlinewidth@length\relax% }{}% - % \advance\md@horizontalspaceofbox by - \width\md@arrayparboxrestore% %%% Beruecksichtigung, dass Auszaehlung bzw. list-Umgebung enthalten - \ifdimless{\md@horizontalspaceofbox}{3cm}{\md@PackageWarning{You have only a width of 3cm}}{} + \ifdimless{\md@horizontalspaceofbox}{3cm}% + {\md@PackageWarning{You have only a width of 3cm}}{} \hsize=\md@horizontalspaceofbox% } - -%%==================================================%% -%%===========Beruecksichtige Linienausgabe==========%% -%%==================================================%% \newrobustcmd*\md@keeplines@single{% \notbool{mdf@topline}{% \advance\md@verticalmarginwhole@length by -\mdf@middlelinewidth@length% @@ -876,39 +679,25 @@ \advance\md@verticalmarginwhole@length by -\mdf@middlelinewidth@length% }{}% } - -%%==================================================%% -%%===========Additionsalgorithmus fuer for==========%% -%%==================================================%% \newrobustcmd*\md@advancelength@verticalmarginwhole[1]{% \advance\md@verticalmarginwhole@length by \csname mdf@#1@length\endcsname\relax% } - \newrobustcmd*\md@advancelength@freevspace@sub[1]{% \advance\dimen@ by -\csname mdf@#1@length\endcsname\relax% } - \newrobustcmd*\md@advancelength@freevspace@add[1]{% \advance\dimen@ by \csname mdf@#1@length\endcsname\relax% } -%%==================================================%% -%%====================Reset changes=================%% -%%==================================================%% -\protected@edef\md@reset{\boxmaxdepth\the\boxmaxdepth +\protected@edef\md@reset{\boxmaxdepth\the\boxmaxdepth \splittopskip\the\splittopskip}% - - -%%==================================================%% -%%===========Ausgaberoutine -> Berechnung===========%% -%%==================================================%% - \newrobustcmd*\md@put@frame@standalone{\relax% \ifvoid\@tempboxa\relax \md@PackageWarning{The environment is empty\MessageBreak}% \let\md@reserved@a\relax% \else %Hier berechnung Box-Inhalt+Rahmen oben und unten - \setlength{\md@verticalmarginwhole@length}{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}% + \setlength{\md@verticalmarginwhole@length}% + {\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}% \mdf@dolist{\md@advancelength@verticalmarginwhole}{% outerlinewidth,middlelinewidth,innerlinewidth,innertopmargin, innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}% @@ -917,24 +706,23 @@ \fi \md@reserved@a% } - - \def\md@put@frame{\relax% \ifvoid\@tempboxa\relax \md@PackageWarning{The environment is empty\MessageBreak}% \let\md@reserved@a\relax% \else - \md@print@space% - \md@freepagevspace% - \md@PackageInfoSpace{\the\md@freevspace@length before the beginning of the environment^^J - ending on input line \MessageBreak}% + \md@print@space% + \md@freepagevspace% + \md@PackageInfoSpace{\the\md@freevspace@length before the beginning of ^^J + the environment ending on input line \MessageBreak}% \ifdimless{\md@freevspace@length}{2\baselineskip} - {\md@PackageInfo{Not enough space on this page}%die Seite hat nur noch minimal Platz + {\md@PackageInfo{Not enough space on this page} \vfill\eject% \def\md@reserved@a{\md@put@frame}% }{% %Hier berechnung Box-Inhalt+Rahmen oben und unten - \setlength{\md@verticalmarginwhole@length}{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}% + \setlength{\md@verticalmarginwhole@length}% + {\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}% \mdf@dolist{\md@advancelength@verticalmarginwhole}{% outerlinewidth,middlelinewidth,innerlinewidth,innertopmargin, innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}% @@ -943,7 +731,7 @@ {%passt auf Seite% \begingroup \iftoggle{md:checktwoside}{\md@@setzref}{}% - \md@putbox@single%%passt auf Seite + \md@putbox@single \endgroup \let\md@reserved@a\relax}% {\def\md@reserved@a{\md@put@frame@i}}%passt nicht auf Seite @@ -951,7 +739,6 @@ \fi \md@reserved@a% } - \def\md@put@frame@i{%Box muss gesplittet werden -- Ausgabe der ersten Teilbox %Berechnung der Splittgroesse -- Linien und Abstand oben \md@freepagevspace% @@ -978,7 +765,6 @@ \advance\dimen@ by -1pt\relax%Box darf nicht zu Groß werden. \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% \setbox\tw@\vsplit\@tempboxa to \dimen@ - \setbox\tw@\vbox{\unvbox\tw@}%needed? \ifdimgreater{\ht\tw@+\dp\tw@}{\dimen@}{%Falsch gesplittet \md@PackageInfo{Box was splittet wrong\MessageBreak}% \dimen@i=\dimen@ @@ -987,11 +773,11 @@ \advance\dimen@i by 0.5\dimen@ \splittopskip\z@% \setbox\@tempboxa\vbox{\unvbox\tw@% - \hrule \@height\dp\strutbox \@width\z@%benoetigt um Tiefe zu haben + %benoetigt um Tiefe zu haben + \hrule \@height\dp\strutbox \@width\z@ \unvbox\@tempboxa} \splittopskip\mdf@splittopskip@length% \setbox\tw@\vsplit\@tempboxa to \dimen@i - \setbox\tw@\vbox{\unvbox\tw@}% }{}% \setbox\@tempboxa\vbox{\unvbox\@tempboxa}%PRUEFEN!!!! \ifvoid\@tempboxa @@ -1004,7 +790,7 @@ \fi \ifvoid\tw@%%pruefe, ob erste Box leer ist \hrule \@height\z@ \@width\hsize - \vfill\eject% + \vfill\eject% \def\md@reserved@a{\md@put@frame}% \else \ifdimequal{\ht\tw@}{0pt}% @@ -1022,11 +808,10 @@ \vfill\eject% \def\md@reserved@a{\md@put@frame@ii}% }% - \fi% + \fi% \fi% \md@reserved@a% } - \def\md@put@frame@ii{%Ausgabe der mittleren Box(en) wenn vorhanden \setlength{\md@freevspace@length}{\vsize}% \setlength{\dimen@}{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}% @@ -1039,7 +824,7 @@ \advance\md@freevspace@length by -\mdf@splitbottomskip@length \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% \setbox\tw@\vsplit\@tempboxa to \md@freevspace@length% - \setbox\tw@\vbox{\unvbox\tw@}%PRUEFEN!!! + % \setbox\tw@\vbox{\unvbox\tw@}%PRUEFEN!!! \setbox\@tempboxa\vbox{\unvbox\@tempboxa}%PRUEFEN!!!! \ifvoid\@tempboxa\relax% \md@PackageWarning{You got a bad break\MessageBreak @@ -1067,18 +852,26 @@ }%Hier kommt die Ausgabe der letzten Box \md@reserved@a% } - -%%==================================================%% -%%= Sicherstellen, dass Optionen nur global setzbar=%% -%%==================================================%% -\DisableKeyvalOption[% - action=warning, - package=mdframed, -]{mdf}{framemethod}% - -\DisableKeyvalOption[% - action=warning, - package=mdframed, -]{mdf}{xcolor}% -\endinput -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{framemethod}% +\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{xcolor}% + + \endinput +%% +%% ================================================================ +%% Copyright (C) 2011 by Marco Daniel +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License (LPPL), either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in the file: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) by +%% Marco Daniel. +%% +%% Have fun! +%% +%% ================================================================ +%% +%% End of file `mdframed.sty'. |