Debian Codegraph @

texmf-dist/source/latex/mdframed/mdframed.dtx

raw
1 % \iffalse meta-comment
2 % !TEX program = pdfLaTeX
3 %<*internal>
4 \iffalse
5 %</internal>
6 %<*readme>
7 ================================================================
8 ================================================================
9 Working with the command \fbox or \fcolorbox, one has to
10 handle page breaks by hand. The present package defines the
11 environment mdframed which automatically deals with page breaks.
12
13 Author's name: Marco Daniel and Elke Schubert (supports tikz implementation)
14 License type: lppl
15
16 ================================================================
17 The revision history is printed in the documentation.
18
19 ================================================================
20 The current development is available at github:
21 https://github.com/marcodaniel/mdframed
22
23 ================================================================
24 The package provides
25 * one dtx files,
26 * one Makefile (compiling for Linux/Mac),
27 * one mdframedmake.bat (compiling for Windows)
28 * one personal documentclass ltxmdf.cls
29 * one example picture donald-duck.jpg
30
31 By running the script `make all` you will
32 produce the following files:
33 - README.txt
34 - mdframed.sty
35 - mdframed.pdf
36 - md-frame-0.mdf
37 - md-frame-1.mdf
38 - md-frame-2.mdf
39 - md-frame-3.mdf
40 - mdframed-example-default.tex
41 - mdframed-example-default.pdf
42 - mdframed-example-tikz.tex
43 - mdframed-example-tikz.pdf
44 - mdframed-example-pstricks.tex
45 - mdframed-example-pstricks.pdf
46 - mdframed-example-texsx.tex
47 - mdframed-example-texsx.pdf
48
49 I recommend the following installation in your texmf-tree:
50
51 /doc/latex/mdframed/
52 - README.txt
53 - mdframed.pdf
54 - mdframed-example-default.tex
55 - mdframed-example-default.pdf
56 - mdframed-example-tikz.tex
57 - mdframed-example-tikz.pdf
58 - mdframed-example-pstricks.tex
59 - mdframed-example-pstricks.pdf
60 - mdframed-example-texsx.tex
61 - mdframed-example-texsx.pdf
62 - ctan-lion.png "CTAN lion drawing by Duane Bibby; thanks to www.ctan.org".
63
64
65 /source/latex/mdframed/
66 - Makefile
67 - mdframed.dtx
68
69 /tex/latex/mdframed
70 - mdframed.sty
71 - md-frame-0.mdf
72 - md-frame-1.mdf
73 - md-frame-2.mdf
74 - md-frame-3.mdf
75 - ltxmdf.cls
76 ================================================================
77 ================================================================
78 %</readme>
79 %<*internal>
80 \fi
81 \def\nameofplainTeX{plain}
82 \ifx\fmtname\nameofplainTeX\else
83 \expandafter\begingroup
84 \fi
85 %</internal>
86 %<*install>
87 \input docstrip.tex
88 \keepsilent
89 \askforoverwritefalse
90 \preamble
91 ----------------------------------------------------------------
92 Working with the command fbox or fcolorbox, one has to
93 handle page breaks by hand. The present package defines the
94 environment mdframed which automatically deals with page breaks.
95
96 Author's name: Marco Daniel and Elke Schubert (!new)
97 License type: lppl
98
99 ==================================================
100 ========Is based on the idea of framed.sty========
101 ==================================================
102 ===== Currently the package has a beta-Status ====
103 ==================================================
104 WITH THANKS TO (alphabetically):
105 ROLF NIEPRASCHK
106 HEIKO OBERDIEK
107 HERBERT VOSS
108
109 Copyright (c) 2010-2013 Marco Daniel
110
111 This package may be distributed under the terms of the LaTeX Project
112 Public License, as described in lppl.txt in the base LaTeX distribution.
113 Either version 1.0 or, at your option, any later version.
114
115
116 =================================================
117 Erstellung eines Rahmens, der am Seitenende keine
118 horizontale Linie einfuegt
119 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
120 _______________
121 | page 1 |
122 | Text |
123 | __Text__ |
124 | | Text | |
125 P A G E B R E A K
126 | | Text | |
127 | |_Text_| |
128 | Text |
129 |____page 2___|
130
131 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
132 ==================================================
133
134 \endpreamble
135 \postamble
136
137 ================================================================
138 Copyright (C) 2012 by Marco Daniel
139
140 This work may be distributed and/or modified under the
141 conditions of the LaTeX Project Public License (LPPL), either
142 version 1.3c of this license or (at your option) any later
143 version. The latest version of this license is in the file:
144
145 http://www.latex-project.org/lppl.txt
146
147 This work is "maintained" (as per LPPL maintenance status) by
148 Marco Daniel.
149
150 Have fun!
151
152 ================================================================
153 \endpostamble
154 \usedir{tex/latex/mdframed}
155 \generate{\file{mdframed.sty}{\from{mdframed.dtx}{package}}}
156 \nopreamble\nopostamble\usedir{tex/latex/mdframed}
157 \generate{\file{md-frame-0.mdf}{\from{mdframed.dtx}{mdframedefault}}}
158 \nopreamble\nopostamble\usedir{tex/latex/mdframed}
159 \generate{\file{md-frame-1.mdf}{\from{mdframed.dtx}{mdframetikz}}}
160 \nopreamble\nopostamble\usedir{tex/latex/mdframed}
161 \generate{\file{md-frame-2.mdf}{\from{mdframed.dtx}{mdframepstricks}}}
162 \nopreamble\nopostamble\usedir{tex/latex/mdframed}
163 \generate{\file{md-frame-3.mdf}{\from{mdframed.dtx}{mdframepstricks}}}
164 \Msg{*********************************************************}
165 \Msg{*}
166 \Msg{* To finish the installation you have to move the}
167 \Msg{* following file into a directory searched by TeX:}
168 \Msg{*}
169 \Msg{* \space\space documentation.sty}
170 \Msg{*}
171 \Msg{* To produce the documentation run the file mdframed.dtx}
172 \Msg{* once through LaTeX. Then, run}
173 \Msg{*}
174 \Msg{* \space\space makeindex -s gglo.ist -o mdframed.gls mdframed.glo}
175 \Msg{* \space\space makeindex -s gind.ist mdframed.idx}
176 \Msg{*}
177 \Msg{* through makeIndex to produce the glossary.}
178 \Msg{* Finally, run PdfLaTeX once again.}
179 \Msg{*}
180 \Msg{* To create the examples run (pdf)latex on the tex-files.}
181 \Msg{*}
182 \Msg{* That's all!}
183 \Msg{*}
184 \Msg{* Happy TeXing!}
185 \Msg{*********************************************************}
186 %</install>
187 %<install>\endbatchfile
188 %<*internal>
189 \usedir{source/latex/mdframed}
190 \generate{\file{mdframed.ins}
191 {\from{mdframed.dtx}{install}}}
192
193 \nopreamble\nopostamble\usedir{doc/latex/mdframed}
194 \generate{\file{README.txt}
195 {\from{mdframed.dtx}{readme}}}
196 \nopreamble\nopostamble\usedir{source/latex/mdframed}
197 \generate{\file{mdframed-example-default.tex}
198 {\from{mdframed.dtx}{mdframed-example-default}}}
199 \nopreamble\nopostamble\usedir{source/latex/mdframed}
200 \generate{\file{mdframed-example-tikz.tex}
201 {\from{mdframed.dtx}{mdframed-example-tikz}}}
202 \nopreamble\nopostamble\usedir{source/latex/mdframed}
203 \generate{\file{mdframed-example-pstricks.tex}
204 {\from{mdframed.dtx}{mdframed-example-pstricks}}}
205 \nopreamble\nopostamble\usedir{source/latex/mdframed}
206 \generate{\file{mdframed-example-texsx.tex}
207 {\from{mdframed.dtx}{mdframed-example-texsx}}}
208
209 \ifx\fmtname\nameofplainTeX
210 \expandafter\endbatchfile
211 \else
212 \expandafter\endgroup
213 \fi
214 %</internal>
215 %<*driver>
216
217 \setcounter{errorcontextlines}{999}
218 \documentclass[parskip=false,11pt,]{ltxmdf}
219 \usepackage{pdfpages}
220 \usepackage[framemethod=TikZ]{mdframed}
221 \usetikzlibrary{shadows}
222 \surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
223 roundcorner=10pt,innertopmargin=0pt,%
224 leftmargin=1cm,rightmargin=1cm,%
225 innerleftmargin=-15pt,innerrightmargin=-15pt,%
226 ignorelastdescenders,%
227 settings={\lstset{resetmargins}},%
228 skipbelow=\topskip,skipabove=\topskip,%
229 innerbottommargin=0pt,backgroundcolor=gray!10]%
230 {tltxmdfexample}
231
232 \EnableCrossrefs
233 \CodelineIndex
234 \OnlyDescription
235 %%\RecordChanges
236 \begin{document}
237 \DocInput{mdframed.dtx}
238 \end{document}
239 %</driver>
240 % \fi
241 %
242 %
243 % \CharacterTable
244 % {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
245 % 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
246 % Digits \0\1\2\3\4\5\6\7\8\9
247 % Exclamation \! Double quote \" Hash (number) \#
248 % Dollar \$ Percent \% Ampersand \&
249 % Acute accent \' Left paren \( Right paren \)
250 % Asterisk \* Plus \+ Comma \,
251 % Minus \- Point \. Solidus \/
252 % Colon \: Semicolon \; Less than \<
253 % Equals \= Greater than \> Question mark \?
254 % Commercial at \@ Left bracket \[ Backslash \\
255 % Right bracket \] Circumflex \^ Underscore \_
256 % Grave accent \` Left brace \{ Vertical bar \|
257 % Right brace \} Tilde \~}
258 %
259 % \GetFileInfo{mdframed.sty}
260 %
261 %
262 % \title{The \Pack{mdframed} package
263 % \footnote{Extending the package \texttt{framed.sty}}}
264 % \subtitle{auto-split frame environment}
265 % \author{\href{mailto:[email protected]}{Marco Daniel},
266 % \href{mailto:[email protected]}{Elke Schubert}}
267 % \version{\mdversion}
268 % \date{\mdfmaindate}
269 % \introduction{The standard methods for framing text (\Cmd{fbox}
270 % or \Cmd{fcolorbox}) require you to handle page breaks
271 % by hand, meaning that you have to split the \Cmd{fbox}
272 % into two. The present package defines the environment
273 % \Pack{mdframed} which automatically deals with pagebreaks
274 % in framed text.\par
275 % By defining new environments the user may choose between
276 % several individual designs.%
277 % \par\kern.5\baselineskip\noindent
278 % Linked files:\quad
279 % \begin{tabular}[t]{ll}
280 % \url{mdframed-example-default.pdf} &
281 % \url{mdframed-example-tikz.pdf} \\
282 % \url{mdframed-example-pstricks.pdf} &
283 % \url{mdframed-example-texsx.pdf}
284 % \end{tabular}
285 % \par\kern.5\baselineskip\noindent
286 % FYI:\quad\parbox[t]{.8\linewidth}{%
287 % I create a repository for \Pack{mdframed}
288 % on \href{https://github.com/marcodaniel/mdframed}{github}
289 % where you can
290 % \href{https://github.com/marcodaniel/mdframed}{download}
291 % the current development status.}%
292 % }
293 %
294 % \maketitle
295 %
296 % \vspace*{2\baselineskip}
297 %
298 % \section{Motivation}
299 % Many users wish to (further) emphasize lemmata, definitions, proofs, etc. The
300 % package \Pack{mdframed} allows you to create environments with breakable
301 % frames. I think an example is the best way to demonstrate its properties.
302 %
303 % \newmdtheoremenv[%
304 % outerlinewidth = 2 ,%
305 % roundcorner = 10pt ,%
306 % leftmargin = 40 ,%
307 % rightmargin = 40 ,%
308 % backgroundcolor = yellow!40 ,%
309 % outerlinecolor = blue!70!black ,%
310 % innertopmargin = \topskip ,%
311 % splittopskip = \topskip ,%
312 % ntheorem = true ,%
313 % ]{theorem}{Theorem}[section]
314 %
315 % \begin{theorem}[Pythagorean theorem]
316 % In any right triangle, the area of the square whose side is the hypotenuse
317 % is equal to the sum of the areas of the squares whose sides are the two
318 % legs.
319 %
320 % \[ a^2+b^2=c^2 \]
321 % \end{theorem}
322 %
323 % The frame was defined with the following settings.
324 %
325 % \iffalse
326 %<*example>
327 % \fi
328 \begin{tltxmdfexample}[columns=fixed,fontadjust=false]
329 \newmdtheoremenv[%
330 outerlinewidth = 2 ,%
331 roundcorner = 10pt ,%
332 leftmargin = 40 ,%
333 rightmargin = 40 ,%
334 backgroundcolor = yellow!40 ,%
335 outerlinecolor = blue!70!black ,%
336 innertopmargin = \topskip ,%
337 splittopskip = \topskip ,%
338 ntheorem = true ,%
339 ]{theorem}{Theorem}[section]
340 \begin{theorem}[Pythagorean theorem]
341 ...
342 \end{theorem}
343 \end{tltxmdfexample}
344 % \iffalse
345 %</example>
346 % \fi
347 %
348 %
349 % \section{Syntax}\label{sec:syntax}
350 %
351 % \minisec{Required packages by \Pack{mdframed}}
352 % The package itself loads the packages
353 % \begin{center}
354 % \Pack{kvoptions}\qquad\Pack{xparse}\qquad\Pack{etoolbox}
355 % \quad\Pack{color}.
356 % \end{center}
357 % Depending on the option \Opt{framemthod} \Pack{mdframed} will load
358 % \begin{center}
359 % \Pack{xcolor}\qquad\Pack{tikz}\qquad\Pack{pstricks}.
360 % \end{center}
361 %
362 % Load the package as usual:
363 % \iffalse
364 %<*example>
365 % \fi
366 \begin{tltxmdfexample}
367 \usepackage[<GLOBAL OPTIONS>]{mdframed}
368 \end{tltxmdfexample}
369 % \iffalse
370 %</example>
371 % \fi
372 %
373 % Only the option \Opt{framemethod} should be loaded by the
374 % optional argument of \Cmd{usepackage}. All other options
375 % should be loaded with \Cmd{mdfsetup} or related environments.
376 % The package should be loaded after \Pack{amsthm} if you need the package.
377 % \minisec{Provided environment}
378 % The package defines only one environment with the following syntax:
379 % \iffalse
380 %<*example>
381 % \fi
382 \begin{tltxmdfexample}
383 \begin{mdframed}[<LOCAL OPTIONS>]
384 <CONTENT>
385 \end{mdframed}
386 \end{tltxmdfexample}
387 % \iffalse
388 %</example>
389 % \fi
390 % To create own environments with \Pack{mdframed} see section \ref{sec:cmds}.
391 %
392 % \minisec{Autodetecting floats}
393 % \Pack{mdframed} detects whether the environment is used inside \Pack{float}
394 % or \Pack{minipage} environments. If you use \Pack{mdframed} in such
395 % an environment \Pack{mdframed} will use the option \Opt{nobreak}
396 % automatically.
397 %
398 %
399 %
400 % %%%%%%%%%%%%%%%%%%%%%%%
401 % \section{The frames}\label{sec:frames}
402 %
403 % Normally you can say \Pack{mdframed} draws only some lines.
404 % To allow page breaks the following designs are supported.
405 % If you load the package with \Opt{framemethod=default} you
406 % can only draw a single line. Inside the gray boxes of the images below
407 % the text will be printed.
408 % \newcommand\Punkt[2][below]{%
409 % \node[label=#1:#2] at (#2){\tikz\fill(0,0)circle(0.05);};}
410 % \newcommand\Single[1][]{\path[#1] (O)--(O|-P)--(P)--(P|-O)--cycle;}
411 % \newcommand\FirstSecond[1][]{\path[#1] (O|-P)--(O)--(P|-O)--(P);}
412 % \newcommand\MiddleFlaeche[1][]{\path[#1] (O)--(O|-P)--(P)--(P|-O);}
413 % \newcommand\MiddleLinien[1][]{\path[#1] (O)--(O|-P)(P)--(P|-O);}
414 % \begin{center}
415 % \vspace*{2\baselineskip}
416 % \null\hfill
417 % \begin{tikzpicture}[baseline=(current bounding box.north)]
418 % \coordinate (O) at (0,0);
419 % \pgfmathsetlengthmacro\x{4cm+2mm+6mm}
420 % \pgfmathsetlengthmacro\y{2cm+2mm+6mm}
421 % \coordinate (P) at (\x,\y);
422 % \begin{scope}
423 % \Single[line width=3mm,draw=blue!20]
424 % \Single[clip]
425 % \Single[fill=gray!70]
426 % \Single[line width=7mm,draw=green!20]
427 % \end{scope}
428 % \Single[line width=2mm,draw=red!20,use as bounding box]
429 % \node[anchor=south,font=\bfseries,text width=4cm,align=center] %
430 % at (24mm,35mm) {Frame of a single page};
431 % \end{tikzpicture}%
432 % \hfill%
433 % \begin{tikzpicture}[baseline=(current bounding box.north)]
434 % \coordinate (O) at (0,0);
435 % \pgfmathsetlengthmacro\x{4cm+2mm+6mm}
436 % \pgfmathsetlengthmacro\y{-2cm-1mm-3mm}
437 % \coordinate (P) at (\x,\y);
438 % \begin{scope}
439 % \FirstSecond[line width=3mm,draw=blue!20]
440 % \FirstSecond[clip]
441 % \FirstSecond[fill=gray!70]
442 % \FirstSecond[line width=7mm,draw=green!20]
443 % \end{scope}
444 % \FirstSecond[line width=2mm,draw=red!20,use as bounding box]
445 % \node[anchor=south,font=\bfseries,text width=4cm,align=center]
446 % at (2.4,0.7) {First box -- first part of the output};
447 % \end{tikzpicture}
448 % \hfill\null
449 %
450 % \vspace{3\baselineskip}
451 %
452 % \null\hfill
453 % \begin{tikzpicture}[baseline=(current bounding box.north)]
454 % \coordinate (O) at (0,0);
455 % \pgfmathsetlengthmacro\x{4cm+2mm+6mm}
456 % \pgfmathsetlengthmacro\y{2cm+1mm+3mm}
457 % \coordinate (P) at (\x,\y);
458 % \begin{scope}
459 % \FirstSecond[line width=3mm,draw=blue!20]
460 % \FirstSecond[clip]
461 % \FirstSecond[fill=gray!70]
462 % \FirstSecond[line width=7mm,draw=green!20]
463 % \end{scope}
464 % \FirstSecond[line width=2mm,draw=red!20,use as bounding box]
465 % \node[anchor=south,font=\bfseries,text width=4cm,align=center] %
466 % at (24mm,25mm) {Second box -- last part of the output};
467 % \end{tikzpicture}%
468 % \hfill%
469 % \begin{tikzpicture}[baseline=(current bounding box.north)]
470 % \coordinate (O) at (0,0);
471 % \pgfmathsetlengthmacro\x{4cm+2mm+6mm}
472 % \pgfmathsetlengthmacro\y{2cm}
473 % \coordinate (P) at (\x,\y);
474 % \begin{scope}
475 % \MiddleLinien[line width=3mm,draw=blue!20]
476 % \MiddleFlaeche[clip]
477 % \MiddleFlaeche[fill=gray!70]
478 % \MiddleLinien[line width=7mm,draw=green!20]
479 % \end{scope}
480 % \MiddleLinien[line width=2mm,draw=red!20,use as bounding box]
481 % \node[anchor=south,font=\bfseries,text width=4cm,align=center]
482 % at (24mm,20mm) {Middle box -- middle part of the output};
483 % \end{tikzpicture}
484 % \hfill\null
485 %
486 % \captionof{figure}{The basic frames}\label{fig:basicframes}
487 %\end{center}
488 % %%%%%%%%%%%%%%%%%%%%%%%
489 % \section{Commands}\label{sec:cmds}
490 %
491 % The following commands should countenance your by the handling with
492 % \Pack{mdframed}.
493 %
494 % \ExplCmd{newmdenv[options]\{env-name\}} The command allows the definition of a new environment
495 % which is surrounded by \Env{mdframed}. The command has the following syntax:
496 % \iffalse
497 %<*example>
498 % \fi
499 \begin{tltxmdfexample}
500 \newmdenv[<MDFRAMED OPTIONS>]{Name of the environment}
501 \end{tltxmdfexample}
502 % \iffalse
503 %</example>
504 % \fi
505 % In this way you can say:
506 % \iffalse
507 %<*example>
508 % \fi
509 \begin{tltxmdfexample}
510 \newmdenv[linecolor=red,frametitle=Infobox]{infobox}
511
512 \begin{infobox}[backgroundcolor=yellow]
513 Some Infos\ldots
514 \end{infobox}
515 \end{tltxmdfexample}
516 % \iffalse
517 %</example>
518 % \fi
519 % \ExplCmd{renewmdenv[options]\{env-name\}}
520 % By using this command you can redefine environments which are created by
521 % \Cmd{newmdenv}.
522 %
523 % \ExplCmd{surroundwithmdframed[options]\{environment\}}
524 % Sometimes you have predefined environments. This commands allows you to
525 % surround an predefined \Env{environment} with \Env{mdframed} without
526 % changing the original name. To set a \Env{mdframed} around the
527 % environment \Env{verbatim} you can simple say.
528 % \iffalse
529 %<*example>
530 % \fi
531 \begin{tltxmdfexample}
532 \surroundwithmdframed[linewidth=2pt]{verbatim}
533 \end{tltxmdfexample}
534 % \iffalse
535 %</example>
536 % \fi
537 %
538 %
539 % \ExplCmd{mdflength\{options\}}
540 % If you want to work with length defined by \Pack{mdframed} (for example
541 % \Opt{innerleftmargin}) you can use the command \Cmd{mdflength}.
542 % \iffalse
543 %<*example>
544 % \fi
545 \begin{tltxmdfexample}
546 The distance is \hspace{\mdflength{innerleftmargin}}
547 \the\mdflength{innerleftmargin}
548 \end{tltxmdfexample}
549 % \iffalse
550 %</example>
551 % \fi
552 % The result will be:
553 % \begin{center}
554 % The distance is \hspace{\mdflength{innerleftmargin}} \the\mdflength{innerleftmargin}
555 % \end{center}
556 %
557 %
558 % \ExplCmd{mdfsetup\{options\}}To set the options
559 % you can use the optional argument of \Cmd{usepackage} or
560 % you can use the command \Cmd{mdfsetup} which is not limited to the preamble.
561 % Inside a group the settings work only local.\par
562 % \textbf{\color{red!70!black}At this point I want to recommend the usage of
563 % the command \Cmd{mdfsetup} instead of setting package option via the optional
564 % argument of \Cmd{usepackage}. So you are avoiding breaking of non robust
565 % commands.}^^A
566 % \footnote{Thanks to Heiko Oberdiek and Philipp Stephani
567 % \href{https://groups.google.com/group/de.comp.text.tex/^^A
568 % browse_thread/thread/15c5ad290490d426?hl=de}^^A
569 % {kvoptions-Declaration von Optionen schl\"agt fehl}}
570 % The sole exception is the option \Opt{framemethod} which must given as an optional
571 % argument of \Cmd{usepackage}.
572 %
573 %
574 %
575 %
576 % \section{Defining your own style}
577 % In the next section all options are introduced. However instead of
578 % passing them global or as an optional argument of the environment
579 % you can define your own styles. The method is as follows
580 % \ExplCmd{mdfdefinestyle\{style name\}\{options\}}
581 % \Cmd{mdfdefinestyle} allows the user to define different styles which can
582 % be used as an option of \Pack{mdframed} via \Opt{style}.
583 % \ExplCmd{mdfapptodefinestyle\{style name\}\{options\}}
584 % This commands add options to a defined style.\footnote{Thanks
585 % to Martin Scharrer and Enrico Gregorio:\newline
586 % \href{http://tex.stackexchange.com/questions/34684/argument-of-setkeys}
587 % {http://tex.stackexchange.com/questions/34684/argument-of-setkeys}}
588 % \ExplOpt{style}
589 % If you define a special style with \Cmd{mdfdefinestyle} you can use
590 % the key \Opt{style} to load the style. \Pack{mdframed} has
591 % no predefined styles yet.
592 %
593 % Here a small example:
594 % \iffalse
595 %<*example>
596 % \fi
597 \begin{tltxmdfexample}[morekeywords={mystyle}]
598 \mdfdefinestyle{mystyle}{leftmargin=1cm,linecolor=blue}
599 \begin{mdframed}[style=mystyle]
600 foo
601 \end{mdframed}
602 \end{tltxmdfexample}
603 % \iffalse
604 %</example>
605 % \fi
606 %
607 %
608 % %%%%%%%%%%%%%%%%%%%%%%%
609 % \section{Options}
610 % The package provides various options to manipulate frames. In the following
611 % section all options are listed. Some internal macros which can be manipulated
612 % are not shown in this documentation.
613 % The listed options are divided in global and local options. The global
614 % options can not be used inside \Cmd{mdfsetup}.
615 %
616 % \subsection{Global Options}\label{globopt}
617 % The following options are only global options.
618 %
619 % \ExplOpt[none]{xcolor}
620 % By setting this key, the package \Pack{xcolor} will
621 % be loaded with the given value(s). Without any value \mbox{\Pack{mdframed}}
622 % loads the package \Pack{color} without any options. If the package
623 % \Pack{xcolor} is already loaded the given option will be ignored.
624 % I recommend to load \Pack{xcolor} before \Pack{mdframed}.
625 %
626 % \ExplOpt[default]{framemethod}
627 % With this key you can change the way frames are drawn. You can decide
628 % whether the frame is drawn with
629 % \begin{enumerate}
630 % \item \LaTeX-commands {\small\Cmd{hrule}, \Cmd{vrule}, \Cmd{rule}},
631 % \item \Pack{TikZ} {\small(the package \Pack{TikZ} will be loaded)} or
632 % \item \Pack{PSTricks} {\small(the package \Pack{pstricks} will be loaded)}.
633 % \end{enumerate}
634 % The option \Opt{framemethod} requires a string. Allowed combinations are
635 % listed in the following table.
636 % \begin{center}
637 % \renewcommand*\arraystretch{1.3}
638 % \captionof{table}{Allowed keys for \Opt{framemethod}}
639 % \begin{tabular}{@{}>{\small\bfseries}l>{\small\ttfamily}l@{}}
640 % \toprule
641 % \multicolumn{1}{@{}l}{\textbf{Method}} & \multicolumn{1}{l}{Allowed keys}\\
642 % \midrule
643 % \LaTeX-commands & default, tex, latex, none, 0 \\
644 % \Pack{TikZ} & tikz, pgf, 1 \\
645 % \Pack{PSTricks} & pstricks, ps, postscript, 2 \\
646 % \bottomrule
647 % \end{tabular}
648 % \end{center}
649 %
650 % If you are lazy you can also work with the following short forms:
651 % \Opt{tikz}, \Opt{TikZ}, \Opt{pstricks}, \Opt{PSTricks} or \Opt{ps}. Of
652 % course for the default method exists no key.
653 %
654 % \minisec{FYI}
655 % It is independently whether the \texttt{method} is
656 % written with no, one or more capital letter.
657 %
658 % All other options listed below can be set globally or locally and they are not
659 % limited to the preamble. I was trying to define self explained names.
660 %
661 % \subsection{Restoring the settings}
662 % Sometimes it's useful to remove all done settings. Every default value
663 % is saved in a style wich can be called by the option \Opt{default} or
664 % a more suitable
665 % name \Opt{style=defaultoptions}. Both do the same.
666 %
667 % Here a small example:
668 % \iffalse
669 %<*example>
670 % \fi
671 \begin{tltxmdfexample}[morekeywords={mystyle}]
672 \mdfsetup{%
673 middlelinecolor=red,
674 middlelinewidth=2pt,
675 backgroundcolor=red!10,
676 roundcorner=10pt}
677 \begin{mdframed}
678 Text\par Text
679 \end{mdframed}
680
681 \begin{mdframed}[default]
682 Text\par Text
683 \end{mdframed}
684 \end{tltxmdfexample}
685 % \iffalse
686 %</example>
687 % \fi
688 %
689 % \begin{mdframed}[%
690 % backgroundcolor=yellow!70!brown,linewidth=1.5pt,
691 % roundcorner=8pt,linecolor=brown!70!black,innerleftmargin=10pt]
692 % \mdfsetup{default,
693 % middlelinecolor=red,
694 % middlelinewidth=2pt,
695 % backgroundcolor=red!10,
696 % roundcorner=10pt}
697 % \begin{mdframed}
698 % Text\par Text
699 % \end{mdframed}
700 %
701 % \begin{mdframed}[default]
702 % Text\par Text
703 % \end{mdframed}
704 % \end{mdframed}
705 %
706 %
707 %
708 % \subsection{Options with lengths}\label{optlength}
709 %
710 % In figure \eqref{fig:laengen} you can see the adjustable lengths
711 % (compare also figure \eqref{fig:basicframes}).
712 %
713 % \begin{center}
714 % \begin{tikzpicture}[scale=0.9]
715 % %Declaration
716 % \newlength{\linew}
717 % \setlength{\linew}{5pt}
718 % \tikzstyle{every node}=[font=\bfseries\large\sffamily]
719 % \coordinate (innersep) at (3.2,2.25);
720 % \coordinate (outersep) at (3.2,2);
721 % %Center
722 % \node[fill=green!10,draw=black,framed,rounded corners,
723 % minimum width=3cm,minimum height=1.5cm]%
724 % (CenterNode) {Contents};
725 %
726 % %frames
727 % \draw[draw=red!70!black,line width=\linew] %
728 % ($(CenterNode)+(innersep)$) %
729 % rectangle ($(CenterNode)-(innersep)$);
730 % \draw[draw=blue!70!black,line width=\linew] %
731 % ($(CenterNode)+(innersep)+(\linew,\linew)$)%
732 % rectangle ($(CenterNode)-(innersep)+(-\linew,-\linew)$);
733 % \draw[draw=yellow!70!black,line width=\linew]
734 % ($(CenterNode)+(innersep)+(2\linew,2\linew)$)%
735 % rectangle ($(CenterNode)-(innersep)+(-2\linew,-2\linew)$);
736 % \draw[draw=black,line width=1] ($(CenterNode)+(innersep)+(outersep)$)%
737 % rectangle ($(CenterNode)-(innersep)-(outersep)$);
738 %
739 %
740 % \tikzstyle{every node}=[font=\small\ttfamily]
741 % %%innertopmargin
742 % \draw[draw=black,triangle 45-triangle 45]let \p1=(innersep) in
743 % (CenterNode.north) -- ($(CenterNode)+(0,\y1)-(0,.5\linew)$) ;
744 % \path let \p1=(innersep) in
745 % (CenterNode.north)
746 % edge
747 % node[align=center,framed,fill=white,draw=white]{innertopmargin}
748 % ($(CenterNode)+(0,\y1)-(0,.5\linew)$) ;
749 % %%innerbottommargin
750 % \draw[draw=black,triangle 45-triangle 45]let \p1=(innersep) in
751 % (CenterNode.south) -- ($(CenterNode)-(0,\y1)+(0,.5\linew)$) ;
752 % \path let \p1=(innersep) in
753 % (CenterNode.south)
754 % edge
755 % node[align=center,framed,fill=white,draw=white]{innerbottommargin}
756 % ($(CenterNode)-(0,\y1)+(0,.5\linew)$) ;
757 %
758 % %%innerleftmargin
759 % \draw[draw=black,triangle 45-triangle 45]let \p1=(innersep) in
760 % (CenterNode.west) -- ($(CenterNode)-(\x1,0)+(.5\linew,0)$) ;
761 % \path let \p1=(innersep) in
762 % (CenterNode.west) edge
763 % node[align=center,rotate=90,framed,fill=white,draw=white]
764 % {innerleftmargin}
765 % ($(CenterNode)-(\x1,0)+(.5\linew,0)$) ;
766 % %%innerrightmargin
767 % \draw[draw=black,triangle 45-triangle 45]let \p1=(innersep) in
768 % (CenterNode.east) -- ($(CenterNode)+(\x1,0)-(.5\linew,0)$) ;
769 % \path let \p1=(innersep) in
770 % (CenterNode.east) edge
771 % node[align=center,rotate=90,framed,fill=white,draw=white]
772 % {innerrightmargin}
773 % ($(CenterNode)+(\x1,0)-(.5\linew,0)$) ;
774 %
775 %
776 % %%leftmargin
777 % \draw[draw=black,triangle 45-triangle 45]
778 % let \p1=(innersep) , \p2=(outersep) in
779 % ($(CenterNode)-(\x1,0)-(2.5\linew,0)$) --
780 % ($(CenterNode)-(\x1,0)-(\x2,0)$) ;
781 % \path let \p1=(innersep) , \p2=(outersep) in
782 % ($(CenterNode)-(\x1,0)-(2.5\linew,0)$) edge
783 % node[align=center,rotate=0,framed,fill=white,draw=white]
784 % {leftmargin}
785 % ($(CenterNode)-(\x1,0)-(\x2,0)$) ;
786 % %%rightmargin
787 % \draw[draw=black,triangle 45-triangle 45]
788 % let \p1=(innersep) , \p2=(outersep) in
789 % ($(CenterNode)+(\x1,0)+(2.5\linew,0)$) --
790 % ($(CenterNode)+(\x1,0)+(\x2,0)$) ;
791 % \path let \p1=(innersep) , \p2=(outersep) in
792 % ($(CenterNode)+(\x1,0)+(2.5\linew,0)$) edge
793 % node[align=center,rotate=0,framed,fill=white,draw=white]
794 % {rightmargin}
795 % ($(CenterNode)+(\x1,0)+(\x2,0)$) ;
796 %
797 % %%skipabove
798 % \draw[draw=black,triangle 45-triangle 45]
799 % let \p1=(innersep) , \p2=(outersep) in
800 % ($(CenterNode)+(0,\y1)+(0,2.5\linew)$) --
801 % ($(CenterNode)+(0,\y1)+(0,\y2)$) ;
802 % \path let \p1=(innersep) , \p2=(outersep) in
803 % ($(CenterNode)+(0,\y1)+(0,2.5\linew)$) edge
804 % node[align=center,rotate=0,framed,fill=white,draw=white]
805 % {skipabove}
806 % ($(CenterNode)+(0,\y1)+(0,\y2)$) ;
807 % %%skipbelow
808 % \draw[draw=black,triangle 45-triangle 45]
809 % let \p1=(innersep) , \p2=(outersep) in
810 % ($(CenterNode)-(0,\y1)-(0,2.5\linew)$) --
811 % ($(CenterNode)-(0,\y1)-(0,\y2)$) ;
812 % \path let \p1=(innersep) , \p2=(outersep) in
813 % ($(CenterNode)-(0,\y1)-(0,2.5\linew)$) edge
814 % node[align=center,rotate=0,framed,fill=white,draw=white]
815 % {skipbelow}
816 % ($(CenterNode)-(0,\y1)-(0,\y2)$) ;
817 % \end{tikzpicture}
818 %
819 % \captionof{figure}{adjustable lengths of \Pack{mdframed}}
820 % \label{fig:laengen}
821 % \end{center}
822 %
823 % \ExplOpt[pt]{defaultunit}
824 % All lengths accept two kinds of input. The first one is a length (e.g. 2pt)
825 % and the second one is a number (e.g. 2) which will be multiplied by
826 % \Opt{1 defaultunit}. To get a better overview, all length options with their
827 % default value are listet in a table. I think the names are self explained
828 % so that don't describe it anymore. Although special hints and length are
829 % described below
830 %
831 %
832 % The first table lists the length for the geometry of the frame.
833 % \begin{center}
834 % \def\arraystretch{1.4}
835 % \begin{tabular}{@{}%
836 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
837 % @{\qquad}
838 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
839 % @{}}
840 % \hline
841 % skipabove & 0pt & skipbelow & 0pt \\
842 % leftmargin & 0pt & rightmargin & 0pt \\
843 % innerleftmargin & 10pt & innerrightmargin & 10pt \\
844 % innertopmargin & 5pt & innerbottommargin & 5pt \\
845 % \hline
846 % \end{tabular}
847 % \end{center}
848 % Before the next options are introduced here an example where the described
849 % length are used.
850 % \iffalse
851 %<*example>
852 % \fi
853 \begin{tltxmdfexample}[morekeywords={mystyle}]
854 \mdfdefinestyle{mdfexample1}{leftmargin=1cm,rightmargin=2cm,%
855 innerleftmargin=1cm,innerrightmargin=1cm,roundcorner=10pt}
856 \begin{mdframed}[style=mdfexample1]
857 In any right triangle, the area of the square whose side is the hypotenuse
858 is equal to the sum of the areas of the squares whose sides are the two
859 legs.
860 \end{mdframed}
861 \end{tltxmdfexample}
862 % \iffalse
863 %</example>
864 % \fi
865 % \begin{mdframed}[%
866 % backgroundcolor=yellow!70!brown,linewidth=1.5pt,
867 % roundcorner=8pt,linecolor=brown!70!black,innerleftmargin=10pt]
868 % \mdfdefinestyle{mdfexample1}{default,leftmargin=1cm,rightmargin=2cm,%
869 % innerleftmargin=2cm,innerrightmargin=1cm,roundcorner=10pt}
870 % \begin{mdframed}[style=mdfexample1]
871 % In any right triangle, the area of the square whose side is the hypotenuse
872 % is equal to the sum of the areas of the squares whose sides are the two
873 % legs.
874 % \end{mdframed}
875 % \end{mdframed}
876 %
877 %
878 % The next table lists the options to manipulate the lines of \Env{mdframed}.
879 % If you are working with \Opt{framemethod=default} you have only one line
880 % for framing.
881 % \begin{center}
882 % \def\arraystretch{1.4}
883 % \begin{tabular}{@{}%
884 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
885 % @{\qquad}
886 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
887 % @{\qquad}
888 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
889 % @{}}
890 % \hline
891 % linewidth & 0.4pt & innerlinewidth & 0pt &
892 % middlelinewidth & 0.4pt \\
893 % outerlinewidth & 0pt & roundcorner & 0pt &
894 % \multicolumn{2}{c}{} \\
895 % \hline
896 % \end{tabular}
897 % \end{center}
898 % If you are working width \Opt{framemethod=tikz} or \Opt{framemethod=pstricks}
899 % the option \Opt{linewidth} is an alias for the option \Opt{middlelinewidth}.
900 %
901 %
902 % \subsection{Colored Options}
903 % Now we want to bring some color on your frames. The limitation is equal
904 % the the length options. For \Opt{framemethod=default} you have only one
905 % line.
906 % \begin{center}
907 % \def\arraystretch{1.4}
908 % \begin{tabular}{@{}%
909 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
910 % @{\qquad}
911 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
912 % @{}}
913 % \hline
914 % linecolor & black & innerlinecolor & black \\
915 % middlelinecolor & black & outerlinecolor & black \\
916 % backgroundcolor & white & fontcolor & black \\
917 % \hline
918 % \end{tabular}
919 % \end{center}
920 %
921 % \ExplOpt[\{\}]{font}
922 % Although it's no really a color options you can also specify the font
923 % of the contents. Therefor the option \Opt{font} can be used.
924 %
925 % Ok after we have some lengths and some colors we can improve our example.
926 % \iffalse
927 %<*example>
928 % \fi
929 \begin{tltxmdfexample}[morekeywords={example1}]
930 \mdfapptodefinestyle{example1}{backgroundcolor=brown!20,%
931 linecolor=red!40!black,linewidth=4pt}
932 \begin{mdframed}[style=mdfexample1]
933 In any right triangle, the area of the square whose side is the hypotenuse
934 is equal to the sum of the areas of the squares whose sides are the two
935 legs.
936 \end{mdframed}
937 \end{tltxmdfexample}
938 % \iffalse
939 %</example>
940 % \fi
941 % \begin{mdframed}[%
942 % backgroundcolor=yellow!70!brown,linewidth=1.5pt,
943 % roundcorner=8pt,linecolor=brown!70!black,innerleftmargin=10pt]
944 % \mdfdefinestyle{mdfexample1}{default,leftmargin=1cm,rightmargin=2cm,%
945 % innerleftmargin=2cm,innerrightmargin=1cm,roundcorner=10pt,%
946 % backgroundcolor=brown!20,linecolor=red!40!black, linewidth=4pt}
947 % \begin{mdframed}[style=mdfexample1]
948 % In any right triangle, the area of the square whose side is the hypotenuse
949 % is equal to the sum of the areas of the squares whose sides are the two
950 % legs.
951 % \end{mdframed}
952 % \end{mdframed}
953 %
954 %
955 %
956 % \subsection{Shadows}\label{sec:shadow}
957 % Another possibility to highlight a frame can be a shadow. The package
958 % \Pack{mdframed} supports some elementary options to add a shadow. For
959 % \Opt{framemethod=tikz} the library \Pack{shadows} is needed which must be
960 % loaded by the user by \verb+\usetikzlibrary{shadows}+.
961 % \ExplOpt[8\,pt]{shadowsize}
962 % \ExplOpt[black!50]{shadowcolor}
963 % If a shadow is used depends on the option \Opt{shadow} which can be either
964 % \texttt{true} or \texttt{false}. The option shadows enables two new options
965 % \Opt{shadowsize} and \Opt{shadowcolor}.
966 % \iffalse
967 %<*example>
968 % \fi
969 \begin{tltxmdfexample}[morekeywords={example1}]
970 \begin{mdframed}[backgroundcolor=gray!40,shadow=true,roundcorner=8pt]
971 In any right triangle, the area of the square whose side is the hypotenuse
972 is equal to the sum of the areas of the squares whose sides are the two
973 legs.
974 \end{mdframed}
975 \end{tltxmdfexample}
976 % \iffalse
977 %</example>
978 % \fi
979 % \begin{mdframed}[backgroundcolor=gray!40!white,shadow=true,roundcorner=8pt]
980 % In any right triangle, the area of the square whose side is the hypotenuse
981 % is equal to the sum of the areas of the squares whose sides are the two
982 % legs.
983 % \end{mdframed}
984 %
985 %
986 % \subsection{Hidden Lines}
987 % The default behaoiur of the output was shown in a previous picture.
988 % \Pack{mdframed} offers the possibility to print only requested lines. If
989 % you don't want any right line you can say \Opt{rightline=false}. The
990 % table below listed all keys to this topic and shows their default setting.
991 % \begin{center}
992 % \def\arraystretch{1.4}
993 % \begin{tabular}{@{}%
994 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
995 % @{\qquad}
996 % >{\Opt\bgroup}l<{\egroup}@{${}={}$}>{\ttfamily}l%
997 % @{}}
998 % \hline
999 % topline & true & rightline & true \\
1000 % leftline & true & bottomline & true \\
1001 % \hline
1002 % \end{tabular}
1003 % \end{center}
1004 % \ExplOpt[false]{hidealllines}
1005 % If you want to disable all lines you can use the short from
1006 % \Opt{hidealllines}.
1007 %
1008 %
1009 % \subsection{Working in twoside-mode}
1010 %
1011 % Many books are written in \texttt{twoside} mode. In those cases it's
1012 % better to set the margins related to the site. Instead of the
1013 % explained options \Opt{leftmargin} and \Opt{rightmargin} you can work with the
1014 % options \Opt{outermargin} and \Opt{innermargin}. Of course if you working
1015 % in \texttt{oneside} mode the options have no effect. If you don't want to
1016 % work with \Opt{outermargin} and \Opt{innermargin} whether the document is
1017 % done in \texttt{twoside} mode you can disable the behaviour by the option
1018 % \Opt{usetwoside}. Allowed values for this key are \texttt{true} or
1019 % \texttt{false}.
1020 %
1021 %
1022 % \subsection{Footnotes}
1023 % Inside the environment you can use the command \Cmd{footnote} as usual.
1024 % \Pack{mdframed} uses the syntax of environment \Pack{minipage} with
1025 % the same counter.
1026 %
1027 % Every footnote text will be collected inside a box and will be displayed
1028 % at the end of the environment \Pack{mdframed}.
1029 %
1030 % \ExplOpt[\mbox{} \Cmd{bigskipamount}]{footnotedistance}
1031 % The length is the distance between the end of the environment
1032 % \Pack{mdframed} and the displaying of the \Cmd{footnoterule}.
1033 % \ExplOpt[true]{footnoteinside}
1034 % The position of the footnotes can be changed with the option
1035 % \Opt{footnoteinside}. The footnotes will be displayed at the end
1036 % of the environment but you can decide whether the output is inside
1037 % \Pack{mdframed} or after.
1038 %
1039 % \minisec{Note}
1040 % The output of the footnotes with the option \Opt{footnoteinside=false}
1041 % are not in a splitted frame. I think it isn't useful because the first line
1042 % of a new page shouldn't be a footnote.
1043 %
1044 %
1045 %
1046 %
1047 %\subsection{Page breaks}
1048 % The package \Pack{mdframed} splits its content if neccessary. In figure
1049 % \ref{fig:basicframes} the default style for splitting is presented. However
1050 % there a sevaral situations where no page preak should occur.
1051 % \ExplOpt[false]{nobreak}
1052 % For this case you can use the option \Opt{nobreak} which is either
1053 % \texttt{true} or \texttt{false}. As you can see in figure
1054 % \ref{fig:basicframes} the different elements have different ways of drawing.
1055 % E.g. the middle part of \Pack{mdframed} has only a left and a right line.
1056 %
1057 % \ExplOpt[false]{everyline}
1058 % If you want that all parts of \Pack{mdframed} get a whole frame you can work
1059 % with the option \Opt{everyline}. Then all parts are displayed as a single
1060 % frame.
1061 %
1062 % In a previous section the options \Opt{innertopmargin} and
1063 % \Opt{innerbottommaring} were introduced. However if a page break occurs
1064 % you have two new length options which influence the space at the breaking
1065 % point.
1066 % \ExplOpt[0\,pt]{splittopskip}
1067 % Sets the length of the skip above the split part of the environment.
1068 % \ExplOpt[0\,pt]{splitbottomskip}
1069 % Sets the length of the skip below the split part of the environment.
1070 %
1071 % \subsection{Frametitle}
1072 % In this section all relevant options of the frame title will be presented.
1073 % They are not divided in their properties.
1074 %
1075 % \ExplOpt[none]{frametitle}
1076 % The environment gets a title. To set a title use
1077 % \Opt{frametitle=\{The Title of the frame\}} as an option of the
1078 % environment.
1079 % \ExplOpt[\Cmd{normalfont}\Cmd{bfseries}]{frametitlefont}
1080 % Sets the format of the \Opt{frametitle}.
1081 % \ExplOpt[\Cmd{raggedleft}]{frametitlealignment}
1082 % Align the \Opt{frametitle}. This option must be set via \Cmd{mdfsetup}.
1083 % \ExplOpt[false]{frametitlerule}
1084 % Set this key to \Opt{true} to get a line between the frame title
1085 % and the text.
1086 % \ExplOpt[.2\,pt]{frametitlerulewidth}
1087 % Sets the width of the line between the text and the title of
1088 % \Env{mdframed}.
1089 % \ExplOpt[5\,pt]{frametitleaboveskip}
1090 % Sets the skip of the frame title to the margin above of \Env{mdframed}.
1091 % \ExplOpt[5\,pt]{frametitlebelowskip}
1092 % Sets the skip of the frame title to the rule of the frame title.
1093 % \ExplOpt[backroundcolor]{frametitlebackgroundcolor}
1094 % Sets the color of the background of the frametitle
1095 % \ExplOpt[false]{repeatframetitle}
1096 % Repeat the frame title on every frame.
1097 %
1098 %
1099 % The following picture demonstrates the behaviour of the lengths if the option
1100 % \Opt{frametitle} is used.
1101 %
1102 % \begin{center}
1103 % \begin{tikzpicture}[scale=0.9]
1104 % %Declaration
1105 % \tikzstyle{every node}=[font=\bfseries\large\sffamily]
1106 % \coordinate (innersep) at (3.2,2.25);
1107 % \coordinate (outersep) at (3.2,2);
1108 % %Center box
1109 % \node[fill=green!10,draw=red!70!black,very thick,fill opacity=.2,
1110 % text opacity=1,minimum width=9cm,minimum height=3cm,]%
1111 % (CenterNode) {Contents of the box};
1112 % %frametitle box
1113 % \node[fill=yellow!70,draw=red!70!black,very thick,fill opacity=.2,
1114 % text opacity=1,minimum width=9cm,minimum height=3cm,anchor=south]%
1115 % at (CenterNode.north) (frametitle) {frame title};
1116 % % frametitlerule
1117 % \draw[line width=3pt,blue!60!black] (frametitle.south west)
1118 % -- (frametitle.south east)
1119 % node[pos=1,anchor=west,text width=4cm]
1120 % {\Opt{frametitlerulewidth}\\\Opt{frametitlerule=true}};
1121 % % frametitlebelowskip
1122 % \draw[very thick,blue!60!black,latex-latex,shorten >=0.2cm]
1123 % (frametitle.south) -- (frametitle.center)
1124 % node[pos=0.5,anchor=west]
1125 % {\Opt{ frametitlebelowskip}};
1126 % % frametitleaboveskip
1127 % \draw[very thick,blue!60!black,latex-latex,shorten >=0.2cm]
1128 % (frametitle.north) -- (frametitle.center)
1129 % node[pos=0.5,anchor=west] {\Opt{ frametitleaboveskip}};
1130 % % innertopmargin
1131 % \draw[very thick,blue!60!black,latex-latex,shorten >=0.2cm]
1132 % (CenterNode.north) -- (CenterNode.center)
1133 % node[pos=0.5,anchor=west] {\Opt{ innertopmargin}};
1134 % % splittopskip
1135 % \draw[very thick,blue!60!black,latex-latex,shorten >=0.2cm]
1136 % (CenterNode.north) -- (CenterNode.center)
1137 % node[pos=0.5,anchor=east] {\Opt{splittopskip}};
1138 % % global frame
1139 % \draw[thick] (-5.5,-2.1) rectangle (9.4,5.5);
1140 % \end{tikzpicture}
1141 % \captionof{figure}{Behavior of the lengths if \Opt{frametitle} is used}
1142 % \label{fig:frametitlelaengen}
1143 % \end{center}
1144 %
1145 %
1146 % \minisec{FYI and Note}
1147 % The splitting of the frame title is really a fiddly issue. If you want to use
1148 % the option \Opt{repeatframetitle} a splitting is more than wrong. On the
1149 % other hand if you use the option \Opt{repeatframetitle} the user must prepare
1150 % the contents well.
1151 %
1152 % \subsection{Title commands inside the environment}
1153 %
1154 % To provide titles inside the environment \Pack{mdframed} you can use
1155 % \Cmd{mdfsubtitle}. The relavant options are listed below.
1156 %
1157 % \ExplCmd{mdfsubtitle}
1158 % Set a title inside \Pack{mdframed} of the internal level 1.
1159 %
1160 % The command accepts one optional and one
1161 % mandatory argument. The optional argument sets the option of \Pack{mdframed}
1162 % whereby everything will be local. The second argument of subtitle also allows
1163 % paragraph breaking.
1164 %
1165 % Breaks inside the \Cmd{mdfsubtitle} are not supported.
1166 %
1167 % \iffalse
1168 %<*example>
1169 % \fi
1170 \begin{tltxmdfexample}
1171 \mdfsubtitle[<options>]{the subtitle}
1172 \end{tltxmdfexample}
1173 % \iffalse
1174 %</example>
1175 % \fi
1176 %
1177 %
1178 % \subsubsection{Options related to the title of level 1}
1179 % \ExplOpt[false]{subtitleaboveline}
1180 % Decide to draw a line above the subtile.
1181 % \ExplOpt[false]{subtitlebelowline}
1182 % Decide to draw a line below the subtitle.
1183 % \ExplOpt[\string\normalfont\string\bfseries]{subtitlefont}
1184 % Sets the font for subtitles.
1185 % \ExplOpt[white]{subtitlebackgroundcolor}
1186 % Sets the background color of the subtitle between the above and below
1187 % line.
1188 % \ExplOpt[black]{subtitleabovelinecolor}
1189 % Sets the line color of the line above.
1190 % \ExplOpt[black]{subtitlebelowlinecolor}
1191 % Sets the line color of the line below.
1192 % \ExplOpt[0.8\,pt]{subtitleabovelinewidth}
1193 % Sets the line width of the line above.
1194 % \ExplOpt[0.6\,pt]{subtitlebelowlinewidth}
1195 % Sets the line width of the line below.
1196 % \ExplOpt[\string\baselineskip]{subtitleaboveskip}
1197 % Sets the skip before the subtitle line above will be drawn.
1198 % \ExplOpt[1.2\string\baselineskip]{subtitlebelowskip}
1199 % Sets the skip after the subtitle line below is drawn.
1200 % \ExplOpt[0.5\string\baselineskip]{subtitleinneraboveskip}
1201 % Sets the skip after the line above and the subtitle itself.
1202 % \ExplOpt[0.5\string\baselineskip]{subtitleinnerbelowskip}
1203 % Sets the skip after the subtitle and the line below.
1204 %
1205 % Here an example to demonstrate the behaviour:
1206 %
1207 %\newmdenv[%
1208 % roundcorner=5pt,nobreak=true,
1209 % subtitlebelowline=true,subtitleaboveline=true,
1210 % subtitlebackgroundcolor=yellow!70!white,
1211 % backgroundcolor=blue!20!white,
1212 % frametitle={Theorem},frametitlerule=true,
1213 % frametitlebackgroundcolor=yellow!70!white,
1214 % ]{subtitleenv}
1215 %
1216 % \begin{subtitleenv}
1217 % Some Text \ldots
1218 % \mdfsubtitle{Notes}
1219 % Some Text \ldots
1220 % \end{subtitleenv}
1221 %
1222 % \iffalse
1223 %<*example>
1224 % \fi
1225 \begin{tltxmdfexample}
1226 \newmdenv[%
1227 roundcorner=5pt,
1228 subtitlebelowline=true,subtitleaboveline=true,
1229 subtitlebackgroundcolor=yellow!70!white,
1230 backgroundcolor=blue!20!white,
1231 frametitle={Theorem},frametitlerule=true,
1232 frametitlebackgroundcolor=yellow!70!white,
1233 ]{subtitleenv}
1234 \begin{subtitleenv}
1235 Some Text \ldots
1236 \mdfsubtitle{Notes}
1237 Some Text \ldots
1238 \end{subtitleenv}
1239 \end{tltxmdfexample}
1240 % \iffalse
1241 %</example>
1242 % \fi
1243 %
1244 %
1245 %
1246 % \subsection{General options}\label{genopt}
1247 % Some options can't be classified. Such options are listed in this section.
1248 % \ExplOpt[false]{ntheorem}
1249 % Before setting this boolean key, you have to load
1250 % the package \Pack{ntheorem}. With this option you set the
1251 % values \Cmd{theorempreskipamount} and
1252 % \Cmd{theorempostskipamount} to 0\,pt to avoid extra vertical skip.
1253 % \ExplOpt[0\,pt]{needspace}
1254 % Sometimes it is useful to set a minimum height before a
1255 % frame should be splitted. For such cases you can use \Opt{needspace}.
1256 % The option requires a length which sets the minimum height before
1257 % a frame will be splitted.
1258 % \ExplOpt[false]{ignorelastdescenders}
1259 % Try to ignore the last descenders of the environment \Env{mdframed}. The
1260 % complete idea was inspired by Tobias Weh and the solution was provided
1261 % by Stefan Lemke. See
1262 % \href{http://tex.stackexchange.com/questions/47584/how-to-make-^^A
1263 % mdframed-ignore-descenders-in-last-line}^^A
1264 % {How to make mdframed ignore descenders in last line}
1265 % Of course you have some more length which can be manipulate.
1266 % \ExplOpt[\textbackslash linewidth]{userdefinedwidth}
1267 % Sets the width of the whole \Pack{mdframed} environment.
1268 % The width represent the width including the line width and
1269 % the inner margins. The outer margins will be ignored.
1270 %
1271 % \ExplOpt[left]{align}
1272 % Sometimes it is useful to align the environment itself.
1273 % For this you have the option \Opt{align} which can be set to the
1274 % following strings:
1275 % \begin{itemize}
1276 % \item \Opt{left},
1277 % \item \Opt{right} and
1278 % \item \Opt{center}.
1279 % \end{itemize}
1280 % The alignments \Opt{left} or \Opt{right} depend on the given lengths
1281 % \Opt{leftmargin} and \Opt{rightmargin}. Later I will present an example
1282 % to demonstrate my bad English explanation.
1283 %
1284 % Be aware of using this option please.
1285 %
1286 %
1287 % \subsection{TikZ options}\label{tikzopt}
1288 % \mbox{}
1289 % \ExplOpt[\{\}]{tikzsetting}
1290 % With this key you can pass several options to \Cmd{tikzset}.
1291 % Some examples are listed in the next section. It is very important
1292 % to put the options of \Opt{tikzsetting} in brackets.
1293 % \ExplOpt[\{\}]{apptotikzsetting}
1294 % With this key you can add several options to \Opt{tikzsetting}.
1295 % This key based on the idea of manipulation of predefined keys
1296 % of \Pack{mdframed}. The package \Pack{mdframed} defines via
1297 % \Cmd{tikzset} the following keys to draw frames.
1298 % \begin{itemize}
1299 % \item \Cmd{tikzset\{mdfbox/.style\}}
1300 % \item \Cmd{tikzset\{mdfcorners/.style\}}
1301 % \item \Cmd{tikzset\{mdfbackground/.style\}}
1302 % \item \Cmd{tikzset\{mdfinnerline/.style\}}
1303 % \item \Cmd{tikzset\{mdfouterline/.style\}}
1304 % \item \Cmd{tikzset\{mdfmiddleline/.style\}}
1305 % \item \Cmd{tikzset\{mdfframetitlerule/.style\}}
1306 % \item \Cmd{tikzset\{mdfframetitlebackground/.style\}}
1307 % \item \Cmd{tikzset\{mdfshadow/.style\}}
1308 % \end{itemize}
1309 % \textbf{Before you change one please have a look at the
1310 % file \texttt{md-frame-1.mdf} to see the settings.}
1311 %
1312 %
1313 % \subsection{PSTricks options}\label{pstricksopt}
1314 % \mbox{}
1315 % \ExplOpt[\{\}]{pstrickssetting}
1316 % With this key you can pass several options to \Cmd{psset}.
1317 % For example if you want all lines dashed you will have to set
1318 % \Opt{pstrickssetting=\{linestyle=dashed\}}. It is very important
1319 % to put the options of \Opt{pstrickssetting} in brackets.
1320 % \ExplOpt[\{\}]{pstricksappsetting}
1321 % \Pack{mdframed} works with defined styles for the different elements. By
1322 % using \Cmd{addtopsstyle} in combination with this option
1323 % you can expand the definition. The predefined styles are
1324 % \begin{itemize}
1325 % \item \Opt{mdfbackgroundstyle}
1326 % \item \Opt{mdfframetitlebackgroundstyle}
1327 % \item \Opt{mdfouterlinestyle}
1328 % \item \Opt{mdfinnerlinestyle}
1329 % \item \Opt{mdfmiddlelinestyle}
1330 % \end{itemize}
1331 % \textbf{Before you change one please have a look at the file
1332 % \texttt{md-frame-2.mdf} to see the settings.}
1333 %
1334 %
1335 % \section{Hooks and Bools}\label{hooksandbools}
1336 % The following options and bool flags can be used by the any user. Of course
1337 % some needs more experience than other.
1338
1339 % \ExplOpt[\{\}]{settings}
1340 % This option allows the user to commit some macros at the beginning of
1341 % \Pack{mdframed}. The given material is executed before the savebox starts.
1342 %
1343 % \ExplOpt[\{\}]{extra}
1344 % Add material to every drawn frame.
1345 % \ExplOpt[\{\}]{singleextra}
1346 % With this key you can put extra material to the drawing environment of
1347 % \Pack{mdframed} only for a non splitted frame.
1348 % \ExplOpt[\{\}]{firstextra}
1349 % With this key you can put extra material to the drawing environment of
1350 % \Pack{mdframed} only for the first part of the splitted frame.
1351 % \ExplOpt[\{\}]{middleextra}
1352 % With this key you can put extra material to the drawing environment of
1353 % \Pack{mdframed} only for the middle part of the splitted frame.
1354 % \limitation[TikZ and PSTricks]
1355 % \ExplOpt[\{\}]{secondextra}
1356 % With this key you can put extra material to the drawing environment of
1357 % \Pack{mdframed} only for the second part of the splitted frame.
1358 %
1359 %
1360 % After you can add material to any part of the frame you can also detect which
1361 % part of the frame is drawn. Therefor the bool flags are defined which can be
1362 % test by \Cmd{ifbool\{boolflag\}}. All flags are set to true before the output
1363 % of the content occurs.
1364 % \ExplOpt[false]{mdfsingleframe}
1365 % This bool is only true for a non splitting frame.
1366 % \ExplOpt[false]{mdffirstframe}
1367 % This bool is only for the first part of the frame true.
1368 % \ExplOpt[false]{mdfmiddleframe}
1369 % see above.
1370 % \ExplOpt[false]{mdflastframe}
1371 % see above.
1372 %
1373 % For the advanced users there are also some other hooks which can be used
1374 % to manipulate the output:
1375 % \ExplOpt[\{\}]{beforesingleframe}
1376 % Every given code to this option is executed before a single frame is
1377 % is printed.
1378 % \ExplOpt[\{\}]{aftersingleframe}
1379 % Every given code to this option is executed after a single frame is
1380 % is printed.
1381 % \ExplOpt[\{\}]{beforebreak}
1382 % The value of this option is only executed at breakable frames. Related to
1383 % the introduction the first and middle frame can be manipulated.
1384 % \ExplOpt[\{\}]{afterbreak}
1385 % The value of this option is only executed at breakable frames. Related to
1386 % the introduction the first and middle frame can be manipulated.
1387 % \ExplOpt[\{\}]{beforelastframe}
1388 % The option is executed only for the last frame of a splitted frame.
1389 % \ExplOpt[\{\}]{afterlastframe}
1390 % The option is executed only for the last frame of a splitted frame.
1391 %
1392 % \ExplOpt[\{\}]{startcode}
1393 % Every code given to this option is executed at the beginning of the
1394 % environment.
1395 % \ExplOpt[\{\}]{startinnercode}
1396 % This option is executed at the beginning of the save box.
1397 % \ExplOpt[\{\}]{endinnercode}
1398 % This option is executed at the end of the save box.
1399 % \ExplOpt[\{\}]{endcode}
1400 % The code is executed at the end of the environment.
1401 %
1402 % \section{Theorems}
1403 % In this section is described which commands can help you to define
1404 % theorem environments with \Pack{mdframed}.
1405 %
1406 % \ExplCmd{newmdtheoremenv}
1407 % Since the package is often used to highlight theorem environments,
1408 % the package providesa command to simplify this process. The command has the
1409 % following syntax:
1410 %
1411 % \iffalse
1412 %<*example>
1413 % \fi
1414 \begin{tltxmdfexample}[deletekeywords={mdframed}]
1415 \newmdtheoremenv[<mdframed-options>]{<envname>}%
1416 [<numberedlike>]{<caption>}[<within>]
1417 \end{tltxmdfexample}
1418 % \iffalse
1419 %</example>
1420 % \fi
1421 % The last four arguments are equivalent to the command \Cmd{newtheorem}.
1422 % Only the first optional argument is able to pass \Pack{mdframed}-options. A
1423 % simple example is:
1424 % \iffalse
1425 %<*example>
1426 % \fi
1427 \begin{tltxmdfexample}
1428 \theoremstyle{<some style>}
1429 \newmdtheoremenv[linecolor=blue]{lemma}{Lemma}[section]
1430 ...
1431 \begin{lemma}[Some title]
1432 foo foo foo foo foo foo
1433 \end{lemma}
1434 \end{tltxmdfexample}
1435 % \iffalse
1436 %</example>
1437 % \fi
1438 % So far there is no \Cmd{renewmdtheoremenv}!
1439 %
1440 %
1441 % \ExplCmd{mdtheorem}
1442 % This is a special kind of \Cmd{newtheorem}. The command has the following
1443 % syntax.
1444 % \iffalse
1445 %<*example>
1446 % \fi
1447 \begin{tltxmdfexample}[deletekeywords={mdframed}]
1448 \mdtheorem[<mdframed-options>]{<envname>}%
1449 [<numberedlike>]{<caption>}[<within>]
1450 \end{tltxmdfexample}
1451 % \iffalse
1452 %</example>
1453 % \fi
1454 % As you can see the arguments are equal to \Cmd{newtheorem} but the
1455 % command ignores every \Cmd{theoremstyle}. This is based on the following
1456 % behavior.
1457 %
1458 % The command \Cmd{mdtheorem} creates two environments based on the given
1459 % first mandatory argument. The first environment is named like the given
1460 % argument and creates a numbered theorem. The second environment is named
1461 % like the first mandatory argument with a star. This environment has the
1462 % same formating but isn't numbered.
1463 %
1464 % The syntax of the new defined environments is equal to the normal theorem
1465 % environments.
1466 % \iffalse
1467 %<*example>
1468 % \fi
1469 \begin{tltxmdfexample}[deletekeywords={mdframed}]
1470 \begin{environment}[optional title]
1471 ...
1472 \end{environment}
1473 \end{tltxmdfexample}
1474 % \iffalse
1475 %</example>
1476 % \fi
1477 % What happened? The caption of the command will be set as the frame title.
1478 % In this way all options of the frame title are available. Furthermore
1479 % \Pack{mdframed} provides additional options explained below.
1480 %
1481 % \ExplOpt[\{:\}]{theoremseparator}
1482 % Sets the separator of the caption and the title of the theorem.
1483 % The \Opt{theoremseparator} will be printed only if an theorem
1484 % title is given.
1485 % \ExplOpt[\{\}]{theoremtitlefont}
1486 % Via the option \Opt{frametitlefont} you can manipulate the font
1487 % of the frame title. The option \Opt{theoremtitlefont} allows to
1488 % set a different font to the title of the theorem.
1489 % \ExplOpt[\protect\Cmd{space}]{theoremspace}
1490 % Sets the space after \Opt{theoremseparator}.
1491 %
1492 % Examples can be found in the attached files.
1493 %
1494 %
1495 %
1496 %
1497 % \section{complexe example -- Matlab Terminal}
1498 % The following example was inspiered by a question on TeX.SX.
1499 % \definecolor{DarkBlue}{rgb}{.11,.23,.60}
1500 % \mdfdefinestyle{commandline}%
1501 % {leftmargin=5pt, rightmargin=10pt,innerleftmargin=15pt,
1502 % middlelinecolor=DarkBlue,
1503 % middlelinewidth=2pt,
1504 % frametitlerule=false,
1505 % backgroundcolor=black!10!white,
1506 % frametitle={Command Window},
1507 % frametitlefont={\normalfont\sffamily\color{white}\hspace{-1em}},
1508 % frametitlebackgroundcolor=DarkBlue,
1509 % singleextra={\draw[black!20,line width=12pt]
1510 % ($(O)+(7pt,1pt)$) --
1511 % ($(O|-P)+(7pt,-\mdfframetitleboxtotalheight)-(0,1pt)$);
1512 % \node[inner sep=0pt,color=black]at ($(O)+(7pt,9pt)$)%
1513 % {$\scriptstyle f\!x$}; },
1514 % nobreak=true,
1515 % }
1516 %
1517 % \lstnewenvironment{script} {%
1518 % \lstset{language=Matlab,basicstyle=\tiny\ttfamily,breaklines=true,%
1519 % aboveskip=0pt,belowskip=0pt}}{}
1520 % \surroundwithmdframed[style=commandline]{script}
1521 % \begin{script}
1522 % >> help sin
1523 % sin Sine of argument in radians.
1524 % sin(X) is the sine of the elements of X.
1525 %
1526 % See also asin, sind.
1527 %
1528 % Overloaded methods:
1529 % sdpvar/sin
1530 % codistributed/sin
1531 % gpuArray/sin
1532 %
1533 % Reference page in Help browser
1534 % doc sin
1535 %
1536 % >>
1537 % \end{script}
1538 %
1539 % The code for this result is:
1540 % \iffalse
1541 %<*example>
1542 % \fi
1543 \begin{tltxmdfexample}[moretexcs={lstnewenvironment,definecolor,lstset}]
1544 \definecolor{DarkBlue}{rgb}{.11,.23,.60}
1545 \mdfdefinestyle{commandline}%
1546 {leftmargin=5pt, rightmargin=10pt,innerleftmargin=15pt,
1547 middlelinecolor=DarkBlue,
1548 middlelinewidth=2pt,
1549 frametitlerule=false,
1550 backgroundcolor=black!10!white,
1551 frametitle={Command Window},
1552 frametitlefont={\normalfont\sffamily\color{white}\hspace{-1em}},
1553 frametitlebackgroundcolor=DarkBlue,
1554 singleextra={\draw[black!20,line width=12pt]
1555 ($(O)+(7pt,1pt)$) --
1556 ($(O|-P)+(7pt,-\mdfframetitleboxtotalheight)-(0,1pt)$);
1557 \node[inner sep=0pt,color=black]at ($(O)+(7pt,9pt)$)%
1558 {$\scriptstyle f\!x$}; },
1559 nobreak,
1560 }
1561
1562 \lstnewenvironment{script} {%
1563 \lstset{language=Matlab,basicstyle=\tiny\ttfamily,breaklines=true,%
1564 aboveskip=0pt,belowskip=0pt}}{}
1565 \surroundwithmdframed[style=commandline]{script}
1566 \begin{script}
1567 >> help sin
1568 sin Sine of argument in radians.
1569 sin(X) is the sine of the elements of X.
1570
1571 See also asin, sind.
1572
1573 Overloaded methods:
1574 sdpvar/sin
1575 codistributed/sin
1576 gpuArray/sin
1577
1578 Reference page in Help browser
1579 doc sin
1580
1581 >>
1582 \end{script}
1583 \end{tltxmdfexample}
1584 % \iffalse
1585 %</example>
1586 % \fi
1587 %
1588 %
1589 %
1590 %
1591 % \section{Examples}
1592 %
1593 % I outsource the examples in four files documentation. The files
1594 % are
1595 % \begin{description}[style=nextline]
1596 % \item[\texttt{mdframed-example-default}]
1597 % Demonstration of examples created with \Opt{framemethod=default}.
1598 % \item[\texttt{mdframed-example-tikz}]
1599 % Demonstration of examples created with \Opt{framemethod=TikZ}.
1600 % \item[\texttt{mdframed-example-pstricks}]
1601 % Demonstration of examples created with \Opt{framemethod=pstricks}.
1602 % \item[\texttt{mdframed-example-texsx}]
1603 % Demonstration of examples like interaction with \Pack{listings}
1604 % \end{description}
1605 %
1606 % The examples are often not equivalent but normally they can be adapted to
1607 % another method.
1608 % So I really recommend to have a look to all example files.
1609 %
1610 % The Korean \TeX Group created a very nice presentation. I want to show the
1611 % link because it's really a great work:
1612 % \href{http://prezi.com/zc355i9tcsgz/talk-kts-2012-mdframed/}^^A
1613 % {kts 2012 mdframed}.
1614 %
1615 %
1616 % \IfFileExists{mdframed-example-default.pdf}%
1617 % {\includepdf[pages=-]{mdframed-example-default.pdf}}{}
1618 % \IfFileExists{mdframed-example-tikz.pdf}%
1619 % {\includepdf[pages=-]{mdframed-example-tikz.pdf}}{}
1620 % \IfFileExists{mdframed-example-texsx.pdf}%
1621 % {\includepdf[pages=-]{mdframed-example-texsx.pdf}}{}
1622 % \IfFileExists{mdframed-example-pstricks.pdf}%
1623 % {\includepdf[pages=-]{mdframed-example-pstricks.pdf}}{}
1624 %
1625 % \section{Errors, Warnings and Messages}
1626 %
1627 % The package \Pack{mdframed} provides different errors, warnings and
1628 % messages in the \texttt{log}-file. Some \LaTeX-editors like
1629 % \TeX Maker or \TeX Studio have a special tab for errors and warnings
1630 % but not for messages. So you should look in the \texttt{log-File} itself.
1631 %
1632 % The following errors and warnings are generated by \Pack{mdframed}.
1633 %
1634 % \iffalse
1635 %<*example>
1636 % \fi
1637 \begin{tltxmdfexample}
1638 The package ... does not exist but
1639 needed by mdframed
1640 \end{tltxmdfexample}
1641 % \iffalse
1642 %</example>
1643 % \fi
1644 % To avoid this problem you should install the required
1645 % packages which are listed in section \ref{sec:syntax}.
1646 %
1647 % \iffalse
1648 %<*example>
1649 % \fi
1650 \begin{tltxmdfexample}
1651 package option style is depreciated
1652 use framemethod instead style
1653 \end{tltxmdfexample}
1654 % \iffalse
1655 %</example>
1656 % \fi
1657 % With version 0.9d \Pack{mdframed} changed the meaning of the option
1658 % \Opt{style}. The option is used to load a defined style by
1659 % \Cmd{mdfdefinestyle}. Instead use \Opt{framemethod} (see section
1660 % \ref{globopt}).
1661 %
1662 % \iffalse
1663 %<*example>
1664 % \fi
1665 \begin{tltxmdfexample}
1666 Unknown framemethod .... mdframed
1667 \end{tltxmdfexample}
1668 % \iffalse
1669 %</example>
1670 % \fi
1671 % The input string for the option \Opt{framemethod} is unkown. See section
1672 % \ref{globopt}.
1673 %
1674 % \iffalse
1675 %<*example>
1676 % \fi
1677 \begin{tltxmdfexample}
1678 You have not loaded ntheorem yet
1679 \end{tltxmdfexample}
1680 % \iffalse
1681 %</example>
1682 % \fi
1683 % To use the option \Opt{ntheorem} you have to
1684 % load the package \Pack{ntheorem}.
1685 %
1686 % \iffalse
1687 %<*example>
1688 % \fi
1689 \begin{tltxmdfexample}
1690 You have only a width of 3cm
1691 \end{tltxmdfexample}
1692 % \iffalse
1693 %</example>
1694 % \fi
1695 % The package \Pack{mdframed} calculates the width of the contents
1696 % based on the given options. If the width of the contents is smaller than
1697 % 3\,cm you will get this warnings. You should change the
1698 % settings to get a greater width.
1699 %
1700 % \iffalse
1701 %<*example>
1702 % \fi
1703 \begin{tltxmdfexample}
1704 You got a bad break
1705 you have to change it manually
1706 by changing the text, the space
1707 or something else
1708 \end{tltxmdfexample}
1709 % \iffalse
1710 %</example>
1711 % \fi
1712 % Sometimes you have enough vertical space for the rules and the space
1713 % between the rules and the contents but not for the contents itself.
1714 % In this situation you will get this warning because the contents
1715 % of this box is empty. You have the possibility to change the
1716 % settings or include a \Cmd{clearpage} in front of
1717 % the environment \Pack{mdframed}.
1718 % So far I have no idea how to avoid such things.
1719 %
1720 % \iffalse
1721 %<*example>
1722 % \fi
1723 \begin{tltxmdfexample}
1724 You got a bad break
1725 because the split box is empty
1726 You have to change the page settings
1727 like enlargethispage or something else
1728 You got a bad break
1729 \end{tltxmdfexample}
1730 % \iffalse
1731 %</example>
1732 % \fi
1733 % See the explanation above.
1734 %
1735 % \iffalse
1736 %<*example>
1737 % \fi
1738 \begin{tltxmdfexample}
1739 You got a bad break
1740 because the last split box is empty
1741 You have to change the settings
1742 \end{tltxmdfexample}
1743 % \iffalse
1744 %</example>
1745 % \fi
1746 % The same reason as above but only in the last box.
1747 %
1748 %
1749 % \iffalse
1750 %<*example>
1751 % \fi
1752 \begin{tltxmdfexample}
1753 Option ... is already consumed
1754 and has no effect on input line ...
1755 \end{tltxmdfexample}
1756 % \iffalse
1757 %</example>
1758 % \fi
1759 % If you set a global option inside the document
1760 % body you will get this warning.
1761 %
1762 % \section{Known Limitations}
1763 % In this section I will collect known issues. In case you encounter
1764 % any further problems, please drop me an email,
1765 % \href{mailto:[email protected]}{marco.daniel at mada-nada.de}.
1766 %
1767 % Do you have any ideas / wishes on further extensions to this package?
1768 % Please let me know!
1769 %
1770 % \begin{enumerate}
1771 % \item So far the environment isn't compatible with the package
1772 % \Pack{gmverb}.
1773 % \item If you load the package \Pack{picins} the frame will no be splitted.
1774 % That based on a problem of the package `picins` which defines
1775 % \Cmd{@captype} global.
1776 % To work with the package picins you can use the following hack.
1777 % \iffalse
1778 %<*example>
1779 % \fi
1780 \begin{tltxmdfexample}
1781 \usepackage{picins}
1782 \makeatletter
1783 \let\@captype\@undefined
1784 \def\newcaption{%
1785 \begingroup%
1786 \def\@captype{figure}%
1787 \refstepcounter\@captype\@dblarg{\@newcaption\@captype}%
1788 \endgroup%
1789 }
1790 \makeatother
1791 \end{tltxmdfexample}
1792 % \iffalse
1793 %</example>
1794 % \fi
1795 % \item \Pack{mdframed} can't handle the option \Opt{allowframebreaks} of the
1796 % class \Pack{beamer}.
1797 % \item A nested \Env{mdframed} environment can't be splitted.
1798 % \end{enumerate}
1799 %
1800 %
1801 % \section{ToDo}
1802 % \textbf{\color{red} It is important to update the documentation}
1803 % \begin{enumerate}
1804 % \item see \enquote{Known Problems}.
1805 % \item So far it isn't possible to combine the environment
1806 % \Cmd{begin\{multicols\}} of the package \Pack{multicol}
1807 % with \Pack{mdframed} with the whole option list.
1808 % \item Create new styles.
1809 % \item Improve page breaks.
1810 % \item Improve footnotes.
1811 % \item Improve documentation and examples.
1812 % \item Create styles for \Opt{frametitle}.
1813 % \item Create an inline version of \Env{mdframed} that's works like
1814 % \Cmd{fbox}
1815 % \item Add \Cmd{ht}\Cmd{strutbox} to file \Pack{md-frame-1.mdf}
1816 % \end{enumerate}
1817 %
1818 % \section{Acknowledgements}
1819 % \textsf{Dick Nickalls;\quad Dietrich Grau;\quad Piazza Luca;\quad%
1820 % Jobst Hoffmann;\quad Martin Scharrer;\quad Enrico Gregorio;\quad
1821 % Heiko Oberdiek;\quad Philipp Stephani}.
1822 % \medskip
1823 %
1824 % \noindent Thanks for proofreading
1825 %
1826 % \textsf{Alan Munn} and \textsf{Nahid Shajari}
1827 %
1828 % I hope I forgot nobody.
1829 % \clearpage
1830 % \appendix
1831 %
1832 % \section{More information}
1833 % %\addtocontents{toc}{\protect\setcounter{tocdepth}{-4}}
1834 % In the following section I want to present how to create
1835 % your own frame.
1836 % \subsection{How does \Pack{mdframed} work?}
1837 % With the environment \Cmd{begin\{mdframed\}} \ldots \Cmd{end\{mdframed\}}
1838 % the whole contents will be saved in a \Cmd{savebox} called
1839 % \Cmd{mdf@splitbox@one}. After the calculation of the width and the height of
1840 % the \Cmd{mdf@splitbox@one} (done by \Pack{mdframed.sty}) the box will be set
1841 % sequently (done by \Pack{md-frame-X.mdf}). The following figure demonstrates
1842 % this.
1843 %
1844 % \begin{center}
1845 % \begin{tikzpicture}
1846 % \newcommand{\mybox}[1]{\parbox{3.5cm}{\centering\small #1}}
1847 % \tikzstyle{every node}=[font=\sffamily]
1848 % \tikzset{mymatrixnodes/.style={%
1849 % matrix of nodes,
1850 % nodes={framed,draw=black,fill=yellow!10,},
1851 % column sep=4.5cm,
1852 % row sep=1.5cm,
1853 % }}
1854 % \matrix(m)[mymatrixnodes]
1855 % {%
1856 % \mybox{read in and save contents in \Cmd{mdf@splitbox@one}} &
1857 % \mybox{\Cmd{mdf@putbox@single}} \\
1858 % \mybox{split \textbackslash mdf@splitbox@one in \Cmd{mdf@splitbox@two} to
1859 % the free space of the page} &
1860 % \mybox{\Cmd{mdf@putbox@first}} \\
1861 % \mybox{contents of \Cmd{mdf@splitbox@one} have enough space on the new
1862 % page} &
1863 % \mybox{\Cmd{mdf@putbox@second}} \\
1864 % \mybox{split \Cmd{mdf@splitbox@one} in \Cmd{mdf@splitbox@two} to the free
1865 % space of the page} &
1866 % \mybox{\Cmd{mdf@putbox@middle}} \\
1867 % };
1868 %
1869 % \tikzstyle{every path}=[black,-triangle 45,thick,shorten >=4pt,shorten <=4pt]
1870 % \draw (m-1-1) edge
1871 % node[align=center,anchor=south]{enough space on page} (m-1-2);
1872 % \draw (m-2-1) edge
1873 % node[align=center,anchor=south]{type out \Cmd{mdf@splitbox@two}}
1874 % (m-2-2);
1875 % \draw (m-3-1) edge
1876 % node[align=center,anchor=south]{yes} (m-3-2);
1877 % \draw (m-4-1) edge
1878 % node[align=center,anchor=south]{type out \Cmd{mdf@splitbox@two}}
1879 % (m-4-2);
1880 %
1881 % \draw (m-2-2) edge node[align=center,fill=white]%
1882 % {calculate the height of the new \Cmd{mdf@splitbox@one}} (m-3-1);
1883 %
1884 %
1885 % \draw (m-1-1) edge
1886 % node[align=center,anchor=west]{not enough space on page} (m-2-1);
1887 % \draw (m-3-1) edge node[align=center,anchor=west]{no} (m-4-1);
1888 %
1889 % \draw let \p1=($(m-4-2.south)-(0,1)$), \p2=($(m-3-1.west)-(0.8,0)$) in
1890 % (m-4-2.south) -- ($(m-4-2.south)+(0,-1)$) --
1891 % node[align=center,anchor=north]%
1892 % {calculate the height of the new \Cmd{mdf@splitbox@one}} (\x2,\y1)
1893 % -- ($(m-3-1.west)-(0.8,0)$)-- ($(m-3-1.west)$) ;
1894 %
1895 %
1896 % \end{tikzpicture}
1897 %
1898 % \captionof{figure}{Setting the contents of \Pack{mdframed}}\label{fig:way}
1899 % \end{center}
1900 %
1901 % The width of the contents is the result of the settings of
1902 % \Opt{leftmargin}, \Opt{rightmargin}, \Opt{linewidth},
1903 % \Opt{innerleftmargin} and \Opt{innerrightmargin}
1904 % (see figure \eqref{fig:laengen}).
1905 %
1906 % \subsection{The Framecommands}
1907 % The package \Pack{mdframed} knows four kinds of \enquote{Framecommand}.
1908 % These commands tell \LaTeX\ how to set the contents of \Pack{mdframed}.
1909 % \begin{description}
1910 % \item[\Cmd{mdf@putbox@single}]
1911 % This command sets the contents of a single unsplit frame.
1912 % \item[\Cmd{mdf@putbox@first}]
1913 % This command sets the contents of the first frame of a split frame.
1914 % \item[\Cmd{mdf@putbox@middle}]
1915 % This command sets the contents of the middle frame of a split frame.
1916 % \item[\Cmd{mdf@putbox@second}]
1917 % This command sets the contents of the last frame of a split frame.
1918 % \end{description}
1919 %
1920 % Using the explained commands we give an example. The command \Cmd{box}
1921 % uses the contents of the savebox and types them out.
1922 %
1923 % First we want to type out the single box without any settings
1924 % (but with the calculated width).
1925 % \iffalse
1926 %<*example>
1927 % \fi
1928 \begin{tltxmdfexample}
1929 \makeatletter
1930 \def\mdf@putbox@single{\box\mdf@splitbox@one}
1931 \makeatother
1932 \end{tltxmdfexample}
1933 % \iffalse
1934 %</example>
1935 % \fi
1936 % I am using the command \Cmd{leftline} to start the \enquote{Framecommands} at
1937 % the left.
1938 % \iffalse
1939 %<*example>
1940 % \fi
1941 \begin{tltxmdfexample}[deletekeywords={leftline},moretexcs={leftline}]
1942 \makeatletter
1943 \def\mdf@putbox@single{\leftline{\box\mdf@splitbox@one}}
1944 \makeatother
1945 \end{tltxmdfexample}
1946 % \iffalse
1947 %</example>
1948 % \fi
1949 %
1950 % Now you have to know how the lengths are named. Every length which can be
1951 % modified by the options has the following syntax:
1952 % \iffalse
1953 %<*example>
1954 % \fi
1955 \begin{tltxmdfexample}
1956 \mdf@<Name of the Length>@length
1957 \end{tltxmdfexample}
1958 % \iffalse
1959 %</example>
1960 % \fi
1961 % For example the leftmargin is:
1962 % \iffalse
1963 %<*example>
1964 % \fi
1965 \begin{tltxmdfexample}
1966 \mdf@leftmargin@length
1967 \end{tltxmdfexample}
1968 % \iffalse
1969 %</example>
1970 % \fi
1971 %
1972 % To create only a line at the left with the correct \Opt{leftmargin} you
1973 % can set \Cmd{mdf@putboxsingle} as follows
1974 %
1975 % \iffalse
1976 %<*example>
1977 % \fi
1978 \begin{tltxmdfexample}[deletekeywords={leftline},moretexcs={leftline}]
1979 \makeatletter
1980 \def\mdf@putbox@single{%
1981 \leftline{%
1982 \hspace*{\mdf@leftmargin@length}%
1983 \rule[-\dp\mdf@splitbox@one]{\mdf@linewidth}%
1984 {\ht\mdf@splitbox@one+\dp\mdf@splitbox@one}%
1985 \box\mdf@splitbox@one
1986 }%
1987 }
1988 \makeatother
1989 \end{tltxmdfexample}
1990 % \iffalse
1991 %</example>
1992 % \fi
1993 %
1994 % In this way you can do what you want. If you create your own style you
1995 % can save the file as \Pack{md-frame-X.mdf}.
1996 % \Pack{X} must be an integer.
1997 % In this way you can use the option \Opt{framemethod} to
1998 % load the file by setting \Opt{framemethod=X}.
1999 %
2000 %\iffalse
2001 % \clearpage
2002 %
2003 % \subsection{Revision history}\label{rev}
2004 % \raggedright
2005 %
2006 %
2007 % \minisec{Version 1.8X submitted XX Mar 2013}
2008 % \begin{itemize*}
2009 % \item added \Cmd{topskip=0pt} to remove unwanted space after \Cmd{newpage} or \Cmd{clearpage}
2010 % \end{itemize*}
2011 %
2012 % \footnotesize
2013 % \minisec{Version 1.8 submitted 09 Mar 2013}
2014 % \begin{itemize*}
2015 % \item fixed bugs (e.g. related to \Cmd{parskip} of KOMA)
2016 % \item allow margin notes with \Opt{framemethod=tikz}
2017 % \item fixed some typos
2018 % \end{itemize*}
2019 %
2020 % \minisec{Version 1.6d submitted 21 Sep 2012}
2021 % \begin{itemize*}
2022 % \item fixed bugs
2023 % \item added option \Opt{draft}
2024 % \end{itemize*}
2025 %
2026 % \minisec{Version 1.6b submitted 02 Jun 2012}
2027 % \begin{itemize*}
2028 % \item added commands \Cmd{mdfsubtitle} and \Cmd{mdfsubsubtitle}
2029 % \item added options \Opt{subtitleaboveline}, \Opt{subtitlebelowline},
2030 % \Opt{subsubtitleaboveline}, \Opt{subsubtitlebelowline},
2031 % \Opt{subtitlefont}, \Opt{subsubtitlefont},
2032 % \Opt{subtitlebackgroundcolor},
2033 % \Opt{subsubtitlebackgroundcolor}, \Opt{subtitleabovelinecolor},
2034 % \Opt{subtitlebelowlinecolor}, \Opt{subsubtitleabovelinecolor},
2035 % \Opt{subsubtitlebelowlinecolor}, \Opt{subtitleabovelinewidth},
2036 % \Opt{subtitlebelowlinewidth}, \Opt{subtitleaboveskip},
2037 % \Opt{subtitlebelowskip}, \Opt{subtitleinneraboveskip},
2038 % \Opt{subtitleinnerbelowskip}, \Opt{subsubtitleabovelinewidth},
2039 % \Opt{subsubtitlebelowlinewidth}, \Opt{subsubtitleaboveskip},
2040 % \Opt{subsubtitlebelowskip}, \Opt{subsubtitleinneraboveskip},
2041 % \Opt{subsubtitleinnerbelowskip}
2042 % \item improved formating of the file \Pack{mdframed.dtx}
2043 % \item fixed bug in combination with \Cmd{parskip} -- Thanks David Carlisle.
2044 % \item added extra loop to compute the splitting point.
2045 % \item improved splitting algorithm
2046 % \item added new option \Opt{ignorelastdescenders} -- Thanks Stephan Lehmke.
2047 % \item Improved option \Opt{repeatframetitle}
2048 % \item fixed bug: \Opt{framemethod=tikz} used wrong computed length by
2049 % setting \Opt{everyline=true}
2050 % \item Tobias Weh inspired the excurs-environment not Tobias Schwan. Sorry,
2051 % I fixed it.
2052 % \item Improved \Cmd{mdtheorem} to handle \Cmd{listtheorems} provided by
2053 % \Pack{ntheorem}.
2054 % \end{itemize*}
2055 %
2056 % \minisec{Version 1.5 submitted 10 Mar 2012}
2057 % \begin{itemize*}
2058 % \item fixed bug (Thanks Nicolas Roy)
2059 % \item expanded documentation (Thanks Martin Wilhelm Leidig)
2060 % \item added options \Opt{singleextra}, \Opt{firstextra},
2061 % \Opt{middleextra} and \Opt{secondextra}
2062 % \item expanded examples
2063 % \end{itemize*}
2064 %
2065 % \minisec{Version 1.4d submitted 30 Mar 2012}
2066 % \begin{itemize*}
2067 % \item fixed bug (Thanks Nicolas Roy)
2068 % \item added approach to documentation to work with \Pack{picins}
2069 % \item new implementation of option \Opt{hidealllines}, now you can set
2070 % \Cmd{mdfsetup}\Opt{\{hidealllines=true,leftline=true\}} printing
2071 % only the left line (inspired by Tobias Weh)
2072 % \item added option \Opt{everyline} to draw a top and bottom line at
2073 % splitted frames
2074 % \end{itemize*}
2075 %
2076 % \minisec{Version 1.4 submitted 4 Mar 2012}
2077 % \begin{itemize*}
2078 % \item fixed bug in combination with \Cmd{marginpar} (Thanks Juan Carlos
2079 % Trujillo Ortega)
2080 % \item fixed bug with option \Opt{font}
2081 % \item fixed bug inside \texttt{frametitle} (Thanks Yi, Hoze)
2082 % \item removed unnessary groups (Thanks Yi, Hoze)
2083 % \item changed the definition of \Pack{listings} to allow copy paste of the
2084 % examples
2085 % \end{itemize*}
2086 %
2087 % \minisec{Version 1.3a submitted 5 Feb 2012}
2088 % \begin{itemize*}
2089 % \item fixed bug (Thanks to Dietrich Grau)
2090 % \end{itemize*}
2091 %
2092 % \minisec{Version 1.3 submitted 4 Feb 2012}
2093 % \begin{itemize*}
2094 % \item fixed documentation (Thanks to Dietrich Grau)
2095 % \item added option \Opt{shadow}
2096 % \item improved handling \Cmd{parindent} and \Cmd{parskip} (Thanks to Enrico
2097 % Gregorio and Joseph Wright)
2098 % \end{itemize*}
2099 %
2100 % \minisec{Version 1.2 submitted 8 Jan 2012}
2101 % \begin{itemize*}
2102 % \item fixed documentation (Thanks to Dietrich Grau)
2103 % \item fixed bug in combination with \Pack{amsthm}
2104 % \item fixed bug in \Cmd{newmdtheoremenv}
2105 % \item defined new styles via \Cmd{newpsstyle}\limitation[PSTricks]
2106 % \item added new commands for interaction with \Pack{TikZ} and \Pack{PSTricks}
2107 % \item expand frame title option by option \Opt{frametitlerule},
2108 % \Opt{frametitlerulewidth}, \Opt{frametitlefont},
2109 % \Opt{frametitleaboveskip}, \Opt{frametitlebelowskip},
2110 % \Opt{frametitlealignment}
2111 % \item removed limitation of three lines for PSTricks
2112 % \item defined new commands \Cmd{surroundwithmdframed}, \Cmd{mdflength},
2113 % \Cmd{mdtheorem}
2114 % \item load \Pack{xparse} by default
2115 % \item changed internal names
2116 % \item expanded examples
2117 % \end{itemize*}
2118 %
2119 % \minisec{Version 1.0b submitted 9 Dec 2011}
2120 % \begin{itemize*}
2121 % \item fixes documentation (Thanks to Dietrich Grau)
2122 % \item fixes bug in \Cmd{newmdtheoremenv}
2123 % \item fixes bug with overfull boxes (Thanks to Dietrich Grau)
2124 % \item defined \Cmd{newpsstyle}\Opt{mdfbackgroundstyle} and \Opt{mdflinestyle}
2125 % \limitation[PSTricks]
2126 % \item created dtx-file (Thanks to Kevin Godby)
2127 % \item added \Cmd{@parboxrestore} to \Cmd{mdf@lrbox}
2128 % \end{itemize*}
2129 %
2130 % \minisec{Version 1.0 submitted 13 Nov 2011}
2131 % \begin{itemize*}
2132 % \item add option \Opt{userdefinedwidth}
2133 % \item add option \Opt{align}
2134 % \item add option \Opt{apptotikzsetting}
2135 % \item create new command \Cmd{mdfapptodefinestyle}
2136 % \item changed internal algorithm
2137 % \item removed calc instead using \eTeX\ \verb+\dimexpr+
2138 % \item expand documentation
2139 % \item trying to fixe problems with \Pack{xcolor}
2140 % \item fixed bug with \Opt{framemethod=pstricks}
2141 % \item create file \Pack{mdframed-example-default}
2142 % \item create file \Pack{mdframed-example-tikz}
2143 % \item create file \Pack{mdframed-example-pstricks}
2144 % \item create file \Pack{mdframed-example-texsx}
2145 % (texsx stands for tex stackexchange)
2146 % \end{itemize*}
2147 %
2148 %
2149 % \minisec{Version 0.9g submitted 08 Oct 2011}
2150 % \begin{itemize*}
2151 % \item fixed documentation
2152 % \item added small footnote compatibility
2153 % \end{itemize*}
2154 %
2155 % \minisec{Version 0.9f submitted 04 Oct 2011}
2156 % \begin{itemize*}
2157 % \item fixes bugs (thanks to Lars Madsen)
2158 % \item added option \Opt{hidealllines}
2159 % \item fixed documentation
2160 % \end{itemize*}
2161 %
2162 %
2163 % \minisec{Version 0.9e submitted 11 Sep 2011}
2164 % \begin{itemize*}
2165 % \item working with \texttt{twoside} modus
2166 % \end{itemize*}
2167 %
2168 % \minisec{Version 0.9d submitted 10 Sep 2011}
2169 % \begin{itemize*}
2170 % \item \textcolor{red}{changed the meaning of the option
2171 % \Opt{style}}!!! (inspired by Lars Madsen)
2172 % \item added option \Opt{framemethod} (inspired by Lars Madsen)
2173 % \item added options \Opt{needspace} (inspired by Lars Madsen)
2174 % \item added new command \Cmd{mdfdefinestyle} (inspired by Lars Madsen)
2175 % \item fixes documentation
2176 % \item renamed \Pack{md-frame-3.mdf} to \Pack{md-frame-2.mdf}
2177 % \end{itemize*}
2178 %
2179 %
2180 %
2181 % \minisec{Version 0.9b submitted 7 Sep 2011}
2182 % \begin{itemize*}
2183 % \item fixes bugs in \Cmd{newmdtheoremenv} (Thanks to Enrico Gregorio)
2184 % \end{itemize*}
2185 %
2186 % \minisec{Version 0.9a submitted 5 Sep 2011}
2187 % \begin{itemize*}
2188 % \item fixes bugs (Thanks to Lars Madson)
2189 % \item expanded documentation (added revision history)
2190 % \end{itemize*}
2191 %
2192 %
2193 % \minisec{Version 0.9 submitted 4 Sep 2011}
2194 % \begin{itemize*}
2195 % \item added option \Opt{nobreak}
2196 % \item detecting float environments to prevent split calculation
2197 % \item expand documentation (Thanks to Alan Munn)
2198 % \end{itemize*}
2199 %
2200 % \minisec{Version 0.8a}
2201 % \begin{itemize*}
2202 % \item fixes bugs
2203 % \item fixes documentation
2204 % \end{itemize*}
2205 %
2206 % \minisec{Version 0.8 submitted 22 Aug 2011}
2207 % \begin{itemize*}
2208 % \item added commands: \Cmd{newmdenv}, \Cmd{renewmdenv},
2209 % \Cmd{newmdtheoremenv}
2210 % \item fixes bugs
2211 % \item fixes documentation
2212 % \end{itemize*}
2213 %
2214 % \minisec{Version 0.7a submitted 6 August 2011}
2215 % \begin{itemize*}
2216 % \item added option \Opt{frametitle}
2217 % \item added option \Opt{frametitlefont}
2218 % \item allow twolumn-mode
2219 % \item changed the calculation
2220 % \item added option \Opt{tikzsetting}
2221 % \item added options for hidden lines for all styles
2222 % \item fixes bugs
2223 % \end{itemize*}
2224 %
2225 % \minisec{Version 0.6a submitted 22 Dec 2010}
2226 % \begin{itemize*}
2227 % \item fixes bugs
2228 % \item added \Cmd{mdfsetup}
2229 % \item expanded documentation
2230 % \end{itemize*}
2231 %
2232 % \clearpage
2233 %
2234 %
2235 %
2236 %
2237 %
2238 % \section{Implementation}\label{implementation}
2239 %
2240 % And finally, here's how it all works\ldots
2241 %
2242 %\fi
2243 %\StopEventually{^^A
2244 % ^^A\clearpage
2245 % ^^A\PrintChanges^^A
2246 % ^^A\clearpage
2247 % ^^A\PrintIndex^^A
2248 %}
2249 %
2250 %\iffalse
2251 % \begin{macrocode}
2252 %<*package>
2253 % \end{macrocode}
2254 %\fi
2255 %
2256 % \subsection{The Explanation of mdframed.sty}
2257 %
2258 % \begin{macro}{mdversion,mdframedpackagename,mdfmaindate}
2259 % Set package information
2260 % \begin{macrocode}
2261 \def\mdversion{1.9b}
2262 \def\mdframedpackagename{mdframed}
2263 \def\mdfmaindate{2013/07/01}
2264 \def\mdfrevision{ 212}% Done by github: git rev-list HEAD | wc -l
2265 % \end{macrocode}
2266 % \end{macro}
2267 %
2268 % \begin{macrocode}
2269 \NeedsTeXFormat{LaTeX2e}
2270 \ProvidesPackage{mdframed}%
2271 [\mdfmaindate\space \mdversion: \mdframedpackagename]
2272 % \end{macrocode}
2273 %
2274 % \begin{macro}{mdf@PackageWarning,mdf@PackageInfo,mdf@LoadFile@IfExist}
2275 % Set short form of |\PackageError|, |\PackageWarning|, |\PackageInfo| and
2276 % |IfFileExists| in combination with |\RequirePackage|.
2277 % \begin{macrocode}
2278 \newcommand*\mdf@PackageError[1]{\PackageError{\mdframedpackagename}{#1}}
2279 \newcommand*\mdf@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}}
2280 \newcommand*\mdf@PackageInfo[1]{\PackageInfo{\mdframedpackagename}{#1}}
2281 \newcommand*\mdf@LoadFile@IfExist[1]{%
2282 \IfFileExists{#1.sty}{%
2283 \RequirePackage{#1}%
2284 }{%
2285 \mdf@PackageWarning{The file #1 does not exist\MessageBreak
2286 but needed by \mdframedpackagename\MessageBreak
2287 see documentation fo further information
2288 }%
2289 }%
2290 }
2291 % \end{macrocode}
2292 % \end{macro}
2293 %
2294 % Loading required packages
2295 % \begin{macrocode}
2296 \RequirePackage{kvoptions}
2297 \RequirePackage{xparse}
2298 \RequirePackage{etoolbox}[2011/01/03]
2299 \RequirePackage{zref-abspage}
2300 \RequirePackage{needspace}
2301 \RequirePackage{color}
2302 % \end{macrocode}
2303 %
2304 % Set the family and the prefix of all options.
2305 % \begin{macrocode}
2306 \SetupKeyvalOptions{family=mdf,prefix=mdf@}
2307 % \end{macrocode}
2308 %
2309 % \begin{macro}{mdf@definestyle@defaultoptions}
2310 % Save all keys in a macro which can be used by \Opt{style} or
2311 % as an option
2312 % \begin{macrocode}
2313 \def\mdf@definestyle@defaultoptions{}%
2314 % \end{macrocode}
2315 % \end{macro}
2316 %
2317 %
2318 % \begin{macro}{mdf@iflength,mdf@iflength@check,mdf@iflength@check}
2319 % Command which checks the input of length options. If the length option is
2320 % only a number the |defaultunit| will be used. Syntax:
2321 % |\mdf@iflength{<Input>}{<length>}{<no length>}|
2322 % \begin{macrocode}
2323 \newlength{\mdf@templength}
2324 \def\mdf@iflength#1{%
2325 \afterassignment\mdf@iflength@check%
2326 \mdf@templength=#1\mdf@defaultunit\relax\relax
2327 \expandafter\endgroup\next
2328 }
2329 \def\mdf@iflength@check#1{%
2330 \begingroup
2331 \ifx\relax#1\@empty
2332 \def\next{\@secondoftwo}
2333 \else
2334 \def\next{\@firstoftwo}
2335 \expandafter\mdf@iflength@cleanup
2336 \fi
2337 }
2338 \def\mdf@iflength@cleanup#1\relax{}
2339 % \end{macrocode}
2340 % \end{macro}
2341 %
2342 %
2343 % \begin{macro}{mdf@dolist}
2344 % Loop used by \Pack{mdframed}. I can handle comma separated list. The command
2345 % \Cmd{DeclareListParser} is provided by `etoolbox`.
2346 % \begin{macrocode}
2347 \DeclareListParser*{\mdf@dolist}{,}
2348 % \end{macrocode}
2349 % \end{macro}
2350 %
2351 % \begin{macro}{mdf@do@lengthoption}
2352 % We need lots of length options. So the declaration is simplified.
2353 % \begin{macrocode}
2354 % \mdf@dolist{\mdf@do@lengthoption}{{option name ==default value},...}%
2355 % resulst to the length \mdf@<option name>@length
2356 \def\mdf@do@lengthoption#1{%
2357 \mdf@lengthoption@doubledo#1\@nil%
2358 }
2359 \def\mdf@lengthoption@doubledo#1==#2\@nil{%
2360 \mdf@option@length{#1}{#2}%
2361 \mdf@define@key@length{#1}%
2362 \gappto\mdf@definestyle@defaultoptions{#1=#2,}%
2363 }
2364
2365 \newrobustcmd*{\mdf@option@length}[2]{%
2366 \expandafter\newlength\csname mdf@#1@length\endcsname%
2367 \expandafter\setlength\csname mdf@#1@length\endcsname{#2}%
2368 }
2369
2370 \newrobustcmd*{\mdf@define@key@length}[1]{%
2371 \define@key{mdf}{#1}{%
2372 \def\@tempa{##1}
2373 \mdf@iflength{\@tempa}%
2374 {\csxdef{mdfl@#1}{\the\mdf@templength}}%
2375 {\csxdef{mdfl@#1}{\the\mdf@templength}}%
2376 \setlength{\csname mdf@#1@length\endcsname}{\csname mdfl@#1\endcsname}%
2377 }%
2378 }
2379
2380
2381 % \end{macrocode}
2382 % \end{macro}
2383 %
2384 %
2385 % \begin{macro}{mdf@do@stringoption}
2386 % We need lots of string options which are saved in a macro.%
2387 % So the declaration is simplified.
2388 % \begin{macrocode}
2389 % \mdf@dolist{\mdf@do@stringoption}{{option name ==default value},...}%
2390 % resulst to the macro \mdf@<option name>
2391 \def\mdf@do@stringoption#1{%
2392 \mdf@stringoption@doubledo#1\@nil%
2393 }
2394 \def\mdf@stringoption@doubledo#1==#2\@nil{%
2395 \expandafter\gdef\csname mdf@#1\endcsname{#2}%
2396 \define@key{mdf}{#1}{%
2397 \csdef{mdf@#1}{##1}%
2398 }%
2399 \gappto\mdf@definestyle@defaultoptions{#1=#2,}%
2400 }
2401 % \end{macrocode}
2402 % \end{macro}
2403 %
2404 %
2405 % \begin{macro}{mdf@do@booloption}
2406 % We need lots of bool options. So the declaration is simplified.
2407 % \begin{macrocode}
2408 % \mdf@dolist{\mdf@do@booloption}{{option name ==default value},...}%
2409 % resulst to the bool flag \mdf@<option name>
2410 \def\mdf@do@booloption#1{%
2411 \mdf@booloption@doubledo#1\@nil%
2412 }
2413 \def\mdf@booloption@doubledo#1==#2\@nil{%
2414 \newbool{mdf@#1}\setbool{mdf@#1}{#2}%
2415 \define@key{mdf}{#1}[#2]{%
2416 \setbool{mdf@#1}{##1}%
2417 }%
2418 \gappto\mdf@definestyle@defaultoptions{#1=#2,}%
2419 }
2420 % \end{macrocode}
2421 % \end{macro}
2422 %
2423 %
2424 % Start declaration of options
2425 % \begin{macrocode}
2426 \newcounter{mdf@globalstyle@cnt}
2427 \defcounter{mdf@globalstyle@cnt}{-99}
2428
2429 % Only provide to be backward compatible
2430 \define@key{mdf}{style}{%
2431 \mdf@PackageWarning{package option style is depreciated^^J
2432 at this point and will be ignored^^J
2433 use framemethod instead\MessageBreak}%
2434 }
2435
2436 \providecommand*\mdf@framemethod{}
2437 \def\mdf@framemethod@i{}%
2438 \def\mdf@framemethod@ii{}%
2439 \def\mdf@framemethod@iii{}%
2440 % \end{macrocode}
2441 % \end{macro}
2442 %
2443 % \begin{macrocode}
2444 \define@key{mdf}{framemethod}[default]{%
2445 \lowercase{\def\mdf@tempa{#1}}%lowercase not expandable
2446 \forcsvlist{\listadd\mdf@framemethod@i}{default,tex,latex,none,0}
2447 \forcsvlist{\listadd\mdf@framemethod@ii}{pgf,tikz,1}
2448 \forcsvlist{\listadd\mdf@framemethod@iii}{pstricks,ps,2,postscript}
2449 \xifinlist{\mdf@tempa}{\mdf@framemethod@i}%
2450 {\def\mdf@@framemethod{default}\defcounter{mdf@globalstyle@cnt}{0}}%
2451 {\xifinlist{\mdf@tempa}{\mdf@framemethod@ii}%
2452 {\def\mdf@@framemethod{tikz}%
2453 \defcounter{mdf@globalstyle@cnt}{1}\mdf@LoadFile@IfExist{tikz}}%
2454 {\xifinlist{\mdf@tempa}{\mdf@framemethod@iii}%
2455 {\def\mdf@@framemethod{pstricks}%
2456 \defcounter{mdf@globalstyle@cnt}{2}\mdf@LoadFile@IfExist{pst-node}}%
2457 {\mdf@LoadFile@IfExist{#1}}%
2458 }%
2459 }%
2460 \ifcase\value{mdf@globalstyle@cnt}\relax%
2461 \input{md-frame-0.mdf}%
2462 \or\input{md-frame-1.mdf}%
2463 \or\input{md-frame-2.mdf}%
2464 \or\input{md-frame-3.mdf}%
2465 \else%
2466 \IfFileExists{md-frame-\value{mdf@globalstyle@cnt}.mdf}%
2467 {\input{md-frame-\value{mdf@globalstyle@cnt}.mdf}}%
2468 {%
2469 \input{md-frame-0.mdf}%
2470 \mdf@PackageWarning{The style number \value{mdf@globalstyle@cnt}
2471 does not exist^^J
2472 mdframed ues instead style=0 \mdframedpackagename}%
2473 }%
2474 \fi%
2475 }
2476 \DeclareVoidOption{tikz}{\setkeys{mdf}{framemethod=tikz}}
2477 \DeclareVoidOption{TikZ}{\setkeys{mdf}{framemethod=tikz}}
2478 \DeclareVoidOption{ps}{\setkeys{mdf}{framemethod=pstricks}}
2479 \DeclareVoidOption{pstricks}{\setkeys{mdf}{framemethod=pstricks}}
2480 \DeclareVoidOption{PSTricks}{\setkeys{mdf}{framemethod=pstricks}}
2481
2482 % \end{macrocode}
2483 %
2484 % \begin{macro}{mdf@do@lengthoption}
2485 % Here the declaration of all length options.
2486 % \begin{macrocode}
2487 \mdf@dolist{\mdf@do@lengthoption}{%
2488 {skipabove==\topsep},%
2489 {skipbelow==\topsep},%
2490 {leftmargin==\z@},%
2491 {rightmargin==\z@},%
2492 {innerleftmargin==10pt},%
2493 {innerrightmargin==10pt},%
2494 {innertopmargin==0.4\baselineskip},%
2495 {innerbottommargin==0.4\baselineskip},%
2496 {splittopskip==10pt},%
2497 {splitbottomskip==10pt},%
2498 {outermargin==\z@},%
2499 {innermargin==\z@},%
2500 {linewidth==0.4pt},%
2501 {innerlinewidth==\z@},%
2502 {middlelinewidth==\expandafter\mdf@linewidth@length},%
2503 {outerlinewidth==\z@},%
2504 {roundcorner==\z@},%
2505 {footenotedistance==\medskipamount},
2506 {userdefinedwidth==\linewidth},
2507 {needspace==\z@},
2508 {frametitleaboveskip==5pt},
2509 {frametitlebelowskip==5pt},
2510 {frametitlerulewidth==.2pt},
2511 {frametitleleftmargin==10pt},%
2512 {frametitlerightmargin==10pt},%
2513 {shadowsize==8pt},%
2514 {extratopheight==\z@},%
2515 {subtitleabovelinewidth==.8pt},%
2516 {subtitlebelowlinewidth==.6pt},%
2517 {subtitleaboveskip==\baselineskip},%
2518 {subtitlebelowskip==1.2\baselineskip},%
2519 {subtitleinneraboveskip==.5\baselineskip},%
2520 {subtitleinnerbelowskip==.5\baselineskip},%
2521 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2522 % NOT IMPLEMENTED
2523 {subsubtitleabovelinewidth==.8pt},%
2524 {subsubtitlebelowlinewidth==.6pt},%
2525 {subsubtitleaboveskip==\baselineskip},%
2526 {subsubtitlebelowskip==1.2\baselineskip},%
2527 {subsubtitleinneraboveskip==.5\baselineskip},%
2528 {subsubtitleinnerbelowskip==.5\baselineskip},%
2529 }
2530 % \end{macrocode}
2531 % \end{macro}
2532 %
2533 % \begin{macro}{mdf@do@lengthoption}
2534 % Here the declaration of the string options.
2535 % \begin{macrocode}
2536 \mdf@dolist{\mdf@do@stringoption}{%
2537 {frametitle=={}},%
2538 {firstframetitle=={}},%
2539 {framefoot=={}},%
2540 {lastframefoot=={}},%
2541 {defaultunit==pt},%
2542 {linecolor==black},%
2543 {backgroundcolor==white},%
2544 {fontcolor==black},%
2545 {frametitlefontcolor==black},%
2546 {innerlinecolor==\mdf@linecolor},%
2547 {outerlinecolor==\mdf@linecolor},%
2548 {middlelinecolor==\mdf@linecolor},%
2549 {psroundlinecolor==\mdf@backgroundcolor},%
2550 {frametitlerulecolor==\mdf@linecolor},
2551 {frametitlebackgroundcolor==\mdf@backgroundcolor},%
2552 {shadowcolor==black!50},%
2553 {settings=={}},%
2554 {frametitlesettings=={}},%
2555 {font=={}},%
2556 {frametitlefont==\normalfont\bfseries},%
2557 {printheight==none},%
2558 {alignment=={}},%
2559 {frametitlealignment=={}},%
2560 {theoremseparator=={:}},%
2561 {theoremcountersep=={.}},%
2562 {theoremtitlefont=={}},%
2563 {theoremspace=={\space}},%
2564 {extra=={}},%
2565 {singleextra=={}},%
2566 {firstextra=={}},%
2567 {middleextra=={}},%
2568 {secondextra=={}},%
2569 {beforesingleframe=={}},%
2570 {aftersingleframe=={}},%
2571 {beforebreak=={}},%
2572 {afterbreak=={}},%
2573 {beforelastframe=={}},%
2574 {afterlastframe=={}},%
2575 {startcode=={}},%
2576 {startinnercode=={}},%
2577 {endinnercode=={}},%
2578 {endcode=={}},%
2579 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %
2580 % %%subtitle / subsubtitle added 29.05.12%% %
2581 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %
2582 {subtitlefont==\normalfont\bfseries},%
2583 {subsubtitlefont==\normalfont},%
2584 {subtitlebackgroundcolor==white},%
2585 {subsubtitlebackgroundcolor==white},%
2586 {subtitleabovelinecolor==black},%
2587 {subtitlebelowlinecolor==black},%
2588 {subsubtitleabovelinecolor==black},%
2589 {subsubtitlebelowlinecolor==black},%
2590 }
2591 % \end{macrocode}
2592 % \end{macro}
2593 %
2594 % \begin{macro}{mdf@do@booloption}
2595 % Here the declaration of all bool options.
2596 % \begin{macrocode}
2597 \mdf@dolist{\mdf@do@booloption}{%
2598 {ntheorem==false},%
2599 {topline==true},%
2600 {leftline==true},%
2601 {bottomline==true},%
2602 {rightline==true},%
2603 {frametitletopline==true},%
2604 {frametitleleftline==true},%
2605 {frametitlebottomline==true},%
2606 {frametitlerightline==true},%
2607 {frametitlerule==false},%
2608 {footnoteinside==true},%
2609 {usetwoside==true},%
2610 {repeatframetitle==false},%Noch nicht richtig implementiert
2611 {shadow==false},%
2612 {everyline==false},%
2613 {ignorelastdescenders==false},%
2614 {subtitleaboveline==false},
2615 {subtitlebelowline==false},
2616 {subsubtitleaboveline==false},
2617 {subsubtitlebelowline==false},
2618 {draft==false},
2619 {suppressfirstparskip==true},
2620 }
2621 %%special boolflag hidealllines:
2622 \newbool{mdf@hidealllines}%
2623 \define@key{mdf}{hidealllines}[false]{%
2624 \setbool{mdf@hidealllines}{#1}%
2625 \ifbool{mdf@hidealllines}{%
2626 \kvsetkeys{mdf}{leftline=false,topline=false,%
2627 rightline=false,bottomline=false}%
2628 }{%
2629 \kvsetkeys{mdf}{leftline=true,topline=true,%
2630 rightline=true,bottomline=true}%
2631 }%
2632 }
2633 \appto\mdf@definestyle@defaultoptions{hidealllines=false,}%
2634 %%special boolflag nobreak:
2635 % \newbool{mdf@nobreak}%
2636 % \boolfalse{mdf@nobreak}%
2637 \DeclareBoolOption[true]{nobreak}
2638 \boolfalse{mdf@nobreak}%
2639 \appto\mdf@definestyle@defaultoptions{nobreak=false,}
2640 % \end{macrocode}
2641 % \end{macro}
2642 %
2643 % \begin{macro}{mdf@do@alignoption}
2644 % Here the declaration of all align options.
2645 % \begin{macrocode}
2646 %USELESS
2647 %USELESS
2648 %USELESS
2649 % This part must be worked over.
2650 \def\mdf@do@alignoption#1{%
2651 \mdf@alignoption@tripledo#1\@nil%
2652 }
2653 \def\mdf@alignoption@tripledo#1==#2==#3\@nil{%
2654 \csdef{mdf@align@#1@left}{\null\hspace*{#2}}%
2655 \csdef{mdf@align@#1@right}{\hspace*{#3}\null}%
2656 }
2657 \mdf@dolist{\mdf@do@alignoption}{%
2658 {left==\mdf@leftmargin@length==\z@},%
2659 {center==\fill==\fill},%
2660 {right==\fill==\mdf@rightmargin@length},%
2661 {outer==\fill==\mdf@rightmargin@length},%not supported yet
2662 {outer==\mdf@leftmargin@length==\fill},%not supported yet
2663 }
2664 \newcommand*\mdf@align{}%
2665 \newcommand*\mdf@makeboxalign@left{\null\hspace*{\mdf@leftmargin@length}}%
2666 \newcommand*\mdf@makeboxalign@right{}%
2667 \define@key{mdf}{align}[left]{%
2668 \ifcsundef{mdf@align@#1@left}{%
2669 \mdf@PackageWarning{Unknown alignment #1\MessageBreak}%
2670 \letcs\mdf@makeboxalign@left{mdf@align@left@left}%
2671 \letcs\mdf@makeboxalign@right{mdf@align@left@right}%
2672 }{%
2673 \def\mdf@makeboxalign@left{\csuse{mdf@align@#1@left}}%
2674 \def\mdf@makeboxalign@right{\csuse{mdf@align@#1@right}}%
2675 }%
2676 }
2677 %USELESS
2678 %USELESS
2679 %USELESS
2680 % \end{macrocode}
2681 % \end{macro}
2682 %
2683 % \begin{macro}{mdf@tikzset@local,mdf@psset@local}
2684 % Option to pass options to tikz or pstricks
2685 % \begin{macrocode}
2686 \def\mdf@tikzset@local{\tikzset{tikzsetting/.style={}}}
2687 \define@key{mdf}{tikzsetting}{%
2688 \def\mdf@tikzset@local{\tikzset{tikzsetting/.style={#1}}}%
2689 }
2690 \define@key{mdf}{apptotikzsetting}{%
2691 \appto\mdf@tikzset@local{#1}%
2692 }
2693 \def\mdf@psset@local{}
2694 \define@key{mdf}{pstrickssetting}{%
2695 \def\mdf@psset@local{#1}
2696 }
2697 \def\mdfpstricks@appendsettings{}
2698 \define@key{mdf}{pstricksappsetting}{%
2699 \def\mdfpstricks@appendsettings{#1}%
2700 }
2701 % \end{macrocode}
2702 % \end{macro}
2703 %
2704 % \begin{macro}{mdf@xcolor}
2705 % \textcolor{red}{\bfseries Problem width xcolor. This part must be reworked!}
2706 % \begin{macrocode}
2707 \def\mdf@xcolor{}
2708 \define@key{mdf}{xcolor}[]{%
2709 \def\@tempa{#1}%
2710 \@ifpackageloaded{xcolor}{%
2711 \let\mdf@xcolor\@empty %ignoriere die Eingabe der Optionen
2712 \def\@tempa{}%
2713 }{}%
2714 \ifx\relax\@tempa\relax\else
2715 \PassOptionsToPackage{\mdf@xcolor}{xcolor}%
2716 \RequirePackage{xcolor}%
2717 \fi%
2718 }%
2719 % \end{macrocode}
2720 % \end{macro}
2721 %
2722 %
2723 % \begin{macrocode}
2724 \DeclareDefaultOption{%
2725 \mdf@PackageError{Unknown Option '\CurrentOption' for mdframed}}
2726 \ProcessKeyvalOptions*\relax
2727 \ifnum\c@mdf@globalstyle@cnt<0
2728 \kvsetkeys{mdf}{framemethod=default,}
2729 \fi
2730 % \end{macrocode}
2731 %
2732 % \begin{macro}{mdfsetup}
2733 % Short form of |\setkeys{mdf}|
2734 % \begin{macrocode}
2735 \newrobustcmd*{\mdfsetup}{\kvsetkeys{mdf}}
2736 % \end{macrocode}
2737 % \end{macro}
2738 %
2739 % \begin{macro}{mdf@style}
2740 % Redefinition of the option |style| to use the key in combination with
2741 % |mdfdefinedstyle|.
2742 % \begin{macrocode}
2743 \define@key{mdf}{style}{%
2744 \ifcsundef{mdf@definestyle@#1}{%
2745 \mdf@PackageWarning{Unknown definedstyle #1^^J
2746 You have to define a style ^^J
2747 via \string\mdfdefinedstyle\MessageBreak
2748 }%
2749 }%
2750 {\expandafter\expandafter\expandafter\mdfsetup\expandafter%
2751 \expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}%
2752 }%
2753 \DeclareVoidOption{default}{%
2754 \expandafter\expandafter\expandafter\mdfsetup\expandafter%
2755 \expandafter\expandafter{\csname mdf@definestyle@defaultoptions\endcsname}%
2756 }%
2757 % \end{macrocode}
2758 % \end{macro}
2759
2760 % \begin{macro}{linewidth}
2761 % make linewidth available for all styles:
2762 % |mdfdefinedstyle|.
2763 % \begin{macrocode}
2764 \ifnum\c@mdf@globalstyle@cnt>0
2765 \define@key{mdf}{linewidth}{%
2766 \def\@tempa{#1}
2767 \mdf@iflength{\@tempa}%
2768 {\csxdef{mdfl@linewidth}{\the\mdf@templength}}%
2769 {\csxdef{mdfl@linewidth}{\the\mdf@templength}}%
2770 \setlength{\csname mdf@middlelinewidth@length\endcsname}%
2771 {\csname mdfl@linewidth\endcsname}%
2772 }%
2773 \fi
2774
2775 % \end{macrocode}
2776 % \end{macro}
2777 %
2778 %
2779 % \begin{macro}{mdf@print@space}
2780 % Option to type out the free vertical space of the current page.
2781 % \begin{macrocode}
2782 \let\mdf@PackageNoInfo\@gobble
2783 \newrobustcmd*\mdf@ifstrequal@expand{%
2784 \expandafter\ifstrequal\expandafter{\mdf@printheight}%
2785 }
2786 \newrobustcmd*\mdf@print@space{%
2787 %case "none"
2788 \mdf@ifstrequal@expand{none}{\def\mdf@tempa{NoInfo}}{%
2789 %case "info"
2790 \mdf@ifstrequal@expand{info}{\def\mdf@tempa{Info}}{%
2791 %case "warning"
2792 \mdf@ifstrequal@expand{warning}{\def\mdf@tempa{Warning}}{%
2793 %case "unknown"
2794 \mdf@PackageWarning{Unknown key for printheight=\mdf@printheight^^J
2795 use none, info or warning}%
2796 \def\mdf@tempa{none}%
2797 }%
2798 }%
2799 }%
2800 \def\mdf@PackageInfoSpace{\csname mdf@Package\mdf@tempa\endcsname}%
2801 }
2802 % \end{macrocode}
2803 % \end{macro}
2804 %
2805 % \begin{macro}{new...}
2806 % Initialize all commands and length which will we used later
2807 % \begin{macrocode}
2808 \newsavebox\mdf@frametitlebox
2809 \newsavebox\mdf@footnotebox
2810 \newsavebox\mdf@splitbox@one
2811 \newsavebox\mdf@splitbox@two
2812 \newsavebox\mdf@splitbox@save
2813
2814 \newlength\mdfsplitboxwidth
2815 \newlength\mdfsplitboxtotalwidth
2816 \newlength\mdfsplitboxheight
2817 \newlength\mdfsplitboxdepth
2818 \newlength\mdfsplitboxtotalheight
2819 \newlength\mdfframetitleboxwidth
2820 \newlength\mdfframetitleboxtotalwidth
2821 \newlength\mdfframetitleboxheight
2822 \newlength\mdfframetitleboxdepth
2823 \newlength\mdfframetitleboxtotalheight
2824 \newlength\mdffootnoteboxwidth
2825 \newlength\mdffootnoteboxtotalwidth
2826 \newlength\mdffootnoteboxheight
2827 \newlength\mdffootnoteboxdepth
2828 \newlength\mdffootnoteboxtotalheight
2829 \newlength\mdftotallinewidth
2830 \newlength\mdfboundingboxwidth
2831 \newlength\mdfboundingboxtotalwidth
2832 \newlength\mdfboundingboxheight
2833 \newlength\mdfboundingboxdepth
2834 \newlength\mdfboundingboxtotalheight
2835 \newlength\mdf@freevspace@length
2836 \newlength\mdf@horizontalwidthofbox@length
2837 \newlength\mdf@verticalmarginwhole@length
2838 \newlength\mdf@horizontalspaceofbox
2839 \newlength\mdfsubtitleheight
2840 \newlength\mdfsubsubtitleheight
2841
2842
2843 \newbool{mdfsingleframe}\boolfalse{mdfsingleframe}
2844 \newbool{mdffirstframe}\boolfalse{mdffirstframe}
2845 \newbool{mdfmiddleframe}\boolfalse{mdfmiddleframe}
2846 \newbool{mdflastframe}\boolfalse{mdflastframe}
2847
2848 \newtoggle{mdf@notfirstframetitle}\togglefalse{mdf@notfirstframetitle}%
2849 \newtoggle{mdflastframe}\togglefalse{mdflastframe}
2850
2851 \newcounter{mdfcountframes}\setcounter{mdfcountframes}{0}
2852 % Command to expand the tikz code. (see md-frame-1.mdf)
2853 \newrobustcmd\mdfcreateextratikz{}
2854
2855 % \end{macrocode}
2856 % \end{macro}
2857 %
2858 %
2859 % \begin{macro}{mdf@lrbox,endmdf@lrbox}
2860 % Modification of the default |\lrbox| and |\endlrbox|
2861 % \begin{macrocode}
2862 \def\mdf@lrbox#1{%
2863 \mdf@patchamsthm%patch amsthm
2864 \setbox#1\vbox\bgroup%
2865 \color@begingroup%
2866 \mdf@horizontalmargin@equation%
2867 \columnwidth=\hsize%
2868 \textwidth=\hsize%
2869 \let\if@nobreak\iffalse%
2870 \let\if@noskipsec\iffalse%
2871 \let\par\@@par%
2872 \let\-\@dischyph%
2873 \let\'\@acci\let\`\@accii\let\=\@acciii%
2874 \parindent\z@ \parskip\z@skip%
2875 \linewidth\hsize%
2876 \@totalleftmargin\z@%
2877 \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip%
2878 \parfillskip\@flushglue \lineskip\normallineskip%
2879 \baselineskip\normalbaselineskip%
2880 %% \sloppy%
2881 \let\\\@normalcr%
2882 \mdf@par@local%New feature to restore parskip/parindent local in save box
2883 \ifbool{mdf@suppressfirstparskip}{\vspace*{-\parskip}}{}%
2884 \@afterindentfalse%
2885 %\@afterheading%
2886 }
2887 \def\endmdf@lrbox{\color@endgroup\egroup}
2888 % \end{macrocode}
2889 % \end{macro}
2890 %
2891 % \begin{macro}{mdf@ignorevbadness}
2892 % Avoiding warnings during the splitting process by \Cmd{vsplit}.
2893 % \begin{macrocode}
2894 \newrobustcmd*\mdf@ignorevbadness{%
2895 \edef\mdf@currentvbadness{\the\vbadness}%
2896 \vbadness=\@M%
2897 \afterassignment\mdf@restorevbadness}
2898
2899 \newrobustcmd*\mdf@restorevbadness{\vbadness=\mdf@currentvbadness\relax}
2900 % \end{macrocode}
2901 % \end{macro}
2902 %
2903 % \begin{macro}{mdf@patchamsth}
2904 % The package \Pack{amsthm} provides a not compatible starting of theorem. So I
2905 % have to change the header of amsthm.
2906 % \begin{macrocode}
2907 \let\mdf@patchamsthm\relax
2908 \AtBeginDocument{%
2909 \@ifpackageloaded{amsthm}%
2910 {%
2911 \newrobustcmd\mdf@patchamsthm{%
2912 \let\mdf@deferred@thm@head\deferred@thm@head%
2913 \pretocmd{\deferred@thm@head}{\@inlabelfalse}%
2914 {\mdf@PackageInfo{mdframed detected package amsthm ^^J
2915 changed the theorem header of amsthm\MessageBreak}%
2916 }{%
2917 \mdf@PackageError{mdframed detected package amsthm ^^J
2918 changed the theorem header of amsthm
2919 failed\MessageBreak}%
2920 }%
2921 }%
2922 }{}%
2923 }
2924 % \end{macrocode}
2925 % \end{macro}
2926 %
2927 %
2928 % \begin{macro}{mdf@trivlist,endmdf@trivlist}
2929 % Modification of the default |\trivlist| and |\endtrivlist|.
2930 % \begin{macrocode}
2931 \def\mdf@trivlist#1{%
2932 \edef\mdf@temp{%
2933 \topsep=\the\topsep\relax%
2934 \partopsep=\the\partopsep\relax%
2935 \parsep=\the\parsep\relax%
2936 }%
2937 \setlength{\topsep}{#1}%
2938 \topskip\z@%
2939 \partopsep\z@%
2940 \parsep\z@%
2941 \@nmbrlistfalse%
2942 \@trivlist%
2943 \labelwidth\z@%
2944 \leftmargin\z@%
2945 \itemindent\z@%
2946 \let\@itemlabel\@empty%
2947 \def\makelabel##1{##1}%
2948 \item\relax\mdf@temp\relax%
2949 }
2950 \let\endmdf@trivlist\endtrivlist
2951 \patchcmd\endmdf@trivlist\@endparenv\mdf@endparenv{%
2952 \wlog{^^J****** mdframed patching \string\endmdf@trivlist}%
2953 \wlog{^^J****** -- success******^^J}%
2954 }{%
2955 \wlog{^^J****** mdframed patching \string\endmdf@trivlist}%
2956 \wlog{^^J****** -- failed******^^J}%
2957 }
2958 \def\mdf@endparenv{%
2959 \addpenalty\@endparpenalty\addvspace\mdf@skipbelow@length\@endpetrue}
2960 % \end{macrocode}
2961 % \end{macro}
2962 %
2963 % \begin{macro}{mdf@makebox@out,mdf@makebox@in}
2964 % \begin{macrocode}
2965 \newrobustcmd*\mdf@makebox@out[2][\linewidth]{%
2966 \noindent\hb@xt@\z@{%
2967 \noindent\makebox[\dimexpr #1\relax][l]{#2}%
2968 \hss}%
2969 }%
2970 \newrobustcmd*\mdf@makebox@in[2][\mdf@userdefinedwidth@length]{%
2971 \noindent\makebox[\dimexpr #1\relax][l]{#2}%
2972 }
2973 % \end{macrocode}
2974 % \end{macro}
2975 %
2976 % \begin{macro}{mdfdefinestyle,mdfapptodefinestyle}
2977 % See explanation of this commands in the main documenation.
2978 % \begin{macrocode}
2979 \newrobustcmd*\mdfdefinestyle[2]{%
2980 \csdef{mdf@definestyle@#1}{#2}%
2981 }
2982 \newrobustcmd*\mdfapptodefinestyle[2]{%
2983 \ifcsundef{mdf@definestyle@#1}%
2984 {\mdf@PackageWarning{Unknown style #1}}%
2985 {\csappto{mdf@definestyle@#1}{,#2}}%
2986 }
2987 % \end{macrocode}
2988 % \end{macro}
2989 %
2990 %
2991 % \begin{macro}{mdflength,surroundwithmdframed}
2992 % Helper macros to work with mdframed
2993 % \begin{macrocode}
2994 \newrobustcmd*{\mdflength}[1]{\csuse{mdf@#1@length}}
2995
2996 \newrobustcmd*{\surroundwithmdframed}[2][]{%
2997 \BeforeBeginEnvironment{#2}{\begin{mdframed}[#1]}%
2998 \AfterEndEnvironment{#2}{\end{mdframed}}%
2999 }
3000 % \end{macrocode}
3001 % \end{macro}
3002 %
3003 %
3004 %
3005 % \begin{macro}{newmdenv,renewmdenv,newmdtheoremenv,mdtheorem}
3006 % Defining of the new environment defintions.
3007 % \begin{macrocode}
3008 \newrobustcmd*\newmdenv[2][]{%
3009 \newenvironment{#2}{%
3010 \mdfsetup{#1}%
3011 \begin{mdframed}%
3012 }{%
3013 \end{mdframed}%
3014 }%
3015 }
3016 \newrobustcmd*\renewmdenv[2][]{%
3017 \expandafter\let\csname #2\endcsname\relax%
3018 \expandafter\let\csname end#2\endcsname\relax%
3019 \newmdenv[#1]{#2}%
3020 }%
3021 % \end{macrocode}
3022 % Definitions of the standard Theoerems surrounded by \Pack{mdframed}.
3023 % \begin{macrocode}
3024 \DeclareDocumentCommand\newmdtheoremenv{O{} m o m o }{%
3025 \ifboolexpr{ test {\IfNoValueTF {#3}} and test {\IfNoValueTF {#5}} }%
3026 {\newtheorem{#2}{#4}}{%
3027 \IfValueTF{#3}{\newtheorem{#2}[#3]{#4}}{}%
3028 \IfValueTF{#5}{\newtheorem{#2}{#4}[#5]}{}%
3029 }%
3030 \BeforeBeginEnvironment{#2}{%
3031 \begin{mdframed}[#1]}%
3032 \AfterEndEnvironment{#2}{%
3033 \end{mdframed}}%
3034 }
3035 % \end{macrocode}
3036 % Compatible with \Pack{ntheorem}'s \Cmd{listoftheorems}.
3037 % \begin{macrocode}
3038 \newrobustcmd*\mdf@thm@caption[2]{}
3039 \AtBeginDocument{%
3040 \@ifpackageloaded{ntheorem}%
3041 {\renewrobustcmd*\mdf@thm@caption{\thm@thmcaption}}{}%
3042 }
3043 % \end{macrocode}
3044 %
3045 %
3046 % \begin{macro}{mdf@checkntheorem}
3047 % Command which checks only |ntheorem|. Later I will support also
3048 % |thmtools|.
3049 % \begin{macrocode}
3050 \newrobustcmd*\mdf@checkntheorem{%
3051 \ifbool{mdf@ntheorem}%
3052 {\ifundef{\theorempreskipamount}%
3053 {\mdf@PackageWarning{You have not loaded ntheorem yet}}%
3054 {\setlength{\theorempreskipamount}{\z@}%
3055 \setlength{\theorempostskipamount}{\z@}%
3056 }%
3057 }{}%
3058 }
3059 % \end{macrocode}
3060 % \end{macro}
3061 %
3062 % Defining a complete new theorem set by \Pack{mdframed}
3063 % \begin{macrocode}
3064 \DeclareDocumentCommand{\mdtheorem}{ O{} m o m o }%
3065 {\ifcsdef{#2}%
3066 {\mdf@PackageWarning{Environment #2 already exits\MessageBreak}}%
3067 {%
3068 \IfNoValueTF {#3}%
3069 {%#3 not given -- number relationship
3070 \IfNoValueTF {#5}%
3071 {%#3+#5 not given
3072 \@definecounter{#2}%
3073 \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}%
3074 \newenvironment{#2}[1][]{%
3075 \refstepcounter{#2}%
3076 \ifstrempty{##1}%
3077 {\let\@temptitle\relax}%
3078 {%
3079 \def\@temptitle{\mdf@theoremseparator%
3080 \mdf@theoremspace%
3081 \mdf@theoremtitlefont%
3082 ##1}%
3083 \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
3084 }%
3085 \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
3086 \@temptitle}]}%
3087 {\end{mdframed}}%
3088 \newenvironment{#2*}[1][]{%
3089 \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}%
3090 \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
3091 {\end{mdframed}}%
3092 }%
3093 {%#5 given -- reset counter
3094 \@definecounter{#2}\@newctr{#2}[#5]%
3095 \expandafter\xdef\csname the#2\endcsname{\@thmcounter{#2}}%
3096 \expandafter\xdef\csname the#2\endcsname{%
3097 \expandafter\noexpand\csname the#5\endcsname \@thmcountersep%
3098 \@thmcounter{#2}}%
3099 \newenvironment{#2}[1][]{%
3100 \refstepcounter{#2}%
3101 \ifstrempty{##1}%
3102 {\let\@temptitle\relax}%
3103 {%
3104 \def\@temptitle{\mdf@theoremseparator%
3105 \mdf@theoremspace%
3106 \mdf@theoremtitlefont%
3107 ##1}%
3108 \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
3109 }
3110 \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
3111 \@temptitle}]}%
3112 {\end{mdframed}}%
3113 \newenvironment{#2*}[1][]{%
3114 \ifstrempty{##1}%
3115 {\let\@temptitle\relax}%
3116 {%
3117 \def\@temptitle{\mdf@theoremseparator%
3118 \mdf@theoremspace%
3119 \mdf@theoremtitlefont%
3120 ##1}%
3121 \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
3122 }%
3123 \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
3124 {\end{mdframed}}%
3125 }%
3126 }%
3127 {%#3 given -- number relationship
3128 \global\@namedef{the#2}{\@nameuse{the#3}}%
3129 \newenvironment{#2}[1][]{%
3130 \refstepcounter{#3}%
3131 \ifstrempty{##1}%
3132 {\let\@temptitle\relax}%
3133 {%
3134 \def\@temptitle{\mdf@theoremseparator%
3135 \mdf@theoremspace%
3136 \mdf@theoremtitlefont%
3137 ##1}%
3138 \mdf@thm@caption{#2}{{#4}{\csname the#2\endcsname}{##1}}%
3139 }
3140 \begin{mdframed}[#1,frametitle={\strut#4\ \csname the#2\endcsname%
3141 \@temptitle}]}%
3142 {\end{mdframed}}%
3143 \newenvironment{#2*}[1][]{%
3144 \ifstrempty{##1}{\let\@temptitle\relax}{\def\@temptitle{:\ ##1}}%
3145 \begin{mdframed}[#1,frametitle={\strut#4\@temptitle}]}%
3146 {\end{mdframed}}%
3147 }%
3148 }%
3149 }
3150
3151 % \end{macrocode}
3152 % \end{macro}
3153 %
3154 % \begin{macro}{mdfframedtitleenv,mdf@@frametitle,
3155 % mdf@setopt@body,mdf@setopt@title}
3156 % Default definition of the frame tile used by |mdframed|.
3157 % \textcolor{red}{\bfseries Need a better documenation and must be improved!!!}
3158 % \begin{macrocode}
3159 \newrobustcmd\mdfframedtitleenv[1]{%
3160 \mdf@lrbox{\mdf@frametitlebox}%
3161 \begingroup
3162 %%\parindent\z@\parskip\z@%
3163 \@afterheading
3164 \mdf@frametitlealignment%
3165 \leavevmode\color{\mdf@frametitlefontcolor}%
3166 \normalfont\mdf@frametitlefont{#1}%
3167 \mdf@@ignorelastdescenders%
3168 \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%%
3169 \endgroup
3170 \endmdf@lrbox\relax%
3171 \mdf@ignorevbadness%
3172 \setbox\mdf@frametitlebox=\vbox{\unvbox\mdf@frametitlebox}%
3173 \mdfframetitleboxwidth=\wd\mdf@frametitlebox\relax%
3174 \mdfframetitleboxheight=\ht\mdf@frametitlebox\relax%
3175 \mdfframetitleboxdepth=\dp\mdf@frametitlebox\relax%
3176 \mdfframetitleboxtotalheight=\dimexpr
3177 \ht\mdf@frametitlebox
3178 +\dp\mdf@frametitlebox%
3179 +\mdf@frametitleaboveskip@length
3180 +\mdf@frametitlebelowskip@length
3181 \relax%
3182 \setbox\mdf@frametitlebox=%prevent frametitle to expand glue
3183 \vbox to \dimexpr\mdfframetitleboxheight+\mdfframetitleboxdepth\relax%
3184 {\unvbox\mdf@frametitlebox}%
3185 }
3186
3187 \newrobustcmd\mdf@@frametitle@use{%
3188 \mdf@ignorevbadness%
3189 \setbox\mdf@splitbox@one=\vbox{%
3190 \parskip\z@\relax%
3191 \parindent\z@\relax%
3192 \offinterlineskip\relax%
3193 \unvcopy\mdf@frametitlebox\relax%
3194 \mdf@@frametitlerule\relax%
3195 \unvbox\mdf@splitbox@one\relax%
3196 }%
3197 \mdf@ignorevbadness%
3198 \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}%
3199 \mdfsetup{innertopmargin=\mdf@frametitleaboveskip@length}%
3200 }
3201 % \end{macrocode}
3202 % \end{macro}
3203 %
3204 % \begin{macro}{mdf@footnoterule,mdf@footnoteoutput,mdf@footnoteinput}
3205 % Support for footnotes. See source2e.
3206 % \begin{macrocode}
3207 \newrobustcmd*\mdf@footnoterule{%
3208 \kern0\p@%
3209 \hrule \@width 1in \kern 2.6\p@}
3210
3211 \newrobustcmd*\mdf@footnoteoutput{%
3212 \ifvoid\@mpfootins\else%
3213 \nobreak%
3214 \vskip\mdf@footenotedistance@length%
3215 \normalcolor%
3216 \mdf@footnoterule%
3217 \unvbox\@mpfootins%
3218 \fi%
3219 }
3220
3221 \newrobustcmd*\mdf@footnoteinput{%
3222 \def\@mpfn{mpfootnote}%
3223 \def\thempfn{\thempfootnote}%
3224 \c@mpfootnote\z@%
3225 \let\@footnotetext\@mpfootnotetext%
3226 }
3227 % \end{macrocode}
3228 % \end{macro}
3229 %
3230 %
3231 % \begin{macro}{mdf@styledefinition}
3232 % The default frame method needs special handling.
3233 % \begin{macrocode}
3234 \newrobustcmd*\mdf@styledefinition{%AVOID!!!Needed for framemethod=default
3235 \ifnumequal{\value{mdf@globalstyle@cnt}}{0}%
3236 {\deflength{\mdf@innerlinewidth@length}{\z@}%
3237 \deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}%
3238 \deflength{\mdf@outerlinewidth@length}{\z@}%
3239 \let\mdf@innerlinecolor\mdf@linecolor%
3240 \let\mdf@middlelinecolor\mdf@linecolor%
3241 \let\mdf@outerlinecolor\mdf@linecolor%
3242 }{}%
3243 }
3244 % \end{macrocode}
3245 % \end{macro}
3246 %
3247 % \begin{macro}{detected@mdf@put@frame}
3248 % Detect whether inside a non breakable environment.
3249 % \begin{macrocode}
3250 \let\mdf@reserved@a\@empty
3251 \newrobustcmd*\detected@mdf@put@frame{%
3252 \ifmdf@nobreak%Option nobreak=true?
3253 \def\mdf@reserved@a{\mdf@put@frame@standalone}%
3254 \else%
3255 \def\mdf@reserved@a{\mdf@put@frame}%
3256 \ifx\@captype\@undefined%
3257 \def\mdf@reserved@a{\mdf@put@frame}%
3258 \else%
3259 \mdf@PackageInfo{mdframed inside float ^^J
3260 mdframed uses option nobreak \mdframedpackagename}%
3261 \def\mdf@reserved@a{\mdf@put@frame@standalone}%
3262 \fi%
3263 \if@minipage%
3264 \mdf@PackageInfo{mdframed inside minipage ^^J
3265 mdframed uses option nobreak \mdframedpackagename}%
3266 \def\mdf@reserved@a{\mdf@put@frame@standalone}%
3267 \fi%
3268 \ifinner%
3269 \mdf@PackageInfo{mdframed inside a box ^^J
3270 mdframed uses option nobreak \mdframedpackagename}%
3271 \def\mdf@reserved@a{\mdf@put@frame@standalone}%
3272 \fi%
3273 \fi%
3274 \mdf@reserved@a%
3275 }
3276 % \end{macrocode}
3277 % \end{macro}
3278 %
3279 %
3280 %
3281 %
3282 % \begin{macro}{mdf@envdepth}
3283 % Setting up a counter for the depth of the environment. Nesting of two
3284 % \Env{mdframed} environments isn't recommended but I am trying to support
3285 % the basic rules.
3286 % \begin{macrocode}
3287 \newcount\mdf@envdepth \mdf@envdepth=0
3288 \@definecounter{mdf@env@i}
3289 \@definecounter{mdf@env@ii}
3290 % \end{macrocode}
3291 % \end{macro}
3292 %
3293 %
3294 % \begin{macro}{mdf@preenvsetting}
3295 % Collect all definitions at the beginning of \Env{mdframed}
3296 % \begin{macrocode}
3297 \newrobustcmd*\mdf@preenvsetting{%
3298 \needspace{\mdf@needspace@length}
3299 \mdf@twoside@checklength%
3300 \edef\mdf@par@local{%
3301 \parskip=\the\parskip\relax%
3302 \parindent=\the\parindent\relax}%
3303 \parskip\z@%
3304 \parindent\z@%
3305 \let\width\z@%
3306 \let\height\z@%
3307 \mdf@checkntheorem%
3308 \ifbool{mdf@draft}{%
3309 \ifdimgreater{\overfullrule}{0pt}{}{\setlength\overfullrule{5pt}}}{}%
3310 %% Nested environments and provide an extra counter.
3311 \ifnum\mdf@envdepth >\tw@\@toodeep\else%
3312 \advance\mdf@envdepth\@ne
3313 \edef\mdf@depthctr{mdf@env@\romannumeral\the\mdf@envdepth}%
3314 \fi
3315 \mdf@styledefinition%
3316 \mdf@footnoteinput%
3317 \color{\mdf@fontcolor}%
3318 \mdf@font%
3319 }
3320 % \end{macrocode}
3321 % \end{macro}
3322 %
3323 % \begin{macro}{mdf@@ignorelastdescenders}
3324 % Collect all definitions at the beginning of \Env{mdframed}
3325 % \begin{macrocode}
3326 \newrobustcmd*\mdf@@ignorelastdescenders{%
3327 \ifbool{mdf@ignorelastdescenders}%
3328 {%
3329 \par\strut\par%
3330 \unskip\unskip\setbox0=\lastbox
3331 \vspace*{\dimexpr\ht\strutbox-\baselineskip\relax}%
3332 }{}%
3333 }
3334 % \end{macrocode}
3335 % \end{macro}
3336 %
3337 %
3338 %
3339 % \begin{macro}{mdframed}
3340 % The user environement.
3341 % \begin{macrocode}
3342 \newenvironment{mdframed}[1][]{%
3343 \color@begingroup%
3344 \mdfsetup{userdefinedwidth=\linewidth,#1}%
3345 \mdf@startcode%
3346 \mdf@preenvsetting%
3347 \ifdefempty{\mdf@firstframetitle}{}%
3348 {\let\mdf@frametitlesave\mdf@frametitle%
3349 \let\mdf@frametitle\mdf@firstframetitle%
3350 }%
3351 \ifvmode\nointerlineskip\fi%
3352 \mdf@trivlist{\mdf@skipabove@length}%%
3353 \mdf@settings%
3354 \mdf@lrbox{\mdf@splitbox@one}%
3355 \mdf@startinnercode%
3356 }%
3357 {%
3358 \mdf@@ignorelastdescenders%
3359 \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%%
3360 \ifmdf@footnoteinside%
3361 \def\mdf@reserveda{%
3362 \mdf@footnoteoutput%
3363 \mdf@endinnercode%
3364 \endmdf@lrbox%
3365 \ifdefempty{\mdf@frametitle}{}%
3366 {\mdfframedtitleenv{\mdf@frametitle}\mdf@@frametitle@use}%
3367 \detected@mdf@put@frame}%
3368 \else%
3369 \def\mdf@reserveda{%
3370 \mdf@endinnercode%
3371 \endmdf@lrbox%
3372 \ifdefempty{\mdf@frametitle}{}%
3373 {\mdfframedtitleenv{\mdf@frametitle}\mdf@@frametitle@use}%
3374 \detected@mdf@put@frame%
3375 \mdf@footnoteoutput%
3376 }%
3377 \fi%
3378 \mdf@reserveda%
3379 \aftergroup\endmdf@trivlist%
3380 \color@endgroup%
3381 \mdf@endcode%
3382 }
3383
3384 % \end{macrocode}
3385 % \end{macro}
3386 %
3387 % \begin{macro}{mdf@twoside@checklength,mdf@zref@label,if@mdf@pageodd,
3388 % mdf@pageisodd,mdf@pageiseven,mdf@@setzref}
3389 % The whole bunch is used to work width twoside mode and uses the correct
3390 % margins.
3391 % \begin{macrocode}
3392 \newtoggle{md:checktwoside}
3393 \settoggle{md:checktwoside}{false}
3394 \newrobustcmd*\mdf@twoside@checklength{%
3395 \if@twoside%
3396 \ifbool{mdf@usetwoside}%
3397 {\mdf@PackageInfo{mdframed works in twoside mode}%
3398 \settoggle{md:checktwoside}{true}%
3399 \setlength\mdf@rightmargin@length{\mdf@outermargin@length}%
3400 \setlength\mdf@leftmargin@length{\mdf@innermargin@length}%
3401 }%
3402 {\mdf@PackageInfo{mdframed inside twoside mode but\MessageBreak
3403 works with oneside mode}%
3404 \settoggle{md:checktwoside}{false}%
3405 }%
3406 \fi%
3407 }
3408
3409 \newcounter{mdf@zref@counter}%keine doppelten laebes
3410 \zref@newprop*{mdf@pagevalue}[0]{\number\value{page}}
3411 \zref@addprop{\ZREF@mainlist}{mdf@pagevalue}
3412 \newrobustcmd*\mdf@zref@label{%
3413 \stepcounter{mdf@zref@counter}%
3414 \zref@label{mdf@pagelabel-\number\value{mdf@zref@counter}}%
3415 }
3416 \newrobustcmd*\if@mdf@pageodd{%
3417 \zref@refused{mdf@pagelabel-\the\value{mdf@zref@counter}}%
3418 \ifodd\zref@extract{mdf@pagelabel-\the\value{mdf@zref@counter}}%
3419 {mdf@pagevalue}%
3420 \setlength\mdf@rightmargin@length{\mdf@outermargin@length}%
3421 \setlength\mdf@leftmargin@length{\mdf@innermargin@length}%
3422 \else
3423 \setlength\mdf@rightmargin@length{\mdf@innermargin@length}%
3424 \setlength\mdf@leftmargin@length{\mdf@outermargin@length}%
3425 \fi%
3426 }
3427 \newrobustcmd*\mdf@@setzref{%
3428 \iftoggle{md:checktwoside}{\mdf@zref@label\if@mdf@pageodd}{}%
3429 }
3430 % \end{macrocode}
3431 % \end{macro}
3432 %
3433 % \begin{macro}{mdf@freepagevspace}
3434 % The following lines are added by an inspiration of the great package
3435 % \Pack{multicol}.
3436 % \begin{macrocode}
3437 \newrobustcmd*\mdf@freepagevspace{%
3438 \bgroup\@nobreakfalse\addpenalty\z@\egroup%added 29.5.12
3439 \penalty\@M\relax\vskip 2\baselineskip\relax%
3440 \penalty9999\relax\vskip -2\baselineskip\relax%
3441 \penalty9999%
3442 \ifdimequal{\pagegoal}{\maxdimen}%
3443 {\mdf@freevspace@length\vsize}%
3444 {\mdf@freevspace@length=\pagegoal\relax%
3445 \advance\mdf@freevspace@length by -\pagetotal\relax%
3446 \addtolength\mdf@freevspace@length{\dimexpr-\parskip\relax}\relax%
3447 }%
3448 }
3449 % \end{macrocode}
3450 % \end{macro}
3451 %
3452 % \begin{macro}{mdf@advancelength@sub,mdf@advancelength@add}
3453 % Command used for loop calculation
3454 % \begin{macrocode}
3455 \newrobustcmd*\mdf@advancelength@sub[2]{%
3456 \advance #1 by -\csname mdf@#2@length\endcsname\relax%
3457 }
3458 \newrobustcmd*\mdf@advancelength@add[2]{%
3459 \advance #1 by \csname mdf@#2@length\endcsname\relax%
3460 }
3461 % \end{macrocode}
3462 % \end{macro}
3463 %
3464 %
3465 % \begin{macro}{mdf@horizontalmargin@equation}
3466 % Compute the width of the box
3467 % \begin{macrocode}
3468 \newrobustcmd*\mdf@horizontalmargin@equation{%
3469 \setlength{\mdf@horizontalspaceofbox}{\mdf@userdefinedwidth@length}%
3470 \mdf@dolist{\mdf@advancelength@sub{\mdf@horizontalspaceofbox}}{%
3471 leftmargin,outerlinewidth,middlelinewidth,%
3472 innerlinewidth,innerleftmargin,innerrightmargin,%
3473 innerlinewidth,middlelinewidth,outerlinewidth,%
3474 rightmargin}%
3475 \notbool{mdf@leftline}%
3476 {%
3477 \mdf@dolist{\mdf@advancelength@add{\mdf@horizontalspaceofbox}}%
3478 {innerlinewidth,middlelinewidth,outerlinewidth}%
3479 }{}%
3480 \notbool{mdf@rightline}%
3481 {%
3482 \mdf@dolist{\mdf@advancelength@add{\mdf@horizontalspaceofbox}}%
3483 {innerlinewidth,middlelinewidth,outerlinewidth}%
3484 }{}%
3485 \hsize=\mdf@horizontalspaceofbox%
3486 }
3487 % \end{macrocode}
3488 % \end{macro}
3489 %
3490 % \begin{macro}{mdf@keeplines@single}
3491 % Space in relation of horizontal lines.
3492 % \begin{macrocode}
3493 \newrobustcmd*\mdf@keeplines@single{%
3494 \notbool{mdf@topline}%
3495 {%
3496 \mdf@dolist{\mdf@advancelength@sub{\mdf@verticalmarginwhole@length}}%
3497 {innerlinewidth,middlelinewidth,outerlinewidth}%
3498 }{}%
3499 \notbool{mdf@bottomline}%
3500 {%
3501 \mdf@dolist{\mdf@advancelength@sub{\mdf@verticalmarginwhole@length}}%
3502 {innerlinewidth,middlelinewidth,outerlinewidth}%
3503 }{}%
3504 }
3505 % \end{macrocode}
3506 % \end{macro}
3507 %
3508 %
3509 % \begin{macro}{mdf@reset}
3510 % Reset changes
3511 % \begin{macrocode}
3512 \protected@edef\mdf@reset{\boxmaxdepth\the\boxmaxdepth%
3513 \splittopskip\the\splittopskip}%
3514 % \end{macrocode}
3515 % \end{macro}
3516 %
3517 % \begin{macro}{mdf@put@frame@standalone}
3518 % Output of |mdframed| inside a non breakable environement.
3519 % \begin{macrocode}
3520 \newrobustcmd*\mdf@put@frame@standalone{\relax%
3521 \ifvoid\mdf@splitbox@one\relax%
3522 \mdf@PackageWarning{The environment is empty\MessageBreak}%
3523 \else%
3524 %Hier berechnung Box-Inhalt+Rahmen oben und unten
3525 \setlength{\mdf@verticalmarginwhole@length}%
3526 {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
3527 \mdf@dolist{\mdf@advancelength@add{\mdf@verticalmarginwhole@length}}{%
3528 outerlinewidth,middlelinewidth,innerlinewidth,%
3529 innertopmargin,innerbottommargin,innerlinewidth,%
3530 middlelinewidth,outerlinewidth,extratopheight}%
3531 \mdf@keeplines@single%
3532 \begingroup%
3533 \mdf@@setzref%
3534 \booltrue{mdfsingleframe}%
3535 \mdf@beforesingleframe%
3536 \mdf@putbox@single%
3537 \mdf@aftersingleframe%
3538 \endgroup%Output no break
3539 \fi%
3540 }
3541 % \end{macrocode}
3542 % \end{macro}
3543 %
3544 % \begin{macro}{mdf@put@frame}
3545 % Output of |mdframed| inside a breakable environement.
3546 % The comparison are only check whether the contents must be split or not.
3547 % \begin{macrocode}
3548 \def\mdf@put@frame{\relax%
3549 \ifvoid\mdf@splitbox@one\relax
3550 \mdf@PackageWarning{The environment is empty\MessageBreak}%
3551 \let\mdf@reserved@a\relax%
3552 \else
3553 \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}%
3554 \mdf@print@space%
3555 \mdf@freepagevspace%gives \mdf@freevspace@length
3556 \mdf@PackageInfoSpace{\the\mdf@freevspace@length before the
3557 beginning of \MessageBreak
3558 the environment ending on input line \MessageBreak}%
3559 \ifdimless{\mdf@freevspace@length}{2\baselineskip}%
3560 {%
3561 \mdf@PackageInfo{Not enough space on this page}%
3562 \vfill\eject%
3563 \def\mdf@reserved@a{\mdf@put@frame}%
3564 }{%
3565 %Hier berechnung Box-Inhalt+Rahmen oben und unten
3566 \setlength{\mdf@verticalmarginwhole@length}%
3567 {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
3568 \mdf@dolist{\mdf@advancelength@add{\mdf@verticalmarginwhole@length}}%
3569 {%
3570 outerlinewidth,middlelinewidth,innerlinewidth,%
3571 innertopmargin,innerbottommargin,%
3572 innerlinewidth,middlelinewidth,outerlinewidth,extratopheight}%
3573 \mdf@keeplines@single%
3574 \ifdimless{\mdf@verticalmarginwhole@length}{\mdf@freevspace@length}%
3575 {%enough space / no break
3576 \begingroup%
3577 \mdf@@setzref%
3578 \booltrue{mdfsingleframe}%
3579 \mdf@beforesingleframe%
3580 \mdf@putbox@single%
3581 \mdf@aftersingleframe%
3582 \endgroup%Output no break
3583 \let\mdf@reserved@a\relax%
3584 }%
3585 {%
3586 \def\mdf@reserved@a{\mdf@put@frame@i}%need to split
3587 }%
3588 }%
3589 \fi%
3590 \mdf@reserved@a%
3591 }
3592 % \end{macrocode}
3593 % \end{macro}
3594 %
3595 % \begin{macro}{mdf@put@frame@i}
3596 % Output of the first splitted box.
3597 % \begin{macrocode}
3598 \def\mdf@put@frame@i{%Box must be splitted
3599 \mdf@freepagevspace%gives \mdf@freevspace@length
3600 % minimum 2 lines for one page:
3601 \dimen@=\the\mdf@freevspace@length\relax%
3602 \dimen@i=\mdf@innertopmargin@length\relax%
3603 \mdf@dolist{\mdf@advancelength@add{\dimen@i}}%
3604 {innerlinewidth,middlelinewidth,outerlinewidth}%
3605 \advance\dimen@i by 2\baselineskip\relax%
3606 \ifdimless{\dimen@}{\dimen@i}%
3607 {\hrule \@height\z@ \@width\hsize%
3608 \vfill\eject%no room for two lines
3609 \def\mdf@reserved@a{\mdf@put@frame}%
3610 }%
3611 {%enough space for first part
3612 \mdf@dolist{\mdf@advancelength@sub{\dimen@}}{%calculate with \dimen@
3613 outerlinewidth,middlelinewidth,innerlinewidth,%width of top rule
3614 innertopmargin,splitbottomskip}%width of length
3615 \ifboolexpr{ bool {mdf@everyline} and bool {mdf@bottomline} }%
3616 {%need space for bottomline
3617 \mdf@dolist{\mdf@advancelength@sub{\dimen@}}%
3618 {innerlinewidth,middlelinewidth,outerlinewidth}%
3619 }{}%
3620 \ifbool{mdf@topline}{}%%no top line
3621 {%
3622 \mdf@dolist{\mdf@advancelength@add{\dimen@}}%
3623 {innerlinewidth,middlelinewidth,outerlinewidth}%
3624 }%
3625 \advance\[email protected]\pageshrink%
3626 \ifdimless{\ht\mdf@splitbox@one+\dp\mdf@splitbox@one}{\dimen@}%
3627 {\mdf@PackageWarning{You got a bad break\MessageBreak
3628 because the last box will be empty\MessageBreak
3629 you have to change it manually\MessageBreak
3630 by changing the text, the space\MessageBreak
3631 or something else}%
3632 \advance\dimen@ by -1.8\baselineskip\relax%needed????????????????????
3633 }{}%
3634 \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}%save original
3635 \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
3636 \mdf@ignorevbadness%
3637 \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@\relax%
3638 \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%
3639 \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
3640 \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}{\dimen@}%
3641 {%splitted wrong
3642 \mdf@PackageInfo{Box was splittet wrong^^J
3643 starting loop to iterate
3644 the splitting point\MessageBreak}%
3645 \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
3646 \dimen@i=\dimen@\relax%
3647 \@tempcnta=\z@\relax%
3648 \loop
3649 \ifdim\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax>\dimen@
3650 \advance\dimen@i by -\p@\relax%
3651 \advance\@tempcnta by \@ne\relax%
3652 %% \wlog{***mdframed \string\@tempcnta=\the\@tempcnta***}
3653 %% \wlog{***mdframed \string\dimen@i=\the\dimen@i***}
3654 \mdf@ignorevbadness%
3655 \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
3656 \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
3657 \mdf@ignorevbadness%
3658 \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@i\relax%
3659 \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%
3660 \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
3661 \ifnum\@tempcnta>100
3662 \let\iterate\relax%
3663 \mdf@PackageWarning{correct box splittet fails^^J
3664 It seems you are using a non splittable
3665 contents\MessageBreak}%
3666 \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
3667 \setbox\mdf@splitbox@two=\vbox{}%
3668 \def\mdf@reserved@a{\mdf@put@frame}%
3669 \fi
3670 \repeat%
3671 }{}%
3672 \ifvoid\mdf@splitbox@one\relax%
3673 \mdf@PackageWarning{You got a bad break because the splittet box
3674 is empty^^J
3675 You have to change the page settings^^J
3676 like enlargethispage or something else^^J
3677 the package increases do
3678 \enlargethispage{\baselineskip}\MessageBreak}%
3679 \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}
3680 \enlargethispage{\baselineskip}%
3681 \def\mdf@reserved@a{\mdf@put@frame}%
3682 \fi%
3683 % Test if first splitted frame doesn't have the original with.
3684 % occurs with math
3685 \ifdim\wd\mdf@splitbox@two=\wd\mdf@splitbox@one\relax
3686 \else%
3687 \mdf@PackageInfo{You first box width is to small^^J
3688 mdframed fixed it\MessageBreak}%
3689 \setbox\mdf@splitbox@two=\vbox%
3690 {%
3691 \hrule \@height\z@ \@width\mdfboundingboxwidth\relax%
3692 \unvcopy\mdf@splitbox@two%
3693 }%
3694 \fi%
3695 \ifvoid\mdf@splitbox@two\relax%
3696 {%
3697 \hrule \@height\f@size pt \@width\z@%
3698 \hrule \@height\z@ \@width\hsize}%
3699 \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
3700 \def\mdf@reserved@a{\mdf@put@frame%
3701 }%
3702 \else%
3703 \ifdimequal{\ht\mdf@splitbox@two}{0pt}%
3704 {%
3705 \hrule \@height\z@ \@width\hsize%
3706 \vfill\eject%
3707 \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
3708 \def\mdf@reserved@a{\mdf@put@frame}%
3709 }%
3710 {%
3711 \begingroup%
3712 \mdf@@setzref%
3713 \mdf@beforebreak%
3714 \booltrue{mdffirstframe}%
3715 \mdf@putbox@first%
3716 \mdf@afterbreak%
3717 \endgroup%
3718 \hrule \@height\z@ \@width\hsize%
3719 \vfill\eject%
3720 \def\mdf@reserved@a{\mdf@put@frame@ii}%
3721 }%
3722 \fi%
3723 }%
3724 \mdf@reserved@a%
3725 }
3726 % \end{macrocode}
3727 % \end{macro}
3728 %
3729 %
3730 % \begin{macro}{mdf@put@frame@ii}
3731 % Output of the middle and last box.
3732 % \begin{macrocode}
3733 \def\mdf@put@frame@ii{%
3734 \setlength{\mdf@freevspace@length}{\vsize}%
3735 \ifbool{mdf@repeatframetitle}%
3736 {%repeating title -- more robust using hooks.
3737 \toggletrue{mdf@notfirstframetitle}%
3738 \splitmaxdepth\z@ \splittopskip\z@%
3739 \setbox\mdf@splitbox@one=\vbox{\break\unvbox\mdf@splitbox@one}%
3740 \mdf@ignorevbadness%
3741 \setbox0=\vsplit\mdf@splitbox@one to \z@\relax%
3742 \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}%
3743 \setbox\mdf@splitbox@one\vbox%
3744 {%
3745 \parskip\z@\relax%
3746 \parindent\z@\relax%
3747 % \offinterlineskip\relax%
3748 \vskip\mdf@frametitleaboveskip@length%
3749 \unvcopy\mdf@frametitlebox\relax%
3750 \mdf@@frametitlerule\relax%
3751 \unvbox\mdf@splitbox@one\relax%
3752 }%
3753 \setbox\mdf@splitbox@one=\vbox{\unvbox\mdf@splitbox@one}%
3754 }{}%
3755 \setlength{\dimen@}{\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
3756 \mdf@dolist{\mdf@advancelength@add{\dimen@}}%
3757 {innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}%
3758 \ifboolexpr { bool {mdf@everyline} and bool {mdf@topline} }%
3759 {%
3760 \mdf@dolist{\mdf@advancelength@add{\dimen@}}%
3761 {innerlinewidth,middlelinewidth,outerlinewidth}%
3762 }{}%
3763 \notbool{mdf@bottomline}%remove bottom if neccessary
3764 {%
3765 \mdf@dolist{\mdf@advancelength@sub{\dimen@}}%
3766 {innerlinewidth,middlelinewidth,outerlinewidth}%
3767 }{}%
3768 % Test whether the complete height of the frame fits on the current page
3769 \ifdimgreater{\dimen@}{\mdf@freevspace@length}%
3770 {%have a middle box
3771 \advance\mdf@freevspace@length by -\mdf@splitbottomskip@length\relax%
3772 \ifbool{mdf@everyline}%regard top and bottom if everyline is used
3773 {%
3774 \ifbool{mdf@topline}%
3775 {%
3776 \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}%
3777 {innerlinewidth,middlelinewidth,outerlinewidth}%
3778 }{}%
3779 \ifbool{mdf@bottomline}%
3780 {%
3781 \mdf@dolist{\mdf@advancelength@sub{\mdf@freevspace@length}}%
3782 {innerlinewidth,middlelinewidth,outerlinewidth}%
3783 }{}%
3784 }{}%
3785 \setbox\mdf@splitbox@save=\vbox{\unvcopy\mdf@splitbox@one}%
3786 \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
3787 \mdf@ignorevbadness%
3788 \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \mdf@freevspace@length%
3789 \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%
3790 \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
3791 \ifdimgreater{\ht\mdf@splitbox@two+\dp\mdf@splitbox@two}%
3792 {\mdf@freevspace@length}%
3793 {%splitted wrong
3794 \mdf@PackageInfo{Box was splittet wrong^^J
3795 starting loop to iterate
3796 the splitting point\MessageBreak}%
3797 \dimen@i=\mdf@freevspace@length%\relax
3798 \@tempcnta=\z@\relax
3799 \loop
3800 \ifdim\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax>%
3801 \mdf@freevspace@length\relax
3802 \advance\dimen@i by -\p@\relax%
3803 \advance\@tempcnta by \@ne\relax%
3804 \ifnum\@tempcnta>100
3805 \let\iterate\relax%
3806 \mdf@PackageWarning{correct box splittet fails^^J
3807 It seems you are using a non splittable
3808 contents\MessageBreak}%
3809 \fi
3810 \mdf@ignorevbadness%
3811 \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
3812 \splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
3813 \mdf@ignorevbadness%
3814 \setbox\mdf@splitbox@two\vsplit\mdf@splitbox@one to \dimen@i\relax%
3815 \setbox\mdf@splitbox@two\vbox{\unvbox\mdf@splitbox@two}%
3816 \setbox\mdf@splitbox@one\vbox{\unvbox\mdf@splitbox@one}%
3817 \repeat%
3818 }{}%
3819 \ifvoid\mdf@splitbox@one\relax%
3820 \mdf@PackageWarning{You got a bad break because the splittet box is
3821 empty^^J
3822 You have to change the page settings^^J
3823 like enlargethispage or something else^^J
3824 the package increases do
3825 \enlargethispage{\baselineskip}\MessageBreak}%
3826 \setbox\mdf@splitbox@one=\vbox{\unvcopy\mdf@splitbox@save}%
3827 \enlargethispage{\baselineskip}%
3828 \def\mdf@reserved@a{\mdf@put@frame@ii}%
3829 \else
3830 \setbox\mdf@splitbox@two=\vbox%
3831 {%
3832 \hrule \@height\z@ \@width\mdfboundingboxwidth\relax%
3833 \unvcopy\mdf@splitbox@two%
3834 }%
3835 \begingroup%
3836 \mdf@@setzref%
3837 \booltrue{mdfmiddleframe}%
3838 \mdf@beforebreak%
3839 \mdf@putbox@middle%
3840 \mdf@afterbreak%
3841 \endgroup%
3842 \hrule \@height\z@ \@width\hsize%
3843 \vfill\eject%
3844 \def\mdf@reserved@a{\mdf@put@frame@ii}%
3845 \fi
3846 }%End middle box case
3847 {%start last box case
3848 \ifvoid\mdf@splitbox@one
3849 \mdf@PackageWarning{You got a bad break\MessageBreak
3850 because the last split box is empty\MessageBreak
3851 You have to change the settings}%%
3852 \setbox\mdf@splitbox@one=\vbox%
3853 {%
3854 \unvbox\mdf@splitbox@one%
3855 \hrule \@height\z@ \@width\mdfboundingboxwidth
3856 }%
3857 \fi%
3858 \ifdimless{\ht\mdf@splitbox@one}{1sp}%
3859 {%
3860 \mdf@PackageWarning{You got a bad break\MessageBreak
3861 because the last split box is empty\MessageBreak
3862 You have to change the settings}%
3863
3864 \let\mdf@reserved@a\relax%
3865 \setbox\mdf@splitbox@one=\vbox%
3866 {%
3867 \unvbox\mdf@splitbox@one%
3868 \hrule \@height\z@ \@width\mdfboundingboxwidth
3869 }%
3870 }{}%
3871 \begingroup%
3872 \toggletrue{mdflastframe}%
3873 \mdf@beforebreak%
3874 \begingroup%
3875 \mdf@@setzref%
3876 \booltrue{mdflastframe}%
3877 \mdf@beforelastframe%
3878 \mdf@putbox@second%
3879 \mdf@afterlastframe%
3880 \endgroup%
3881 \hrule \@height\z@ \@width\hsize%
3882 \mdf@afterbreak%
3883 \endgroup%
3884 \let\mdf@reserved@a\relax%
3885 }%
3886 \mdf@reserved@a%
3887 }
3888
3889 % \end{macrocode}
3890 % \end{macro}
3891 %
3892 %
3893 %
3894 % \begin{macro}{mdfsubtitle}
3895 %
3896 % \begin{macrocode}
3897 \newrobustcmd\mdfsubtitle[2][]%
3898 {%
3899 \begingroup
3900 \penalty-9995%set a breakpoint before the subtitle
3901 \parindent\z@\relax%
3902 \parskip\z@\relax%
3903 \mdfsetup{#1}%only for subtitle options
3904 \par\addvspace{\mdf@subtitleaboveskip@length}%
3905 \setbox\z@=\vbox{%
3906 \mdf@frametitlealignment%
3907 \mdf@subtitlefont{#2}%
3908 \mdf@@ignorelastdescenders%
3909 \relax}%
3910 \setbox\z@=\vbox{\unvbox\z@}%
3911 \setbox\z@=\vbox{%
3912 \parskip\z@\relax%
3913 \parindent\z@\relax%
3914 \offinterlineskip\relax%
3915 \vbox to \mdf@subtitleinneraboveskip@length{}%
3916 \unvbox\z@\relax%
3917 \vbox to \mdf@subtitleinnerbelowskip@length{}%
3918 }%\z@ contains the subtitle+required length
3919 \setlength{\mdfsubtitleheight}{\dimexpr\ht\z@+\dp\z@\relax}
3920 \setbox\z@=\vbox to \mdfsubtitleheight {\unvbox\z@}%
3921 % \dimen@ is now the complete width
3922 \mdf@templength=\linewidth\relax%
3923 \mdf@dolist{\mdf@advancelength@add{\mdf@templength}}%
3924 {innerleftmargin,innerrightmargin}%
3925 \offinterlineskip\relax%
3926 \ifbool{mdf@subtitleaboveline}{\mdf@drawsubtitleaboveline\par}{}%
3927 \mdf@drawsubtitlebackground%
3928 \box\z@%
3929 \ifbool{mdf@subtitlebelowline}{\mdf@drawsubtitlebelowline}{}%
3930 \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%
3931 \penalty 9995%
3932 \addvspace{\mdf@subtitlebelowskip@length}%
3933 \endgroup%
3934 \@afterheading%
3935 }
3936
3937 \newrobustcmd\mdfsubsubtitle[2][]%
3938 {%
3939 \begingroup
3940 \penalty-9995%set a breakpoint before the subtitle
3941 \parindent\z@\relax%
3942 \parskip\z@\relax%
3943 \mdfsetup{#1}%only for subtitle options
3944 \par\addvspace{\mdf@subsubtitleaboveskip@length}%
3945 \setbox\z@=\vbox{%
3946 \mdf@frametitlealignment%
3947 \mdf@subsubtitlefont{#2}%
3948 \mdf@@ignorelastdescenders%
3949 \relax}%
3950 \setbox\z@=\vbox{\unvbox\z@}%
3951 \setbox\z@=\vbox{%
3952 \parskip\z@\relax%
3953 \parindent\z@\relax%
3954 \offinterlineskip\relax%
3955 \vbox to \mdf@subsubtitleinneraboveskip@length{}%
3956 \unvbox\z@\relax%
3957 \vbox to \mdf@subsubtitleinnerbelowskip@length{}%
3958 }%\z@ contains the subtitle+required length
3959 \setlength{\mdfsubsubtitleheight}{\dimexpr\ht\z@+\dp\z@\relax}
3960 \setbox\z@=\vbox to \mdfsubsubtitleheight {\unvbox\z@}%
3961 % \dimen@ is now the complete width
3962 \mdf@templength=\linewidth\relax%
3963 \mdf@dolist{\mdf@advancelength@add{\mdf@templength}}%
3964 {innerleftmargin,innerrightmargin}%
3965 \offinterlineskip\relax%
3966 \ifbool{mdf@subsubtitleaboveline}{\mdf@drawsubtitleaboveline\par}{}%
3967 \mdf@drawsubtitlebackground%
3968 \box\z@%
3969 \ifbool{mdf@subsubtitlebelowline}{\mdf@drawsubtitlebelowline}{}%
3970 \par\unskip\ifvmode\nointerlineskip\hrule \@height\z@ \@width\hsize\fi%
3971 \penalty 9995%
3972 \addvspace{\mdf@subsubtitlebelowskip@length}%
3973 \endgroup%
3974 \@afterheading%
3975 }
3976 % \end{macrocode}
3977 % \end{macro}
3978 %
3979 % \begin{macro}{mdf@test@ltrb,mdf@test@ltr,mdf@test@ltb,mdf@test@trb,^^A
3980 % mdf@test@lrb,mdf@test@lb,mdf@test@rb,^^A
3981 % mdf@test@tr,mdf@test@lt,mdf@test@lr,mdf@test@tb,mdf@test@l,^^A
3982 % mdf@test@r,mdf@test@t,mdf@test@b,mdf@test@noline}
3983 % Short forms of checking the option which lines should be drawn.
3984 % \begin{macrocode}
3985 %%%% _____t_____
3986 %%%% | |
3987 %%%% | |
3988 %%%% | |
3989 %%%% l| |r
3990 %%%% | |
3991 %%%% | |
3992 %%%% |___________|
3993 %%%% b
3994 %all lines
3995 \newrobustcmd*\mdf@test@ltrb{%
3996 \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
3997 and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
3998 %three lines
3999 \newrobustcmd*\mdf@test@ltr{%
4000 \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
4001 and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
4002 \newrobustcmd*\mdf@test@ltb{%
4003 \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
4004 and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
4005 \newrobustcmd*\mdf@test@trb{%
4006 \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
4007 and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
4008 \newrobustcmd*\mdf@test@lrb{%
4009 \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
4010 and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
4011 %two lines
4012 \newrobustcmd*\mdf@test@lb{%
4013 \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
4014 and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
4015 \newrobustcmd*\mdf@test@rb{%
4016 \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
4017 and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
4018 \newrobustcmd*\mdf@test@tr{%
4019 \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
4020 and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
4021 \newrobustcmd*\mdf@test@lt{%
4022 \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
4023 and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
4024 \newrobustcmd*\mdf@test@lr{%
4025 \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
4026 and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
4027 \newrobustcmd*\mdf@test@tb{%
4028 \ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
4029 and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
4030 %single lines
4031 \newrobustcmd*\mdf@test@l{%
4032 \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
4033 and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
4034 \newrobustcmd*\mdf@test@r{%
4035 \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
4036 and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
4037 \newrobustcmd*\mdf@test@t{%
4038 \ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
4039 and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
4040 \newrobustcmd*\mdf@test@b{%
4041 \ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
4042 and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
4043 %no lines
4044 \newrobustcmd*\mdf@test@noline{%
4045 \ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
4046 and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
4047 \newrobustcmd*\mdf@test@single{%
4048 \ifboolexpr{ not (test {\mdf@test@ltrb} or test {\mdf@test@ltr} or
4049 test {\mdf@test@ltb} or test {\mdf@test@trb} or
4050 test {\mdf@test@lrb} or test {\mdf@test@lb} or
4051 test {\mdf@test@rb} or test {\mdf@test@tr} or
4052 test {\mdf@test@lt} ) }}
4053 %
4054 % \end{macrocode}
4055 % \end{macro}
4056 %
4057 %
4058 %
4059 % \begin{macrocode}
4060 % % %\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{framemethod}%
4061 \DisableKeyvalOption[action=warning,package=mdframed]{mdf}{xcolor}%
4062
4063 \endinput
4064 % \end{macrocode}
4065 %
4066 %\iffalse
4067 % \begin{macrocode}
4068 %</package>
4069 % \end{macrocode}
4070 %\fi
4071 %
4072 %\iffalse
4073 % \begin{macrocode}
4074 %<*mdframedefault>
4075 % \end{macrocode}
4076 %\fi
4077 % \subsection{The Explanation of md-frame-0.mdf}
4078 % \begin{macrocode}
4079 %% Style file for mdframed for package option `framemethod=default`
4080 %%
4081 %% This package may be distributed under the terms of the LaTeX Project
4082 %% Public License, as described in lppl.txt in the base LaTeX distribution.
4083 %% Either version 1.0 or, at your option, any later version.
4084 %%
4085 % \end{macrocode}
4086 %
4087 % \begin{macro}{mdframedOpackagename}
4088 % local settings
4089 % \begin{macrocode}
4090 \def\mdframedOpackagename{md-frame-0}
4091 \ProvidesFile{md-frame-0.mdf}%
4092 [\mdfmaindate\ %
4093 \mdversion: \mdframedOpackagename]
4094 % \end{macrocode}
4095 % \end{macro}
4096 %
4097 %
4098 % \begin{macro}{mdf@background@default,mdf@linecolor@default,^^A
4099 % mdf@linecolor@bottom}
4100 % short command
4101 % \begin{macrocode}
4102 \def\mdf@background@default{\color{\mdf@backgroundcolor}}
4103 \def\mdf@frametitlebackground@default{\color{\mdf@frametitlebackgroundcolor}}
4104 \def\mdf@shadow@default{\color{\mdf@shadowcolor}}
4105 \def\mdf@innerlinecolor@default{\color{\mdf@innerlinecolor}}
4106 \def\mdf@middlelinecolor@default{\color{\mdf@middlelinecolor}}
4107 \def\mdf@outerlinecolor@default{\color{\mdf@outerlinecolor}}
4108 \def\mdf@frametitlerulecolor@default{\color{\mdf@frametitlerulecolor}}
4109 \let\mdf@linecolor@default\mdf@middlelinecolor@default
4110 \def\mdf@@frametitlerule{%
4111 \ifbool{mdf@frametitlerule}{%
4112 \vbox{\hsize\mdfframetitleboxwidth%
4113 \par\unskip\vskip\mdf@frametitlebelowskip@length%
4114 \rlap{\noindent\hspace*{-\mdf@innerleftmargin@length}%
4115 \mdf@frametitlerulecolor@default%
4116 \rule{\dimexpr\mdfframetitleboxwidth%
4117 +\mdf@innerleftmargin@length
4118 +\mdf@innerrightmargin@length\relax
4119 }{\mdf@frametitlerulewidth@length}%
4120 }\hrule \@height\z@ \@width\hsize}%
4121 }{%
4122 \vbox{\hsize\mdfframetitleboxwidth%
4123 \par\unskip\vskip\mdf@frametitlebelowskip@length%
4124 \rlap{\noindent\hspace*{-\mdf@innerleftmargin@length}%
4125 \mdf@frametitlerulecolor@default%
4126 \rule{\dimexpr\mdfframetitleboxwidth%
4127 +\mdf@innerleftmargin@length
4128 +\mdf@innerrightmargin@length\relax
4129 }{\z@}%
4130 }\hrule \@height\z@ \@width\hsize}%
4131 }%
4132 \iftoggle{mdf@notfirstframetitle}%
4133 {%
4134 \par\unskip\vskip\mdf@splittopskip@length%
4135 }%
4136 {%
4137 \par\unskip\vskip\mdf@innertopmargin@length%
4138 }%
4139 }%
4140
4141 % \end{macrocode}
4142 % \end{macro}
4143 %
4144 %
4145 %
4146 % \begin{macro}{mdf@drawsubtitleaboveline,mdf@drawsubtitlebelowline,^^A
4147 % mdf@drawsubtitlebackground}
4148 %
4149 % \begin{macrocode}
4150 %default:
4151 \def\mdf@drawsubtitleaboveline{%
4152 \rlap{%
4153 \hspace*{-\mdf@innerleftmargin@length}%
4154 \color{\mdf@subtitleabovelinecolor}%
4155 \rule{\mdf@templength}{\mdf@subtitleabovelinewidth@length}%
4156 }%
4157 }
4158 \def\mdf@drawsubtitlebelowline{%
4159 \rlap{%
4160 \hspace*{-\mdf@innerleftmargin@length}%
4161 \color{\mdf@subtitlebelowlinecolor}%
4162 \rule{\mdf@templength}{\mdf@subtitlebelowlinewidth@length}%
4163 }%
4164 }
4165 \def\mdf@drawsubtitlebackground{%
4166 \rlap{\smash{%
4167 \hspace*{-\mdf@innerleftmargin@length}%
4168 \color{\mdf@subtitlebackgroundcolor}%
4169 \rule[-\mdfsubtitleheight]{\mdf@templength}{\mdfsubtitleheight}%
4170 }}%
4171 }
4172 % \end{macrocode}
4173 % \end{macro}
4174 %
4175 %
4176 % \begin{macro}{mdf@putbox@single,mdf@frame@background@single,^^A
4177 % mdf@frame@topandbottomline@single,mdf@frame@leftline@single,^^A
4178 % mdf@frame@rightline@single,mdf@frame@rightline@single}
4179 % The frame of of a non splitted contents of mdframed
4180 % \begin{macrocode}
4181 \def\mdf@frame@background@single{%
4182 \ifbool{mdf@shadow}%
4183 {%
4184 \rlap%
4185 {%
4186 \smash%
4187 {%
4188 \mdf@shadow@default%
4189 \rule[\dimexpr
4190 -\mdfboundingboxdepth
4191 -\mdf@shadowsize@length
4192 \ifbool{mdf@bottomline}{-\mdf@middlelinewidth@length}{}
4193 \relax]%
4194 {\dimexpr
4195 \mdfboundingboxtotalwidth
4196 +\mdf@shadowsize@length
4197 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}
4198 \relax}%
4199 {\dimexpr
4200 \mdfboundingboxtotalheight
4201 +\mdf@shadowsize@length
4202 \ifbool{mdf@bottomline}{+\mdf@middlelinewidth@length}{}
4203 \relax}%
4204 }%
4205 }%
4206 }{}%
4207 \rlap%
4208 {%
4209 \mdf@background@default%
4210 \rule[-\mdfboundingboxdepth]%
4211 {\mdfboundingboxtotalwidth}%
4212 {\mdfboundingboxtotalheight}%
4213 }%
4214 }%
4215 \def\mdf@frame@frametitlebackground@single{%
4216 \rlap%
4217 {%
4218 \mdf@frametitlebackground@default%
4219 \rule[\dimexpr
4220 -\mdfboundingboxdepth
4221 +\mdfboundingboxtotalheight
4222 -\mdfframetitleboxtotalheight
4223 \relax]%
4224 {\mdfboundingboxtotalwidth}%
4225 {\mdfframetitleboxtotalheight}%
4226 }%
4227 }%
4228 \def\mdf@frame@topline@single{%
4229 \rlap%
4230 {%
4231 \mdf@linecolor@default%
4232 \ifbool{mdf@topline}%
4233 {%
4234 \rule[\dimexpr
4235 \mdfboundingboxheight
4236 -\mdfboundingboxdepth%
4237 +\mdf@innerbottommargin@length
4238 +\mdf@innertopmargin@length
4239 \relax]%
4240 {\mdfboundingboxtotalwidth}%
4241 {\mdf@middlelinewidth@length}%
4242 }{}%
4243 }%
4244 }%
4245 \def\mdf@frame@bottomline@single{%
4246 \rlap%
4247 {%
4248 \ifbool{mdf@leftline}%
4249 {%
4250 \hspace*{-\mdf@middlelinewidth@length}%
4251 }{}%
4252 \mdf@linecolor@default%
4253 \ifbool{mdf@bottomline}%
4254 {%
4255 \rule[\dimexpr
4256 -\mdfboundingboxdepth
4257 -\mdf@middlelinewidth@length
4258 \relax]%
4259 {\dimexpr
4260 \mdfboundingboxtotalwidth
4261 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}%
4262 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}%
4263 \relax}%
4264 {\mdf@middlelinewidth@length}%
4265 }{}%
4266 }%
4267 }%
4268 \def\mdf@frame@leftline@single{%
4269 \llap%
4270 {%
4271 \mdf@linecolor@default%
4272 \rule[-\mdfboundingboxdepth]%
4273 {\mdf@middlelinewidth@length}%
4274 {\dimexpr
4275 \mdfboundingboxtotalheight%
4276 \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{}%
4277 \relax}%
4278 }%
4279 }%
4280 \def\mdf@frame@rightline@single{%
4281 \rlap%
4282 {%
4283 \mdf@linecolor@default%
4284 \hspace*{\mdfboundingboxwidth}%
4285 \hspace*{\mdf@innerrightmargin@length}%
4286 \rule[\dimexpr
4287 -\mdfboundingboxdepth%
4288 \relax]%
4289 {\mdf@middlelinewidth@length}%
4290 {\dimexpr
4291 \mdfboundingboxtotalheight%
4292 \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{}%
4293 \relax}%
4294 }%
4295 }%
4296 \def\mdf@putbox@single{%
4297 \ifvoid\mdf@splitbox@one\relax
4298 \else%
4299 \mdf@makebox@out%
4300 {%
4301 \mdf@makeboxalign@left%
4302 \setlength{\mdfboundingboxwidth}%
4303 {\wd\mdf@splitbox@one}%
4304 \setlength{\mdfboundingboxtotalwidth}%
4305 {\dimexpr
4306 \mdfboundingboxwidth
4307 +\mdf@innerleftmargin@length%
4308 +\mdf@innerrightmargin@length
4309 \relax}%
4310 \setlength{\mdfboundingboxheight}%
4311 {\dimexpr
4312 \ht\mdf@splitbox@one
4313 +\dp\mdf@splitbox@one
4314 \relax}%
4315 \setlength{\mdfboundingboxdepth}%
4316 {\dimexpr
4317 \dp\mdf@splitbox@one
4318 +\mdf@innerbottommargin@length
4319 \relax}%
4320 \setlength{\mdfboundingboxtotalheight}%
4321 {\dimexpr
4322 \mdfboundingboxheight
4323 +\mdf@innertopmargin@length%
4324 +\mdf@innerbottommargin@length
4325 \relax}%
4326 \setlength{\mdftotallinewidth}%
4327 {\dimexpr
4328 \mdf@innerlinewidth@length
4329 +\mdf@middlelinewidth@length%
4330 +\mdf@outerlinewidth@length
4331 \relax}%
4332 \noindent%
4333 \setlength{\@tempdima}%
4334 {\dimexpr
4335 \mdfboundingboxtotalwidth%
4336 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}%
4337 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}
4338 \relax}%
4339 \mdf@makebox@in[\@tempdima]%
4340 {%
4341 \null%
4342 \ifbool{mdf@leftline}%
4343 {%
4344 \hspace*{\mdftotallinewidth}%
4345 \mdf@frame@leftline@single%
4346 }{}%
4347 \mdf@frame@topline@single%
4348 \mdf@frame@background@single%
4349 \mdf@frame@bottomline@single%
4350 \ifdefempty{\mdf@frametitle}{}{\mdf@frame@frametitlebackground@single}%
4351 \hspace*{\mdf@innerleftmargin@length}%
4352 \ifbool{mdf@rightline}%
4353 {%
4354 \mdf@frame@rightline@single%
4355 }{}%
4356 {\box\mdf@splitbox@one}%
4357 }%
4358 \mdf@extra%
4359 \mdf@singleextra
4360 \mdf@makeboxalign@right%
4361 }%
4362 \fi%
4363 }
4364 % \end{macrocode}
4365 % \end{macro}
4366 %
4367 %
4368 % \begin{macro}{mdf@putbox@first,mdf@frame@background@first,^^A
4369 % mdf@frame@leftline@first,mdf@frame@topline@first,^^A
4370 % mdf@frame@rightline@first}
4371 % The first frame of of a splitted contents of mdframed
4372 % \begin{macrocode}
4373 \def\mdf@frame@background@first{%
4374 \ifbool{mdf@shadow}%
4375 {%
4376 \rlap%
4377 {%
4378 \smash%
4379 {%
4380 \mdf@shadow@default%
4381 \rule[\dimexpr
4382 -\mdfboundingboxdepth
4383 -\mdf@shadowsize@length
4384 \relax]%
4385 {\dimexpr
4386 \mdfboundingboxtotalwidth
4387 +\mdf@shadowsize@length
4388 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}
4389 \relax}%
4390 {\dimexpr
4391 \mdfboundingboxtotalheight
4392 +\mdf@shadowsize@length
4393 \relax}%
4394 }%
4395 }%
4396 }{}%
4397 \rlap%
4398 {%
4399 \mdf@background@default%
4400 \rule[-\mdfboundingboxdepth]%
4401 {\mdfboundingboxtotalwidth}%
4402 {\mdfboundingboxtotalheight}%
4403 }%
4404 }%
4405 \def\mdf@frame@frametitlebackground@first{%
4406 \ifbool{mdf@repeatframetitle}%
4407 {%repeating title = true
4408 \rlap%
4409 {%
4410 \mdf@frametitlebackground@default%
4411 \rule[\dimexpr
4412 -\mdfboundingboxdepth
4413 +\mdfboundingboxtotalheight
4414 -\mdfframetitleboxtotalheight
4415 \relax]%
4416 {\mdfboundingboxtotalwidth}%
4417 {\mdfframetitleboxtotalheight}%
4418 }%
4419 }%
4420 {%repeating title = false -- maybe splitted
4421 \ifdimless{\mdfframetitleboxtotalheight}{\mdfboundingboxtotalheight}%
4422 {%
4423 \rlap%
4424 {%
4425 \mdf@frametitlebackground@default%
4426 \rule[\dimexpr
4427 -\mdfboundingboxdepth
4428 +\mdfboundingboxtotalheight
4429 -\mdfframetitleboxtotalheight
4430 \relax]%
4431 {\mdfboundingboxtotalwidth}%
4432 {\mdfframetitleboxtotalheight}%
4433 }%
4434 \global\mdfframetitleboxtotalheight=-\p@\relax%
4435 }%
4436 {%
4437 \mdf@PackageWarning{You got a page break inside the title\MessageBreak
4438 Current this isn't well supported}%
4439 \rlap%
4440 {%
4441 \mdf@frametitlebackground@default%
4442 \rule[-\mdfboundingboxdepth]%
4443 {\mdfboundingboxtotalwidth}%
4444 {\mdfboundingboxtotalheight}%
4445 }%
4446 \global\mdfframetitleboxtotalheight=%
4447 \dimexpr%
4448 \mdfframetitleboxtotalheight
4449 -\mdfboundingboxheight
4450 +\mdf@frametitlebelowskip@length
4451 +.5\baselineskip-1pt
4452 % +\dp\strutbox
4453 \relax%
4454 }%
4455 }%
4456 }%
4457 \def\mdf@frame@leftline@first{%
4458 \llap%
4459 {%
4460 \mdf@linecolor@default%
4461 \rule[-\mdfboundingboxdepth]%
4462 {\mdf@middlelinewidth@length}%
4463 {\dimexpr
4464 \mdfboundingboxtotalheight%
4465 \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{}
4466 \relax}%
4467 }%
4468 }%
4469 \def\mdf@frame@topline@first{%
4470 \rlap%
4471 {%
4472 \mdf@linecolor@default%
4473 \rule[\dimexpr
4474 \mdfboundingboxheight
4475 -\mdfboundingboxdepth
4476 +\mdf@splitbottomskip@length
4477 +\mdf@innertopmargin@length
4478 \relax]%
4479 {\mdfboundingboxtotalwidth}%
4480 {\mdf@middlelinewidth@length}%
4481 }%
4482 }
4483 \def\mdf@frame@rightline@first{%
4484 \rlap%
4485 {%
4486 \mdf@linecolor@default%
4487 \hspace*{\mdfboundingboxwidth}%
4488 \hspace*{\mdf@innerrightmargin@length}%
4489 \rule[-\mdfboundingboxdepth]%
4490 {\mdf@middlelinewidth@length}%
4491 {\dimexpr
4492 \mdfboundingboxtotalheight%
4493 \ifbool{mdf@topline}{+\mdf@middlelinewidth@length}{}
4494 \relax}%
4495 }%
4496 }%
4497 \def\mdf@frame@bottomline@first{%
4498 \rlap%
4499 {%
4500 \ifbool{mdf@leftline}%
4501 {%
4502 \hspace*{-\mdf@middlelinewidth@length}%
4503 }{}%
4504 \mdf@linecolor@default%
4505 \ifbool{mdf@bottomline}%
4506 {%
4507 \rule[\dimexpr
4508 -\mdfboundingboxdepth
4509 -\mdf@middlelinewidth@length
4510 \relax]%
4511 {\dimexpr
4512 \mdfboundingboxtotalwidth
4513 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}%
4514 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}
4515 \relax}%
4516 {\mdf@middlelinewidth@length}%
4517 }{}%
4518 }%
4519 }%
4520 \def\mdf@putbox@first{%
4521 \ifvoid\mdf@splitbox@two\relax
4522 \else%
4523 \mdf@makebox@out[\linewidth]%
4524 {%
4525 \mdf@makeboxalign@left%
4526 \setlength{\mdfboundingboxwidth}
4527 {\wd\mdf@splitbox@two}%
4528 \setlength{\mdfboundingboxtotalwidth}%
4529 {\dimexpr
4530 \mdfboundingboxwidth
4531 +\mdf@innerleftmargin@length%
4532 +\mdf@innerrightmargin@length
4533 \relax}%
4534 \setlength{\mdfboundingboxheight}
4535 {\dimexpr
4536 \ht\mdf@splitbox@two
4537 +\dp\mdf@splitbox@two
4538 \relax}%
4539 \setlength{\mdfboundingboxdepth}%
4540 {\dimexpr
4541 \dp\mdf@splitbox@two
4542 +\mdf@splitbottomskip@length
4543 \relax}%
4544 \setlength{\mdfboundingboxtotalheight}%
4545 {\dimexpr
4546 \mdfboundingboxheight
4547 +\mdf@innertopmargin@length%
4548 +\mdf@splitbottomskip@length
4549 \relax}%
4550 \setlength{\@tempdima}%
4551 {\dimexpr
4552 \mdfboundingboxtotalwidth%
4553 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}%
4554 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}%
4555 \relax}%
4556 \mdf@makebox@in[\@tempdima]%
4557 {%
4558 \null%
4559 \ifbool{mdf@leftline}%
4560 {%
4561 \hspace*{\mdf@middlelinewidth@length}%
4562 \mdf@frame@leftline@first%
4563 }{}%
4564 \ifbool{mdf@everyline}%
4565 {%
4566 \mdf@frame@bottomline@first%
4567 }{}%
4568 \ifbool{mdf@topline}%
4569 {%
4570 \mdf@frame@topline@first%
4571 }{}%
4572 \mdf@frame@background@first%
4573 \ifdefempty{\mdf@frametitle}{}{\mdf@frame@frametitlebackground@first}%
4574 \hspace*{\mdf@innerleftmargin@length}%
4575 \ifbool{mdf@rightline}%
4576 {%
4577 \mdf@frame@rightline@first%
4578 }{}%
4579 {\box\mdf@splitbox@two}%
4580 }%
4581 \mdf@extra%
4582 \mdf@firstextra%
4583 \mdf@makeboxalign@right%
4584 }%
4585 \fi%
4586 }
4587 % \end{macrocode}
4588 % \end{macro}
4589 %
4590 %
4591 % \begin{macro}{mdf@putbox@second,mdf@frame@background@second,^^A
4592 % mdf@frame@leftline@second,mdf@frame@bottomline@second,^^A
4593 % mdf@frame@rightline@second}
4594 % The last frame of of a splitted contents of mdframed
4595 % \begin{macrocode}
4596 \def\mdf@frame@background@second{%
4597 \ifbool{mdf@shadow}%
4598 {%
4599 \rlap%
4600 {%
4601 \smash%
4602 {%
4603 \mdf@shadow@default%
4604 \rule[\dimexpr
4605 -\mdfboundingboxdepth
4606 -\mdf@shadowsize@length
4607 \ifbool{mdf@bottomline}{-\mdf@middlelinewidth@length}{}
4608 \relax]%
4609 {\dimexpr
4610 \mdfboundingboxtotalwidth
4611 +\mdf@shadowsize@length
4612 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}
4613 \relax}%
4614 {\dimexpr
4615 \mdfboundingboxtotalheight
4616 +\mdf@shadowsize@length
4617 \relax}%
4618 }%
4619 }%
4620 }{}%
4621 \rlap%
4622 {%
4623 \mdf@background@default%
4624 \rule[-\mdfboundingboxdepth]%
4625 {\mdfboundingboxtotalwidth}%
4626 {\mdfboundingboxtotalheight}%
4627 }%
4628 }%
4629 \def\mdf@frame@frametitlebackground@second{%
4630 \ifbool{mdf@repeatframetitle}%
4631 {%repeating title = true
4632 \rlap%
4633 {%
4634 \mdf@frametitlebackground@default%
4635 \rule[\dimexpr
4636 -\mdfboundingboxdepth
4637 +\mdfboundingboxtotalheight
4638 -\mdfframetitleboxtotalheight
4639 \relax]%
4640 {\mdfboundingboxtotalwidth}%
4641 {\mdfframetitleboxtotalheight}%
4642 }%
4643 }%
4644 {%repeating title = false -- maybe splitted
4645 \ifdimless{\mdfframetitleboxtotalheight}{\z@}%
4646 {}%
4647 {%
4648 \rlap%
4649 {%
4650 \mdf@frametitlebackground@default%
4651 \rule[\dimexpr
4652 -\mdfboundingboxdepth
4653 +\mdfboundingboxtotalheight
4654 -\mdfframetitleboxtotalheight
4655 \relax]%
4656 {\mdfboundingboxtotalwidth}%
4657 {\mdfframetitleboxtotalheight}%
4658 }%
4659 }%
4660 }%
4661 }%
4662 \def\mdf@frame@leftline@second{%
4663 \llap%
4664 {%
4665 \mdf@linecolor@default%
4666 \rule[-\mdfboundingboxdepth]%
4667 {\mdf@middlelinewidth@length}%
4668 {\dimexpr\mdfboundingboxtotalheight}%
4669 }%
4670 }%
4671 \def\mdf@frame@bottomline@second{%
4672 \rlap%
4673 {%
4674 \ifbool{mdf@leftline}%
4675 {%
4676 \hspace*{-\mdf@middlelinewidth@length}%
4677 }{}%
4678 \mdf@linecolor@default%
4679 \rule[\dimexpr
4680 -\mdfboundingboxdepth
4681 -\mdf@middlelinewidth@length
4682 \relax]%
4683 {\dimexpr
4684 \mdfboundingboxtotalwidth
4685 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}
4686 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}
4687 \relax}%
4688 {\mdf@middlelinewidth@length}%
4689 }%
4690 }%
4691 \def\mdf@frame@rightline@second{%
4692 \rlap%
4693 {%
4694 \mdf@linecolor@default\hspace*{\mdfboundingboxwidth}%
4695 \hspace*{\mdf@innerrightmargin@length}%
4696 \rule[-\mdfboundingboxdepth]%
4697 {\mdf@middlelinewidth@length}%
4698 {\mdfboundingboxtotalheight}%
4699 }%
4700 }%
4701 \def\mdf@frame@topline@second{%
4702 \rlap%
4703 {%
4704 \ifbool{mdf@leftline}%
4705 {%
4706 \hspace*{-\mdf@middlelinewidth@length}%
4707 }{}%
4708 \mdf@linecolor@default%
4709 \ifbool{mdf@topline}%
4710 {%
4711 \rule[\dimexpr
4712 \mdfboundingboxheight
4713 -\mdfboundingboxdepth%
4714 +\mdf@innerbottommargin@length
4715 \relax]%
4716 {\dimexpr
4717 \mdfboundingboxtotalwidth
4718 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}%
4719 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}
4720 \relax}%
4721 {\mdf@middlelinewidth@length}%
4722 }{}%
4723 }%
4724 }%
4725
4726 \def\mdf@putbox@second{%
4727 \ifvoid\mdf@splitbox@one\relax%
4728 \else
4729 \mdf@makebox@out%
4730 {%
4731 \mdf@makeboxalign@left%
4732 \setlength{\mdfboundingboxwidth}%
4733 {\wd\mdf@splitbox@one}%
4734 \setlength{\mdfboundingboxtotalwidth}%
4735 {\dimexpr
4736 \mdfboundingboxwidth
4737 +\mdf@innerleftmargin@length%
4738 +\mdf@innerrightmargin@length
4739 \relax}%
4740 \setlength{\mdfboundingboxheight}%
4741 {\dimexpr
4742 \ht\mdf@splitbox@one
4743 +\dp\mdf@splitbox@one
4744 \relax}%
4745 \setlength{\mdfboundingboxdepth}%
4746 {\dimexpr
4747 \dp\mdf@splitbox@one
4748 +\mdf@innerbottommargin@length
4749 \relax}%
4750 \setlength{\mdfboundingboxtotalheight}%
4751 {\dimexpr
4752 \mdfboundingboxheight
4753 +\mdf@innerbottommargin@length
4754 \relax}%
4755 \setlength{\@tempdima}%
4756 {\dimexpr
4757 \mdfboundingboxtotalwidth%
4758 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}%
4759 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}%
4760 \relax}%
4761 \mdf@makebox@in[\@tempdima]%
4762 {%
4763 \null%
4764 \ifbool{mdf@leftline}%
4765 {%
4766 \hspace*{\mdf@middlelinewidth@length}%
4767 \mdf@frame@leftline@second%
4768 }{}%
4769 \ifbool{mdf@everyline}%
4770 {%
4771 \mdf@frame@topline@second
4772 }{}%
4773 \mdf@frame@background@second%
4774 \ifbool{mdf@bottomline}%
4775 {%
4776 \mdf@frame@bottomline@second%
4777 }{}%
4778 \ifdefempty{\mdf@frametitle}{}{\mdf@frame@frametitlebackground@second}%
4779 \hspace*{\mdf@innerleftmargin@length}%
4780 \ifbool{mdf@rightline}%
4781 {%
4782 \mdf@frame@rightline@second%
4783 }{}%
4784 {\box\mdf@splitbox@one}%
4785 }%
4786 \mdf@extra%
4787 \mdf@secondextra%
4788 \mdf@makeboxalign@right%
4789 }%
4790 \fi%
4791 }%
4792 % \end{macrocode}
4793 % \end{macro}
4794 %
4795 %
4796 % \begin{macro}{mdf@putbox@middle,mdf@frame@background@middle,^^A
4797 % mdf@frame@leftline@middle,mdf@frame@rightline@middle}
4798 % The last frame of of a splitted contents of mdframed
4799 % \begin{macrocode}
4800 \def\mdf@frame@leftline@middle{%
4801 \llap%
4802 {%
4803 \mdf@linecolor@default%
4804 \rule[-\mdfboundingboxdepth]%
4805 {\mdf@middlelinewidth@length}%
4806 {\mdfboundingboxtotalheight}%
4807 }%
4808 }%
4809 \def\mdf@frame@background@middle{%
4810 \ifbool{mdf@shadow}%
4811 {%
4812 \rlap%
4813 {%
4814 \smash%
4815 {%
4816 \mdf@shadow@default%
4817 \rule[\dimexpr
4818 -\mdfboundingboxdepth
4819 -\mdf@shadowsize@length
4820 \relax]%
4821 {\dimexpr
4822 \mdfboundingboxtotalwidth
4823 +\mdf@shadowsize@length
4824 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}
4825 \relax}%
4826 {\mdfboundingboxtotalheight}%
4827 }%
4828 }%
4829 }{}%
4830 \rlap%
4831 {%
4832 \mdf@background@default%
4833 \rule[-\mdfboundingboxdepth]%
4834 {\mdfboundingboxtotalwidth}%
4835 {\mdfboundingboxtotalheight}%
4836 }%
4837 }%
4838 \def\mdf@frame@frametitlebackground@middle{%
4839 \ifbool{mdf@repeatframetitle}%
4840 {%repeating title = true
4841 \rlap%
4842 {%
4843 \mdf@frametitlebackground@default%
4844 \rule[\dimexpr
4845 -\mdfboundingboxdepth
4846 +\mdfboundingboxtotalheight
4847 -\mdfframetitleboxtotalheight
4848 \relax]%
4849 {\mdfboundingboxtotalwidth}%
4850 {\mdfframetitleboxtotalheight}%
4851 }%
4852 }%
4853 {%repeating title = false -- maybe splitted
4854 \ifdimless{\mdfframetitleboxtotalheight}{\z@}%
4855 {}%
4856 {%
4857 \rlap%
4858 {%
4859 \mdf@frametitlebackground@default%
4860 \rule[\dimexpr
4861 -\mdfboundingboxdepth
4862 +\mdfboundingboxtotalheight
4863 -\mdfframetitleboxtotalheight
4864 \relax]%
4865 {\mdfboundingboxtotalwidth}%
4866 {\mdfframetitleboxtotalheight}%
4867 }%
4868 \global\mdfframetitleboxtotalheight=-\p@\relax%
4869 }%
4870 }%
4871 }%
4872 \def\mdf@frame@rightline@middle{%
4873 \rlap%
4874 {%
4875 \mdf@linecolor@default%
4876 \hspace*{\mdfboundingboxwidth}%
4877 \hspace*{\mdf@innerrightmargin@length}%
4878 \rule[-\mdfboundingboxdepth]%
4879 {\mdf@middlelinewidth@length}%
4880 {\mdfboundingboxtotalheight}%
4881 }%
4882 }%
4883 \def\mdf@frame@topline@middle{%
4884 \rlap%
4885 {%
4886 \ifbool{mdf@leftline}%
4887 {%
4888 \hspace*{-\mdf@middlelinewidth@length}%
4889 }{}%
4890 \mdf@linecolor@default%
4891 \ifbool{mdf@topline}%
4892 {%
4893 \rule[\dimexpr
4894 \mdfboundingboxtotalheight
4895 -\mdfboundingboxdepth
4896 \relax]%
4897 {\dimexpr
4898 \mdfboundingboxtotalwidth
4899 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}%
4900 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}
4901 \relax}%
4902 {\mdf@middlelinewidth@length}%
4903 }{}%
4904 }%
4905 }%
4906 \def\mdf@frame@bottomline@middle{%
4907 \rlap%
4908 {%
4909 \ifbool{mdf@leftline}%
4910 {%
4911 \hspace*{-\mdf@middlelinewidth@length}%
4912 }{}%
4913 \mdf@linecolor@default%
4914 \ifbool{mdf@bottomline}%
4915 {%
4916 \rule[\dimexpr
4917 -\mdfboundingboxdepth
4918 -\mdf@middlelinewidth@length
4919 \relax]%
4920 {\dimexpr
4921 \mdfboundingboxtotalwidth
4922 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}%
4923 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}
4924 \relax}%
4925 {\mdf@middlelinewidth@length}%
4926 }{}%
4927 }%
4928 }%
4929
4930 \def\mdf@putbox@middle{%
4931 \ifvoid\mdf@splitbox@two\relax%
4932 \else
4933 \mdf@makebox@out%
4934 {%
4935 \mdf@makeboxalign@left%
4936 \setlength{\mdfboundingboxwidth}
4937 {\wd\mdf@splitbox@two}%
4938 \setlength{\mdfboundingboxtotalwidth}%
4939 {\dimexpr
4940 \mdfboundingboxwidth
4941 +\mdf@innerleftmargin@length%
4942 +\mdf@innerrightmargin@length
4943 \relax}%
4944 \setlength{\mdfboundingboxheight}
4945 {\dimexpr
4946 \ht\mdf@splitbox@two
4947 +\dp\mdf@splitbox@two
4948 \relax}%
4949 \setlength{\mdfboundingboxdepth}%
4950 {\dimexpr
4951 \dp\mdf@splitbox@two
4952 +\mdf@splitbottomskip@length
4953 \relax}%
4954 \setlength{\mdfboundingboxtotalheight}%
4955 {\dimexpr
4956 \mdfboundingboxheight
4957 +\mdf@splitbottomskip@length
4958 \relax}%
4959 \setlength{\@tempdima}
4960 {\dimexpr
4961 \mdfboundingboxtotalwidth%
4962 \ifbool{mdf@leftline}{+\mdf@middlelinewidth@length}{}%
4963 \ifbool{mdf@rightline}{+\mdf@middlelinewidth@length}{}%
4964 \relax}%
4965 \mdf@makebox@in[\@tempdima]%
4966 {%
4967 \null%
4968 \ifbool{mdf@leftline}%
4969 {%
4970 \hspace*{\mdf@middlelinewidth@length}%
4971 \mdf@frame@leftline@middle%
4972 }{}%
4973 \mdf@frame@background@middle%
4974 \ifbool{mdf@everyline}%
4975 {%
4976 \mdf@frame@topline@middle
4977 }{}%
4978 \ifdefempty{\mdf@frametitle}{}
4979 {\mdf@frame@frametitlebackground@middle}%
4980 \ifbool{mdf@everyline}%
4981 {%
4982 \mdf@frame@bottomline@middle%
4983 }{}%
4984 \hspace*{\mdf@innerleftmargin@length}%
4985 \ifbool{mdf@rightline}%
4986 {%
4987 \mdf@frame@rightline@middle%
4988 }{}%
4989 {\box\mdf@splitbox@two}%
4990 }%
4991 \mdf@extra%
4992 \mdf@middleextra%
4993 \mdf@makeboxalign@right%
4994 }%
4995 \fi%
4996 }
4997 % \end{macrocode}
4998 % \end{macro}
4999 %
5000 % \begin{macrocode}
5001 \endinput
5002 % \end{macrocode}
5003 %
5004 % \iffalse
5005 %</mdframedefault>
5006 % \fi
5007 %
5008 %
5009 %\iffalse
5010 % \begin{macrocode}
5011 %<*mdframetikz>
5012 % \end{macrocode}
5013 %\fi
5014 % \subsection{The Explanation of md-frame-1.mdf}
5015 % \begin{macrocode}
5016 %% Style file for mdframed for package option `framemethod=tikz`
5017 %%
5018 %% This package may be distributed under the terms of the LaTeX Project
5019 %% Public License, as described in lppl.txt in the base LaTeX distribution.
5020 %% Either version 1.0 or, at your option, any later version.
5021 %%
5022 %
5023 % \end{macrocode}
5024 % \changes{v1.1beta}{2011/12/16}{added lost semicolons}
5025 % \begin{macro}{mdframedIpackagename}
5026 % local settings
5027 % \begin{macrocode}
5028 \def\mdframedIpackagename{md-frame-1}
5029 \ProvidesFile{md-frame-1.mdf}%
5030 [\mdfmaindate\ %
5031 \mdversion: \mdframedIpackagename]
5032 %
5033 % \end{macrocode}
5034 % \end{macro}
5035 %
5036 % \begin{macro}{mdf@tikz@settings}
5037 % Define settings for tikz
5038 % \begin{macrocode}
5039 %Allgemeine Einstellungen fuer tikz
5040 \def\mdf@tikz@settings{%
5041 %
5042 %% \mdf@testdraftmode%
5043 \tikzset{mdfbox/.style={anchor=south west,%
5044 inner sep=0pt,%
5045 outer sep=0pt,%
5046 \mdf@fontcolor,%
5047 }%
5048 }% anchor der Ausgabebox ist unten links
5049 \tikzset{mdfcorners/.style={rounded corners=\mdf@roundcorner@length}}%
5050 \tikzset{mdfbackground/.style={fill=\mdf@backgroundcolor,%
5051 draw=none,%
5052 }%
5053 }%
5054 \tikzset{mdfframetitlebackground/.style=%
5055 {%
5056 fill=\mdf@frametitlebackgroundcolor,%
5057 draw=none,%
5058 rounded corners={max(\mdf@roundcorner@length%
5059 -\mdf@innerlinewidth@length%
5060 -.5\mdf@middlelinewidth@length,0)%
5061 }%
5062 }%
5063 }%
5064 %
5065 \tikzset{mdfouterline/.style={}}%
5066 % nur wenn outerlinewidth>0 wird aussere Linie gezeichnet
5067 \ifdimgreater{\mdf@outerlinewidth@length}{\z@}
5068 {\tikzset{mdfouterline/.append style={%
5069 draw=\mdf@outerlinecolor,%
5070 line width=2\mdf@outerlinewidth@length+\mdf@middlelinewidth@length}}}{}%
5071 %
5072 \tikzset{mdfinnerline/.style={}}%
5073 % nur wenn innerlinewidth>0 wird innere Linie gezeichnet
5074 \ifdimgreater{\mdf@innerlinewidth@length}{\z@}
5075 {\tikzset{mdfinnerline/.append style={%
5076 draw=\mdf@innerlinecolor,%
5077 line width=2\mdf@innerlinewidth@length+\mdf@middlelinewidth@length}}}{}%
5078 %
5079 \tikzset{mdfshadow/.style={drop shadow={%
5080 shadow xshift=\mdf@shadowsize@length-2pt,
5081 shadow yshift=-\mdf@shadowsize@length+2pt,
5082 fill=\mdf@shadowcolor,
5083 every shadow }}}%
5084 %
5085 \mdf@tikzset@local%
5086 \tikzset{mdfmiddleline/.style={}}%
5087 % nur wenn middlelinewidth>0 wird mittlere Linie gezeichnet
5088 \ifdimgreater{\mdf@middlelinewidth@length}{\z@}
5089 {\tikzset{mdfmiddleline/.append style={%
5090 preaction={draw=\mdf@middlelinecolor,%
5091 line width=\mdf@middlelinewidth@length},%
5092 line width=\mdf@middlelinewidth@length,%
5093 tikzsetting}}%
5094 }{}%
5095 }%
5096 % \end{macrocode}
5097 % \end{macro}
5098 %
5099 % \begin{macro}{mdf@tikzbox@tfl,mdf@tikzbox@otl}
5100 % Befehle fuer Ausgabe von Rahmen und Hintergrund
5101 % \begin{macrocode}
5102 \newrobustcmd*\mdf@tikzbox@tfl[1]{%three or four borders
5103 \clip(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);%
5104 \begin{scope}[mdfcorners]%
5105 \clip[preaction=mdfouterline]%
5106 [postaction=mdfbackground]%
5107 [postaction=mdfinnerline]#1;%
5108 \end{scope}%
5109 \path[mdfmiddleline,mdfcorners]#1;
5110 }%
5111
5112
5113
5114 \newrobustcmd*\mdf@tikzbox@otl[2]{%one or two borders
5115 \clip(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);%
5116 \begin{scope}
5117 \path[mdfouterline,mdfcorners]#1;%
5118 \clip[postaction=mdfbackground]#2;%
5119 \path[mdfinnerline,mdfcorners]#1;%
5120 \end{scope}%
5121 \path[mdfmiddleline,mdfcorners]#1;}%
5122 % \end{macrocode}
5123 % \end{macro}
5124 %
5125 %
5126 %
5127 % \begin{macro}{mdf@drawframe@whole}
5128 % Befehle fuer Ausgabe von Rahmen und Hintergrund
5129 % \begin{macrocode}
5130 \newrobustcmd*\mdf@drawframe@whole{%
5131 \mdf@test@ltrb{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}%
5132 \mdf@test@ltb{\mdf@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}%
5133 \mdf@test@trb{\mdf@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}%
5134 \mdf@test@ltr{\mdf@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}%
5135 \mdf@test@lrb{\mdf@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}%
5136 \mdf@test@lb{\mdf@tikzbox@otl{(P|-O)--(O)--(O|-P)}%
5137 {(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}%
5138 }{}%
5139 \mdf@test@rb{\mdf@tikzbox@otl{(P)--(P|-O)--(O)}%
5140 {(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}%
5141 }{}%
5142 \mdf@test@tr{\mdf@tikzbox@otl{(O-|P)--(P)--(P-|O)}%
5143 {(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}%
5144 }{}%
5145 \mdf@test@lt{\mdf@tikzbox@otl{(O)--(O|-P)--(P)}%
5146 {(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}%
5147 }{}%
5148 \mdf@test@lr{\mdf@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}%
5149 {(O)rectangle(P)}%
5150 }{}%
5151 \mdf@test@tb{\mdf@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}%
5152 {(O)rectangle(P)}%
5153 }{}%
5154 \mdf@test@l{\mdf@tikzbox@otl{(O)--(O|-P)}%
5155 {(O)rectangle(P)}%
5156 }{}%
5157 \mdf@test@r{\mdf@tikzbox@otl{(O-|P)--(P)}%
5158 {(O)rectangle(P)}%
5159 }{}%
5160 \mdf@test@t{\mdf@tikzbox@otl{(O|-P)--(P)}%
5161 {(O)rectangle(P)}%
5162 }{}%
5163 \mdf@test@b{\mdf@tikzbox@otl{(O)--(O-|P)}%
5164 {(O)rectangle(P)}%
5165 }{}%
5166 \mdf@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}%
5167 }
5168 % \end{macrocode}
5169 % \end{macro}
5170 %
5171 %
5172 % \begin{macro}{mdf@predtikzcalc,mdf@innertikzcalc}
5173 % Before the output can start some calculations before \Env{tikzpicture}
5174 % starts are neccessary.
5175 % \begin{macrocode}
5176 \newrobustcmd*\mdf@predtikzcalc{%
5177 %%width
5178 \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}%
5179 \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}%
5180 {innerleftmargin,innerrightmargin}%
5181 \ifbool{mdf@leftline}{%
5182 \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}%
5183 {innerlinewidth,middlelinewidth,outerlinewidth}}{}%
5184 \ifbool{mdf@rightline}{%
5185 \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxwidth}}%
5186 {innerlinewidth,middlelinewidth,outerlinewidth}}{}%
5187 %%height
5188 \setlength\mdfboundingboxheight%
5189 {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
5190 \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}%
5191 {innertopmargin,innerbottommargin}%
5192 \ifbool{mdf@topline}{%
5193 \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}%
5194 {innerlinewidth,middlelinewidth,outerlinewidth}}{}%
5195 \ifbool{mdf@bottomline}{%
5196 \mdf@dolist{\mdf@advancelength@add{\mdfboundingboxheight}}%
5197 {innerlinewidth,middlelinewidth,outerlinewidth}}{}%
5198 }
5199
5200 \newrobustcmd*\mdf@innertikzcalc{%
5201 \pgfmathsetlengthmacro\mdf@Ax{+\mdf@innerleftmargin@length}%
5202 \pgfmathsetlengthmacro\mdf@Ay{+\mdf@innerbottommargin@length}%
5203 \pgfmathsetlengthmacro\mdf@Ox{+0pt}%
5204 \pgfmathsetlengthmacro\mdf@Oy{+0pt}%
5205 \pgfmathsetlengthmacro\mdf@Px{+\mdfboundingboxwidth}%
5206 \pgfmathsetlengthmacro\mdf@Py{+\mdfboundingboxheight}%
5207 \ifbool{mdf@leftline}%
5208 {%
5209 \pgfmathsetlengthmacro\mdf@Ax%
5210 {\mdf@Ax+\mdf@outerlinewidth@length+%
5211 \mdf@middlelinewidth@length+\mdf@innerlinewidth@length}%
5212 \pgfmathsetlengthmacro\mdf@Ox%
5213 {\mdf@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}%
5214 }{}%
5215 \ifbool{mdf@rightline}%
5216 {%
5217 \pgfmathsetlengthmacro\mdf@Px%
5218 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}%
5219 }{}%
5220 \ifbool{mdf@bottomline}%
5221 {%
5222 \pgfmathsetlengthmacro\mdf@Ay%
5223 {\mdf@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length%
5224 +\mdf@innerlinewidth@length}%
5225 \pgfmathsetlengthmacro\mdf@Oy%
5226 {\mdf@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}%
5227 }{}%
5228 \ifbool{mdf@topline}%
5229 {%
5230 \pgfmathsetlengthmacro\mdf@Py%
5231 {\mdf@Py-\mdf@[email protected]\mdf@middlelinewidth@length}%
5232 }{}%
5233 }
5234 % \end{macrocode}
5235 % \end{macro}
5236 %
5237 %
5238 % \begin{macro}{mdf@put@frametitlerule}
5239 % frametitlerule with tikz
5240 % \begin{macrocode}
5241 \tikzset{mdfframetitlerule/.style={%
5242 draw=none,
5243 fill=\mdf@frametitlerulecolor,
5244 }%
5245 }
5246 \def\mdf@@frametitlerule{%
5247 \ifbool{mdf@frametitlerule}{%
5248 \vbox{\hsize0pt
5249 \par\unskip\vskip\mdf@frametitlebelowskip@length
5250 \noindent\rlap{\hspace*{-\mdf@innerleftmargin@length}%
5251 \begingroup%
5252 \pgfmathsetlength{\dimen@}{\mdfframetitleboxwidth
5253 +\mdf@innerleftmargin@length
5254 +\mdf@innerrightmargin@length}%
5255 \tikz\draw[mdfframetitlerule] (0,0)%
5256 rectangle (\dimen@,\mdf@frametitlerulewidth@length);
5257 \endgroup}
5258 }%
5259 }{%
5260 \vbox{\hsize0pt
5261 \par\unskip\vskip\mdf@frametitlebelowskip@length
5262 \noindent\rlap{}
5263 }%
5264 }%
5265 \iftoggle{mdf@notfirstframetitle}%
5266 {%
5267 \par\unskip\vskip\mdf@splittopskip@length%
5268 }%
5269 {%
5270 \par\unskip\vskip\mdf@innertopmargin@length%
5271 }%
5272 }%
5273
5274 % \end{macrocode}
5275 % \end{macro}
5276 %
5277 % \begin{macro}{mdf@putbox@single}
5278 % Output of the non breakable contents.
5279 % \begin{macrocode}
5280 % Info zu den verwendeten Punkten:
5281 % O ist die untere linke Ecke der Mitte der middleline
5282 % P ist die obere rechte Ecke der Mitte der middleline
5283 % A ist der Punkt fuer den anchor (d.h. die untere linke Ecke) der Ausgabebox
5284 %
5285 \def\mdf@putbox@single{%
5286 \ifvoid\mdf@splitbox@one
5287 \else%
5288 \mdf@makebox@out{%
5289 \mdf@makeboxalign@left%
5290 \mdf@tikz@settings%
5291 \mdf@predtikzcalc%
5292 \mdf@makebox@in[\mdfboundingboxwidth]{%
5293 \null%
5294 \begin{tikzpicture}[remember picture]%
5295 \mdf@innertikzcalc
5296 \coordinate(O)at(\mdf@Ox,\mdf@Oy);%
5297 \coordinate(P)at(\mdf@Px,\mdf@Py);%
5298 \ifbool{mdf@shadow}
5299 {\path[mdfshadow,mdfcorners](O) rectangle (P);}{}%
5300 \begin{scope}
5301 \begin{scope}[use as bounding box]
5302 \mdf@drawframe@whole
5303 \drawbrackgroundframetitle@single
5304 \end{scope}
5305 \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};
5306 \end{scope}
5307 %HIER KOMMT EIN WEITERES MAKRO
5308 \mdf@extra%
5309 \mdf@singleextra%
5310 \mdfcreateextratikz
5311 \end{tikzpicture}%
5312 }%
5313 \mdf@makeboxalign@right%
5314 }%
5315 \fi%
5316 }%
5317
5318 \def\drawbrackgroundframetitle@single{%
5319 \ifdefempty{\mdf@frametitle}{}{%
5320 \drawbrackgroundframetitle@@single%
5321 }%
5322 }%
5323 \def\drawbrackgroundframetitle@@single{%
5324 \begin{scope}%background frame title
5325 \ifbool{mdf@leftline}{
5326 \pgfmathsetlengthmacro\mdf@Ox%
5327 {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}%
5328 }{}%
5329 \ifbool{mdf@rightline}{%
5330 \pgfmathsetlengthmacro\mdf@Px%
5331 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}%
5332 }{}%
5333 \ifbool{mdf@topline}{%
5334 \pgfmathsetlengthmacro\mdf@Py%
5335 {\mdf@Py-\mdf@[email protected]\mdf@middlelinewidth@length}%
5336 }{}%
5337 \pgfmathsetlengthmacro\mdf@Fy%
5338 {\mdf@Py-\mdfframetitleboxtotalheight}%
5339 \path[mdfframetitlebackground]%
5340 (\mdf@Ox,\mdf@Fy)--(\mdf@Ox,\mdf@Py)--(\mdf@Px,\mdf@Py)--(\mdf@Px,\mdf@Fy);
5341 \end{scope}
5342 }
5343 % \end{macrocode}
5344 % \end{macro}
5345 %
5346 % \begin{macro}{mdf@putbox@first}
5347 % Output of the first breakable contents.
5348 % \begin{macrocode}
5349 \def\drawbrackgroundframetitle@first{%
5350 {%
5351 \ifbool{mdf@repeatframetitle}%
5352 {%repeating title = true
5353 \begin{scope}%background frame title
5354 \ifbool{mdf@leftline}{
5355 \pgfmathsetlengthmacro\mdf@Ox%
5356 {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}
5357 }{}%
5358 \ifbool{mdf@rightline}{%
5359 \pgfmathsetlengthmacro\mdf@Px%
5360 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}
5361 }{}%
5362 \ifbool{mdf@topline}{%
5363 \pgfmathsetlengthmacro\mdf@Py%
5364 {\mdf@Py-\mdf@[email protected]\mdf@middlelinewidth@length}
5365 }{}%
5366 \pgfmathsetlengthmacro\mdf@Fy
5367 {\mdf@Py-\mdfframetitleboxtotalheight}
5368 \coordinate(P)at(\mdf@Px,\mdf@Py);%
5369 \path[mdfframetitlebackground]
5370 (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)%
5371 --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy);
5372 \end{scope}
5373 }%
5374 {%
5375 \ifdefempty{\mdf@frametitle}{}%
5376 {%
5377 \ifdimgreater{\mdfboundingboxheight}{\mdfframetitleboxtotalheight}%
5378 {%
5379 \drawbrackgroundframetitle@@first
5380 \pgfmathsetlength{\global\mdfframetitleboxtotalheight}{-\p@}%
5381 }{\mdf@PackageWarning%
5382 {You got a page break inside the frame title\MessageBreak
5383 Currently this isn't well supported}%
5384 \drawbrackgroundframetitle@@first
5385 \pgfmathsetlength{\global\mdfframetitleboxtotalheight}%
5386 {\mdfframetitleboxtotalheight
5387 -\mdfboundingboxheight
5388 -\mdf@innerlinewidth@length
5389 -0.5\mdf@middlelinewidth@length%
5390 +\mdf@frametitlebelowskip@length
5391 +\mdf@splitbottomskip@length
5392 %% +\mdf@splittopskip@length
5393 %% -\dp\strutbox%
5394 }%
5395 }%
5396 }%
5397 }%
5398 }%
5399 }%
5400 %
5401 \def\drawbrackgroundframetitle@@first{%
5402 \begin{scope}%background frame title
5403 \ifbool{mdf@leftline}{%
5404 \pgfmathsetlengthmacro\mdf@Ox%
5405 {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}
5406 }{}%
5407 \ifbool{mdf@rightline}{%
5408 \pgfmathsetlengthmacro\mdf@Px%
5409 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}
5410 }{}%
5411 \ifbool{mdf@topline}{%
5412 \pgfmathsetlengthmacro\mdf@Py%
5413 {\mdf@Py-\mdf@[email protected]\mdf@middlelinewidth@length}
5414 }{}%
5415 \pgfmathsetlengthmacro\mdf@Fy
5416 {max(0,\mdf@Py-\mdfframetitleboxtotalheight)}
5417 \path[mdfframetitlebackground]
5418 (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)%
5419 --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy);
5420 \end{scope}%
5421 }%
5422 %
5423 \def\mdf@putbox@first{%
5424 \ifvoid\mdf@splitbox@two
5425 \else%
5426 \mdf@makebox@out{%
5427 \mdf@makeboxalign@left%
5428 %Special for first frame -- used other savebox
5429 \let\mdf@splitbox@one\mdf@splitbox@two%
5430 \mdf@tikz@settings%
5431 %Special for first frame -- no innerbottommargin but splitbottomskip
5432 \let\mdf@innerbottommargin@length\mdf@splitbottomskip@length
5433 \mdf@predtikzcalc%calc with all lines
5434 %Special for first frame -- no bottom line without everyline true
5435 % if every line false -- test if bottomline is in use and remove the width
5436 \ifbool{mdf@everyline}{}{%
5437 \ifbool{mdf@bottomline}{%
5438 \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}%
5439 {innerlinewidth,middlelinewidth,outerlinewidth}}{}%
5440 }%
5441 \ifdimgreater{\pagegoal-\maxdimen}{0pt}{}{\enlargethispage{\baselineskip}}%
5442 \mdf@makebox@in[\mdfboundingboxwidth]{%
5443 \null%
5444 \begin{tikzpicture}[remember picture]
5445 \mdf@innertikzcalc
5446 %Special for first frame -- no bottom line without everyline true
5447 \ifbool{mdf@everyline}{}{%
5448 \ifbool{mdf@bottomline}%
5449 {%
5450 \pgfmathsetlengthmacro\mdf@Ay%
5451 {\mdf@Ay-\mdf@outerlinewidth@length-\mdf@middlelinewidth@length%
5452 -\mdf@innerlinewidth@length}%
5453 \pgfmathsetlengthmacro\mdf@Oy%
5454 {\mdf@Oy-\mdf@outerlinewidth@length
5455 -0.5\mdf@middlelinewidth@length}%
5456 }{}%
5457 }%
5458 \coordinate(O)at(\mdf@Ox,\mdf@Oy);%
5459 \coordinate(P)at(\mdf@Px,\mdf@Py);%
5460 \ifbool{mdf@shadow}
5461 {\path[mdfshadow] (O) -- (O|-P) to[mdfcorners] (P) -- (P|-O) -- (O);}{}%
5462 \begin{scope}
5463 \begin{scope}[use as bounding box]
5464 %Special for first frame
5465 \ifbool{mdf@everyline}{}{%
5466 \mdfsetup{bottomline=false}%
5467 }
5468 \mdf@drawframe@whole
5469 \drawbrackgroundframetitle@first
5470 \end{scope}
5471 \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};%
5472 \end{scope}
5473 %HIER KOMMT EIN WEITERES MAKRO
5474 \mdf@extra%
5475 \mdf@firstextra%
5476 \mdfcreateextratikz%
5477 \end{tikzpicture}%
5478 }%
5479 \mdf@makeboxalign@right%
5480 }%
5481 \fi
5482 }%
5483 % \end{macrocode}
5484 % \end{macro}
5485 %
5486 % \begin{macro}{mdf@putbox@middle}
5487 % Output of the middle breakable contents.
5488 % \begin{macrocode}
5489 \def\drawbrackgroundframetitle@middle{%
5490 \ifdefempty{\mdf@frametitle}{}%
5491 {%
5492 \ifbool{mdf@repeatframetitle}%
5493 {%repeating title = true
5494 \begin{scope}%background frame title
5495 \ifbool{mdf@leftline}{
5496 \pgfmathsetlengthmacro\mdf@Ox%
5497 {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}
5498 }{}%
5499 \ifbool{mdf@rightline}{%
5500 \pgfmathsetlengthmacro\mdf@Px%
5501 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}
5502 }{}%
5503 \ifbool{mdf@everyline}%
5504 {%
5505 \ifbool{mdf@topline}{%
5506 \pgfmathsetlengthmacro\mdf@Py%
5507 {\mdf@Py-\mdf@innerlinewidth@length%
5508 -.5\mdf@middlelinewidth@length}
5509 }{}%
5510 }{}%
5511 \pgfmathsetlengthmacro\mdf@Fy
5512 {\mdf@Py-\mdfframetitleboxtotalheight}
5513 \coordinate(P)at(\mdf@Px,\mdf@Py);%
5514 \path[mdfframetitlebackground]
5515 (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)%
5516 --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy);
5517 \end{scope}
5518 }%
5519 {%
5520 \ifdimless{\mdfframetitleboxtotalheight}{\z@}
5521 {}%
5522 {%
5523 \drawbrackgroundframetitle@@middle%
5524 \pgfmathsetlength{\global\mdfframetitleboxtotalheight}{-\p@}%
5525 }%
5526 }%
5527 }%
5528 }%
5529 \def\drawbrackgroundframetitle@@middle{%
5530 \begin{scope}%background frame title
5531 \ifbool{mdf@leftline}{%
5532 \pgfmathsetlengthmacro\mdf@Ox%
5533 {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}
5534 }{}%
5535 \ifbool{mdf@rightline}{%
5536 \pgfmathsetlengthmacro\mdf@Px%
5537 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}
5538 }{}%
5539 \pgfmathsetlengthmacro\mdf@Fy
5540 {\mdf@Py-\mdfframetitleboxtotalheight}
5541 \path[mdfframetitlebackground,rounded corners=\z@]
5542 (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)%
5543 --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy);
5544 \end{scope}
5545 }%
5546 %
5547 \def\drawbrackgroundframetitle@@middle{%
5548 \begin{scope}%background frame title
5549 \ifbool{mdf@leftline}{
5550 \pgfmathsetlengthmacro\mdf@Ox%
5551 {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}
5552 }{}%
5553 \ifbool{mdf@rightline}{%
5554 \pgfmathsetlengthmacro\mdf@Px%
5555 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}
5556 }{}%
5557 \pgfmathsetlengthmacro\mdf@Fy
5558 {\mdf@Py-\mdfframetitleboxtotalheight}
5559 \path[mdfframetitlebackground,rounded corners=\z@]
5560 (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)%
5561 --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy);
5562 \end{scope}
5563 }%
5564 \def\mdf@putbox@middle{%
5565 \ifvoid\mdf@splitbox@two
5566 \else%
5567 \mdf@makebox@out{%
5568 \mdf@makeboxalign@left%
5569 \mdf@tikz@settings%
5570 %Special for middle frame -- used other savebox
5571 \let\mdf@splitbox@one\mdf@splitbox@two%
5572 %Special for middle frame -- no innertopmargin -- done by splittopskip
5573 % in box and no bottommargin instead splitbottomskip
5574 \setlength{\mdf@innertopmargin@length}{\z@}%
5575 \let\mdf@innerbottommargin@length\mdf@splitbottomskip@length
5576 \mdf@predtikzcalc%
5577 %Special for middle frame -- remove topline and bottomline if no everyline
5578 \ifbool{mdf@everyline}{}{%
5579 \ifbool{mdf@topline}{%
5580 \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}%
5581 {innerlinewidth,middlelinewidth,outerlinewidth}}{}%
5582 \ifbool{mdf@bottomline}{%
5583 \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}%
5584 {innerlinewidth,middlelinewidth,outerlinewidth}}{}%
5585 }%
5586 \mdf@makebox@in[\mdfboundingboxwidth]{%
5587 \null%
5588 \begin{tikzpicture}[remember picture]
5589 \mdf@innertikzcalc%
5590 %Special for middle frame
5591 \ifbool{mdf@everyline}{}{%
5592 \ifbool{mdf@bottomline}%
5593 {%
5594 \pgfmathsetlengthmacro\mdf@Ay%
5595 {\mdf@Ay-\mdf@outerlinewidth@length-\mdf@middlelinewidth@length%
5596 -\mdf@innerlinewidth@length}%
5597 \pgfmathsetlengthmacro\mdf@Oy%
5598 {\mdf@Oy-\mdf@outerlinewidth@length
5599 -0.5\mdf@middlelinewidth@length}%
5600 }{}%
5601 \ifbool{mdf@topline}%
5602 {%
5603 \pgfmathsetlengthmacro\mdf@Py%
5604 {\mdf@Py-\mdf@[email protected]\mdf@middlelinewidth@length}%
5605 }{}%
5606 }{}%
5607 \coordinate(O)at(\mdf@Ox,\mdf@Oy);%
5608 \coordinate(P)at(\mdf@Px,\mdf@Py);%
5609 \ifbool{mdf@shadow}{\path[mdfshadow](O) rectangle (P);}{}%
5610 \begin{scope}
5611 \begin{scope}[use as bounding box]
5612 %%Special for middle frame
5613 \ifbool{mdf@everyline}{}{\mdfsetup{topline=false,bottomline=false}}%
5614 \mdf@drawframe@whole
5615 \drawbrackgroundframetitle@middle
5616 \end{scope}
5617 \node[mdfbox] (mdfframe) at(\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@two};%
5618 \end{scope}
5619 \mdf@extra%
5620 \mdf@middleextra%
5621 %HIER KOMMT EIN WEITERES MAKRO
5622 \mdfcreateextratikz
5623 \end{tikzpicture}%
5624 }%
5625 \mdf@makeboxalign@right%
5626 }%
5627 \fi
5628 }%
5629 % \end{macrocode}
5630 % \end{macro}
5631 %
5632 % \begin{macro}{mdf@putbox@second}
5633 % Output of the last breakable contents.
5634 % \begin{macrocode}
5635 \def\drawbrackgroundframetitle@second{%
5636 \ifdefempty{\mdf@frametitle}{}%
5637 {%
5638 \ifbool{mdf@repeatframetitle}%
5639 {%repeating title = true
5640 \begin{scope}%background frame title
5641 \ifbool{mdf@leftline}{
5642 \pgfmathsetlengthmacro\mdf@Ox%
5643 {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}
5644 }{}%
5645 \ifbool{mdf@rightline}{%
5646 \pgfmathsetlengthmacro\mdf@Px%
5647 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}
5648 }{}%
5649 \ifbool{mdf@everyline}%
5650 {%
5651 \ifbool{mdf@topline}{%
5652 \pgfmathsetlengthmacro\mdf@Py%
5653 {\mdf@Py-\mdf@innerlinewidth@length%
5654 -.5\mdf@middlelinewidth@length}
5655 }{}%
5656 }{}%
5657 \pgfmathsetlengthmacro\mdf@Fy
5658 {\mdf@Py-\mdfframetitleboxtotalheight}
5659 \coordinate(P)at(\mdf@Px,\mdf@Py);%
5660 \path[mdfframetitlebackground]
5661 (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)%
5662 --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy);
5663 \end{scope}
5664 }%
5665 {%
5666 \ifdimless{\mdfframetitleboxtotalheight}{\z@}
5667 {}%
5668 {%
5669 \drawbrackgroundframetitle@@second%
5670 }%
5671 }%
5672 }%
5673 }%
5674 %
5675 \def\drawbrackgroundframetitle@@second{%
5676 \begin{scope}%background frame title
5677 \ifbool{mdf@leftline}{%
5678 \pgfmathsetlengthmacro\mdf@Ox%
5679 {\mdf@Ox+\mdf@innerlinewidth@length+0.5\mdf@middlelinewidth@length}
5680 }{}%
5681 \ifbool{mdf@rightline}{%
5682 \pgfmathsetlengthmacro\mdf@Px%
5683 {\mdf@Px-\mdf@[email protected]\mdf@middlelinewidth@length}%
5684 }{}%
5685 \pgfmathsetlengthmacro\mdf@Fy
5686 {\mdf@Py-\mdfframetitleboxtotalheight}%
5687 \path[mdfframetitlebackground,rounded corners=\z@]
5688 (\mdf@Ox,\mdf@Fy) -- (\mdf@Ox,\mdf@Py)%
5689 --(\mdf@Px,\mdf@Py) --(\mdf@Px,\mdf@Fy);
5690 \end{scope}
5691 }%
5692 \def\mdf@putbox@second{%
5693 \ifvoid\mdf@splitbox@one
5694 \else%
5695 \mdf@makebox@out{%
5696 \mdf@makeboxalign@left%
5697 \mdf@tikz@settings%
5698 %Special for middle frame -- no innertopmargin -- done by splittopskip
5699 \setlength{\mdf@innertopmargin@length}{\z@}%
5700 \mdf@predtikzcalc%
5701 %Special for second frame -- no top line without everyline true
5702 \ifbool{mdf@everyline}{}{%
5703 \ifbool{mdf@topline}{%
5704 \mdf@dolist{\mdf@advancelength@sub{\mdfboundingboxheight}}%
5705 {innerlinewidth,middlelinewidth,outerlinewidth}}{}%
5706 }%
5707 \mdf@makebox@in[\mdfboundingboxwidth]{%
5708 \null%
5709 \begin{tikzpicture}[remember picture]
5710 \mdf@innertikzcalc
5711 %Special for second frame
5712 \ifbool{mdf@everyline}{}{%
5713 \ifbool{mdf@topline}%
5714 {%
5715 \pgfmathsetlengthmacro\mdf@Py%
5716 {\mdf@Py+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}%
5717 }{}%
5718 }%
5719 \coordinate(O)at(\mdf@Ox,\mdf@Oy);%
5720 \coordinate(P)at(\mdf@Px,\mdf@Py);%
5721 \ifbool{mdf@shadow}
5722 {%
5723 \path[mdfshadow] (O|-P) to[mdfcorners] (O) to[mdfcorners] (P|-O)
5724 -- (P) -- (O|-P);%
5725 }{}%
5726 \begin{scope}
5727 \begin{scope}[use as bounding box]
5728 \ifbool{mdf@everyline}{}{\mdfsetup{topline=false}}%
5729 \mdf@drawframe@whole
5730 \drawbrackgroundframetitle@second
5731 \end{scope}
5732 \node[mdfbox] (mdfframe) at (\mdf@Ax,\mdf@Ay){\box\mdf@splitbox@one};%
5733 \end{scope}
5734 \mdf@extra%
5735 \mdf@secondextra%
5736 %HIER KOMMT EIN WEITERES MAKRO
5737 \mdfcreateextratikz
5738 \end{tikzpicture}%
5739 }%
5740 \mdf@makeboxalign@right%
5741 }%
5742 \fi%
5743 }%
5744
5745
5746 %
5747 % \begin{macro}{mdf@drawsubtitleaboveline,mdf@drawsubtitlebelowline,^^A
5748 % mdf@drawsubtitlebackground}
5749 %
5750 % \begin{macrocode}%
5751 \tikzset{mdfsubtitleaboverule/.style={%
5752 draw=none,
5753 fill=\mdf@subtitleabovelinecolor,
5754 }%
5755 }
5756
5757 \tikzset{mdfsubtitlebelowrule/.style={%
5758 draw=none,
5759 fill=\mdf@subtitlebelowlinecolor,
5760 }%
5761 }
5762
5763 \tikzset{mdfsubtitlebackground/.style={%
5764 draw=\mdf@subtitlebackgroundcolor,
5765 fill=\mdf@subtitlebackgroundcolor,
5766 }%
5767 }
5768
5769 \tikzset{mdfsubsubtitleaboverule/.style={%
5770 draw=none,
5771 fill=\mdf@subsubtitleabovelinecolor,
5772 }%
5773 }
5774
5775 \tikzset{mdfsubsubtitlebelowrule/.style={%
5776 draw=none,
5777 fill=\mdf@subsubtitlebelowlinecolor,
5778 }%
5779 }
5780
5781 \tikzset{mdfsubsubtitlebackground/.style={%
5782 draw=none,
5783 fill=\mdf@subsubtitlebackgroundcolor,
5784 }%
5785 }
5786
5787 %default:
5788 \def\mdf@drawsubtitleaboveline{%
5789 \rlap{%
5790 \hspace*{-\mdf@innerleftmargin@length}%
5791 \tikz\draw[mdfsubsubtitleaboverule](0,0) rectangle
5792 (\mdf@templength,\mdf@subtitleabovelinewidth@length);%
5793 }%
5794 }
5795 \def\mdf@drawsubtitlebelowline{%
5796 \rlap{%
5797 \hspace*{-\mdf@innerleftmargin@length}%
5798 \tikz\draw[mdfsubsubtitleaboverule](0,0) rectangle
5799 (\mdf@templength,\mdf@subtitlebelowlinewidth@length);%
5800 }%
5801 }
5802 \def\mdf@drawsubtitlebackground{%
5803 \rlap{%
5804 \hspace*{-\mdf@innerleftmargin@length}%
5805 \tikz\draw[overlay,mdfsubtitlebackground](0,0) rectangle
5806 (\mdf@templength,-\mdfsubtitleheight);%
5807 }%
5808 }
5809
5810 % \end{macrocode}
5811 % \end{macro}
5812 %
5813 % \begin{macrocode}
5814 \endinput
5815 % \end{macrocode}
5816 % \iffalse
5817 %</mdframetikz>
5818 % \fi
5819 %
5820 %
5821 %\iffalse
5822 % \begin{macrocode}
5823 %<*mdframepstricks>
5824 % \end{macrocode}
5825 %\fi
5826 % \subsection{The Explanation of md-frame-2.mdf / md-frame-3.mdf}
5827 % \begin{macrocode}
5828 %% Style file for mdframed for package option `framemethod=pstricks`
5829 %%
5830 %% This package may be distributed under the terms of the LaTeX Project
5831 %% Public License, as described in lppl.txt in the base LaTeX distribution.
5832 %% Either version 1.0 or, at your option, any later version.
5833 %%
5834 %
5835 % \end{macrocode}
5836 %
5837 % \begin{macro}{mdframedIIpackagename}
5838 % local settings
5839 % \begin{macrocode}
5840 \def\mdframedIIpackagename{md-frame-2}
5841 \ProvidesFile{md-frame-2.mdf}%
5842 [\mdfmaindate\ %
5843 \mdversion: \mdframedIIpackagename]
5844 % \end{macrocode}
5845 % \end{macro}
5846 %
5847 % \begin{macro}{mdf@ptlength@to@pscode,ptTps}
5848 % Command to calculate a latex length to postscript
5849 % \begin{macrocode}
5850 \def\mdf@ptlength@to@pscode#1{\pst@number{#1} \pst@number\psxunit div }
5851 \def\mdf@ptlength@to@pscode@length#1{%
5852 \pst@number{\csname mdf@#1@length\endcsname}
5853 \pst@number\psxunit div\space}
5854 \let\ptTps\mdf@ptlength@to@pscode\relax
5855 \let\ptTpsL\mdf@ptlength@to@pscode@length\relax
5856 % \end{macrocode}
5857 % \end{macro}
5858 %
5859 % \begin{macro}{mdfbackgroundstyle,mdflinestyle,^^A
5860 % mdfframetitlerule,mdfframetitlebackground}
5861 % background and line settings for pstricks
5862 % \begin{macrocode}
5863 \def\mdfpstricks@settings{%expand by \addtopsstyle
5864 \newpsstyle{mdfbackgroundstyle}%
5865 {linecolor=\mdf@backgroundcolor,fillstyle=solid,%
5866 fillcolor=\mdf@backgroundcolor,linestyle=none,%
5867 ,dimen=middle,%
5868 }%
5869 %
5870 \newpsstyle{mdfframetitlebackgroundstyle}{%
5871 linecolor=\mdf@frametitlebackgroundcolor,
5872 fillcolor=\mdf@frametitlebackgroundcolor,
5873 fillstyle=solid,linestyle=none,
5874 linearc=\ifdimgreater{\mdf@roundcorner@length%
5875 -\mdf@innerlinewidth@length%
5876 -.5\mdf@middlelinewidth@length}
5877 {\z@}{\dimexpr\mdf@roundcorner@length%
5878 -\mdf@innerlinewidth@length%
5879 -.5\mdf@middlelinewidth@length}{\z@},
5880 }
5881 %
5882 \newpsstyle{mdfouterlinestyle}{linestyle=none}%
5883 \ifdimgreater{\mdf@outerlinewidth@length}{\z@}
5884 {\newpsstyle{mdfouterlinestyle}{%
5885 linecolor=\mdf@outerlinecolor,%
5886 linewidth=\dimexpr2\mdf@outerlinewidth@length
5887 +\mdf@middlelinewidth@length\relax,
5888 dimen=middle,
5889 }}{}%
5890 %
5891 \newpsstyle{mdfinnerlinestyle}{linestyle=none}%
5892 \ifdimgreater{\mdf@innerlinewidth@length}{\z@}%
5893 {\newpsstyle{mdfinnerlinestyle}{%
5894 linecolor=\mdf@innerlinecolor,%
5895 linewidth=\dimexpr2\mdf@innerlinewidth@length
5896 +\mdf@middlelinewidth@length\relax,
5897 dimen=middle,
5898 }}{}%
5899 %
5900 \newpsstyle{mdfmiddlelinestyle}{linestyle=none}%
5901 \newpsstyle{mdfshadow}{shadow=true,shadowcolor=\mdf@shadowcolor,
5902 shadowsize=\mdf@shadowsize@length}%
5903 \ifdimgreater{\mdf@middlelinewidth@length}{\z@}%
5904 {\newpsstyle{mdfmiddlelinestyle}{%
5905 linewidth=\mdf@middlelinewidth@length,%
5906 linecolor=\mdf@middlelinecolor,dimen=middle
5907 }}{}%
5908 \mdfpstricks@appendsettings
5909 }%
5910 %
5911 \newrobustcmd*\mdf@pstricksbox@fl[2]{%four lines
5912 \psframe[style=mdfouterlinestyle](#1)(#2)%aussen=3mm
5913 \psframe[style=mdfbackgroundstyle](#1)(#2)%Hintergrund
5914 \psclip{\psframe[style=mdfmiddlelinestyle](#1)(#2)}
5915 \psframe[style=mdfinnerlinestyle](#1)(#2)%innere=3mm
5916 \endpsclip
5917 \psframe[style=mdfmiddlelinestyle](#1)(#2)%mittlere=2mm
5918 }%
5919 \newrobustcmd*\mdf@pstricksbox@tl[1]{%three lines
5920 \psline[style=mdfouterlinestyle]#1%aussen=3mm
5921 \psline[style=mdfbackgroundstyle]#1%Hintergrund
5922 \psclip{\psline[style=mdfmiddlelinestyle]#1}
5923 \psline[style=mdfinnerlinestyle]#1%innere=3mm
5924 \endpsclip
5925 \psline[style=mdfmiddlelinestyle]#1%mittlere=2mm
5926 }%
5927 \newrobustcmd*\mdf@pstricksbox@tcl[2]{%two combined lines
5928 %%#1 background comple
5929 %%#2 line path
5930 \psline[style=mdfouterlinestyle]#2%aussen=3mm
5931 \psline[style=mdfbackgroundstyle]#2%Hintergrund
5932 \psclip{\pscustom[linestyle=none]{
5933 \psline[style=mdfmiddlelinestyle]#2
5934 \psline[linestyle=none,linearc=0pt]#1}
5935 }
5936 \psframe[style=mdfbackgroundstyle,linearc=0pt](mdf@O)(mdf@P)%Hintergrund
5937 \psline[style=mdfinnerlinestyle]#2%innere=3mm
5938 \endpsclip
5939 \psline[style=mdfmiddlelinestyle]#2%mittlere=2mm
5940 }%
5941 \newrobustcmd*\mdf@pstricksbox@tncl[2]{%two not combined lines
5942 \begingroup
5943 \psset{linearc=0pt}
5944 \psline[style=mdfouterlinestyle](mdf@O)#1%aussen=3mm
5945 \psline[style=mdfouterlinestyle](mdf@P)#2%aussen=3mm
5946 \psclip{
5947 \pscustom[linestyle=none]{%
5948 \psline[style=mdfmiddlelinestyle](mdf@O)#1%mittlere=2mm
5949 \psline[linestyle=none](mdf@O)#2
5950 \psline[style=mdfmiddlelinestyle](mdf@P)#2%mittlere=2mm
5951 \psline[linestyle=none](mdf@P)#1
5952 }%
5953 }%
5954 \psframe[style=mdfbackgroundstyle,linearc=0pt](mdf@O)(mdf@P)%Hintergrund
5955 \psline[style=mdfinnerlinestyle](mdf@O)#1%innere=3mm
5956 \psline[style=mdfinnerlinestyle](mdf@P)#2%innere=3mm
5957 \endpsclip
5958 \psline[style=mdfmiddlelinestyle](mdf@O)#1%mittlere=2mm
5959 \psline[style=mdfmiddlelinestyle](mdf@P)#2%mittlere=2mm
5960 \endgroup
5961 }%
5962 \newrobustcmd*\mdf@pstricksbox@ol[1]{%one line
5963 \begingroup
5964 \psset{linearc=0pt}
5965 \psline[style=mdfouterlinestyle]#1%aussen=3mm
5966 \psline[style=mdfbackgroundstyle]#1%Hintergrund
5967 \psclip{\pscustom[linestyle=none]{
5968 \psline[style=mdfmiddlelinestyle]#1
5969 \psframe[linestyle=none,fillstyle=none,dimen=inner](mdf@O)(mdf@P)
5970 }}
5971 \psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)
5972 \psline[style=mdfinnerlinestyle]#1%innere=3mm
5973 \endpsclip
5974 \psline[style=mdfmiddlelinestyle]#1%mittlere=2mm
5975 \endgroup%
5976 }%
5977
5978 %
5979 \newpsstyle{mdfframetitlerule}{%
5980 linecolor=\mdf@frametitlerulecolor,%
5981 fillcolor=\mdf@frametitlerulecolor,%
5982 fillstyle=solid,dimen=outer,%
5983 }
5984 %
5985 % \end{macrocode}
5986 % \end{macro}
5987 %
5988 %
5989 % \begin{macro}{mdf@put@frametitlerule}
5990 % frametitlerule with pstricks
5991 % \begin{macrocode}
5992 \def\mdf@@frametitlerule{%
5993 \ifbool{mdf@frametitlerule}{%
5994 \vbox{\hsize0pt
5995 \par\unskip\vskip\mdf@frametitlebelowskip@length
5996 \noindent\rlap{%
5997 \begingroup%
5998 \begin{pspicture}(0,0)(0,\mdf@frametitlerulewidth@length)
5999 \psframe[style=mdfframetitlerule]%
6000 (!\ptTpsL{innerleftmargin} neg 0)%
6001 (!\ptTpsL{innerrightmargin}
6002 \ptTps{\mdfframetitleboxwidth} add
6003 \ptTpsL{frametitlerulewidth})
6004 \end{pspicture}
6005 \endgroup}%
6006 }%
6007 }{%
6008 \vbox{\hsize0pt
6009 \par\unskip\vskip\mdf@frametitlebelowskip@length
6010 \noindent\rlap{}
6011 }%
6012 }%
6013 \iftoggle{mdf@notfirstframetitle}%
6014 {%
6015 \par\unskip\vskip\mdf@splittopskip@length%
6016 }%
6017 {%
6018 \par\unskip\vskip\mdf@innertopmargin@length%
6019 }%
6020 }%
6021 %
6022 %
6023 % \begin{macro}{mdf@drawsubtitleaboveline,mdf@drawsubtitlebelowline,^^A
6024 % mdf@drawsubtitlebackground}
6025 %
6026 % \begin{macrocode}
6027 %default:
6028 \def\mdf@drawsubtitleaboveline{%
6029 \rlap{%
6030 \hspace*{-\mdf@innerleftmargin@length}%
6031 \begin{pspicture}(0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)
6032 \psframe[style=mdfsubtitleaboverule]%
6033 (0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)%
6034 \end{psicture}%
6035 }%
6036 }
6037 \def\mdf@drawsubtitlebelowline{%
6038 \rlap{%
6039 \hspace*{-\mdf@innerleftmargin@length}%
6040 \begin{pspicture}(0,0)(\mdf@templength,\mdf@subtitlebelowlinewidth@length)
6041 \psframe[style=mdfsubtitlebelowrule]%
6042 (0,0)(\mdf@templength,\mdf@subtitleabovelinewidth@length)%
6043 \end{psicture}%
6044 }%
6045 }
6046 \def\mdf@drawsubtitlebackground{%
6047 \rlap{%
6048 \hspace*{-\mdf@innerleftmargin@length}%
6049 \begin{pspicture}(0,0)(0,0)
6050 \psframe[style=mdfsubtitlebackground]%
6051 (0,0)(\mdf@templength,-\mdfsubtitleheight)%
6052 \end{psicture}%
6053 }%
6054 }
6055
6056 \newpsstyle{mdfsubtitleaboverule}{%
6057 linecolor=\mdf@subtitleabovelinecolor,
6058 fillcolor=\mdf@subtitleabovelinecolor,
6059 fillstyle=solid,dimen=outer,%
6060 }
6061
6062 \newpsstyle{mdfsubtitlebelowrule}{%
6063 linecolor=\mdf@subtitlebelowlinecolor,
6064 fillcolor=\mdf@subtitlebelowlinecolor,
6065 fillstyle=solid,dimen=outer,%
6066 }
6067
6068 \newpsstyle{mdfsubtitlebackground}{%
6069 linecolor=\mdf@subtitlebackgroundcolor,
6070 fillcolor=\mdf@subtitlebackgroundcolor,
6071 fillstyle=solid,linestyle=none,
6072 }
6073
6074 \newpsstyle{mdfsubsubtitleaboverule}{%
6075 linecolor=\mdf@subtitleabovelinecolor,
6076 fillcolor=\mdf@subtitleabovelinecolor,
6077 fillstyle=solid,dimen=outer,%
6078 }
6079
6080 \newpsstyle{mdfsubsubtitlebelowrule}{%
6081 linecolor=\mdf@subtitlebelowlinecolor,
6082 fillcolor=\mdf@subtitlebelowlinecolor,
6083 fillstyle=solid,dimen=outer,%
6084 }
6085
6086 \newpsstyle{mdfsubsubtitlebackground}{%
6087 linecolor=\mdf@subtitlebackgroundcolor,
6088 fillcolor=\mdf@subtitlebackgroundcolor,
6089 fillstyle=solid,linestyle=none,
6090 }
6091
6092 % \end{macrocode}
6093 % \end{macro}
6094 %
6095 %
6096 %
6097 %
6098 %
6099 %
6100 %
6101 %
6102 %
6103 %
6104 % \begin{macro}{mdf@putbox@single}
6105 % Single output
6106 % \begin{macrocode}
6107 % Info zu den verwendeten Punkten:
6108 % O ist die untere linke Ecke der Mitte der middleline
6109 % P ist die obere rechte Ecke der Mitte der middleline
6110 % A ist der Punkt fuer den anchor (d.h. die untere linke Ecke) der Ausgabebox
6111 \def\mdf@putbox@single{%
6112 \ifvoid\mdf@splitbox@one\relax
6113 \else%
6114 \mdf@makebox@out{%
6115 \mdf@makeboxalign@left%
6116 \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}%
6117 \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax%
6118 \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax%
6119 \ifbool{mdf@leftline}{%
6120 \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
6121 \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
6122 \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
6123 \ifbool{mdf@rightline}{%
6124 \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
6125 \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
6126 \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
6127 %
6128 \setlength\mdfboundingboxheight%
6129 {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
6130 \advance\mdfboundingboxheight by \mdf@innerbottommargin@length\relax%
6131 \advance\mdfboundingboxheight by \mdf@innertopmargin@length\relax%
6132 \ifbool{mdf@topline}{%
6133 \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
6134 \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
6135 \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
6136 \ifbool{mdf@bottomline}{%
6137 \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
6138 \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
6139 \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
6140 %
6141 \setlength\mdftotallinewidth{\dimexpr\mdf@innerlinewidth@length%
6142 +\mdf@middlelinewidth@length
6143 +\mdf@outerlinewidth@length\relax}%
6144 \psset{unit=1truecm}%
6145 \mdf@makebox@in[\mdfboundingboxwidth]{%
6146 \null%
6147 \begin{pspicture}(0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)
6148 \mdfpstricks@settings%
6149 \psset{linearc=\mdf@roundcorner@length,cornersize=absolut,}%
6150 \expandafter\psset\expandafter{\mdf@psset@local}%
6151 \pnode(\mdf@innerleftmargin@length,\mdf@innerbottommargin@length)
6152 {mdf@A}
6153 \pnode(0,0){mdf@O}
6154 \pnode(\mdfboundingboxwidth,\mdfboundingboxheight){mdf@P}
6155 \ifbool{mdf@leftline}%
6156 {%
6157 \nodexn{(mdf@A)+(\mdf@outerlinewidth@length,0)
6158 +(\mdf@middlelinewidth@length,0)
6159 +(\mdf@innerlinewidth@length,0)}{mdf@A}%
6160 \nodexn{(mdf@O)+(\mdf@outerlinewidth@length,0)
6161 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}%
6162 }{}%
6163 \ifbool{mdf@rightline}%
6164 {%
6165 \nodexn{(mdf@P)-(\mdf@outerlinewidth@length,0)
6166 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}%
6167 }{}%
6168 \ifbool{mdf@bottomline}%
6169 {%
6170 \nodexn{(mdf@A)+(0,\mdf@outerlinewidth@length)
6171 +(0,\mdf@middlelinewidth@length)
6172 +(0,\mdf@innerlinewidth@length)}{mdf@A}%
6173 \nodexn{(mdf@O)+(0,\mdf@outerlinewidth@length)
6174 +0.5(0,\mdf@middlelinewidth@length)}{mdf@O}%
6175 }{}%
6176 \ifbool{mdf@topline}%
6177 {%
6178 \nodexn{(mdf@P)-(0,\mdf@outerlinewidth@length)
6179 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}
6180 }{}%
6181 \ifbool{mdf@shadow}
6182 {\psframe[style=mdfshadow](mdf@O)(mdf@P)}{}
6183 % \psclip{%
6184 %Four lines
6185 \mdf@test@ltrb{\mdf@pstricksbox@fl{mdf@O}{mdf@P}}{}
6186 %three lines
6187 \mdf@test@ltb{%
6188 \mdf@pstricksbox@tl{(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6189 \mdf@test@trb{%
6190 \mdf@pstricksbox@tl{(mdf@O)(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}}{}
6191 \mdf@test@ltr{%
6192 \mdf@pstricksbox@tl{(mdf@O)(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}%
6193 \mdf@test@lrb{%
6194 \mdf@pstricksbox@tl{(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}%
6195 %two lines combinded
6196 \mdf@test@lb{\mdf@pstricksbox@tcl%
6197 {(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}%
6198 {(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)}}{}
6199 \mdf@test@rb{\mdf@pstricksbox@tcl%
6200 {(mdf@P)(mdf@O|mdf@P)(mdf@O)}%
6201 {(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}
6202 \mdf@test@tr{\mdf@pstricksbox@tcl%
6203 {(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)}%
6204 {(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}
6205 \mdf@test@lt{\mdf@pstricksbox@tcl%
6206 {(mdf@O)(mdf@P|mdf@O)(mdf@P)}%
6207 {(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6208 %two lines not combinded combinded
6209 \mdf@test@lr{\mdf@pstricksbox@tncl{(mdf@O|mdf@P)}{(mdf@P|mdf@O)}
6210 }{}
6211 \mdf@test@tb{\mdf@pstricksbox@tncl{(mdf@P|mdf@O)}{(mdf@O|mdf@P)}
6212 }{}
6213 %single line
6214 \mdf@test@l{\mdf@pstricksbox@ol{(mdf@O)(mdf@O|mdf@P)}}{}
6215 \mdf@test@r{\mdf@pstricksbox@ol{(mdf@P)(mdf@P|mdf@O)}}{}
6216 \mdf@test@t{\mdf@pstricksbox@ol{(mdf@P)(mdf@O|mdf@P)}}{}
6217 \mdf@test@b{\mdf@pstricksbox@ol{(mdf@O)(mdf@P|mdf@O)}}{}
6218 %no line
6219 \mdf@test@noline{\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}
6220 % }
6221 %Frametitlebackground
6222 \drawbrackgroundframetitle@single
6223 %output%
6224 \rput[bl](mdf@A){\box\mdf@splitbox@one}
6225 % \psdot(mdf@A)\uput[90](mdf@A){mdf at A}
6226 % \psdot(mdf@P)\uput[90](mdf@P){mdf at P}
6227 % \psdot(mdf@O)\uput[90](mdf@O){mdf at O}
6228 %
6229 % \endpsclip
6230 \mdf@extra%
6231 \mdf@singleextra
6232 \end{pspicture}%
6233 }%
6234 \mdf@makeboxalign@right%
6235 }%
6236 \fi
6237 }%
6238 \def\drawbrackgroundframetitle@single{%
6239 \ifdefempty{\mdf@frametitle}{}{%
6240 \drawbrackgroundframetitle@@single%
6241 }%
6242 }%
6243 \def\drawbrackgroundframetitle@@single{%
6244 \begingroup%
6245 \ifbool{mdf@leftline}{%
6246 \nodexn{(mdf@O)+(\mdf@innerlinewidth@length,0)
6247 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}%
6248 }{}%
6249 \ifbool{mdf@rightline}{%
6250 \nodexn{(mdf@P)-(\mdf@innerlinewidth@length,0)
6251 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}%
6252 }{}%
6253 \ifbool{mdf@topline}{%
6254 \nodexn{(mdf@P)-(0,\mdf@innerlinewidth@length)
6255 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}%
6256 }{}%
6257 \nodexn{(mdf@P)-(0,\mdfframetitleboxtotalheight)}{mdf@F}%
6258 \psline[style=mdfframetitlebackgroundstyle](mdf@O|mdf@F)(mdf@O|mdf@P)
6259 (mdf@P)(mdf@P|mdf@F)%
6260 \endgroup
6261 }
6262 % \end{macrocode}
6263 % \end{macro}
6264 %
6265 % \begin{macro}{mdf@putbox@first}
6266 % First output
6267 % \begin{macrocode}
6268 \def\mdf@putbox@first{%
6269 \ifvoid\mdf@splitbox@two
6270 \else%
6271 \mdf@makebox@out{%
6272 \mdf@makeboxalign@left%
6273 %\ifbool{mdf@leftline}{\hspace*{\mdf@middlelinewidth@length}}{}%
6274 \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@two}%
6275 \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax%
6276 \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax%
6277 \ifbool{mdf@leftline}{%
6278 \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
6279 \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
6280 \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
6281 \ifbool{mdf@rightline}{%
6282 \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
6283 \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
6284 \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
6285 \setlength\mdfboundingboxheight%
6286 {\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax}%
6287 \advance\mdfboundingboxheight by \mdf@innertopmargin@length\relax%
6288 \advance\mdfboundingboxheight by \mdf@splitbottomskip@length\relax%
6289 \ifbool{mdf@topline}{%
6290 \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
6291 \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
6292 \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
6293 %%%%%%%%%
6294 \ifbool{mdf@everyline}{%
6295 \ifbool{mdf@bottomline}{%
6296 \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
6297 \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
6298 \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
6299 }{}%
6300 %%%%%%%%%%%%%%
6301 \psset{linearc=\mdf@roundcorner@length,cornersize=absolute}%
6302 \expandafter\psset\expandafter{\mdf@psset@local}%
6303 \mdf@makebox@in[\mdfboundingboxwidth]{%
6304 \null%
6305 \psset{unit=1truecm}%
6306 \ifdimgreater{\mdfboundingboxheight}{\vsize}
6307 {\begin{pspicture}(0,0)(\mdfboundingboxwidth,\vsize)}
6308 {\begin{pspicture}(0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)}
6309 \mdfpstricks@settings%
6310 \psset{linearc=\mdf@roundcorner@length,cornersize=absolut,}%
6311 \expandafter\psset\expandafter{\mdf@psset@local}%
6312 \pnode(\mdf@innerleftmargin@length,\mdf@splitbottomskip@length){mdf@A}
6313 \pnode(0,0){mdf@O}
6314 \pnode(\mdfboundingboxwidth,\mdfboundingboxheight){mdf@P}
6315 \ifbool{mdf@leftline}%
6316 {%
6317 \nodexn{(mdf@A)+(\mdf@outerlinewidth@length,0)
6318 +(\mdf@middlelinewidth@length,0)
6319 +(\mdf@innerlinewidth@length,0)}{mdf@A}
6320 \nodexn{(mdf@O)+(\mdf@outerlinewidth@length,0)
6321 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}
6322 }{}%
6323 \ifbool{mdf@rightline}%
6324 {%
6325 \nodexn{(mdf@P)-(\mdf@outerlinewidth@length,0)
6326 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}
6327 }{}%
6328 \ifbool{mdf@topline}%
6329 {%
6330 \nodexn{(mdf@P)-(0,\mdf@outerlinewidth@length)
6331 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}
6332 }{}%
6333 %%%%%%%%%%%
6334 \ifbool{mdf@everyline}{%
6335 \ifbool{mdf@bottomline}%
6336 {%
6337 \nodexn{(mdf@A)+(0,\mdf@outerlinewidth@length)
6338 +(0,\mdf@middlelinewidth@length)
6339 +(0,\mdf@innerlinewidth@length)}{mdf@A}%
6340 \nodexn{(mdf@O)+(0,\mdf@outerlinewidth@length)
6341 +0.5(0,\mdf@middlelinewidth@length)}{mdf@O}%
6342 }{}%
6343 }{}%
6344 %%%%%%%%%%
6345 \ifbool{mdf@shadow}
6346 {\pscustom[style=mdfshadow,linestyle=none]{%
6347 \psline[linejoin=2,linecap=1,]%
6348 (mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)%
6349 \psline[linejoin=2,linecap=1,linearc=\z@]%
6350 (mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)
6351 \closedshadow
6352 }
6353 }{}
6354 % \psclip{
6355 %%%%%%%%%%%%%
6356 \ifbool{mdf@everyline}{%
6357 %Four lines
6358 \mdf@test@ltrb{\mdf@pstricksbox@fl{mdf@O}{mdf@P}}{}
6359 %three lines
6360 \mdf@test@ltb{%
6361 \mdf@pstricksbox@tl{(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6362 \mdf@test@trb{%
6363 \mdf@pstricksbox@tl{(mdf@O)(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}}{}
6364 \mdf@test@ltr{%
6365 \mdf@pstricksbox@tl{(mdf@O)(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}%
6366 \mdf@test@lrb{%
6367 \mdf@pstricksbox@tl{(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}%
6368 %two lines combinded
6369 \mdf@test@lb{\mdf@pstricksbox@tcl%
6370 {(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}%
6371 {(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)}}{}
6372 \mdf@test@rb{\mdf@pstricksbox@tcl%
6373 {(mdf@P)(mdf@O|mdf@P)(mdf@O)}%
6374 {(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}
6375 \mdf@test@tr{\mdf@pstricksbox@tcl%
6376 {(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)}%
6377 {(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}
6378 \mdf@test@lt{\mdf@pstricksbox@tcl%
6379 {(mdf@O)(mdf@P|mdf@O)(mdf@P)}%
6380 {(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6381 %two lines not combinded combinded
6382 \mdf@test@lr{\mdf@pstricksbox@tncl{(mdf@O|mdf@P)}{(mdf@P|mdf@O)}
6383 }{}
6384 \mdf@test@tb{\mdf@pstricksbox@tncl{(mdf@P|mdf@O)}{(mdf@O|mdf@P)}
6385 }{}
6386 %single line
6387 \mdf@test@l{\mdf@pstricksbox@ol{(mdf@O)(mdf@O|mdf@P)}}{}
6388 \mdf@test@r{\mdf@pstricksbox@ol{(mdf@P)(mdf@P|mdf@O)}}{}
6389 \mdf@test@t{\mdf@pstricksbox@ol{(mdf@P)(mdf@O|mdf@P)}}{}
6390 \mdf@test@b{\mdf@pstricksbox@ol{(mdf@O)(mdf@P|mdf@O)}}{}
6391 %no line
6392 \mdf@test@noline{\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}%
6393 }{%
6394 %Four or Three lines
6395 \ifboolexpr{test {\mdf@test@ltrb} or test {\mdf@test@ltr}}%
6396 {\mdf@pstricksbox@tl{(mdf@O)(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}%
6397 {}%
6398 %two combinded lines
6399 \ifboolexpr{test {\mdf@test@ltb} or test {\mdf@test@lt}}
6400 {\mdf@pstricksbox@tcl{(mdf@O)(mdf@P|mdf@O)(mdf@P)}%
6401 {(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6402 \ifboolexpr{test {\mdf@test@trb} or test {\mdf@test@tr}}%
6403 {\mdf@pstricksbox@tcl{(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)}%
6404 {(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}
6405 %two not combinded lines
6406 \ifboolexpr{test {\mdf@test@lrb} or test {\mdf@test@lr}}%
6407 {\mdf@pstricksbox@tncl{(mdf@O|mdf@P)}{(mdf@P|mdf@O)}}{}
6408 %single line
6409 \ifboolexpr{test {\mdf@test@tb} or test {\mdf@test@t}}%
6410 {\mdf@pstricksbox@ol{(mdf@P)(mdf@O|mdf@P)}}{}
6411 \ifboolexpr{test {\mdf@test@lb} or test {\mdf@test@l}}%
6412 {\mdf@pstricksbox@ol{(mdf@O)(mdf@O|mdf@P)}}{}
6413 \ifboolexpr{test {\mdf@test@rb} or test {\mdf@test@r}}%
6414 {\mdf@pstricksbox@ol{(mdf@P)(mdf@P|mdf@O)}}{}
6415 %no line
6416 \mdf@test@b{\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}%
6417 \mdf@test@noline{\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}%
6418 }%
6419 % }
6420 %Frametitlebackground
6421 \drawbrackgroundframetitle@first
6422 %output%
6423 \rput[bl](mdf@A){\box\mdf@splitbox@two}
6424 % \psdot(mdf@A)\uput[90](mdf@A){mdf at A}
6425 % \psdot(mdf@P)\uput[90](mdf@P){mdf at P}
6426 % \psdot(mdf@O)\uput[90](mdf@O){mdf at O}
6427 % \endpsclip
6428 \mdf@extra%
6429 \mdf@firstextra%
6430 \end{pspicture}
6431 }%
6432 \mdf@makeboxalign@right%
6433 }%
6434 \fi
6435 }%
6436 \def\drawbrackgroundframetitle@first{%
6437 \ifdefempty{\mdf@frametitle}{}%
6438 {%
6439 \ifbool{mdf@repeatframetitle}%
6440 {%repeating title = true
6441 \drawbrackgroundframetitle@@@first
6442 }%
6443 {%
6444 \ifdimgreater{\mdfboundingboxheight}{\mdfframetitleboxtotalheight}%
6445 {%
6446 \drawbrackgroundframetitle@@first
6447 \global\mdfframetitleboxtotalheight=-\p@%
6448 }{\mdf@PackageWarning{You got a page break inside the frame
6449 title\MessageBreak
6450 Currently this isn't well supported}%
6451 \drawbrackgroundframetitle@@first
6452 \global\mdfframetitleboxtotalheight=\dimexpr
6453 \mdfframetitleboxtotalheight
6454 -\mdfboundingboxheight
6455 -\mdf@innerlinewidth@length
6456 -0.5\mdf@middlelinewidth@length%
6457 +\mdf@frametitlebelowskip@length
6458 +\mdf@splitbottomskip@length
6459 +\mdf@splittopskip@length
6460 +\dp\strutbox\relax%
6461 }%
6462 }%
6463 }%
6464 }%
6465 \def\drawbrackgroundframetitle@@first{%
6466 \begingroup%
6467 \ifbool{mdf@leftline}{%
6468 \nodexn{(mdf@O)+(\mdf@innerlinewidth@length,0)
6469 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}%
6470 }{}%
6471 \ifbool{mdf@rightline}{%
6472 \nodexn{(mdf@P)-(\mdf@innerlinewidth@length,0)
6473 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}%
6474 }{}%
6475 \ifbool{mdf@topline}{%
6476 \nodexn{(mdf@P)-(0,\mdf@innerlinewidth@length)
6477 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}%
6478 }{}%
6479 \ifdimgreater{\mdfboundingboxheight}{\mdfframetitleboxtotalheight}
6480 {\nodexn{(mdf@P)-(0,\mdfframetitleboxtotalheight)}{mdf@F}}%
6481 {\nodexn{(mdf@O)}{mdf@F}}%
6482 \psline[style=mdfframetitlebackgroundstyle](mdf@O|mdf@F)(mdf@O|mdf@P)
6483 (mdf@P)(mdf@P|mdf@F)%
6484 \endgroup
6485 }
6486 \def\drawbrackgroundframetitle@@@first{%
6487 \begingroup%
6488 \ifbool{mdf@leftline}{%
6489 \nodexn{(mdf@O)+(\mdf@innerlinewidth@length,0)
6490 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}%
6491 }{}%
6492 \ifbool{mdf@rightline}{%
6493 \nodexn{(mdf@P)-(\mdf@innerlinewidth@length,0)
6494 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}%
6495 }{}%
6496 \ifbool{mdf@topline}{%
6497 \nodexn{(mdf@P)-(0,\mdf@innerlinewidth@length)
6498 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}%
6499 }{}%
6500 \nodexn{(mdf@P)-(0,\mdfframetitleboxtotalheight)}{mdf@F}%
6501 \psline[style=mdfframetitlebackgroundstyle](mdf@O|mdf@F)(mdf@O|mdf@P)
6502 (mdf@P)(mdf@P|mdf@F)%
6503 \endgroup
6504 }
6505 % \end{macrocode}
6506 % \end{macro}
6507 %
6508 % \begin{macro}{mdf@putbox@middle}
6509 % Middle output
6510 % \begin{macrocode}
6511 \def\mdf@putbox@middle{%
6512 \ifvoid\mdf@splitbox@two
6513 \else%
6514 \mdf@makebox@out{%
6515 \mdf@makeboxalign@left%
6516 % \ifbool{mdf@leftline}{\hspace*{\mdf@middlelinewidth@length}}{}%
6517 \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@two}%
6518 \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax%
6519 \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax%
6520 \ifbool{mdf@leftline}{%
6521 \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
6522 \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
6523 \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
6524 \ifbool{mdf@rightline}{%
6525 \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
6526 \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
6527 \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
6528 \setlength\mdfboundingboxheight%
6529 {\dimexpr\ht\mdf@splitbox@two+\dp\mdf@splitbox@two\relax}%
6530 \advance\mdfboundingboxheight by \mdf@splitbottomskip@length\relax%
6531 %%%%%%%%%
6532 \ifbool{mdf@everyline}{%
6533 \ifbool{mdf@topline}{%
6534 \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
6535 \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
6536 \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
6537 \ifbool{mdf@bottomline}{%
6538 \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
6539 \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
6540 \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
6541 }{}%
6542 %%%%%%%%%%%%%%
6543 \psset{unit=1truecm}%
6544 \mdf@makebox@in[\mdfboundingboxwidth]{%
6545 \null%
6546 \ifdimgreater{\mdfboundingboxheight}{\vsize}
6547 {\begin{pspicture}(0,0)(\mdfboundingboxwidth,\vsize)}
6548 {\begin{pspicture}(0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)}
6549 \mdfpstricks@settings%
6550 \psset{linearc=0pt,cornersize=absolut,}%
6551 \expandafter\psset\expandafter{\mdf@psset@local}%
6552 %%%%
6553 \pnode(\mdf@innerleftmargin@length,\mdf@splitbottomskip@length){mdf@A}
6554 \pnode(0,0){mdf@O}
6555 \pnode(\mdfboundingboxwidth,\mdfboundingboxheight){mdf@P}
6556 \ifbool{mdf@leftline}%
6557 {%
6558 \nodexn{(mdf@A)+(\mdf@outerlinewidth@length,0)
6559 +(\mdf@middlelinewidth@length,0)
6560 +(\mdf@innerlinewidth@length,0)}{mdf@A}
6561 \nodexn{(mdf@O)+(\mdf@outerlinewidth@length,0)
6562 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}
6563 }{}%
6564 \ifbool{mdf@rightline}%
6565 {%
6566 \nodexn{(mdf@P)-(\mdf@outerlinewidth@length,0)
6567 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}
6568 }{}%
6569 %%
6570 %%%%%%%%%%%
6571 \ifbool{mdf@everyline}{%
6572 \ifbool{mdf@bottomline}%
6573 {%
6574 \nodexn{(mdf@A)+(0,\mdf@outerlinewidth@length)
6575 +(0,\mdf@middlelinewidth@length)
6576 +(0,\mdf@innerlinewidth@length)}{mdf@A}%
6577 \nodexn{(mdf@O)+(0,\mdf@outerlinewidth@length)
6578 +0.5(0,\mdf@middlelinewidth@length)}{mdf@O}%
6579 }{}%
6580 \ifbool{mdf@topline}%
6581 {%
6582 \nodexn{(mdf@P)-(0,\mdf@outerlinewidth@length)
6583 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}
6584 }{}%
6585 }{}%
6586 %%%%%%%%%%
6587 %%
6588 \ifbool{mdf@shadow}
6589 {\psframe[style=mdfshadow](mdf@O)(mdf@P)}{}
6590 %%%%%%%%%%%%%
6591 \ifbool{mdf@everyline}{%
6592 %Four lines
6593 \mdf@test@ltrb{\mdf@pstricksbox@fl{mdf@O}{mdf@P}}{}
6594 %three lines
6595 \mdf@test@ltb{%
6596 \mdf@pstricksbox@tl{(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6597 \mdf@test@trb{%
6598 \mdf@pstricksbox@tl{(mdf@O)(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}}{}
6599 \mdf@test@ltr{%
6600 \mdf@pstricksbox@tl{(mdf@O)(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}%
6601 \mdf@test@lrb{%
6602 \mdf@pstricksbox@tl{(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}%
6603 %two lines combinded
6604 \mdf@test@lb{\mdf@pstricksbox@tcl%
6605 {(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}%
6606 {(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)}}{}
6607 \mdf@test@rb{\mdf@pstricksbox@tcl%
6608 {(mdf@P)(mdf@O|mdf@P)(mdf@O)}%
6609 {(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}
6610 \mdf@test@tr{\mdf@pstricksbox@tcl%
6611 {(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)}%
6612 {(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}
6613 \mdf@test@lt{\mdf@pstricksbox@tcl{(mdf@O)(mdf@P|mdf@O)(mdf@P)}%
6614 {(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6615 %two lines not combinded combinded
6616 \mdf@test@lr{\mdf@pstricksbox@tncl{(mdf@O|mdf@P)}{(mdf@P|mdf@O)}
6617 }{}
6618 \mdf@test@tb{\mdf@pstricksbox@tncl{(mdf@P|mdf@O)}{(mdf@O|mdf@P)}
6619 }{}
6620 %single line
6621 \mdf@test@l{\mdf@pstricksbox@ol{(mdf@O)(mdf@O|mdf@P)}}{}
6622 \mdf@test@r{\mdf@pstricksbox@ol{(mdf@P)(mdf@P|mdf@O)}}{}
6623 \mdf@test@t{\mdf@pstricksbox@ol{(mdf@P)(mdf@O|mdf@P)}}{}
6624 \mdf@test@b{\mdf@pstricksbox@ol{(mdf@O)(mdf@P|mdf@O)}}{}
6625 %no line
6626 \mdf@test@noline{\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}%
6627 }{%
6628 \ifboolexpr{bool {mdf@leftline} and bool {mdf@rightline}}%
6629 {\mdf@pstricksbox@tncl{(mdf@O|mdf@P)}{(mdf@P|mdf@O)}}{}%
6630 \ifboolexpr{bool {mdf@leftline} and not (bool {mdf@rightline})}%
6631 {\mdf@pstricksbox@ol{(mdf@O)(mdf@O|mdf@P)}}{}%
6632 \ifboolexpr{not (bool {mdf@leftline}) and bool {mdf@rightline}}%
6633 {\mdf@pstricksbox@ol{(mdf@P)(mdf@P|mdf@O)}}{}%
6634 \ifboolexpr{not (bool {mdf@leftline}) and not (bool {mdf@rightline})}%
6635 {\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}%
6636 }%
6637 %Frametitlebackground
6638 \drawbrackgroundframetitle@middle
6639 %output%
6640 \rput[bl](mdf@A){\box\mdf@splitbox@two}
6641 %\psdot(mdf@A)\uput[90](mdf@A){mdf at A}
6642 %\psdot(mdf@P)\uput[90](mdf@P){mdf at P}
6643 %\psdot(mdf@O)\uput[90](mdf@O){mdf at O}
6644 \mdf@extra%
6645 \mdf@middleextra%
6646 \end{pspicture}%
6647 }%
6648 \mdf@makeboxalign@right%
6649 }%
6650 \fi
6651 }%
6652 \def\drawbrackgroundframetitle@middle{%
6653 \ifdefempty{\mdf@frametitle}{}%
6654 {%
6655 \ifbool{mdf@repeatframetitle}%
6656 {%repeating title = true
6657 \drawbrackgroundframetitle@@@middle
6658 }%
6659 {%
6660 \ifdimless{\mdfframetitleboxtotalheight}{\z@}
6661 {}%
6662 {%
6663 \drawbrackgroundframetitle@@middle
6664 \global\mdfframetitleboxtotalheight=-\p@\relax%
6665 }%
6666 }%
6667 }%
6668 }%
6669 \def\drawbrackgroundframetitle@@middle{%
6670 \begingroup%
6671 \ifbool{mdf@leftline}{%
6672 \nodexn{(mdf@O)+(\mdf@innerlinewidth@length,0)
6673 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}%
6674 }{}%
6675 \ifbool{mdf@rightline}{%
6676 \nodexn{(mdf@P)-(\mdf@innerlinewidth@length,0)
6677 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}%
6678 }{}%
6679 \nodexn{(mdf@P)-(0,\mdfframetitleboxtotalheight)}{mdf@F}%
6680 \psline[style=mdfframetitlebackgroundstyle,linearc=\z@]%
6681 (mdf@O|mdf@F)(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@F)%
6682 \endgroup
6683 }
6684 \def\drawbrackgroundframetitle@@@middle{%
6685 \begingroup%
6686 \ifbool{mdf@leftline}{%
6687 \nodexn{(mdf@O)+(\mdf@innerlinewidth@length,0)
6688 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}%
6689 }{}%
6690 \ifbool{mdf@rightline}{%
6691 \nodexn{(mdf@P)-(\mdf@innerlinewidth@length,0)
6692 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}%
6693 }{}%
6694 \ifbool{mdf@everyline}%
6695 {%
6696 \ifbool{mdf@topline}{%
6697 \nodexn{(mdf@P)-(0,\mdf@innerlinewidth@length)
6698 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}%
6699 }{}%
6700 }{}%
6701 \nodexn{(mdf@P)-(0,\mdfframetitleboxtotalheight)}{mdf@F}%
6702 \psline[style=mdfframetitlebackgroundstyle](mdf@O|mdf@F)(mdf@O|mdf@P)
6703 (mdf@P)(mdf@P|mdf@F)%
6704 \endgroup
6705 }
6706 % \end{macrocode}
6707 % \end{macro}
6708 %
6709 % \begin{macro}{mdf@putbox@second}
6710 % Last output
6711 % \begin{macrocode}
6712 \def\mdf@putbox@second{
6713 \ifvoid\mdf@splitbox@one
6714 \else%
6715 \mdf@makebox@out{%
6716 \mdf@makeboxalign@left%
6717 % \ifbool{mdf@leftline}{\hspace*{\mdf@middlelinewidth@length}}{}%
6718 \setlength\mdfboundingboxwidth{\wd\mdf@splitbox@one}%
6719 \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax%
6720 \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax%
6721 \ifbool{mdf@leftline}{%
6722 \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
6723 \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
6724 \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
6725 \ifbool{mdf@rightline}{%
6726 \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
6727 \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
6728 \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
6729 \setlength\mdfboundingboxheight%
6730 {\dimexpr\ht\mdf@splitbox@one+\dp\mdf@splitbox@one\relax}%
6731 \advance\mdfboundingboxheight by \mdf@innerbottommargin@length\relax%
6732 \ifbool{mdf@bottomline}{%
6733 \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
6734 \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
6735 \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
6736 %%%%%%%%%
6737 \ifbool{mdf@everyline}{%
6738 \ifbool{mdf@topline}{%
6739 \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
6740 \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
6741 \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
6742 }{}%
6743 %%%%%%%%%%%%%%
6744 \psset{unit=1truecm}%
6745 \mdf@makebox@in[\mdfboundingboxwidth]{%
6746 \null%
6747 \begin{pspicture}(0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)
6748 \mdfpstricks@settings%
6749 \psset{linearc=\mdf@roundcorner@length,cornersize=absolut,}%
6750 \expandafter\psset\expandafter{\mdf@psset@local}%
6751 \pnode(\mdf@innerleftmargin@length,\mdf@innerbottommargin@length)
6752 {mdf@A}
6753 \pnode(0,0){mdf@O}
6754 \pnode(\mdfboundingboxwidth,\mdfboundingboxheight){mdf@P}
6755 \ifbool{mdf@leftline}%
6756 {%
6757 \nodexn{(mdf@A)+(\mdf@outerlinewidth@length,0)
6758 +(\mdf@middlelinewidth@length,0)
6759 +(\mdf@innerlinewidth@length,0)}{mdf@A}
6760 \nodexn{(mdf@O)+(\mdf@outerlinewidth@length,0)
6761 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}
6762 }{}%
6763 \ifbool{mdf@rightline}%
6764 {%
6765 \nodexn{(mdf@P)-(\mdf@outerlinewidth@length,0)
6766 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}
6767 }{}%
6768 \ifbool{mdf@bottomline}%
6769 {%
6770 \nodexn{(mdf@A)+(0,\mdf@outerlinewidth@length)
6771 +(0,\mdf@middlelinewidth@length)
6772 +(0,\mdf@innerlinewidth@length)}{mdf@A}
6773 \nodexn{(mdf@O)+(0,\mdf@outerlinewidth@length)
6774 +0.5(0,\mdf@middlelinewidth@length)}{mdf@O}
6775 }{}%
6776 %%%%%%%%%%%
6777 \ifbool{mdf@everyline}{%
6778 \ifbool{mdf@topline}%
6779 {%
6780 \nodexn{(mdf@P)-(0,\mdf@outerlinewidth@length)
6781 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}
6782 }{}%
6783 }{}%
6784 %%%%%%%%%%
6785 %%
6786 \ifbool{mdf@shadow}
6787 {\pscustom[style=mdfshadow,linestyle=none]{%
6788 \psline[linejoin=2,linecap=1,](mdf@O|mdf@P)(mdf@O)%
6789 (mdf@P|mdf@O)(mdf@P)%
6790 \psline[linejoin=2,linecap=1,linearc=\z@](mdf@O|mdf@P)(mdf@P)
6791 \closedshadow
6792 }
6793 }{}
6794 %%%%%%%%%%%%%
6795 \ifbool{mdf@everyline}{%
6796 %Four lines
6797 \mdf@test@ltrb{\mdf@pstricksbox@fl{mdf@O}{mdf@P}}{}
6798 %three lines
6799 \mdf@test@ltb{%
6800 \mdf@pstricksbox@tl{(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6801 \mdf@test@trb{%
6802 \mdf@pstricksbox@tl{(mdf@O)(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}}{}
6803 \mdf@test@ltr{%
6804 \mdf@pstricksbox@tl{(mdf@O)(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}%
6805 \mdf@test@lrb{%
6806 \mdf@pstricksbox@tl{(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}%
6807 %two lines combinded
6808 \mdf@test@lb{\mdf@pstricksbox@tcl%
6809 {(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}%
6810 {(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)}}{}
6811 \mdf@test@rb{\mdf@pstricksbox@tcl%
6812 {(mdf@P)(mdf@O|mdf@P)(mdf@O)}%
6813 {(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}
6814 \mdf@test@tr{\mdf@pstricksbox@tcl%
6815 {(mdf@P|mdf@O)(mdf@O)(mdf@O|mdf@P)}%
6816 {(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@O)}}{}
6817 \mdf@test@lt{\mdf@pstricksbox@tcl%
6818 {(mdf@O)(mdf@P|mdf@O)(mdf@P)}%
6819 {(mdf@O)(mdf@O|mdf@P)(mdf@P)}}{}
6820 %two lines not combinded combinded
6821 \mdf@test@lr{\mdf@pstricksbox@tncl{(mdf@O|mdf@P)}{(mdf@P|mdf@O)}
6822 }{}
6823 \mdf@test@tb{\mdf@pstricksbox@tncl{(mdf@P|mdf@O)}{(mdf@O|mdf@P)}
6824 }{}
6825 %single line
6826 \mdf@test@l{\mdf@pstricksbox@ol{(mdf@O)(mdf@O|mdf@P)}}{}
6827 \mdf@test@r{\mdf@pstricksbox@ol{(mdf@P)(mdf@P|mdf@O)}}{}
6828 \mdf@test@t{\mdf@pstricksbox@ol{(mdf@P)(mdf@O|mdf@P)}}{}
6829 \mdf@test@b{\mdf@pstricksbox@ol{(mdf@O)(mdf@P|mdf@O)}}{}
6830 %no line
6831 \mdf@test@noline{\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}%
6832 }{%
6833 %Four + Three
6834 \ifboolexpr{test {\mdf@test@ltrb} or test {\mdf@test@lrb}}%
6835 {\mdf@pstricksbox@tl{(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}%
6836 %Two combinded
6837 \ifboolexpr{test {\mdf@test@ltb} or test {\mdf@test@lb}}%
6838 {\mdf@pstricksbox@tcl{(mdf@P|mdf@O)(mdf@P)(mdf@O|mdf@P)}%
6839 {(mdf@O|mdf@P)(mdf@O)(mdf@P|mdf@O)}}{}
6840 \ifboolexpr{test {\mdf@test@trb} or test {\mdf@test@rb}}%
6841 {\mdf@pstricksbox@tcl{(mdf@P)(mdf@O|mdf@P)(mdf@O)}%
6842 {(mdf@O)(mdf@P|mdf@O)(mdf@P)}}{}
6843 %Two not combinded
6844 \ifboolexpr{test {\mdf@test@ltr} or test {\mdf@test@lr}}%
6845 {\mdf@pstricksbox@tncl{(mdf@O|mdf@P)}{(mdf@P|mdf@O)}}{}%
6846 %one line
6847 \ifboolexpr{test {\mdf@test@tb} or test {\mdf@test@b}}%
6848 {\mdf@pstricksbox@ol{(mdf@O)(mdf@P|mdf@O)}}{}
6849 \ifboolexpr{test {\mdf@test@lt} or test {\mdf@test@l}}%
6850 {\mdf@pstricksbox@ol{(mdf@O)(mdf@O|mdf@P)}}{}
6851 \ifboolexpr{test {\mdf@test@tr} or test {\mdf@test@r}}%
6852 {\mdf@pstricksbox@ol{(mdf@P)(mdf@P|mdf@O)}}{}
6853 %no line
6854 \mdf@test@t{\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}%
6855 \mdf@test@noline{\psframe[style=mdfbackgroundstyle](mdf@O)(mdf@P)}{}%
6856 }%
6857 %Frametitlebackground
6858 \drawbrackgroundframetitle@second
6859 %output%
6860 \rput[bl](mdf@A){\box\mdf@splitbox@one}
6861 \mdf@extra%
6862 \mdf@secondextra
6863 % \psdot(mdf@A)\uput[90](mdf@A){mdf at A}
6864 % \psdot(mdf@P)\uput[90](mdf@P){mdf at P}
6865 % \psdot(mdf@O)\uput[90](mdf@O){mdf at O}
6866 \end{pspicture}%
6867 }%
6868 \mdf@makeboxalign@right%
6869 }%
6870 \fi
6871 }%
6872 \def\drawbrackgroundframetitle@second{%
6873 \ifdefempty{\mdf@frametitle}{}%
6874 {%
6875 \ifbool{mdf@repeatframetitle}%
6876 {%repeating title = true
6877 \drawbrackgroundframetitle@@@second
6878 }%
6879 {%
6880 \ifdimless{\mdfframetitleboxtotalheight}{\z@}
6881 {}{%
6882 \drawbrackgroundframetitle@@second
6883 }%
6884 }%
6885 }%
6886 }%
6887 \def\drawbrackgroundframetitle@@second{%
6888 \begingroup%
6889 \ifbool{mdf@leftline}{%
6890 \nodexn{(mdf@O)+(\mdf@innerlinewidth@length,0)
6891 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}%
6892 }{}%
6893 \ifbool{mdf@rightline}{%
6894 \nodexn{(mdf@P)-(\mdf@innerlinewidth@length,0)
6895 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}%
6896 }{}%
6897 \nodexn{(mdf@P)-(0,\mdfframetitleboxtotalheight)}{mdf@F}%
6898 \psline[style=mdfframetitlebackgroundstyle,linearc=\z@]%
6899 (mdf@O|mdf@F)(mdf@O|mdf@P)(mdf@P)(mdf@P|mdf@F)%
6900 \endgroup
6901 }
6902 \def\drawbrackgroundframetitle@@@second{%
6903 \begingroup%
6904 \ifbool{mdf@leftline}{%
6905 \nodexn{(mdf@O)+(\mdf@innerlinewidth@length,0)
6906 +0.5(\mdf@middlelinewidth@length,0)}{mdf@O}%
6907 }{}%
6908 \ifbool{mdf@rightline}{%
6909 \nodexn{(mdf@P)-(\mdf@innerlinewidth@length,0)
6910 -0.5(\mdf@middlelinewidth@length,0)}{mdf@P}%
6911 }{}%
6912 \ifbool{mdf@everyline}%
6913 {%
6914 \ifbool{mdf@topline}{%
6915 \nodexn{(mdf@P)-(0,\mdf@innerlinewidth@length)
6916 -0.5(0,\mdf@middlelinewidth@length)}{mdf@P}%
6917 }{}%
6918 }{}%
6919 \nodexn{(mdf@P)-(0,\mdfframetitleboxtotalheight)}{mdf@F}%
6920 \psline[style=mdfframetitlebackgroundstyle](mdf@O|mdf@F)(mdf@O|mdf@P)
6921 (mdf@P)(mdf@P|mdf@F)%
6922 \endgroup
6923 }
6924 % \end{macrocode}
6925 % \end{macro}
6926 %
6927 % \begin{macrocode}
6928 \endinput
6929 %eof
6930 % \end{macrocode}
6931 % \iffalse
6932 %</mdframepstricks>
6933 % \fi
6934 %
6935 %
6936 %
6937 %\iffalse
6938 % \begin{macrocode}
6939 %<*mdframed-example-default>
6940 % \end{macrocode}
6941 %\fi
6942 %
6943 % \section{The file mdframed-example-default}
6944 %
6945 % \begin{macrocode}
6946 %Documenation of the package mdframed
6947 \setcounter{errorcontextlines}{999}
6948 \documentclass[parskip=false,english,11pt]{ltxmdf}
6949
6950
6951
6952 \lstset{style=lstltxmdf}
6953
6954 \newcommand\Loadedframemethod{default}
6955 \usepackage[framemethod=\Loadedframemethod]{mdframed}
6956
6957
6958 \surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
6959 roundcorner=10pt,innertopmargin=0pt,%
6960 leftmargin=1cm,rightmargin=1cm,%
6961 innerleftmargin=-15pt,innerrightmargin=-15pt,%
6962 ignorelastdescenders,%
6963 settings={\lstset{resetmargins}},%
6964 skipbelow=\topskip,skipabove=\topskip,%
6965 innerbottommargin=0pt,backgroundcolor=gray!10]%
6966 {tltxmdfexample}
6967
6968
6969 \newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
6970 roundcorner=10pt,innertopmargin=0pt,%
6971 leftmargin=1cm,rightmargin=1cm,%
6972 innerleftmargin=-15pt,innerrightmargin=-15pt,%
6973 ignorelastdescenders,%
6974 settings={\lstset{resetmargins}},%
6975 skipbelow=\topskip,skipabove=\topskip,%
6976 innerbottommargin=0pt,backgroundcolor=gray!10]%
6977 {tltxmdfhighlight}
6978 \def\highlightinputenv{tltxmdfhighlight}
6979
6980
6981 \title{The \Pack{mdframed} package}
6982 \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}}
6983 \author{\href{mailto:[email protected]}{Marco Daniel}}
6984 \date{\mdfmaindate}
6985 \version{\mdversion}
6986 \introduction{In this document I collect various examples for
6987 \Opt{framemethod=\Loadedframemethod}.
6988 Some presented examples are more or less exorbitant.}
6989
6990 \mdfsetup{skipabove=\topskip,skipbelow=\topskip}
6991 \newrobustcmd\ExampleText{%
6992 An \textit{inhomogeneous linear} differential equation has the form
6993 \begin{align}
6994 L[v ] = f,
6995 \end{align}
6996 where $L$ is a linear differential operator, $v$ is
6997 the dependent variable, and $f$ is a given non-zero
6998 function of the independent variables alone.
6999 }
7000
7001 \newcounter{examplecount}
7002 \setcounter{examplecount}{0}
7003 \renewcommand\thesubsection{}
7004 \newcommand\Examplesec[1]{%
7005 \stepcounter{examplecount}%
7006 \subsection{Example~\arabic{examplecount}~--~#1\relax}%
7007 }
7008
7009 \begin{document}
7010 \maketitle
7011 \section{Loading}
7012 In the preamble only the package \Pack{mdframed} with the option
7013 \Opt{framemethod=\Loadedframemethod} is loaded. All other modifications will be
7014 done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}.
7015
7016 {\large\color{red!50!black}
7017 \NOTE Every \Cmd{global} inside the examples is necessary to work with my own
7018 created environment \Env{tltxmdfexample*}.}
7019
7020 \section{Examples}
7021 All examples have the following settings:
7022
7023 \begin{tltxmdfexample}
7024 \mdfsetup{skipabove=\topskip,skipbelow=\topskip}
7025 \newrobustcmd\ExampleText{%
7026 An \textit{inhomogeneous linear} differential equation has the form
7027 \begin{align}
7028 L[v ] = f,
7029 \end{align}
7030 where $L$ is a linear differential operator, $v$ is the dependent
7031 variable, and $f$ is a given non-zero function of the independent
7032 variables alone.
7033 }
7034 \end{tltxmdfexample}
7035
7036 \clearpage
7037 \Examplesec{very simple}
7038 \begin{tltxmdfexample*}
7039 \global\mdfdefinestyle{exampledefault}{%
7040 linecolor=red,linewidth=3pt,%
7041 leftmargin=1cm,rightmargin=1cm
7042 }
7043 \begin{mdframed}[style=exampledefault]
7044 \ExampleText
7045 \end{mdframed}
7046 \end{tltxmdfexample*}
7047
7048 \Examplesec{hidden line + frame title}
7049 \begin{tltxmdfexample*}
7050 \global\mdfapptodefinestyle{exampledefault}{%
7051 topline=false,bottomline=false}
7052 \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}]
7053 \ExampleText
7054 \end{mdframed}
7055 \end{tltxmdfexample*}
7056
7057 \Examplesec{colored frame title}
7058 \begin{tltxmdfexample*}
7059
7060 \global\mdfapptodefinestyle{exampledefault}{%
7061 rightline=true,innerleftmargin=10,innerrightmargin=10,
7062 frametitlerule=true,frametitlerulecolor=green,
7063 frametitlebackgroundcolor=yellow,
7064 frametitlerulewidth=2pt}
7065 \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}]
7066 \ExampleText
7067 \end{mdframed}
7068 \end{tltxmdfexample*}
7069
7070 \Examplesec{framed picture which is centered}
7071 \begin{tltxmdfexample*}[morekeywords=width]
7072 \begin{mdframed}[userdefinedwidth=6cm,align=center,
7073 linecolor=blue,linewidth=4pt]
7074 \textit{CTAN lion drawing by Duane Bibby; thanks to \url{www.ctan.org}}
7075 \IfFileExists{ctan-lion.png}%
7076 {\includegraphics[width=\linewidth]{ctan-lion.png}}%
7077 {\rule{\linewidth}{4cm}}%
7078 \end{mdframed}
7079 \end{tltxmdfexample*}
7080
7081 \Examplesec{Theorem environments}
7082 \begin{tltxmdfexample*}[morekeywords={theoremstyle,definition}]
7083 \mdfdefinestyle{theoremstyle}{%
7084 linecolor=red,linewidth=2pt,%
7085 frametitlerule=true,%
7086 frametitlebackgroundcolor=gray!20,
7087 innertopmargin=\topskip,
7088 }
7089 \mdtheorem[style=theoremstyle]{definition}{Definition}
7090 \begin{definition}
7091 \ExampleText
7092 \end{definition}
7093 \begin{definition}[Inhomogeneous linear]
7094 \ExampleText
7095 \end{definition}
7096 \begin{definition*}[Inhomogeneous linear]
7097 \ExampleText
7098 \end{definition*}
7099 \end{tltxmdfexample*}
7100
7101 \Examplesec{theorem with separate header and the help of TikZ (complex)}
7102 \begin{tltxmdfexample*}[%
7103 morekeywords={theo,baseline,anchor,outer,sep,current,bounding,box,east},%
7104 moretexcs=tikz]
7105 \newcounter{theo}[section]
7106 \newenvironment{theo}[1][]{%
7107 \stepcounter{theo}%
7108 \ifstrempty{#1}%
7109 {\mdfsetup{%
7110 frametitle={%
7111 \tikz[baseline=(current bounding box.east),outer sep=0pt]
7112 \node[anchor=east,rectangle,fill=blue!20]
7113 {\strut Theorem~\thetheo};}}
7114 }%
7115 {\mdfsetup{%
7116 frametitle={%
7117 \tikz[baseline=(current bounding box.east),outer sep=0pt]
7118 \node[anchor=east,rectangle,fill=blue!20]
7119 {\strut Theorem~\thetheo:~#1};}}%
7120 }%
7121 \mdfsetup{innertopmargin=10pt,linecolor=blue!20,%
7122 linewidth=2pt,topline=true,
7123 frametitleaboveskip=\dimexpr-\ht\strutbox\relax,}
7124 \begin{mdframed}[]\relax%
7125 }{\end{mdframed}}
7126 \begin{theo}[Inhomogeneous Linear]
7127 \ExampleText
7128 \end{theo}
7129
7130 \begin{theo}
7131 \ExampleText
7132 \end{theo}
7133 \end{tltxmdfexample*}
7134
7135
7136 \Examplesec{hide only a part of a line}
7137 The example below is inspired by the following post on StackExchange
7138 \href{http://tex.stackexchange.com/questions/24101/theorem-decorations^^A
7139 -that-stay-with-theorem-environment}%
7140 {Theorem decorations that stay with theorem environment}
7141 \begin{tltxmdfexample*}[morekeywords={mdf@frame@leftline@single,mdf@frame@rightline@single,%
7142 mdf@frame@leftline@first,mdf@frame@rightline@first,%
7143 mdf@frame@leftline@second,mdf@frame@rightline@second,%
7144 mdf@frame@leftline@middle,mdf@frame@rightline@middle,%
7145 mdfboundingboxdepth,mdfboundingboxtotalheight,%
7146 mdf@topline,ifbool,interruptrule,everyline}]
7147 \makeatletter
7148 \newlength{\interruptlength}
7149 \newrobustcmd\interruptrule[3]{%
7150 \color{#1}%
7151 \hspace*{\dimexpr\mdfboundingboxwidth+
7152 \mdf@innerrightmargin@length\relax}%
7153 \rule[\dimexpr-\mdfboundingboxdepth+
7154 #2\interruptlength\relax]%
7155 {\mdf@middlelinewidth@length}%
7156 {\dimexpr\mdfboundingboxtotalheight-#3\interruptlength\relax}%
7157 }
7158 \newrobustcmd\overlaplines[2][white]{%
7159 \mdfsetup{everyline=false}%
7160 \setlength{\interruptlength}{#2}
7161 \appto\mdf@frame@leftline@single{\llap{\interruptrule{#1}{1}{2}}}
7162 \appto\mdf@frame@rightline@single{\rlap{\interruptrule{#1}{1}{2}}}
7163 \appto\mdf@frame@leftline@first{\llap{\interruptrule{#1}{0}{1}}}
7164 \appto\mdf@frame@rightline@first{\rlap{\interruptrule{#1}{0}{1}}}
7165 \appto\mdf@frame@leftline@second{\llap{\interruptrule{#1}{1}{1}}}
7166 \appto\mdf@frame@rightline@second{\rlap{\interruptrule{#1}{1}{1}}}
7167 \appto\mdf@frame@leftline@middle{\llap{\interruptrule{#1}{0}{0}}}
7168 \appto\mdf@frame@rightline@middle{\rlap{\interruptrule{#1}{0}{0}}}
7169 }
7170 \makeatother
7171
7172 \overlaplines{2.5ex}
7173 \begin{mdframed}[linecolor=blue,linewidth=8pt]
7174 \ExampleText
7175 \end{mdframed}
7176 \overlaplines[blue!70!black!20]{2.5ex}
7177 \begin{mdframed}[linecolor=blue,linewidth=8pt]
7178 \ExampleText
7179 \end{mdframed}
7180 \end{tltxmdfexample*}
7181 \end{document}
7182 \endinput
7183 % \end{macrocode}
7184 %
7185 %\iffalse
7186 % \begin{macrocode}
7187 %</mdframed-example-default>
7188 % \end{macrocode}
7189 %\fi
7190 %
7191 %\iffalse
7192 % \begin{macrocode}
7193 %<*mdframed-example-tikz>
7194 % \end{macrocode}
7195 %\fi
7196 %
7197 % \section{The file mdframed-example-tikz}
7198 %
7199 % \begin{macrocode}
7200 %Documenation of the package mdframed
7201 \setcounter{errorcontextlines}{999}
7202 \documentclass[parskip=false,english,11pt]{ltxmdf}
7203
7204 \newcommand\Loadedframemethod{TikZ}
7205 \usepackage[framemethod=\Loadedframemethod]{mdframed}
7206
7207 \surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
7208 roundcorner=10pt,innertopmargin=0pt,%
7209 leftmargin=1cm,rightmargin=1cm,%
7210 innerleftmargin=-15pt,innerrightmargin=-15pt,%
7211 ignorelastdescenders,%
7212 settings={\lstset{resetmargins}},%
7213 skipbelow=\topskip,skipabove=\topskip,%
7214 innerbottommargin=0pt,backgroundcolor=gray!10]%
7215 {tltxmdfexample}
7216
7217
7218 \newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
7219 roundcorner=10pt,innertopmargin=0pt,%
7220 leftmargin=1cm,rightmargin=1cm,%
7221 innerleftmargin=-15pt,innerrightmargin=-15pt,%
7222 ignorelastdescenders,%
7223 settings={\lstset{resetmargins}},%
7224 skipbelow=\topskip,skipabove=\topskip,%
7225 innerbottommargin=0pt,backgroundcolor=gray!10]%
7226 {tltxmdfhighlight}
7227 \def\highlightinputenv{tltxmdfhighlight}
7228
7229
7230 \title{The \Pack{mdframed} package}
7231 \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}}
7232 \author{\href{mailto:[email protected]}{Marco Daniel}}
7233 \date{\mdfmaindate}
7234 \version{\mdversion}
7235 \introduction{In this document I collect various examples for
7236 \Opt{framemethod=\Loadedframemethod}.
7237 Some presented examples are more or less exorbitant.}
7238
7239 \mdfsetup{skipabove=\topskip,skipbelow=\topskip}
7240 \newrobustcmd\ExampleText{%
7241 An \textit{inhomogeneous linear} differential equation has the form
7242 \begin{align}
7243 L[v ] = f,
7244 \end{align}
7245 where $L$ is a linear differential operator, $v$ is
7246 the dependent variable, and $f$ is a given non-zero
7247 function of the independent variables alone.
7248 }
7249
7250 \newcounter{examplecount}
7251 \setcounter{examplecount}{0}
7252 \renewcommand\thesubsection{}
7253 \newcommand\Examplesec[1]{%
7254 \stepcounter{examplecount}%
7255 \subsection{Example~\arabic{examplecount}~--~#1\relax}%
7256 }
7257
7258 \begin{document}
7259 \maketitle
7260 \section{Loading}
7261 In the preamble only the package \Pack{mdframed} width the option
7262 \Opt{framemethod=\Loadedframemethod} is loaded. All other modifications will be
7263 done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}.
7264
7265 {\large\color{red!50!black}
7266 \NOTE Every \Cmd{global} inside the examples is necessary to work with my own
7267 created environment \Env{tltxmdfexample*}.}
7268
7269 \section{Examples}
7270 All examples have the following settings:
7271
7272 \begin{tltxmdfexample}
7273 \mdfsetup{skipabove=\topskip,skipbelow=\topskip}
7274 \newrobustcmd\ExampleText{%
7275 An \textit{inhomogeneous linear} differential equation has the form
7276 \begin{align}
7277 L[v ] = f,
7278 \end{align}
7279 where $L$ is a linear differential operator, $v$ is the dependent
7280 variable, and $f$ is a given non-zero function of the independent
7281 variables alone.
7282 }
7283 \end{tltxmdfexample}
7284
7285 \clearpage
7286 \Examplesec{round corner}
7287 \begin{tltxmdfexample*}
7288 \global\mdfdefinestyle{exampledefault}{%
7289 outerlinewidth=5pt,innerlinewidth=0pt,
7290 outerlinecolor=red,roundcorner=5pt
7291 }
7292 \begin{mdframed}[style=exampledefault]
7293 \ExampleText
7294 \end{mdframed}
7295 \end{tltxmdfexample*}
7296
7297 \Examplesec{hidden line + frame title}
7298 \begin{tltxmdfexample*}
7299 \global\mdfapptodefinestyle{exampledefault}{%
7300 topline=false,leftline=false,}
7301 \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}]
7302 \ExampleText
7303 \end{mdframed}
7304 \end{tltxmdfexample*}
7305
7306
7307 \Examplesec{framed picture which is centered}
7308 \begin{tltxmdfexample*}
7309 \begin{mdframed}[userdefinedwidth=6cm,align=center,
7310 linecolor=blue,middlelinewidth=4pt,roundcorner=5pt]
7311 \textit{CTAN lion drawing by Duane Bibby; thanks to \url{www.ctan.org}}
7312 \IfFileExists{ctan-lion.png}%
7313 {\includegraphics[width=\linewidth]{ctan-lion.png}}%
7314 {\rule{\linewidth}{4cm}}%
7315 \end{mdframed}
7316 \end{tltxmdfexample*}
7317
7318 \Examplesec{Gimmick}
7319 \begin{tltxmdfexample*}[morekeywords={line,width,dash,dashed,pattern}]
7320 \mdfsetup{splitbottomskip=0.8cm,splittopskip=0cm,
7321 innerrightmargin=2cm,innertopmargin=1cm,%
7322 innerlinewidth=2pt,outerlinewidth=2pt,
7323 middlelinewidth=10pt,backgroundcolor=red,
7324 linecolor=blue,middlelinecolor=gray,
7325 tikzsetting={draw=yellow,line width=3pt,%
7326 dashed,%
7327 dash pattern= on 10pt off 3pt},
7328 rightline=false,bottomline=false}
7329 \begin{mdframed}
7330 \ExampleText
7331 \end{mdframed}
7332 \end{tltxmdfexample*}
7333
7334
7335 \clearpage
7336 \Examplesec{complex example with TikZ}
7337
7338 \begin{tltxmdfexample*}[morekeywords={mdf}]
7339 \tikzset{titregris/.style =
7340 {draw=gray, thick, fill=white, shading = exersicetitle, %
7341 text=gray, rectangle, rounded corners, right,minimum height=.7cm}}
7342 \pgfdeclarehorizontalshading{exersicebackground}{100bp}
7343 {color(0bp)=(green!40); color(100bp)=(black!5)}
7344 \pgfdeclarehorizontalshading{exersicetitle}{100bp}
7345 {color(0bp)=(red!40);color(100bp)=(black!5)}
7346 \newcounter{exercise}
7347 \renewcommand*\theexercise{Exercise~n\arabic{exercise}}
7348 \makeatletter
7349 \def\mdf@@exercisepoints{}%new mdframed key:
7350 \define@key{mdf}{exercisepoints}{%
7351 \def\mdf@@exercisepoints{#1}
7352 }
7353 \mdfdefinestyle{exercisestyle}{%
7354 outerlinewidth=1em,outerlinecolor=white,%
7355 leftmargin=-1em,rightmargin=-1em,%
7356 middlelinewidth=1.2pt,roundcorner=5pt,linecolor=gray,
7357 apptotikzsetting={\tikzset{mdfbackground/.append style ={%
7358 shading = exersicebackground}}},
7359 innertopmargin=1.2\baselineskip,
7360 skipabove={\dimexpr0.5\baselineskip+\topskip\relax},
7361 skipbelow={-1em},
7362 needspace=3\baselineskip,
7363 frametitlefont=\sffamily\bfseries,
7364 settings={\global\stepcounter{exercise}},
7365 singleextra={%
7366 \node[titregris,xshift=1cm] at (P-|O) %
7367 {~\mdf@frametitlefont{\theexercise}\hbox{~}};
7368 \ifdefempty{\mdf@@exercisepoints}%
7369 {}%
7370 {\node[titregris,left,xshift=-1cm] at (P)%
7371 {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}%
7372 },
7373 firstextra={%
7374 \node[titregris,xshift=1cm] at (P-|O) %
7375 {~\mdf@frametitlefont{\theexercise}\hbox{~}};
7376 \ifdefempty{\mdf@@exercisepoints}%
7377 {}%
7378 {\node[titregris,left,xshift=-1cm] at (P)%
7379 {~\mdf@frametitlefont{\mdf@@exercisepoints points}\hbox{~}};}%
7380 },
7381 }
7382 \makeatother
7383
7384 \begin{mdframed}[style=exercisestyle]
7385 \ExampleText
7386 \end{mdframed}
7387
7388 \begin{mdframed}[style=exercisestyle,exercisepoints=10]
7389 \ExampleText
7390 \end{mdframed}
7391 \end{tltxmdfexample*}
7392
7393
7394
7395 \clearpage
7396 \Examplesec{Theorem environments}
7397 \begin{tltxmdfexample*}[morekeywords={theoremstyle,definition}]
7398 \mdfdefinestyle{theoremstyle}{%
7399 linecolor=red,middlelinewidth=2pt,%
7400 frametitlerule=true,%
7401 apptotikzsetting={\tikzset{mdfframetitlebackground/.append style={%
7402 shade,left color=white, right color=blue!20}}},
7403 frametitlerulecolor=green!60,
7404 frametitlerulewidth=1pt,
7405 innertopmargin=\topskip,
7406 }
7407 \mdtheorem[style=theoremstyle]{definition}{Definition}
7408 \begin{definition}[Inhomogeneous linear]
7409 \ExampleText
7410 \end{definition}
7411 \begin{definition*}[Inhomogeneous linear]
7412 \ExampleText
7413 \end{definition*}
7414 \end{tltxmdfexample*}
7415 \end{document}
7416 \endinput
7417
7418 % \end{macrocode}
7419 %
7420 %\iffalse
7421 % \begin{macrocode}
7422 %</mdframed-example-tikz>
7423 % \end{macrocode}
7424 %\fi
7425 %
7426 %\iffalse
7427 % \begin{macrocode}
7428 %<*mdframed-example-pstricks>
7429 % \end{macrocode}
7430 %\fi
7431 %
7432 % \section{The file mdframed-example-pstricks}
7433 %
7434 % \begin{macrocode}
7435 %Documenation of the package mdframed
7436 \setcounter{errorcontextlines}{999}
7437 \documentclass[parskip=false,english,11pt]{ltxmdf}
7438
7439 \lstDeleteShortInline{|}
7440 \newcommand\Loadedframemethod{PSTricks}
7441 \usepackage[framemethod=\Loadedframemethod]{mdframed}
7442
7443 \surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
7444 roundcorner=10pt,innertopmargin=0pt,%
7445 leftmargin=1cm,rightmargin=1cm,%
7446 innerleftmargin=-15pt,innerrightmargin=-15pt,%
7447 ignorelastdescenders,%
7448 settings={\lstset{resetmargins}},%
7449 skipbelow=\topskip,skipabove=\topskip,%
7450 innerbottommargin=0pt,backgroundcolor=gray!10]%
7451 {tltxmdfexample}
7452
7453 \newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
7454 roundcorner=10pt,innertopmargin=0pt,%
7455 leftmargin=1cm,rightmargin=1cm,%
7456 innerleftmargin=-15pt,innerrightmargin=-15pt,%
7457 ignorelastdescenders,%
7458 settings={\lstset{resetmargins}},%
7459 skipbelow=\topskip,skipabove=\topskip,%
7460 innerbottommargin=0pt,backgroundcolor=gray!10]%
7461 {tltxmdfhighlight}
7462 \def\highlightinputenv{tltxmdfhighlight}
7463
7464
7465
7466 \title{The \Pack{mdframed} package}
7467 \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}}
7468 \author{\href{mailto:[email protected]}{Marco Daniel}}
7469 \date{\mdfmaindate}
7470 \version{\mdversion}
7471 \introduction{In this document I collect various examples for
7472 \Opt{framemethod=\Loadedframemethod}.
7473 Some presented examples are more or less exorbitant.}
7474
7475 \mdfsetup{skipabove=\topskip,skipbelow=\topskip}
7476 \newrobustcmd\ExampleText{%
7477 An \textit{inhomogeneous linear} differential equation has the form
7478 \begin{align}
7479 L[v ] = f,
7480 \end{align}
7481 where $L$ is a linear differential operator, $v$ is
7482 the dependent variable, and $f$ is a given non-zero
7483 function of the independent variables alone.
7484 }
7485
7486 \newcounter{examplecount}
7487 \setcounter{examplecount}{0}
7488 \renewcommand\thesubsection{}
7489 \newcommand\Examplesec[1]{%
7490 \stepcounter{examplecount}%
7491 \subsection{Example~\arabic{examplecount}~--~#1\relax}%
7492 }
7493
7494 \begin{document}
7495 \maketitle
7496 \section{Loading}
7497 In the preamble only the package \Pack{mdframed} width the option
7498 \Opt{framemethod=\Loadedframemethod} is loaded. All other modifications will be
7499 done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}.
7500
7501 {\large\color{red!50!black}
7502 \NOTE Every \Cmd{global} inside the examples is necessary to work with my own
7503 created environment \Env{tltxmdfexample*}.}
7504
7505
7506 \section{Examples}
7507 All examples have the following settings:
7508
7509 \begin{tltxmdfexample}
7510 \mdfsetup{skipabove=\topskip,skipbelow=\topskip}
7511 \newrobustcmd\ExampleText{%
7512 An \textit{inhomogeneous linear} differential equation has the form
7513 \begin{align}
7514 L[v ] = f,
7515 \end{align}
7516 where $L$ is a linear differential operator, $v$ is the dependent
7517 variable, and $f$ is a given non-zero function of the independent
7518 variables alone.
7519 }
7520 \end{tltxmdfexample}
7521
7522 \clearpage
7523
7524 \Examplesec{very simple}
7525 \begin{tltxmdfexample*}
7526 \global\mdfdefinestyle{exampledefault}{%
7527 linecolor=red,middlelinewidth=3pt,%
7528 leftmargin=1cm,rightmargin=1cm
7529 }
7530 \begin{mdframed}[style=exampledefault,roundcorner=5]
7531 \ExampleText
7532 \end{mdframed}
7533 \end{tltxmdfexample*}
7534
7535
7536 \Examplesec{hidden line + frame title}
7537 \begin{tltxmdfexample*}[morekeywords={innerlinecolor,addtopsstyle,mdfouterlinestyle,
7538 linestyle}]
7539 \global\mdfapptodefinestyle{exampledefault}{%
7540 topline=false,rightline=false,bottomline=false,
7541 frametitlerule=true,innertopmargin=6pt,
7542 outerlinewidth=6pt,outerlinecolor=blue,
7543 pstricksappsetting={\addtopsstyle{mdfouterlinestyle}{linestyle=dashed}},
7544 innerlinecolor=yellow,innerlinewidth=5pt}%
7545 \begin{mdframed}[style=exampledefault,frametitle={Inhomogeneous linear}]
7546 \ExampleText
7547 \end{mdframed}
7548 \end{tltxmdfexample*}
7549
7550 \Examplesec{Dash Lines}[morekeywords={pstrickssetting,linestyle,dashed}]
7551 \begin{tltxmdfexample*}
7552 \global\mdfdefinestyle{exampledefault}{%
7553 pstrickssetting={linestyle=dashed,},linecolor=red,middlelinewidth=2pt}
7554 \begin{mdframed}[style=exampledefault]
7555 \ExampleText
7556 \end{mdframed}
7557 \end{tltxmdfexample*}
7558
7559 \Examplesec{Double Lines}
7560 \begin{tltxmdfexample*}[morekeywords={addtopsstyle,mdfmiddlelinestyle,
7561 doubleline,doublesep}]
7562 \global\mdfdefinestyle{exampledefault}{%
7563 pstricksappsetting={\addtopsstyle{mdfmiddlelinestyle}{%
7564 doubleline=true,doublesep=6pt,linewidth=4pt}},%
7565 linecolor=red,middlelinewidth=16pt}
7566 \begin{mdframed}[style=exampledefault]
7567 \ExampleText
7568 \end{mdframed}
7569 \end{tltxmdfexample*}
7570
7571 \Examplesec{Shadow frame}
7572 \begin{tltxmdfexample*}[morekeywords={shadow,shadowsize,myshadowbox}]
7573 \newmdenv[shadow=true,
7574 shadowsize=11pt,
7575 linewidth=8pt,
7576 frametitlerule=true,
7577 roundcorner=10pt,
7578 ]{myshadowbox}
7579 \begin{myshadowbox}[frametitle={Inhomogeneous linear}]
7580 \ExampleText
7581 \end{myshadowbox}
7582 \end{tltxmdfexample*}
7583 \end{document}
7584 \endinput
7585 % \end{macrocode}
7586 %
7587 %\iffalse
7588 % \begin{macrocode}
7589 %</mdframed-example-pstricks>
7590 % \end{macrocode}
7591 %\fi
7592 %
7593 %\iffalse
7594 % \begin{macrocode}
7595 %<*mdframed-example-texsx>
7596 % \end{macrocode}
7597 %\fi
7598 %
7599 % \section{The file mdframed-example-texsx}
7600
7601 % \begin{macrocode}
7602 %Documenation of the package mdframed
7603 \setcounter{errorcontextlines}{999}
7604 \documentclass[parskip=false,english,11pt,lipsum=true]{ltxmdf}
7605
7606 \usepackage{tikz}
7607 \usetikzlibrary{calc,arrows,shadings,shadows}
7608 \newcommand\Loadedframemethod{tikz}
7609 \usepackage[framemethod=\Loadedframemethod]{mdframed}
7610
7611
7612
7613 \surroundwithmdframed[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
7614 roundcorner=10pt,innertopmargin=0pt,%
7615 leftmargin=1cm,rightmargin=1cm,%
7616 innerleftmargin=-15pt,innerrightmargin=-15pt,%
7617 ignorelastdescenders,%
7618 settings={\lstset{resetmargins}},%
7619 skipbelow=\topskip,skipabove=\topskip,%
7620 innerbottommargin=0pt,backgroundcolor=gray!10]%
7621 {tltxmdfexample}
7622
7623
7624 \newmdenv[middlelinecolor=ltxmdfblue,middlelinewidth=1pt,%
7625 roundcorner=10pt,innertopmargin=0pt,%
7626 leftmargin=1cm,rightmargin=1cm,%
7627 innerleftmargin=-15pt,innerrightmargin=-15pt,%
7628 ignorelastdescenders,%
7629 settings={\lstset{resetmargins}},%
7630 skipbelow=\topskip,skipabove=\topskip,%
7631 innerbottommargin=0pt,backgroundcolor=gray!10]%
7632 {tltxmdfhighlight}
7633 \def\highlightinputenv{tltxmdfhighlight}
7634
7635 \title{The \Pack{mdframed} package}
7636 \subtitle{Examples for \Opt{framemethod=\Loadedframemethod}}
7637 \author{\href{mailto:[email protected]}{Marco Daniel}}
7638 \date{\mdfmaindate}
7639 \version{\mdversion}
7640 \introduction{In this document I collect various examples for
7641 \Opt{framemethod=\Loadedframemethod}.
7642 Some presented examples are more or less exorbitant.}
7643
7644 \mdfsetup{skipabove=\topskip,skipbelow=\topskip}
7645 \newrobustcmd\ExampleText{%
7646 An \textit{inhomogeneous linear} differential equation has the form
7647 \begin{align}
7648 L[v ] = f,
7649 \end{align}
7650 where $L$ is a linear differential operator, $v$ is
7651 the dependent variable, and $f$ is a given non-zero
7652 function of the independent variables alone.
7653 }
7654
7655 \newcounter{examplecount}
7656 \setcounter{examplecount}{0}
7657 \renewcommand\thesubsection{}
7658 \newcommand\Examplesec[1]{%
7659 \stepcounter{examplecount}%
7660 \subsection{Example~\arabic{examplecount}~--~#1\relax}%
7661 }
7662
7663 \begin{document}
7664 \maketitle
7665 \section{Loading}
7666 In the preamble only the package \Pack{mdframed} width the option
7667 \Opt{framemethod=\Loadedframemethod} is loaded. All other modifications will be
7668 done by \Cmd{mdfdefinestyle} or \Cmd{mdfsetup}.
7669
7670 {\large\color{red!50!black}
7671 \NOTE Every \Cmd{global} inside the examples is necessary to work with my own
7672 created environment \Env{tltxmdfexample*}.}
7673
7674 \section{Examples}
7675 All examples have the following settings:
7676
7677 \begin{tltxmdfexample}
7678 \mdfsetup{skipabove=\topskip,skipbelow=\topskip}
7679 \newrobustcmd\ExampleText{%
7680 An \textit{inhomogeneous linear} differential equation has the form
7681 \begin{align}
7682 L[v ] = f,
7683 \end{align}
7684 where $L$ is a linear differential operator, $v$ is the dependent
7685 variable, and $f$ is a given non-zero function of the independent
7686 variables alone.
7687 }
7688 \end{tltxmdfexample}
7689 \clearpage
7690 \Examplesec{Package listings}
7691 The example below is inspired by the following post on StackExchange
7692 \href{http://tex.stackexchange.com/questions/27673/background-overflows-^^A
7693 when-using-rounded-corners-for-listings-package-listings}%
7694 {Background overflows when using rounded corners for listings
7695 (package: `listings`)}
7696
7697 Here the solution which can be decorate as usual.
7698
7699 \begin{tltxmdfexample}[moretexcs={BeforeBeginEnvironment,AfterEndEnvironment},
7700 morekeywords={lstlisting}]
7701 \BeforeBeginEnvironment{lstlisting}{%
7702 \begin{mdframed}[<modification>]%
7703 \vspace{-0.7em}}
7704 \AfterEndEnvironment{lstlisting}{%
7705 \vspace{-0.5em}%
7706 \end{mdframed}}
7707 \end{tltxmdfexample}
7708
7709 With the new command \Cmd{surroundwithmdframed} you can use
7710 \begin{tltxmdfexample}[moretexcs={BeforeBeginEnvironment,AfterEndEnvironment},
7711 morekeywords={listings}]
7712 \surroundwithmdframed{listings}
7713 \end{tltxmdfexample}
7714
7715 \clearpage
7716 \Examplesec{Package multicol}
7717 How I wrote in \enquote{Known Problems} you can't combine \Pack{multicol} with
7718 \Pack{mdframed}. In a simple way without any breaks you can use:
7719
7720 \begin{tltxmdfexample*}[morekeywords={multicols}]
7721 \begin{multicols}{2}
7722 \lipsum[1]
7723 \begin{mdframed}
7724 \ExampleText
7725 \end{mdframed}
7726 \lipsum[2]
7727 \end{multicols}
7728 \end{tltxmdfexample*}
7729
7730 \clearpage
7731 \twocolumn[\Examplesec{Working in twocolumn mode}]
7732 \begin{tltxmdfexample*}[moretexcs={Examplesec}]
7733 %\twocolumn[%
7734 % \Examplesec{Working in twocolumn mode}]
7735 \lipsum[1]\lipsum[2]
7736 \begin{mdframed}[%
7737 leftmargin=10pt,%
7738 rightmargin=10pt,%
7739 linecolor=red,
7740 backgroundcolor=yellow]
7741 \ExampleText
7742 \end{mdframed}
7743 \lipsum[2]
7744 \end{tltxmdfexample*}
7745
7746
7747
7748 \clearpage
7749 \onecolumn
7750 \Examplesec{Working inside enumerate}
7751 \begin{tltxmdfexample*}[morekeywords={enumerate}]
7752 Text Text Text Text Text Text Text Text
7753 \begin{enumerate}
7754 \item in the following \ldots
7755 \begin{mdframed}[linecolor=blue,middlelinewidth=2]
7756 \ExampleText
7757 \end{mdframed}
7758 \item \lipsum[2]
7759 \end{enumerate}
7760 Text Text Text Text Text Text
7761 \end{tltxmdfexample*}
7762
7763
7764 \Examplesec{Position a specific symbol at a line}
7765 \begin{tltxmdfexample*}
7766 \tikzset{
7767 warningsymbol/.style={
7768 rectangle,draw=red,
7769 fill=white,scale=1,
7770 overlay}}
7771 \mdfdefinestyle{warning}{%
7772 hidealllines=true,leftline=true,
7773 skipabove=12,skipbelow=12pt,
7774 innertopmargin=0.4em,%
7775 innerbottommargin=0.4em,%
7776 innerrightmargin=0.7em,%
7777 rightmargin=0.7em,%
7778 innerleftmargin=1.7em,%
7779 leftmargin=0.7em,%
7780 middlelinewidth=.2em,%
7781 linecolor=red,%
7782 fontcolor=red,%
7783 firstextra={\path let \p1=(P), \p2=(O) in ($(\x2,0)+0.5*(0,\y1)$)
7784 node[warningsymbol] {\$};},%
7785 secondextra={\path let \p1=(P), \p2=(O) in ($(\x2,0)+0.5*(0,\y1)$)
7786 node[warningsymbol] {\$};},%
7787 middleextra={\path let \p1=(P), \p2=(O) in ($(\x2,0)+0.5*(0,\y1)$)
7788 node[warningsymbol] {\$};},%
7789 singleextra={\path let \p1=(P), \p2=(O) in ($(\x2,0)+0.5*(0,\y1)$)
7790 node[warningsymbol] {\$};},%
7791 }
7792 \begin{mdframed}[style=warning]
7793 \ExampleText
7794 \end{mdframed}
7795 \end{tltxmdfexample*}
7796
7797 \Examplesec{digression-environement inspired by Tobias Weh}
7798 \begin{tltxmdfexample*}[morekeywords={%
7799 font,anchor,let,in,arrow,round,cap,controls,coordinate,%
7800 excursus,head,arrows,calc,line,width,and,to,digressionarrows,%
7801 base,west},%
7802 moretexcs={usetikzlibrary}]
7803 \usetikzlibrary{calc,arrows}
7804 \tikzset{
7805 excursus arrow/.style={%
7806 line width=2pt,
7807 draw=gray!40,
7808 rounded corners=2ex,
7809 },
7810 excursus head/.style={
7811 fill=white,
7812 font=\bfseries\sffamily,
7813 text=gray!80,
7814 anchor=base west,
7815 },
7816 }
7817 \mdfdefinestyle{digressionarrows}{%
7818 singleextra={%
7819 \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);
7820 \path let \p1=(Q), \p2=(O) in (\x1,{(\y1-\y2)/2}) coordinate (M);
7821 \path [excursus arrow, round cap-to]
7822 ($(O)+(5em,0ex)$) -| (M) |- %
7823 ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. %
7824 ++(23em,2ex);
7825 \node [excursus head] at ($(Q)+(2.5em,-0.75pt)$) {Digression};},
7826 firstextra={%
7827 \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);
7828 \path [excursus arrow,-to]
7829 (O) |- %
7830 ($(Q)+(12em,0ex)$) .. controls +(0:16em) and +(185:6em) .. %
7831 ++(23em,2ex);
7832 \node [excursus head] at ($(Q)+(2.5em,-2pt)$) {Digression};},
7833 secondextra={%
7834 \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);
7835 \path [excursus arrow,round cap-]
7836 ($(O)+(5em,0ex)$) -| (Q);},
7837 middleextra={%
7838 \path let \p1=(P), \p2=(O) in (\x2,\y1) coordinate (Q);
7839 \path [excursus arrow]
7840 (O) -- (Q);},
7841 middlelinewidth=2.5em,middlelinecolor=white,
7842 hidealllines=true,topline=true,
7843 innertopmargin=0.5ex,
7844 innerbottommargin=2.5ex,
7845 innerrightmargin=2pt,
7846 innerleftmargin=2ex,
7847 skipabove=0.87\baselineskip,
7848 skipbelow=0.62\baselineskip,
7849 }
7850
7851 \begin{mdframed}[style=digressionarrows]
7852 \ExampleText
7853 \end{mdframed}
7854 \end{tltxmdfexample*}
7855
7856
7857 \Examplesec{Theorem style shading background}
7858 \begin{tltxmdfexample*}[morekeywords={top,bottom,Theorem,shadow,alternativtheorem}]
7859 %\usetikzlibrary{shadings,shadows}% loaded in the header
7860 \mdtheorem[%
7861 apptotikzsetting={%
7862 \tikzset{mdfbackground/.append style ={%
7863 top color=yellow!40!white,
7864 bottom color=yellow!80!black},
7865 mdfframetitlebackground/.append style={
7866 top color=purple!40!white,
7867 bottom color=purple!80!black
7868 }
7869 }%
7870 },
7871 ,roundcorner=10pt,middlelinewidth=2pt,
7872 shadow=true,frametitlerule=true,frametitlerulewidth=4pt,
7873 innertopmargin=10pt,%
7874 ]{alternativtheorem}{Theorem}
7875 \begin{alternativtheorem}[Inhomogeneous linear]
7876 \ExampleText
7877 \end{alternativtheorem}
7878 \end{tltxmdfexample*}
7879 \end{document}
7880 \endinput
7881 % \end{macrocode}
7882 %
7883 %\iffalse
7884 % \begin{macrocode}
7885 %</mdframed-example-texsx>
7886 % \end{macrocode}
7887 %\fi
7888 %
7889 %
7890 %
7891 % \Finale
7892 %
7893 \endinput
7894
7895