% \iffalse meta-comment % !TEX program = pdfLaTeX %<*internal> \iffalse % %<*readme> ================================================================ ================================================================ 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 (supports tikz implementation) License type: lppl ================================================================ The revision history is printed in the documentation. ================================================================ The current development is available at github: https://github.com/marcodaniel/mdframed ================================================================ The package provides * one dtx files, * one Makefile (compiling for Linux/Mac), * one mdframedmake.bat (compiling for Windows) * one personal documentclass ltxmdf.cls * one example picture donald-duck.jpg By running the script `make all` you will produce the following files: - README.txt - mdframed.sty - mdframed.pdf - md-frame-0.mdf - md-frame-1.mdf - md-frame-2.mdf - md-frame-3.mdf - mdframed-example-default.tex - mdframed-example-default.pdf - mdframed-example-tikz.tex - mdframed-example-tikz.pdf - mdframed-example-pstricks.tex - mdframed-example-pstricks.pdf - mdframed-example-texsx.tex - mdframed-example-texsx.pdf I recommend the following installation in your texmf-tree: /doc/latex/mdframed/ - README.txt - mdframed.pdf - mdframed-example-default.tex - mdframed-example-default.pdf - mdframed-example-tikz.tex - mdframed-example-tikz.pdf - mdframed-example-pstricks.tex - mdframed-example-pstricks.pdf - mdframed-example-texsx.tex - mdframed-example-texsx.pdf - ctan-lion.png "CTAN lion drawing by Duane Bibby; thanks to www.ctan.org". /source/latex/mdframed/ - Makefile - mdframed.dtx /tex/latex/mdframed - mdframed.sty - md-frame-0.mdf - md-frame-1.mdf - md-frame-2.mdf - md-frame-3.mdf - ltxmdf.cls ================================================================ ================================================================ % %<*internal> \fi \def\nameofplainTeX{plain} \ifx\fmtname\nameofplainTeX\else \expandafter\begingroup \fi % %<*install> \input docstrip.tex \keepsilent \askforoverwritefalse \preamble ---------------------------------------------------------------- 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-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. 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___| >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ================================================== \endpreamble \postamble ================================================================ Copyright (C) 2012 by Marco Daniel This work may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either 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! ================================================================ \endpostamble \usedir{tex/latex/mdframed} \generate{\file{mdframed.sty}{\from{mdframed.dtx}{package}}} \nopreamble\nopostamble\usedir{tex/latex/mdframed} \generate{\file{md-frame-0.mdf}{\from{mdframed.dtx}{mdframedefault}}} \nopreamble\nopostamble\usedir{tex/latex/mdframed} \generate{\file{md-frame-1.mdf}{\from{mdframed.dtx}{mdframetikz}}} \nopreamble\nopostamble\usedir{tex/latex/mdframed} \generate{\file{md-frame-2.mdf}{\from{mdframed.dtx}{mdframepstricks}}} \nopreamble\nopostamble\usedir{tex/latex/mdframed} \generate{\file{md-frame-3.mdf}{\from{mdframed.dtx}{mdframepstricks}}} \Msg{*********************************************************} \Msg{*} \Msg{* To finish the installation you have to move the} \Msg{* following file into a directory searched by TeX:} \Msg{*} \Msg{* \space\space documentation.sty} \Msg{*} \Msg{* To produce the documentation run the file mdframed.dtx} \Msg{* once through LaTeX. Then, run} \Msg{*} \Msg{* \space\space makeindex -s gglo.ist -o mdframed.gls mdframed.glo} \Msg{* \space\space makeindex -s gind.ist mdframed.idx} \Msg{*} \Msg{* through makeIndex to produce the glossary.} \Msg{* Finally, run PdfLaTeX once again.} \Msg{*} \Msg{* To create the examples run (pdf)latex on the tex-files.} \Msg{*} \Msg{* That's all!} \Msg{*} \Msg{* Happy TeXing!} \Msg{*********************************************************} % %\endbatchfile %<*internal> \usedir{source/latex/mdframed} \generate{\file{mdframed.ins} {\from{mdframed.dtx}{install}}} \nopreamble\nopostamble\usedir{doc/latex/mdframed} \generate{\file{README.txt} {\from{mdframed.dtx}{readme}}} \nopreamble\nopostamble\usedir{source/latex/mdframed} \generate{\file{mdframed-example-default.tex} {\from{mdframed.dtx}{mdframed-example-default}}} \nopreamble\nopostamble\usedir{source/latex/mdframed} \generate{\file{mdframed-example-tikz.tex} {\from{mdframed.dtx}{mdframed-example-tikz}}} \nopreamble\nopostamble\usedir{source/latex/mdframed} \generate{\file{mdframed-example-pstricks.tex} {\from{mdframed.dtx}{mdframed-example-pstricks}}} \nopreamble\nopostamble\usedir{source/latex/mdframed} \generate{\file{mdframed-example-texsx.tex} {\from{mdframed.dtx}{mdframed-example-texsx}}} \ifx\fmtname\nameofplainTeX \expandafter\endbatchfile \else \expandafter\endgroup \fi % %<*driver> \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} \EnableCrossrefs \CodelineIndex \OnlyDescription %%\RecordChanges \begin{document} \DocInput{mdframed.dtx} \end{document} % % \fi % % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % \GetFileInfo{mdframed.sty} % % % \title{The \Pack{mdframed} package % \footnote{Extending the package \texttt{framed.sty}}} % \subtitle{auto-split frame environment} % \author{\href{mailto:marco.daniel@mada-nada.de}{Marco Daniel}, % \href{mailto:marco.daniel@mada-nada.de}{Elke Schubert}} % \version{\mdversion} % \date{\mdfmaindate} % \introduction{The standard methods for framing text (\Cmd{fbox} % or \Cmd{fcolorbox}) require you to handle page breaks % by hand, meaning that you have to split the \Cmd{fbox} % into two. The present package defines the environment % \Pack{mdframed} which automatically deals with pagebreaks % in framed text.\par % By defining new environments the user may choose between % several individual designs.% % \par\kern.5\baselineskip\noindent % Linked files:\quad % \begin{tabular}[t]{ll} % \url{mdframed-example-default.pdf} & % \url{mdframed-example-tikz.pdf} \\ % \url{mdframed-example-pstricks.pdf} & % \url{mdframed-example-texsx.pdf} % \end{tabular} % \par\kern.5\baselineskip\noindent % FYI:\quad\parbox[t]{.8\linewidth}{% % I create a repository for \Pack{mdframed} % on \href{https://github.com/marcodaniel/mdframed}{github} % where you can % \href{https://github.com/marcodaniel/mdframed}{download} % the current development status.}% % } % % \maketitle % % \vspace*{2\baselineskip} % % \section{Motivation} % Many users wish to (further) emphasize lemmata, definitions, proofs, etc. The % 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 ,% % roundcorner = 10pt ,% % leftmargin = 40 ,% % rightmargin = 40 ,% % backgroundcolor = yellow!40 ,% % outerlinecolor = blue!70!black ,% % innertopmargin = \topskip ,% % splittopskip = \topskip ,% % ntheorem = true ,% % ]{theorem}{Theorem}[section] % % \begin{theorem}[Pythagorean theorem] % 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. % % \[ a^2+b^2=c^2 \] % \end{theorem} % % The frame was defined with the following settings. % % \iffalse %<*example> % \fi \begin{tltxmdfexample}[columns=fixed,fontadjust=false] \newmdtheoremenv[% outerlinewidth = 2 ,% roundcorner = 10pt ,% leftmargin = 40 ,% rightmargin = 40 ,% backgroundcolor = yellow!40 ,% outerlinecolor = blue!70!black ,% innertopmargin = \topskip ,% splittopskip = \topskip ,% ntheorem = true ,% ]{theorem}{Theorem}[section] \begin{theorem}[Pythagorean theorem] ... \end{theorem} \end{tltxmdfexample} % \iffalse % % \fi % % % \section{Syntax}\label{sec:syntax} % % \minisec{Required packages by \Pack{mdframed}} % The package itself loads the packages % \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 %<*example> % \fi \begin{tltxmdfexample} \usepackage[]{mdframed} \end{tltxmdfexample} % \iffalse % % \fi % % Only the option \Opt{framemethod} should be loaded by the % optional argument of \Cmd{usepackage}. All other options % should be loaded with \Cmd{mdfsetup} or related environments. % The package should be loaded after \Pack{amsthm} if you need the package. % \minisec{Provided environment} % The package defines only one environment with the following syntax: % \iffalse %<*example> % \fi \begin{tltxmdfexample} \begin{mdframed}[] \end{mdframed} \end{tltxmdfexample} % \iffalse % % \fi % To create own environments with \Pack{mdframed} see section \ref{sec:cmds}. % % \minisec{Autodetecting floats} % \Pack{mdframed} detects whether the environment is used inside \Pack{float} % or \Pack{minipage} environments. If you use \Pack{mdframed} in such % an environment \Pack{mdframed} will use the option \Opt{nobreak} % automatically. % % % % %%%%%%%%%%%%%%%%%%%%%%% % \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 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;} % \newcommand\FirstSecond[1][]{\path[#1] (O|-P)--(O)--(P|-O)--(P);} % \newcommand\MiddleFlaeche[1][]{\path[#1] (O)--(O|-P)--(P)--(P|-O);} % \newcommand\MiddleLinien[1][]{\path[#1] (O)--(O|-P)(P)--(P|-O);} % \begin{center} % \vspace*{2\baselineskip} % \null\hfill % \begin{tikzpicture}[baseline=(current bounding box.north)] % \coordinate (O) at (0,0); % \pgfmathsetlengthmacro\x{4cm+2mm+6mm} % \pgfmathsetlengthmacro\y{2cm+2mm+6mm} % \coordinate (P) at (\x,\y); % \begin{scope} % \Single[line width=3mm,draw=blue!20] % \Single[clip] % \Single[fill=gray!70] % \Single[line width=7mm,draw=green!20] % \end{scope} % \Single[line width=2mm,draw=red!20,use as bounding box] % \node[anchor=south,font=\bfseries,text width=4cm,align=center] % % at (24mm,35mm) {Frame of a single page}; % \end{tikzpicture}% % \hfill% % \begin{tikzpicture}[baseline=(current bounding box.north)] % \coordinate (O) at (0,0); % \pgfmathsetlengthmacro\x{4cm+2mm+6mm} % \pgfmathsetlengthmacro\y{-2cm-1mm-3mm} % \coordinate (P) at (\x,\y); % \begin{scope} % \FirstSecond[line width=3mm,draw=blue!20] % \FirstSecond[clip] % \FirstSecond[fill=gray!70] % \FirstSecond[line width=7mm,draw=green!20] % \end{scope} % \FirstSecond[line width=2mm,draw=red!20,use as bounding box] % \node[anchor=south,font=\bfseries,text width=4cm,align=center] % at (2.4,0.7) {First box -- first part of the output}; % \end{tikzpicture} % \hfill\null % % \vspace{3\baselineskip} % % \null\hfill % \begin{tikzpicture}[baseline=(current bounding box.north)] % \coordinate (O) at (0,0); % \pgfmathsetlengthmacro\x{4cm+2mm+6mm} % \pgfmathsetlengthmacro\y{2cm+1mm+3mm} % \coordinate (P) at (\x,\y); % \begin{scope} % \FirstSecond[line width=3mm,draw=blue!20] % \FirstSecond[clip] % \FirstSecond[fill=gray!70] % \FirstSecond[line width=7mm,draw=green!20] % \end{scope} % \FirstSecond[line width=2mm,draw=red!20,use as bounding box] % \node[anchor=south,font=\bfseries,text width=4cm,align=center] % % at (24mm,25mm) {Second box -- last part of the output}; % \end{tikzpicture}% % \hfill% % \begin{tikzpicture}[baseline=(current bounding box.north)] % \coordinate (O) at (0,0); % \pgfmathsetlengthmacro\x{4cm+2mm+6mm} % \pgfmathsetlengthmacro\y{2cm} % \coordinate (P) at (\x,\y); % \begin{scope} % \MiddleLinien[line width=3mm,draw=blue!20] % \MiddleFlaeche[clip] % \MiddleFlaeche[fill=gray!70] % \MiddleLinien[line width=7mm,draw=green!20] % \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,20mm) {Middle box -- middle part of the output}; % \end{tikzpicture} % \hfill\null % % \captionof{figure}{The basic frames}\label{fig:basicframes} %\end{center} % %%%%%%%%%%%%%%%%%%%%%%% % \section{Commands}\label{sec:cmds} % % The following commands should countenance your by the handling with % \Pack{mdframed}. % % \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 \begin{tltxmdfexample} \newmdenv[]{Name of the environment} \end{tltxmdfexample} % \iffalse % % \fi % In this way you can say: % \iffalse %<*example> % \fi \begin{tltxmdfexample} \newmdenv[linecolor=red,frametitle=Infobox]{infobox} \begin{infobox}[backgroundcolor=yellow] Some Infos\ldots \end{infobox} \end{tltxmdfexample} % \iffalse % % \fi % \ExplCmd{renewmdenv[options]\{env-name\}} % By using this command you can redefine environments which are created by % \Cmd{newmdenv}. % % \ExplCmd{surroundwithmdframed[options]\{environment\}} % Sometimes you have predefined environments. This commands allows you to % 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 \begin{tltxmdfexample} \surroundwithmdframed[linewidth=2pt]{verbatim} \end{tltxmdfexample} % \iffalse % % \fi % % % \ExplCmd{mdflength\{options\}} % If you want to work with length defined by \Pack{mdframed} (for example % \Opt{innerleftmargin}) you can use the command \Cmd{mdflength}. % \iffalse %<*example> % \fi \begin{tltxmdfexample} The distance is \hspace{\mdflength{innerleftmargin}} \the\mdflength{innerleftmargin} \end{tltxmdfexample} % \iffalse % % \fi % The result will be: % \begin{center} % The distance is \hspace{\mdflength{innerleftmargin}} \the\mdflength{innerleftmargin} % \end{center} % % % \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 % \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 % \footnote{Thanks to Heiko Oberdiek and Philipp Stephani % \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}. % % % % % \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=1cm,linecolor=blue} \begin{mdframed}[style=mystyle] foo \end{mdframed} \end{tltxmdfexample} % \iffalse % % \fi % % % %%%%%%%%%%%%%%%%%%%%%%% % \section{Options} % The package provides various options to manipulate frames. In the following % section all options are listed. Some internal macros which can be manipulated % are not shown in this documentation. % The listed options are divided in global and local options. The global % options can not be used inside \Cmd{mdfsetup}. % % \subsection{Global Options}\label{globopt} % The following options are only global options. % % \ExplOpt[none]{xcolor} % By setting this key, the package \Pack{xcolor} will % be loaded with the given value(s). Without any value \mbox{\Pack{mdframed}} % loads the package \Pack{color} without any options. If the package % \Pack{xcolor} is already loaded the given option will be ignored. % I recommend to load \Pack{xcolor} before \Pack{mdframed}. % % \ExplOpt[default]{framemethod} % With this key you can change the way frames are drawn. You can decide % whether the frame is drawn with % \begin{enumerate} % \item \LaTeX-commands {\small\Cmd{hrule}, \Cmd{vrule}, \Cmd{rule}}, % \item \Pack{TikZ} {\small(the package \Pack{TikZ} will be loaded)} or % \item \Pack{PSTricks} {\small(the package \Pack{pstricks} will be loaded)}. % \end{enumerate} % The option \Opt{framemethod} requires a string. Allowed combinations are % listed in the following table. % \begin{center} % \renewcommand*\arraystretch{1.3} % \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}\\ % \midrule % \LaTeX-commands & default, tex, latex, none, 0 \\ % \Pack{TikZ} & tikz, pgf, 1 \\ % \Pack{PSTricks} & pstricks, ps, postscript, 2 \\ % \bottomrule % \end{tabular} % \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. % % 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 % % \fi % % \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}). % % \begin{center} % \begin{tikzpicture}[scale=0.9] % %Declaration % \newlength{\linew} % \setlength{\linew}{5pt} % \tikzstyle{every node}=[font=\bfseries\large\sffamily] % \coordinate (innersep) at (3.2,2.25); % \coordinate (outersep) at (3.2,2); % %Center % \node[fill=green!10,draw=black,framed,rounded corners, % minimum width=3cm,minimum height=1.5cm]% % (CenterNode) {Contents}; % % %frames % \draw[draw=red!70!black,line width=\linew] % % ($(CenterNode)+(innersep)$) % % rectangle ($(CenterNode)-(innersep)$); % \draw[draw=blue!70!black,line width=\linew] % % ($(CenterNode)+(innersep)+(\linew,\linew)$)% % rectangle ($(CenterNode)-(innersep)+(-\linew,-\linew)$); % \draw[draw=yellow!70!black,line width=\linew] % ($(CenterNode)+(innersep)+(2\linew,2\linew)$)% % rectangle ($(CenterNode)-(innersep)+(-2\linew,-2\linew)$); % \draw[draw=black,line width=1] ($(CenterNode)+(innersep)+(outersep)$)% % rectangle ($(CenterNode)-(innersep)-(outersep)$); % % % \tikzstyle{every node}=[font=\small\ttfamily] % %%innertopmargin % \draw[draw=black,triangle 45-triangle 45]let \p1=(innersep) in % (CenterNode.north) -- ($(CenterNode)+(0,\y1)-(0,.5\linew)$) ; % \path let \p1=(innersep) in % (CenterNode.north) % edge % node[align=center,framed,fill=white,draw=white]{innertopmargin} % ($(CenterNode)+(0,\y1)-(0,.5\linew)$) ; % %%innerbottommargin % \draw[draw=black,triangle 45-triangle 45]let \p1=(innersep) in % (CenterNode.south) -- ($(CenterNode)-(0,\y1)+(0,.5\linew)$) ; % \path let \p1=(innersep) in % (CenterNode.south) % edge % node[align=center,framed,fill=white,draw=white]{innerbottommargin} % ($(CenterNode)-(0,\y1)+(0,.5\linew)$) ; % % %%innerleftmargin % \draw[draw=black,triangle 45-triangle 45]let \p1=(innersep) in % (CenterNode.west) -- ($(CenterNode)-(\x1,0)+(.5\linew,0)$) ; % \path let \p1=(innersep) in % (CenterNode.west) edge % node[align=center,rotate=90,framed,fill=white,draw=white] % {innerleftmargin} % ($(CenterNode)-(\x1,0)+(.5\linew,0)$) ; % %%innerrightmargin % \draw[draw=black,triangle 45-triangle 45]let \p1=(innersep) in % (CenterNode.east) -- ($(CenterNode)+(\x1,0)-(.5\linew,0)$) ; % \path let \p1=(innersep) in % (CenterNode.east) edge % node[align=center,rotate=90,framed,fill=white,draw=white] % {innerrightmargin} % ($(CenterNode)+(\x1,0)-(.5\linew,0)$) ; % % % %%leftmargin % \draw[draw=black,triangle 45-triangle 45] % let \p1=(innersep) , \p2=(outersep) in % ($(CenterNode)-(\x1,0)-(2.5\linew,0)$) -- % ($(CenterNode)-(\x1,0)-(\x2,0)$) ; % \path let \p1=(innersep) , \p2=(outersep) in % ($(CenterNode)-(\x1,0)-(2.5\linew,0)$) edge % node[align=center,rotate=0,framed,fill=white,draw=white] % {leftmargin} % ($(CenterNode)-(\x1,0)-(\x2,0)$) ; % %%rightmargin % \draw[draw=black,triangle 45-triangle 45] % let \p1=(innersep) , \p2=(outersep) in % ($(CenterNode)+(\x1,0)+(2.5\linew,0)$) -- % ($(CenterNode)+(\x1,0)+(\x2,0)$) ; % \path let \p1=(innersep) , \p2=(outersep) in % ($(CenterNode)+(\x1,0)+(2.5\linew,0)$) edge % node[align=center,rotate=0,framed,fill=white,draw=white] % {rightmargin} % ($(CenterNode)+(\x1,0)+(\x2,0)$) ; % % %%skipabove % \draw[draw=black,triangle 45-triangle 45] % let \p1=(innersep) , \p2=(outersep) in % ($(CenterNode)+(0,\y1)+(0,2.5\linew)$) -- % ($(CenterNode)+(0,\y1)+(0,\y2)$) ; % \path let \p1=(innersep) , \p2=(outersep) in % ($(CenterNode)+(0,\y1)+(0,2.5\linew)$) edge % node[align=center,rotate=0,framed,fill=white,draw=white] % {skipabove} % ($(CenterNode)+(0,\y1)+(0,\y2)$) ; % %%skipbelow % \draw[draw=black,triangle 45-triangle 45] % let \p1=(innersep) , \p2=(outersep) in % ($(CenterNode)-(0,\y1)-(0,2.5\linew)$) -- % ($(CenterNode)-(0,\y1)-(0,\y2)$) ; % \path let \p1=(innersep) , \p2=(outersep) in % ($(CenterNode)-(0,\y1)-(0,2.5\linew)$) edge % node[align=center,rotate=0,framed,fill=white,draw=white] % {skipbelow} % ($(CenterNode)-(0,\y1)-(0,\y2)$) ; % \end{tikzpicture} % % \captionof{figure}{adjustable lengths of \Pack{mdframed}} % \label{fig:laengen} % \end{center} % % \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 % % % 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 % % \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}. % % % \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[\{\}]{font} % 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 % % \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 % % \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} % % % \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}. % % % \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}. % % % \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. % % 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. % % \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. % They are not divided in their properties. % % \ExplOpt[none]{frametitle} % The environment gets a title. To set a title use % \Opt{frametitle=\{The Title of the frame\}} as an option of the % environment. % \ExplOpt[\Cmd{normalfont}\Cmd{bfseries}]{frametitlefont} % Sets the format of the \Opt{frametitle}. % \ExplOpt[\Cmd{raggedleft}]{frametitlealignment} % Align the \Opt{frametitle}. This option must be set via \Cmd{mdfsetup}. % \ExplOpt[false]{frametitlerule} % Set this key to \Opt{true} to get a line between the frame title % and the text. % \ExplOpt[.2\,pt]{frametitlerulewidth} % Sets the width of the line between the text and the title of % \Env{mdframed}. % \ExplOpt[5\,pt]{frametitleaboveskip} % Sets the skip of the frame title to the margin above of \Env{mdframed}. % \ExplOpt[5\,pt]{frametitlebelowskip} % Sets the skip of the frame title to the rule of the frame title. % \ExplOpt[backroundcolor]{frametitlebackgroundcolor} % Sets the color of the background of the frametitle % \ExplOpt[false]{repeatframetitle} % Repeat the frame title on every frame. % % % The following picture demonstrates the behaviour of the lengths if the option % \Opt{frametitle} is used. % % \begin{center} % \begin{tikzpicture}[scale=0.9] % %Declaration % \tikzstyle{every node}=[font=\bfseries\large\sffamily] % \coordinate (innersep) at (3.2,2.25); % \coordinate (outersep) at (3.2,2); % %Center box % \node[fill=green!10,draw=red!70!black,very thick,fill opacity=.2, % text opacity=1,minimum width=9cm,minimum height=3cm,]% % (CenterNode) {Contents of the box}; % %frametitle box % \node[fill=yellow!70,draw=red!70!black,very thick,fill opacity=.2, % text opacity=1,minimum width=9cm,minimum height=3cm,anchor=south]% % at (CenterNode.north) (frametitle) {frame title}; % % frametitlerule % \draw[line width=3pt,blue!60!black] (frametitle.south west) % -- (frametitle.south east) % node[pos=1,anchor=west,text width=4cm] % {\Opt{frametitlerulewidth}\\\Opt{frametitlerule=true}}; % % frametitlebelowskip % \draw[very thick,blue!60!black,latex-latex,shorten >=0.2cm] % (frametitle.south) -- (frametitle.center) % node[pos=0.5,anchor=west] % {\Opt{ frametitlebelowskip}}; % % frametitleaboveskip % \draw[very thick,blue!60!black,latex-latex,shorten >=0.2cm] % (frametitle.north) -- (frametitle.center) % node[pos=0.5,anchor=west] {\Opt{ frametitleaboveskip}}; % % innertopmargin % \draw[very thick,blue!60!black,latex-latex,shorten >=0.2cm] % (CenterNode.north) -- (CenterNode.center) % node[pos=0.5,anchor=west] {\Opt{ innertopmargin}}; % % splittopskip % \draw[very thick,blue!60!black,latex-latex,shorten >=0.2cm] % (CenterNode.north) -- (CenterNode.center) % node[pos=0.5,anchor=east] {\Opt{splittopskip}}; % % global frame % \draw[thick] (-5.5,-2.1) rectangle (9.4,5.5); % \end{tikzpicture} % \captionof{figure}{Behavior of the lengths if \Opt{frametitle} is used} % \label{fig:frametitlelaengen} % \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 use % \Cmd{mdfsubtitle}. The relavant options are listed below. % % \ExplCmd{mdfsubtitle} % Set a title inside \Pack{mdframed} of the internal level 1. % % 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 \begin{tltxmdfexample} \mdfsubtitle[]{the subtitle} \end{tltxmdfexample} % \iffalse % % \fi % % % \subsubsection{Options related to the title of level 1} % \ExplOpt[false]{subtitleaboveline} % Decide to draw a line above the subtile. % \ExplOpt[false]{subtitlebelowline} % Decide to draw a line below the subtitle. % \ExplOpt[\string\normalfont\string\bfseries]{subtitlefont} % Sets the font for subtitles. % \ExplOpt[white]{subtitlebackgroundcolor} % Sets the background color of the subtitle between the above and below % line. % \ExplOpt[black]{subtitleabovelinecolor} % Sets the line color of the line above. % \ExplOpt[black]{subtitlebelowlinecolor} % Sets the line color of the line below. % \ExplOpt[0.8\,pt]{subtitleabovelinewidth} % Sets the line width of the line above. % \ExplOpt[0.6\,pt]{subtitlebelowlinewidth} % Sets the line width of the line below. % \ExplOpt[\string\baselineskip]{subtitleaboveskip} % Sets the skip before the subtitle line above will be drawn. % \ExplOpt[1.2\string\baselineskip]{subtitlebelowskip} % Sets the skip after the subtitle line below is drawn. % \ExplOpt[0.5\string\baselineskip]{subtitleinneraboveskip} % Sets the skip after the line above and the subtitle itself. % \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} % % \begin{subtitleenv} % Some Text \ldots % \mdfsubtitle{Notes} % Some Text \ldots % \end{subtitleenv} % % \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 % % \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. % % \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}. % % \ExplCmd{newmdtheoremenv} % Since the package is often used to highlight theorem environments, % the package providesa command to simplify this process. The command has the % following syntax: % % \iffalse %<*example> % \fi \begin{tltxmdfexample}[deletekeywords={mdframed}] \newmdtheoremenv[]{}% []{}[] \end{tltxmdfexample} % \iffalse % % \fi % The last four arguments are equivalent to the command \Cmd{newtheorem}. % Only the first optional argument is able to pass \Pack{mdframed}-options. A % simple example is: % \iffalse %<*example> % \fi \begin{tltxmdfexample} \theoremstyle{} \newmdtheoremenv[linecolor=blue]{lemma}{Lemma}[section] ... \begin{lemma}[Some title] foo foo foo foo foo foo \end{lemma} \end{tltxmdfexample} % \iffalse % % \fi % So far there is no \Cmd{renewmdtheoremenv}! % % % \ExplCmd{mdtheorem} % This is a special kind of \Cmd{newtheorem}. The command has the following % syntax. % \iffalse %<*example> % \fi \begin{tltxmdfexample}[deletekeywords={mdframed}] \mdtheorem[]{}% []{}[] \end{tltxmdfexample} % \iffalse % % \fi % As you can see the arguments are equal to \Cmd{newtheorem} but the % command ignores every \Cmd{theoremstyle}. This is based on the following % behavior. % % The command \Cmd{mdtheorem} creates two environments based on the given % first mandatory argument. The first environment is named like the given % argument and creates a numbered theorem. The second environment is named % like the first mandatory argument with a star. This environment has the % same formating but isn't numbered. % % The syntax of the new defined environments is equal to the normal theorem % environments. % \iffalse %<*example> % \fi \begin{tltxmdfexample}[deletekeywords={mdframed}] \begin{environment}[optional title] ... \end{environment} \end{tltxmdfexample} % \iffalse % % \fi % What happened? The caption of the command will be set as the frame title. % In this way all options of the frame title are available. Furthermore % \Pack{mdframed} provides additional options explained below. % % \ExplOpt[\{:\}]{theoremseparator} % Sets the separator of the caption and the title of the theorem. % The \Opt{theoremseparator} will be printed only if an theorem % title is given. % \ExplOpt[\{\}]{theoremtitlefont} % Via the option \Opt{frametitlefont} you can manipulate the font % of the frame title. The option \Opt{theoremtitlefont} allows to % set a different font to the title of the theorem. % \ExplOpt[\protect\Cmd{space}]{theoremspace} % Sets the space after \Opt{theoremseparator}. % % Examples can be found in the attached files. % % % % % \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, % } % % \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 % % \fi % % % % % \section{Examples} % % I outsource the examples in four files documentation. The files % are % \begin{description}[style=nextline] % \item[\texttt{mdframed-example-default}] % Demonstration of examples created with \Opt{framemethod=default}. % \item[\texttt{mdframed-example-tikz}] % Demonstration of examples created with \Opt{framemethod=TikZ}. % \item[\texttt{mdframed-example-pstricks}] % Demonstration of examples created with \Opt{framemethod=pstricks}. % \item[\texttt{mdframed-example-texsx}] % Demonstration of examples like interaction with \Pack{listings} % \end{description} % % The examples are often not equivalent but normally they can be adapted to % another method. % So I really recommend to have a look to all example files. % % The Korean \TeX Group created a very nice presentation. I want to show the % link because it's really a great work: % \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 % messages in the \texttt{log}-file. Some \LaTeX-editors like % \TeX Maker or \TeX Studio have a special tab for errors and warnings % but not for messages. So you should look in the \texttt{log-File} itself. % % The following errors and warnings are generated by \Pack{mdframed}. % % \iffalse %<*example> % \fi \begin{tltxmdfexample} The package ... does not exist but needed by mdframed \end{tltxmdfexample} % \iffalse % % \fi % To avoid this problem you should install the required % packages which are listed in section \ref{sec:syntax}. % % \iffalse %<*example> % \fi \begin{tltxmdfexample} package option style is depreciated use framemethod instead style \end{tltxmdfexample} % \iffalse % % \fi % With version 0.9d \Pack{mdframed} changed the meaning of the option % \Opt{style}. The option is used to load a defined style by % \Cmd{mdfdefinestyle}. Instead use \Opt{framemethod} (see section % \ref{globopt}). % % \iffalse %<*example> % \fi \begin{tltxmdfexample} Unknown framemethod .... mdframed \end{tltxmdfexample} % \iffalse % % \fi % The input string for the option \Opt{framemethod} is unkown. See section % \ref{globopt}. % % \iffalse %<*example> % \fi \begin{tltxmdfexample} You have not loaded ntheorem yet \end{tltxmdfexample} % \iffalse % % \fi % To use the option \Opt{ntheorem} you have to % load the package \Pack{ntheorem}. % % \iffalse %<*example> % \fi \begin{tltxmdfexample} You have only a width of 3cm \end{tltxmdfexample} % \iffalse % % \fi % The package \Pack{mdframed} calculates the width of the contents % based on the given options. If the width of the contents is smaller than % 3\,cm you will get this warnings. You should change the % settings to get a greater width. % % \iffalse %<*example> % \fi \begin{tltxmdfexample} You got a bad break you have to change it manually by changing the text, the space or something else \end{tltxmdfexample} % \iffalse % % \fi % Sometimes you have enough vertical space for the rules and the space % between the rules and the contents but not for the contents itself. % In this situation you will get this warning because the contents % of this box is empty. You have the possibility to change the % settings or include a \Cmd{clearpage} in front of % the environment \Pack{mdframed}. % So far I have no idea how to avoid such things. % % \iffalse %<*example> % \fi \begin{tltxmdfexample} You got a bad break because the split box is empty You have to change the page settings like enlargethispage or something else You got a bad break \end{tltxmdfexample} % \iffalse % % \fi % See the explanation above. % % \iffalse %<*example> % \fi \begin{tltxmdfexample} You got a bad break because the last split box is empty You have to change the settings \end{tltxmdfexample} % \iffalse % % \fi % The same reason as above but only in the last box. % % % \iffalse %<*example> % \fi \begin{tltxmdfexample} Option ... is already consumed and has no effect on input line ... \end{tltxmdfexample} % \iffalse % % \fi % If you set a global option inside the document % body you will get this warning. % % \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}. % % Do you have any ideas / wishes on further extensions to this package? % Please let me know! % % \begin{enumerate} % \item So far the environment isn't compatible with the package % \Pack{gmverb}. % \item If you load the package \Pack{picins} the frame will no be splitted. % That based on a problem of the package `picins` which defines % \Cmd{@captype} global. % To work with the package picins you can use the following hack. % \iffalse %<*example> % \fi \begin{tltxmdfexample} \usepackage{picins} \makeatletter \let\@captype\@undefined \def\newcaption{% \begingroup% \def\@captype{figure}% \refstepcounter\@captype\@dblarg{\@newcaption\@captype}% \endgroup% } \makeatother \end{tltxmdfexample} % \iffalse % % \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} % % % \section{ToDo} % \textbf{\color{red} It is important to update the documentation} % \begin{enumerate} % \item see \enquote{Known Problems}. % \item So far it isn't possible to combine the environment % \Cmd{begin\{multicols\}} of the package \Pack{multicol} % with \Pack{mdframed} with the whole option list. % \item Create new styles. % \item Improve page breaks. % \item Improve footnotes. % \item Improve documentation and examples. % \item Create styles for \Opt{frametitle}. % \item Create an inline version of \Env{mdframed} that's works like % \Cmd{fbox} % \item Add \Cmd{ht}\Cmd{strutbox} to file \Pack{md-frame-1.mdf} % \end{enumerate} % % \section{Acknowledgements} % \textsf{Dick Nickalls;\quad Dietrich Grau;\quad Piazza Luca;\quad% % Jobst Hoffmann;\quad Martin Scharrer;\quad Enrico Gregorio;\quad % Heiko Oberdiek;\quad Philipp Stephani}. % \medskip % % \noindent Thanks for proofreading % % \textsf{Alan Munn} and \textsf{Nahid Shajari} % % I hope I forgot nobody. % \clearpage % \appendix % % \section{More information} % %\addtocontents{toc}{\protect\setcounter{tocdepth}{-4}} % In the following section I want to present how to create % your own frame. % \subsection{How does \Pack{mdframed} work?} % With the environment \Cmd{begin\{mdframed\}} \ldots \Cmd{end\{mdframed\}} % the whole contents will be saved in a \Cmd{savebox} called % \Cmd{mdf@splitbox@one}. After the calculation of the width and the height of % the \Cmd{mdf@splitbox@one} (done by \Pack{mdframed.sty}) the box will be set % sequently (done by \Pack{md-frame-X.mdf}). The following figure demonstrates % this. % % \begin{center} % \begin{tikzpicture} % \newcommand{\mybox}[1]{\parbox{3.5cm}{\centering\small #1}} % \tikzstyle{every node}=[font=\sffamily] % \tikzset{mymatrixnodes/.style={% % matrix of nodes, % nodes={framed,draw=black,fill=yellow!10,}, % column sep=4.5cm, % row sep=1.5cm, % }} % \matrix(m)[mymatrixnodes] % {% % \mybox{read in and save contents in \Cmd{mdf@splitbox@one}} & % \mybox{\Cmd{mdf@putbox@single}} \\ % \mybox{split \textbackslash mdf@splitbox@one in \Cmd{mdf@splitbox@two} to % the free space of the page} & % \mybox{\Cmd{mdf@putbox@first}} \\ % \mybox{contents of \Cmd{mdf@splitbox@one} have enough space on the new % page} & % \mybox{\Cmd{mdf@putbox@second}} \\ % \mybox{split \Cmd{mdf@splitbox@one} in \Cmd{mdf@splitbox@two} to the free % space of the page} & % \mybox{\Cmd{mdf@putbox@middle}} \\ % }; % % \tikzstyle{every path}=[black,-triangle 45,thick,shorten >=4pt,shorten <=4pt] % \draw (m-1-1) edge % node[align=center,anchor=south]{enough space on page} (m-1-2); % \draw (m-2-1) edge % node[align=center,anchor=south]{type out \Cmd{mdf@splitbox@two}} % (m-2-2); % \draw (m-3-1) edge % node[align=center,anchor=south]{yes} (m-3-2); % \draw (m-4-1) edge % node[align=center,anchor=south]{type out \Cmd{mdf@splitbox@two}} % (m-4-2); % % \draw (m-2-2) edge node[align=center,fill=white]% % {calculate the height of the new \Cmd{mdf@splitbox@one}} (m-3-1); % % % \draw (m-1-1) edge % node[align=center,anchor=west]{not enough space on page} (m-2-1); % \draw (m-3-1) edge node[align=center,anchor=west]{no} (m-4-1); % % \draw let \p1=($(m-4-2.south)-(0,1)$), \p2=($(m-3-1.west)-(0.8,0)$) in % (m-4-2.south) -- ($(m-4-2.south)+(0,-1)$) -- % node[align=center,anchor=north]% % {calculate the height of the new \Cmd{mdf@splitbox@one}} (\x2,\y1) % -- ($(m-3-1.west)-(0.8,0)$)-- ($(m-3-1.west)$) ; % % % \end{tikzpicture} % % \captionof{figure}{Setting the contents of \Pack{mdframed}}\label{fig:way} % \end{center} % % The width of the contents is the result of the settings of % \Opt{leftmargin}, \Opt{rightmargin}, \Opt{linewidth}, % \Opt{innerleftmargin} and \Opt{innerrightmargin} % (see figure \eqref{fig:laengen}). % % \subsection{The Framecommands} % The package \Pack{mdframed} knows four kinds of \enquote{Framecommand}. % These commands tell \LaTeX\ how to set the contents of \Pack{mdframed}. % \begin{description} % \item[\Cmd{mdf@putbox@single}] % This command sets the contents of a single unsplit frame. % \item[\Cmd{mdf@putbox@first}] % This command sets the contents of the first frame of a split frame. % \item[\Cmd{mdf@putbox@middle}] % This command sets the contents of the middle frame of a split frame. % \item[\Cmd{mdf@putbox@second}] % This command sets the contents of the last frame of a split frame. % \end{description} % % Using the explained commands we give an example. The command \Cmd{box} % uses the contents of the savebox and types them out. % % First we want to type out the single box without any settings % (but with the calculated width). % \iffalse %<*example> % \fi \begin{tltxmdfexample} \makeatletter \def\mdf@putbox@single{\box\mdf@splitbox@one} \makeatother \end{tltxmdfexample} % \iffalse % % \fi % I am using the command \Cmd{leftline} to start the \enquote{Framecommands} at % the left. % \iffalse %<*example> % \fi \begin{tltxmdfexample}[deletekeywords={leftline},moretexcs={leftline}] \makeatletter \def\mdf@putbox@single{\leftline{\box\mdf@splitbox@one}} \makeatother \end{tltxmdfexample} % \iffalse % % \fi % % Now you have to know how the lengths are named. Every length which can be % modified by the options has the following syntax: % \iffalse %<*example> % \fi \begin{tltxmdfexample} \mdf@@length \end{tltxmdfexample} % \iffalse % % \fi % For example the leftmargin is: % \iffalse %<*example> % \fi \begin{tltxmdfexample} \mdf@leftmargin@length \end{tltxmdfexample} % \iffalse % % \fi % % To create only a line at the left with the correct \Opt{leftmargin} you % can set \Cmd{mdf@putboxsingle} as follows % % \iffalse %<*example> % \fi \begin{tltxmdfexample}[deletekeywords={leftline},moretexcs={leftline}] \makeatletter \def\mdf@putbox@single{% \leftline{% \hspace*{\mdf@leftmargin@length}% \rule[-\dp\mdf@splitbox@one]{\mdf@linewidth}% {\ht\mdf@splitbox@one+\dp\mdf@splitbox@one}% \box\mdf@splitbox@one }% } \makeatother \end{tltxmdfexample} % \iffalse % % \fi % % In this way you can do what you want. If you create your own style you % can save the file as \Pack{md-frame-X.mdf}. % \Pack{X} must be an integer. % 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) % \item allow margin notes with \Opt{framemethod=tikz} % \item fixed some typos % \end{itemize*} % % \minisec{Version 1.6d submitted 21 Sep 2012} % \begin{itemize*} % \item fixed bugs % \item added option \Opt{draft} % \end{itemize*} % % \minisec{Version 1.6b submitted 02 Jun 2012} % \begin{itemize*} % \item added commands \Cmd{mdfsubtitle} and \Cmd{mdfsubsubtitle} % \item added options \Opt{subtitleaboveline}, \Opt{subtitlebelowline}, % \Opt{subsubtitleaboveline}, \Opt{subsubtitlebelowline}, % \Opt{subtitlefont}, \Opt{subsubtitlefont}, % \Opt{subtitlebackgroundcolor}, % \Opt{subsubtitlebackgroundcolor}, \Opt{subtitleabovelinecolor}, % \Opt{subtitlebelowlinecolor}, \Opt{subsubtitleabovelinecolor}, % \Opt{subsubtitlebelowlinecolor}, \Opt{subtitleabovelinewidth}, % \Opt{subtitlebelowlinewidth}, \Opt{subtitleaboveskip}, % \Opt{subtitlebelowskip}, \Opt{subtitleinneraboveskip}, % \Opt{subtitleinnerbelowskip}, \Opt{subsubtitleabovelinewidth}, % \Opt{subsubtitlebelowlinewidth}, \Opt{subsubtitleaboveskip}, % \Opt{subsubtitlebelowskip}, \Opt{subsubtitleinneraboveskip}, % \Opt{subsubtitleinnerbelowskip} % \item improved formating of the file \Pack{mdframed.dtx} % \item fixed bug in combination with \Cmd{parskip} -- Thanks David Carlisle. % \item added extra loop to compute the splitting point. % \item improved splitting algorithm % \item added new option \Opt{ignorelastdescenders} -- Thanks Stephan Lehmke. % \item Improved option \Opt{repeatframetitle} % \item fixed bug: \Opt{framemethod=tikz} used wrong computed length by % setting \Opt{everyline=true} % \item Tobias Weh inspired the excurs-environment not Tobias Schwan. Sorry, % I fixed it. % \item Improved \Cmd{mdtheorem} to handle \Cmd{listtheorems} provided by % \Pack{ntheorem}. % \end{itemize*} % % \minisec{Version 1.5 submitted 10 Mar 2012} % \begin{itemize*} % \item fixed bug (Thanks Nicolas Roy) % \item expanded documentation (Thanks Martin Wilhelm Leidig) % \item added options \Opt{singleextra}, \Opt{firstextra}, % \Opt{middleextra} and \Opt{secondextra} % \item expanded examples % \end{itemize*} % % \minisec{Version 1.4d submitted 30 Mar 2012} % \begin{itemize*} % \item fixed bug (Thanks Nicolas Roy) % \item added approach to documentation to work with \Pack{picins} % \item new implementation of option \Opt{hidealllines}, now you can set % \Cmd{mdfsetup}\Opt{\{hidealllines=true,leftline=true\}} printing % only the left line (inspired by Tobias Weh) % \item added option \Opt{everyline} to draw a top and bottom line at % splitted frames % \end{itemize*} % % \minisec{Version 1.4 submitted 4 Mar 2012} % \begin{itemize*} % \item fixed bug in combination with \Cmd{marginpar} (Thanks Juan Carlos % Trujillo Ortega) % \item fixed bug with option \Opt{font} % \item fixed bug inside \texttt{frametitle} (Thanks Yi, Hoze) % \item removed unnessary groups (Thanks Yi, Hoze) % \item changed the definition of \Pack{listings} to allow copy paste of the % examples % \end{itemize*} % % \minisec{Version 1.3a submitted 5 Feb 2012} % \begin{itemize*} % \item fixed bug (Thanks to Dietrich Grau) % \end{itemize*} % % \minisec{Version 1.3 submitted 4 Feb 2012} % \begin{itemize*} % \item fixed documentation (Thanks to Dietrich Grau) % \item added option \Opt{shadow} % \item improved handling \Cmd{parindent} and \Cmd{parskip} (Thanks to Enrico % Gregorio and Joseph Wright) % \end{itemize*} % % \minisec{Version 1.2 submitted 8 Jan 2012} % \begin{itemize*} % \item fixed documentation (Thanks to Dietrich Grau) % \item fixed bug in combination with \Pack{amsthm} % \item fixed bug in \Cmd{newmdtheoremenv} % \item defined new styles via \Cmd{newpsstyle}\limitation[PSTricks] % \item added new commands for interaction with \Pack{TikZ} and \Pack{PSTricks} % \item expand frame title option by option \Opt{frametitlerule}, % \Opt{frametitlerulewidth}, \Opt{frametitlefont}, % \Opt{frametitleaboveskip}, \Opt{frametitlebelowskip}, % \Opt{frametitlealignment} % \item removed limitation of three lines for PSTricks % \item defined new commands \Cmd{surroundwithmdframed}, \Cmd{mdflength}, % \Cmd{mdtheorem} % \item load \Pack{xparse} by default % \item changed internal names % \item expanded examples % \end{itemize*} % % \minisec{Version 1.0b submitted 9 Dec 2011} % \begin{itemize*} % \item fixes documentation (Thanks to Dietrich Grau) % \item fixes bug in \Cmd{newmdtheoremenv} % \item fixes bug with overfull boxes (Thanks to Dietrich Grau) % \item defined \Cmd{newpsstyle}\Opt{mdfbackgroundstyle} and \Opt{mdflinestyle} % \limitation[PSTricks] % \item created dtx-file (Thanks to Kevin Godby) % \item added \Cmd{@parboxrestore} to \Cmd{mdf@lrbox} % \end{itemize*} % % \minisec{Version 1.0 submitted 13 Nov 2011} % \begin{itemize*} % \item add option \Opt{userdefinedwidth} % \item add option \Opt{align} % \item add option \Opt{apptotikzsetting} % \item create new command \Cmd{mdfapptodefinestyle} % \item changed internal algorithm % \item removed calc instead using \eTeX\ \verb+\dimexpr+ % \item expand documentation % \item trying to fixe problems with \Pack{xcolor} % \item fixed bug with \Opt{framemethod=pstricks} % \item create file \Pack{mdframed-example-default} % \item create file \Pack{mdframed-example-tikz} % \item create file \Pack{mdframed-example-pstricks} % \item create file \Pack{mdframed-example-texsx} % (texsx stands for tex stackexchange) % \end{itemize*} % % % \minisec{Version 0.9g submitted 08 Oct 2011} % \begin{itemize*} % \item fixed documentation % \item added small footnote compatibility % \end{itemize*} % % \minisec{Version 0.9f submitted 04 Oct 2011} % \begin{itemize*} % \item fixes bugs (thanks to Lars Madsen) % \item added option \Opt{hidealllines} % \item fixed documentation % \end{itemize*} % % % \minisec{Version 0.9e submitted 11 Sep 2011} % \begin{itemize*} % \item working with \texttt{twoside} modus % \end{itemize*} % % \minisec{Version 0.9d submitted 10 Sep 2011} % \begin{itemize*} % \item \textcolor{red}{changed the meaning of the option % \Opt{style}}!!! (inspired by Lars Madsen) % \item added option \Opt{framemethod} (inspired by Lars Madsen) % \item added options \Opt{needspace} (inspired by Lars Madsen) % \item added new command \Cmd{mdfdefinestyle} (inspired by Lars Madsen) % \item fixes documentation % \item renamed \Pack{md-frame-3.mdf} to \Pack{md-frame-2.mdf} % \end{itemize*} % % % % \minisec{Version 0.9b submitted 7 Sep 2011} % \begin{itemize*} % \item fixes bugs in \Cmd{newmdtheoremenv} (Thanks to Enrico Gregorio) % \end{itemize*} % % \minisec{Version 0.9a submitted 5 Sep 2011} % \begin{itemize*} % \item fixes bugs (Thanks to Lars Madson) % \item expanded documentation (added revision history) % \end{itemize*} % % % \minisec{Version 0.9 submitted 4 Sep 2011} % \begin{itemize*} % \item added option \Opt{nobreak} % \item detecting float environments to prevent split calculation % \item expand documentation (Thanks to Alan Munn) % \end{itemize*} % % \minisec{Version 0.8a} % \begin{itemize*} % \item fixes bugs % \item fixes documentation % \end{itemize*} % % \minisec{Version 0.8 submitted 22 Aug 2011} % \begin{itemize*} % \item added commands: \Cmd{newmdenv}, \Cmd{renewmdenv}, % \Cmd{newmdtheoremenv} % \item fixes bugs % \item fixes documentation % \end{itemize*} % % \minisec{Version 0.7a submitted 6 August 2011} % \begin{itemize*} % \item added option \Opt{frametitle} % \item added option \Opt{frametitlefont} % \item allow twolumn-mode % \item changed the calculation % \item added option \Opt{tikzsetting} % \item added options for hidden lines for all styles % \item fixes bugs % \end{itemize*} % % \minisec{Version 0.6a submitted 22 Dec 2010} % \begin{itemize*} % \item fixes bugs % \item added \Cmd{mdfsetup} % \item expanded documentation % \end{itemize*} % % \clearpage % % % % % % \section{Implementation}\label{implementation} % % And finally, here's how it all works\ldots % %\fi %\StopEventually{^^A % ^^A\clearpage % ^^A\PrintChanges^^A % ^^A\clearpage % ^^A\PrintIndex^^A %} % %\iffalse % \begin{macrocode} %<*package> % \end{macrocode} %\fi % % \subsection{The Explanation of mdframed.sty} % % \begin{macro}{mdversion,mdframedpackagename,mdfmaindate} % Set package information % \begin{macrocode} \def\mdversion{1.9b} \def\mdframedpackagename{mdframed} \def\mdfmaindate{2013/07/01} \def\mdfrevision{ 212}% Done by github: git rev-list HEAD | wc -l % \end{macrocode} % \end{macro} % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mdframed}% [\mdfmaindate\space \mdversion: \mdframedpackagename] % \end{macrocode} % % \begin{macro}{mdf@PackageWarning,mdf@PackageInfo,mdf@LoadFile@IfExist} % Set short form of |\PackageError|, |\PackageWarning|, |\PackageInfo| and % |IfFileExists| in combination with |\RequirePackage|. % \begin{macrocode} \newcommand*\mdf@PackageError[1]{\PackageError{\mdframedpackagename}{#1}} \newcommand*\mdf@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}} \newcommand*\mdf@PackageInfo[1]{\PackageInfo{\mdframedpackagename}{#1}} \newcommand*\mdf@LoadFile@IfExist[1]{% \IfFileExists{#1.sty}{% \RequirePackage{#1}% }{% \mdf@PackageWarning{The file #1 does not exist\MessageBreak but needed by \mdframedpackagename\MessageBreak see documentation fo further information }% }% } % \end{macrocode} % \end{macro} % % Loading required packages % \begin{macrocode} \RequirePackage{kvoptions} \RequirePackage{xparse} \RequirePackage{etoolbox}[2011/01/03] \RequirePackage{zref-abspage} \RequirePackage{needspace} \RequirePackage{color} % \end{macrocode} % % Set the family and the prefix of all options. % \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: % |\mdf@iflength{}{}{}| % \begin{macrocode} \newlength{\mdf@templength} \def\mdf@iflength#1{% \afterassignment\mdf@iflength@check% \mdf@templength=#1\mdf@defaultunit\relax\relax \expandafter\endgroup\next } \def\mdf@iflength@check#1{% \begingroup \ifx\relax#1\@empty \def\next{\@secondoftwo} \else \def\next{\@firstoftwo} \expandafter\mdf@iflength@cleanup \fi } \def\mdf@iflength@cleanup#1\relax{} % \end{macrocode} % \end{macro} % % % \begin{macro}{mdf@dolist} % 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@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@