diff options
author | Karl Berry <karl@freefriends.org> | 2013-03-09 22:47:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-03-09 22:47:59 +0000 |
commit | 856ac22d901c0f4f007b58ee5af58f54b40ce4d3 (patch) | |
tree | 7aae426ef3e0892be42e493c0064875984118d69 /Master/texmf-dist/source | |
parent | d3e7010a51e2e85b7a564d576f92f0f06a1d4fa7 (diff) |
mdframed (9mar13)
git-svn-id: svn://tug.org/texlive/trunk@29319 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/mdframed/Makefile | 8 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/mdframed/mdframed.dtx | 245 |
2 files changed, 164 insertions, 89 deletions
diff --git a/Master/texmf-dist/source/latex/mdframed/Makefile b/Master/texmf-dist/source/latex/mdframed/Makefile index a1f2040f1d1..0976d3355e9 100644 --- a/Master/texmf-dist/source/latex/mdframed/Makefile +++ b/Master/texmf-dist/source/latex/mdframed/Makefile @@ -23,6 +23,8 @@ EXAMPLLIST= $(EXAMPLED) $(EXAMPLET) $(EXAMPLEP) $(EXAMPLESX) FILELIST = $(PACKAGE) $(EXAMPLED) $(EXAMPLET) $(EXAMPLEP) $(EXAMPLESX) STYLELIST = $(STYLE_I) $(STYLE_II) $(STYLE_III) $(STYLE_IV) AUXFILES = aux dtxe glo glolog gls hd ins idx idxlog ilg ind log out ps thm tmp toc xdv + + ################################################################ ## Colordefinition ################################################################ @@ -190,7 +192,7 @@ changeversion: @echo -e "$(OK_COLOR)Aktuell wird die folgende Version verwendet" @sed '/\\def\\mdversion/!d' $(PACKAGE).sty @echo -e "$(WARN_COLOR)" - @read -p "Bitte neue Version eingeben: " REPLY && sed -rie "s/(\\\\def\\\\mdversion\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\ + @read -p "Bitte neue Version eingeben: " REPLY && sed -Eie "s/(\\\\def\\\\mdversion\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\ echo -e "$(OK_COLOR)Version geändert zu $$REPLY$(NO_COLOR)" @echo @@ -199,7 +201,7 @@ changerevision: @echo -e "$(OK_COLOR)Aktuell wird die folgende Revision verwendet" @sed '/\\def\\mdfrevision/!d' $(PACKAGE).dtx @echo -e "$(WARN_COLOR)" - @REPLY=`git rev-list HEAD | wc -l` && sed -rie "s/(\\\\def\\\\mdfrevision\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\ + @REPLY=`git rev-list HEAD | wc -l` && sed -Eie "s/(\\\\def\\\\mdfrevision\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\ echo -e "$(OK_COLOR)Revision geändert zu $$REPLY$(NO_COLOR)" @echo @@ -208,7 +210,7 @@ changedate: @echo -e "$(OK_COLOR)Aktuell wird die folgendes Datum verwendet" @sed '/\\def\\mdfmaindate/!d' $(PACKAGE).dtx @echo -e "$(WARN_COLOR)" - @REPLY=`date +"%Y\/%m\/%d"` && sed -rie "s/(\\\\def\\\\mdfmaindate\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\ + @REPLY=`date +"%Y\/%m\/%d"` && sed -Eie "s/(\\\\def\\\\mdfmaindate\{).*(})/\1$$REPLY\2/" $(PACKAGE).dtx&&\ echo -e "$(OK_COLOR)Datum geändert zu $$REPLY$(NO_COLOR)" @echo diff --git a/Master/texmf-dist/source/latex/mdframed/mdframed.dtx b/Master/texmf-dist/source/latex/mdframed/mdframed.dtx index 7f80de45b5b..f1209ceffba 100644 --- a/Master/texmf-dist/source/latex/mdframed/mdframed.dtx +++ b/Master/texmf-dist/source/latex/mdframed/mdframed.dtx @@ -218,6 +218,15 @@ Have fun! \documentclass[parskip=false,11pt,]{ltxmdf} \usepackage[framemethod=TikZ]{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} + \EnableCrossrefs \CodelineIndex %%\RecordChanges @@ -288,12 +297,19 @@ Have fun! % package \Pack{mdframed} allows you to create environments with breakable % frames. I think an example is the best way to demonstrate its properties. % -% -% \newmdtheoremenv[outerlinewidth=2,leftmargin=40,rightmargin=40,% -% backgroundcolor=yellow,outerlinecolor=blue,innertopmargin=\topskip,% -% splittopskip=\topskip,skipbelow=\baselineskip, -% skipabove=\baselineskip, -% ntheorem,roundcorner=5pt]{theorem}{Theorem}[section] +% \newmdtheoremenv[% +% outerlinewidth = 2 ,% +% roundcorner = 10pt ,% +% leftmargin = 40 ,% +% rightmargin = 40 ,% +% backgroundcolor = yellow ,% +% outerlinecolor = blue ,% +% innertopmargin = \topskip ,% +% splittopskip = \topskip ,% +% ntheorem = true ,% +% skipabove = \baselineskip ,% +% skipbelow = \baselineskip] +% {theorem}{Theorem}[section] % % \begin{theorem}[Pythagorean theorem] % In any right triangle, the area of the square whose side is the hypotenuse @@ -308,13 +324,19 @@ Have fun! % \iffalse %<*example> % \fi -\begin{tltxmdfexample} - \newmdtheoremenv[outerlinewidth=2,leftmargin=40,% - rightmargin=40,backgroundcolor=yellow,% - outerlinecolor=blue,innertopmargin=\topskip,% - splittopskip=\topskip,skipbelow=\baselineskip,% - skipabove=\baselineskip,ntheorem]{theorem}% - {Theorem}[section] +\begin{tltxmdfexample}[columns=fixed,fontadjust=false] + \newmdtheoremenv[% + outerlinewidth = 2 ,% + leftmargin = 40 ,% + rightmargin = 40 ,% + backgroundcolor = yellow ,% + outerlinecolor = blue ,% + innertopmargin = \topskip ,% + splittopskip = \topskip ,% + ntheorem = true ,% + skipabove = \baselineskip ,% + skipbelow = \baselineskip] + {theorem}{Theorem}[section] \begin{theorem}[Pythagorean theorem] ... \end{theorem} @@ -434,7 +456,7 @@ Have fun! % \end{tikzpicture} % \hfill\null % -% \vspace{2\baselineskip} +% \vspace{3\baselineskip} % % \null\hfill % \begin{tikzpicture}[baseline=(current bounding box.north)] @@ -466,7 +488,7 @@ Have fun! % \end{scope} % \MiddleLinien[line width=2mm,draw=red!20,use as bounding box] % \node[anchor=south,font=\bfseries,text width=4cm,align=center] -% at (24mm,25mm) {Middle box -- middle part of the output}; +% at (24mm,20mm) {Middle box -- middle part of the output}; % \end{tikzpicture} % \hfill\null % @@ -528,21 +550,23 @@ Have fun! %<*example> % \fi \begin{tltxmdfexample} - Some Text \hspace{\mdflength{innerleftmargin}} Some Text - + The distance is \hspace{\mdflength{innerleftmargin}} \the\mdflength{innerleftmargin} \end{tltxmdfexample} % \iffalse %</example> % \fi -% +% The result will be: +% \begin{center} +% The distance is \hspace{\mdflength{innerleftmargin}} \the\mdflength{innerleftmargin} +% \end{center} % % % \ExplCmd{mdfsetup}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 -% \textbf{\color{red!70!black}At this point I want to recommend the using of +% \textbf{\color{red!70!black}At this point I want to recommend the usage of % the command \Cmd{mdfsetup} instead of setting package option via the optional % argument of \Cmd{usepackage}. So you are avoiding breaking of non robust % commands.}^^A @@ -550,7 +574,9 @@ Have fun! % \href{https://groups.google.com/group/de.comp.text.tex/^^A % browse_thread/thread/15c5ad290490d426?hl=de}^^A % {kvoptions-Declaration von Optionen schl\"agt fehl}} -% +% 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} @@ -1175,8 +1201,7 @@ Have fun! % \fi \begin{tltxmdfexample} \theoremstyle{<some style>} - \newmdtheoremenv[linecolor=blue]{lemma}% - {Lemma}[section] + \newmdtheoremenv[linecolor=blue]{lemma}{Lemma}[section] ... \begin{lemma}[Some title] foo foo foo foo foo foo @@ -1459,6 +1484,7 @@ Have fun! % \fi % \item \Pack{mdframed} can't handle the option \Opt{allowframebreaks} of the % class \Pack{beamer}. +% \item A nested \Env{mdframed} environment can't be splitted. % \end{enumerate} % % @@ -1666,6 +1692,16 @@ Have fun! % \subsection{Revision history}\label{rev} % \raggedright % +% +% \minisec{Version 1.8 submitted 09 Mar 2013} +% \begin{itemize*} +% \item fixed bugs (e.g. related to \Cmd{parskip} of KOMA) +% \item allow margin notes with \Opt{framemethod=tikz} +% \item fixed some typos +% \end{itemize*} +% +% +% \footnotesize % \minisec{Version 1.6d submitted 21 Sep 2012} % \begin{itemize*} % \item fixed bugs @@ -1721,8 +1757,7 @@ Have fun! % \item added option \Opt{everyline} to draw a top and bottom line at % splitted frames % \end{itemize*} -% -% \footnotesize +% % \minisec{Version 1.4 submitted 4 Mar 2012} % \begin{itemize*} % \item fixed bug in combination with \Cmd{marginpar} (Thanks Juan Carlos @@ -1902,10 +1937,10 @@ Have fun! % \begin{macro}{mdversion,mdframedpackagename,mdfmaindate} % Set package information % \begin{macrocode} -\def\mdversion{1.6d} +\def\mdversion{1.8} \def\mdframedpackagename{mdframed} -\def\mdfmaindate{2012/09/21} -\def\mdfrevision{162}% Done by github: git rev-list HEAD | wc -l +\def\mdfmaindate{2013/03/09} +\def\mdfrevision{ 172}% Done by github: git rev-list HEAD | wc -l % \end{macrocode} % \end{macro} % @@ -2253,6 +2288,7 @@ Have fun! {subsubtitleaboveline==false}, {subsubtitlebelowline==false}, {draft==false}, + {suppressfirstparskip==true}, } %%special boolflag hidealllines: \newbool{mdf@hidealllines}% @@ -2522,10 +2558,10 @@ Have fun! \let\mdf@deferred@thm@head\deferred@thm@head \pretocmd{\deferred@thm@head}{\@inlabelfalse}% {\mdf@PackageInfo{mdframed detected package amsthm ^^J - changed the theoerem header of amsthm\MessageBreak}% + changed the theorem header of amsthm\MessageBreak}% }{% \mdf@PackageError{mdframed detected package amsthm ^^J - changed the theoerem header of amsthm + changed the theorem header of amsthm failed\MessageBreak}% }% }% @@ -2538,6 +2574,7 @@ 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} \setlength{\topsep}{#1}% \partopsep\z@% \parsep\z@% @@ -2548,17 +2585,17 @@ Have fun! \itemindent\z@% \let\@itemlabel\@empty% \def\makelabel##1{##1}% -%% \item\leavevmode\hrule \@height\z@ \@width\linewidth\relax% + \item\relax\x\relax\leavevmode\hrule \@height\z@ \@width\linewidth\relax% %% \item\mbox{}\relax% second version - \item\relax% first Version +%% \item\relax\x% first Version } \let\endmdf@trivlist\endtrivlist \patchcmd\endmdf@trivlist\@endparenv\mdf@endparenv{% - \immediate\typeout{^^J****** mdframed patching \string\endmdf@trivlist}% - \immediate\typeout{^^J****** -- success******^^J}% + \wlog{^^J****** mdframed patching \string\endmdf@trivlist}% + \wlog{^^J****** -- success******^^J}% }{% - \immediate\typeout{^^J****** mdframed patching \string\endmdf@trivlist}% - \immediate\typeout{^^J****** -- failed******^^J}% + \wlog{^^J****** mdframed patching \string\endmdf@trivlist}% + \wlog{^^J****** -- failed******^^J}% } \def\mdf@endparenv{% \addpenalty\@endparpenalty\addvspace\mdf@skipbelow@length\@endpetrue} @@ -2909,6 +2946,21 @@ Have fun! % \end{macrocode} % \end{macro} % +% +% +% +% \begin{macro}{mdf@envdepth} +% Setting up a counter for the depth of the environment. Nesting of two +% \Env{mdframed} environments isn't recommended but I am trying to support +% the basic rules. +% \begin{macrocode} +\newcount\mdf@envdepth \mdf@envdepth=0 +\@definecounter{mdf@env@i} +\@definecounter{mdf@env@ii} +% \end{macrocode} +% \end{macro} +% +% % \begin{macro}{mdframed} % The user environement. % \begin{macrocode} @@ -2933,6 +2985,13 @@ Have fun! \ifdimgreater{\overfullrule}{0pt}{}{\setlength\overfullrule{5pt}}% }{}% % \end{macrocode} +% Nesting environments and provide an extra counter. +% \begin{macrocode} + \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% @@ -2946,6 +3005,12 @@ Have fun! % \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}% @@ -3326,8 +3391,8 @@ Have fun! \ifdim\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax>\dimen@ \advance\dimen@i by -\p@\relax \advance\@tempcnta by \@ne\relax -%% \immediate\typeout{***mdframed \string\@tempcnta=\the\@tempcnta***} -%% \immediate \typeout{***mdframed \string\dimen@i=\the\dimen@i***} +%% \wlog{***mdframed \string\@tempcnta=\the\@tempcnta***} +%% \wlog{***mdframed \string\dimen@i=\the\dimen@i***} \mdf@ignorevbadness% \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}% \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length% @@ -3540,8 +3605,8 @@ Have fun! \mdf@freevspace@length\relax \advance\dimen@i by -\p@\relax% \advance\@tempcnta by \@ne\relax% -%% \immediate\typeout{***mdframed \string\@tempcnta=\the\@tempcnta***} -%% \immediate \typeout{***mdframed \string\dimen@i=\the\dimen@i***} +%% \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 @@ -4869,7 +4934,7 @@ Have fun! %Allgemeine Einstellungen fuer tikz \def\mdf@tikz@settings{% % - \mdf@testdraftmode% +%% \mdf@testdraftmode% \tikzset{mdfbox/.style={anchor=south west,% inner sep=0pt,% outer sep=0pt,% @@ -4957,50 +5022,50 @@ Have fun! % \begin{macro}{mdf@testdraftmode} % draftmode test % \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@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;% +%% }% +%% }{}% +%% }% +%%} % \end{macrocode} % \end{macro} % @@ -5375,6 +5440,7 @@ Have fun! \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}}{}% % @@ -5419,6 +5485,7 @@ Have fun! % %Frametitlebackground \drawbrackgroundframetitle@single + \end{scope} % \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};%output \end{scope} @@ -5506,8 +5573,8 @@ Have fun! -0.5\mdf@middlelinewidth@length% +\mdf@frametitlebelowskip@length +\mdf@splitbottomskip@length - +\mdf@splittopskip@length - +\dp\strutbox% +%% +\mdf@splittopskip@length + -\dp\strutbox% }% }% }% @@ -5613,6 +5680,7 @@ Have fun! \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}{% @@ -5686,6 +5754,7 @@ Have fun! } %%%%%%%%%%%% \drawbrackgroundframetitle@first + \end{scope} \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% \end{scope} %HIER KOMMT EIN WEITERES MAKRO @@ -5853,6 +5922,7 @@ Have fun! \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}{% @@ -5904,6 +5974,7 @@ Have fun! } %%%%%%%% \drawbrackgroundframetitle@middle + \end{scope} \node[mdfbox]at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};% \end{scope} \mdf@middleextra @@ -6056,6 +6127,7 @@ Have fun! \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}{% @@ -6129,6 +6201,7 @@ Have fun! {}% }% \drawbrackgroundframetitle@second + \end{scope} \node[mdfbox] at (\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};% \end{scope} \mdf@secondextra |