summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mdframed/md-frame-1.mdf
blob: 572f50c8582d093b2e66c650aec2eef4d72e32e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
%%==================================================%%
%%= Ausgabe der Box nach Vorgabe der Ausgaberoutine=%%
%%==================================================%%
%% Styledatei fuer das Paket mdframed erstellt durch
%% Marco Daniel und Elke Schubert
%% 
%% This package may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.

%%$Id: md-frame-1.mdf 172 2011-09-04 16:13:47Z marco $
%%$Rev: 172 $
%%$Author: marco $
%%$Date: 2011-09-04 18:13:47 +0200 (So, 04. Sep 2011) $

\def\mdframedIpackagename{md-frame-1}
\def\md@frameIdate@svn$#1: #2 #3 #4-#5-#6 #7 #8${#4/#5/#6\space }
\ProvidesFile{md-frame-1.mdf}[\md@frameIdate@svn$Id: md-frame-1.mdf 172 2011-09-04 16:13:47Z marco $ \mdversion: \mdframedIpackagename]
%%%%    _____t_____
%%%%   |           |
%%%%   |           |
%%%%   |           |
%%%%  l|           |r
%%%%   |           |
%%%%   |           |
%%%%   |___________|
%%%%         b
%%Zusammenhaenge abfragen:
\newrobustcmd*\md@test@ltrb{\ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
                                      and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
%3-set
\newrobustcmd*\md@test@ltr{\ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
                                      and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\md@test@ltb{\ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
                                      and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\md@test@trb{\ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
                                      and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\md@test@lrb{\ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
                                      and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
%2-set
\newrobustcmd*\md@test@lb{\ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
                                      and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\md@test@rb{\ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
                                      and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\md@test@tr{\ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
                                      and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\md@test@lt{\ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
                                      and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\md@test@lr{\ifboolexpr{not (bool {mdf@topline}) and not (bool {mdf@bottomline})
                                      and (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\md@test@tb{\ifboolexpr{ (bool {mdf@topline}) and (bool {mdf@bottomline})
                                      and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
%Einzellinien
\newrobustcmd*\md@test@l{\ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
                                      and (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\md@test@r{\ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
                                      and not (bool {mdf@leftline}) and (bool {mdf@rightline})}}
\newrobustcmd*\md@test@t{\ifboolexpr{ (bool {mdf@topline}) and not (bool {mdf@bottomline})
                                      and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
\newrobustcmd*\md@test@b{\ifboolexpr{ not (bool {mdf@topline}) and (bool {mdf@bottomline})
                                      and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
%keine Linien
\newrobustcmd*\md@test@noline{\ifboolexpr{ not (bool {mdf@topline}) and not (bool {mdf@bottomline})
                                      and not (bool {mdf@leftline}) and not (bool {mdf@rightline})}}
%
%Allgemeine Einstellungen fuer tikz
\def\md@tikz@settings{%
%
  \tikzset{mdfbox/.style={anchor=south west,inner sep=0pt,outer sep=0pt}}% anchor der Ausgabebox ist unten links
  \tikzset{mdfcorners/.style={rounded corners=\mdf@roundcorner@length}}% 
  \tikzset{mdfbackground/.style={fill=\mdf@backgroundcolor,draw=\mdf@backgroundcolor}}% 
%
  \tikzset{mdfouterline/.style={}}%
  \ifdimgreater{\mdf@outerlinewidth@length}{\z@}%nur wenn outerlinewidth>0 wird aussere Linie gezeichnet
    {\tikzset{mdfouterline/.append style={%
      draw=\mdf@outerlinecolor,%
      line width=2\mdf@outerlinewidth@length+\mdf@middlelinewidth@length}}}{}%
%
  \tikzset{mdfinnerline/.style={}}%
  \ifdimgreater{\mdf@innerlinewidth@length}{\z@}% nur wenn innerlinewidth>0 wird innere Linie gezeichnet
    {\tikzset{mdfinnerline/.append style={%
      draw=\mdf@innerlinecolor,%
      line width=2\mdf@innerlinewidth@length+\mdf@middlelinewidth@length}}}{}%
%
  \mdf@tikzset@local
  \tikzset{mdfmiddleline/.style={}}%
  \ifdimgreater{\mdf@middlelinewidth@length}{\z@}% nur wenn middlelinewidth>0 wird mittlere Linie gezeichnet
    {\tikzset{mdfmiddleline/.append style={%
      preaction={draw=\mdf@middlelinecolor,line width=\mdf@middlelinewidth@length},%
      line width=\mdf@middlelinewidth@length,%
      tikzsetting}}%
    }{}%
}%
%
% Befehle fuer Ausgabe von Rahmen und Hintergrund
\newrobustcmd*\md@tikzbox@tfl[1]{%three or four borders
                                \clip(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);%
                                \begin{scope}[mdfcorners]%
                                  \clip[preaction=mdfouterline][postaction=mdfbackground][postaction=mdfinnerline]#1;%
                                \end{scope}%
                                \path[mdfmiddleline,mdfcorners]#1;}%
\newrobustcmd*\md@tikzbox@otl[2]{%one or two borders
                                \clip(0,0)rectangle(\mdfboundingboxwidth,\mdfboundingboxheight);%
                                \begin{scope}
                                  \path[mdfouterline,mdfcorners]#1;%
                                  \clip[postaction=mdfbackground]#2;%
                                  \path[mdfinnerline,mdfcorners]#1;%
                                \end{scope}
                                \path[mdfmiddleline,mdfcorners]#1;}%
%
% Info zu den verwendeten Punkten:
% O ist die untere linke Ecke der Mitte der middleline
% P ist die obere rechte Ecke der Mitte der middleline
% A ist der Punkt fuer den anchor (d.h. die untere linke Ecke) der Ausgabebox
%
\def\md@putbox@single{%
  \leftline{\null\hspace*{\mdf@leftmargin@length}%%
    \md@tikz@settings%
%
    \setlength\mdfboundingboxwidth{\wd\@tempboxa}%
    \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax%
    \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax%
    \ifbool{mdf@leftline}{%
      \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
    \ifbool{mdf@rightline}{%
      \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
%
    \setlength\mdfboundingboxheight{\ht\@tempboxa+\dp\@tempboxa}%
    \advance\mdfboundingboxheight by \mdf@innertopmargin@length\relax%
    \advance\mdfboundingboxheight by \mdf@innerbottommargin@length\relax%
    \ifbool{mdf@topline}{%
      \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
    \ifbool{mdf@bottomline}{%
      \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
%
    \begin{tikzpicture}%
      \pgfmathsetlengthmacro\md@Ax{+\mdf@innerleftmargin@length}%
      \pgfmathsetlengthmacro\md@Ay{+\mdf@innerbottommargin@length}%
      \pgfmathsetlengthmacro\md@Ox{+0pt}%
      \pgfmathsetlengthmacro\md@Oy{+0pt}%
      \pgfmathsetlengthmacro\md@Px{+\mdfboundingboxwidth}%
      \pgfmathsetlengthmacro\md@Py{+\mdfboundingboxheight}%
      \ifbool{mdf@leftline}{%
        \pgfmathsetlengthmacro\md@Ax{\md@Ax+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+\mdf@innerlinewidth@length}%
        \pgfmathsetlengthmacro\md@Ox{\md@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}}{}%
      \ifbool{mdf@rightline}{%
         \pgfmathsetlengthmacro\md@Px{\md@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}}{}%
      \ifbool{mdf@bottomline}{%
         \pgfmathsetlengthmacro\md@Ay{\md@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+\mdf@innerlinewidth@length}%
         \pgfmathsetlengthmacro\md@Oy{\md@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}}{}%
      \ifbool{mdf@topline}{%
         \pgfmathsetlengthmacro\md@Py{\md@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}}{}%
%
      \coordinate(O)at(\md@Ox,\md@Oy);%
      \coordinate(P)at(\md@Px,\md@Py);%
%
      \md@test@ltrb{\md@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)--cycle}}{}%
%
      \md@test@ltb{\md@tikzbox@tfl{(P|-O)--(O)--(O|-P)--(P)}}{}%
      \md@test@trb{\md@tikzbox@tfl{(O|-P)--(P)--(P|-O)--(O)}}{}%
      \md@test@ltr{\md@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}%
      \md@test@lrb{\md@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P)}}{}%
%
      \md@test@lb{\md@tikzbox@otl{(P|-O)--(O)--(O|-P)}{(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}}{}%
      \md@test@rb{\md@tikzbox@otl{(P)--(P|-O)--(O)}{(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}}{}% 
      \md@test@tr{\md@tikzbox@otl{(O-|P)--(P)--(P-|O)}{(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}}{}%
      \md@test@lt{\md@tikzbox@otl{(O)--(O|-P)--(P)}{(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}}{}%
      \md@test@lr{\md@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}{}%
      \md@test@tb{\md@tikzbox@otl{(O)--(O-|P)(O|-P)--(P)}{(O)rectangle(P)}}{}%
%
      \md@test@l{\md@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}{}%
      \md@test@r{\md@tikzbox@otl{(O-|P)--(P)}{(O)rectangle(P)}}{}%
      \md@test@t{\md@tikzbox@otl{(O|-P)--(P)}{(O)rectangle(P)}}{}%
      \md@test@b{\md@tikzbox@otl{(O)--(O-|P)}{(O)rectangle(P)}}{}%
%
      \md@test@noline{\path[mdfbackground,mdfcorners](O)rectangle(P);}{}%
%
      \node[mdfbox]at(\md@Ax,\md@Ay){\box\@tempboxa};% Ausgabebox einfuegen
    \end{tikzpicture}%
  }%
}%

\def\md@putbox@first{%
  \leftline{\null\hspace*{\mdf@leftmargin@length}%%
    \md@tikz@settings%
    \setlength\mdfboundingboxwidth{\wd\tw@}%
    \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax%
    \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax%
    \ifbool{mdf@leftline}{%
      \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
    \ifbool{mdf@rightline}{%
      \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
%
    \setlength\mdfboundingboxheight{\ht\tw@+\dp\tw@}%
    \advance\mdfboundingboxheight by \mdf@innertopmargin@length\relax%
    \advance\mdfboundingboxheight by \mdf@splitbottomskip@length\relax%
    \ifbool{mdf@topline}{%
      \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
%
    %\ifdimequal{\pagegoal}{\maxdimen}{\enlargethispage{\baselineskip}}{}% ???
    \ifdimgreater{\pagegoal-\maxdimen}{0pt}{}{\enlargethispage{\baselineskip}}%
%
    \begin{tikzpicture}
%
      \pgfmathsetlengthmacro\md@Ax{+\mdf@innerleftmargin@length}%
      \pgfmathsetlengthmacro\md@Ay{+\mdf@splitbottomskip@length}%
      \pgfmathsetlengthmacro\md@Ox{+0pt}%
      \pgfmathsetlengthmacro\md@Oy{+0pt}%
      \pgfmathsetlengthmacro\md@Px{+\mdfboundingboxwidth}%
      \pgfmathsetlengthmacro\md@Py{+\mdfboundingboxheight}%
      \ifbool{mdf@leftline}{%
        \pgfmathsetlengthmacro\md@Ax{\md@Ax+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+\mdf@innerlinewidth@length}%
        \pgfmathsetlengthmacro\md@Ox{\md@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}}{}%
      \ifbool{mdf@rightline}{%
         \pgfmathsetlengthmacro\md@Px{\md@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}}{}%
      \ifbool{mdf@topline}{%
         \pgfmathsetlengthmacro\md@Py{\md@Py-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}}{}%
%
      \coordinate(O)at(\md@Ox,\md@Oy);%
      \coordinate(P)at(\md@Px,\md@Py);%
%
      \ifboolexpr{test {\md@test@ltrb} or test {\md@test@ltr}}{\md@tikzbox@tfl{(O)--(O|-P)--(P)--(P|-O)}}{}%
      \ifboolexpr{test {\md@test@ltb} or test {\md@test@lt}}%
               {\md@tikzbox@otl{(O)--(O|-P)--(P)}{(P|-O)--(O)[mdfcorners]--(O|-P)--(P)}}{}%
      \ifboolexpr{test {\md@test@trb} or test {\md@test@tr}}%
               {\md@tikzbox@otl{(O-|P)--(P)--(P-|O);}{(O)--(O|-P)[mdfcorners]--(P)--(P|-O)}}{}%
      \ifboolexpr{test {\md@test@lrb} or test {\md@test@lr}}%
               {\md@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}{}%
      \ifboolexpr{test {\md@test@tb} or test {\md@test@t}}{\md@tikzbox@otl{(O|-P)--(P)}{(O)rectangle(P)}}{}%
      \ifboolexpr{test {\md@test@lb} or test {\md@test@l}}{\md@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}{}%
      \ifboolexpr{test {\md@test@rb} or test {\md@test@r}}{\md@tikzbox@otl{(O-|P)--(P)}{(O)rectangle(P)}}{}%
      \md@test@b{\path[mdfbackground](O)rectangle(P);}{}%
%
      \md@test@noline{\path[mdfbackground,mdfcorners](O)--(O|-P)--(P)--(P|-O);}{}%
%
      \node[mdfbox]at(\md@Ax,\md@Ay){\box\tw@};% Ausgabebox einfuegen
    \end{tikzpicture}%
  }%
}%


\def\md@putbox@middle{%
  \leftline{\null\hspace*{\mdf@leftmargin@length}%%
    \md@tikz@settings%
%
    \setlength\mdfboundingboxwidth{\wd\tw@}%
    \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax%
    \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax%
    \ifbool{mdf@leftline}{%
      \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
    \ifbool{mdf@rightline}{%
      \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
%
    \setlength\mdfboundingboxheight{\ht\tw@+\dp\tw@}%
    \advance\mdfboundingboxheight by \mdf@splitbottomskip@length\relax%
%
    \begin{tikzpicture}
      \pgfmathsetlengthmacro\md@Ax{+\mdf@innerleftmargin@length}%
      \pgfmathsetlengthmacro\md@Ay{+\mdf@splitbottomskip@length}%
      \pgfmathsetlengthmacro\md@Ox{+0pt}%
      \pgfmathsetlengthmacro\md@Oy{+0pt}%
      \pgfmathsetlengthmacro\md@Px{+\mdfboundingboxwidth}%
      \pgfmathsetlengthmacro\md@Py{+\mdfboundingboxheight}%
      \ifbool{mdf@leftline}{%
        \pgfmathsetlengthmacro\md@Ax{\md@Ax+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+\mdf@innerlinewidth@length}%
        \pgfmathsetlengthmacro\md@Ox{\md@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}}{}%
      \ifbool{mdf@rightline}{%
         \pgfmathsetlengthmacro\md@Px{\md@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}}{}%
%
      \coordinate(O)at(\md@Ox,\md@Oy);%
      \coordinate(P)at(\md@Px,\md@Py);%
%
      \ifboolexpr{bool {mdf@leftline} and bool {mdf@rightline}}%
               {\md@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P);}}{}%
      \ifboolexpr{bool {mdf@leftline} and not (bool {mdf@rightline})}%
               {\md@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P);}}{}%
      \ifboolexpr{not (bool {mdf@leftline}) and bool {mdf@rightline}}%
               {\md@tikzbox@otl{(P)--(P|-O)}{(O)rectangle(P);}}{}%
      \ifboolexpr{not (bool {mdf@leftline}) and not (bool {mdf@rightline})}%
               {\path[mdfbackground](O)rectangle(P);}{}%
%
      \node[mdfbox]at(\md@Ax,\md@Ay){\box\tw@};% Ausgabebox einfuegen
    \end{tikzpicture}%
  }%
}%

\def\md@putbox@second{%
  \leftline{\null\hspace*{\mdf@leftmargin@length}%%
    \md@tikz@settings%
%
    \setlength\mdfboundingboxwidth{\wd\@tempboxa}%
    \advance\mdfboundingboxwidth by \mdf@innerleftmargin@length\relax%
    \advance\mdfboundingboxwidth by \mdf@innerrightmargin@length\relax%
    \ifbool{mdf@leftline}{%
      \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
    \ifbool{mdf@rightline}{%
      \advance\mdfboundingboxwidth by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxwidth by \mdf@outerlinewidth@length\relax}{}%
%
    \setlength\mdfboundingboxheight{\ht\@tempboxa+\dp\@tempboxa}%
    \advance\mdfboundingboxheight by \mdf@innerbottommargin@length\relax%
    \ifbool{mdf@bottomline}{%
      \advance\mdfboundingboxheight by \mdf@innerlinewidth@length\relax%
      \advance\mdfboundingboxheight by \mdf@middlelinewidth@length\relax%
      \advance\mdfboundingboxheight by \mdf@outerlinewidth@length\relax}{}%
%
    \begin{tikzpicture}
      \pgfmathsetlengthmacro\md@Ax{+\mdf@innerleftmargin@length}%
      \pgfmathsetlengthmacro\md@Ay{+\mdf@innerbottommargin@length}%
      \pgfmathsetlengthmacro\md@Ox{+0pt}%
      \pgfmathsetlengthmacro\md@Oy{+0pt}%
      \pgfmathsetlengthmacro\md@Px{+\mdfboundingboxwidth}%
      \pgfmathsetlengthmacro\md@Py{+\mdfboundingboxheight}%
      \ifbool{mdf@leftline}{%
        \pgfmathsetlengthmacro\md@Ax{\md@Ax+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+\mdf@innerlinewidth@length}%
        \pgfmathsetlengthmacro\md@Ox{\md@Ox+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}}{}%
      \ifbool{mdf@rightline}{%
         \pgfmathsetlengthmacro\md@Px{\md@Px-\mdf@outerlinewidth@length-0.5\mdf@middlelinewidth@length}}{}%
      \ifbool{mdf@bottomline}{%
         \pgfmathsetlengthmacro\md@Ay{\md@Ay+\mdf@outerlinewidth@length+\mdf@middlelinewidth@length+\mdf@innerlinewidth@length}%
         \pgfmathsetlengthmacro\md@Oy{\md@Oy+\mdf@outerlinewidth@length+0.5\mdf@middlelinewidth@length}}{}%
%
      \coordinate(O)at(\md@Ox,\md@Oy);%
      \coordinate(P)at(\md@Px,\md@Py);%
%
      \ifboolexpr{test {\md@test@ltrb} or test {\md@test@lrb}}{\md@tikzbox@tfl{(P-|O)--(O)--(O-|P)--(P);}}{}%
      \ifboolexpr{test {\md@test@ltb} or test {\md@test@lb}}%
               {\md@tikzbox@otl{(P-|O)--(O)--(O-|P);}{(P)--(P|-O)[mdfcorners]--(O)--(O|-P)}}{}%
      \ifboolexpr{test {\md@test@trb} or test {\md@test@rb}}%
               {\md@tikzbox@otl{(P)--(P|-O)--(O);}{(O|-P)--(P)[mdfcorners]--(P|-O)--(O)}}{}%
      \ifboolexpr{test {\md@test@ltr} or test {\md@test@lr}}%
               {\md@tikzbox@otl{(O)--(O|-P)(P)--(P|-O)}{(O)rectangle(P)}}{}%
      \ifboolexpr{test {\md@test@tb} or test {\md@test@b}}{\md@tikzbox@otl{(O)--(O-|P)}{(O)rectangle(P)}}{}%
      \ifboolexpr{test {\md@test@lt} or test {\md@test@l}}{\md@tikzbox@otl{(O)--(O|-P)}{(O)rectangle(P)}}{}%
      \ifboolexpr{test {\md@test@tr} or test {\md@test@r}}{\md@tikzbox@otl{(O-|P)--(P)}{(O)rectangle(P)}}{}%
      \md@test@t{\path[mdfbackground](O)rectangle(P);}{}%
%
      \md@test@noline{\path[mdfbackground,mdfcorners](O|-P)--(O)--(O-|P)--(P);}{}%
%
      \node[mdfbox] at (\md@Ax,\md@Ay){\box\@tempboxa};% Ausgabebox einfuegen
       \end{tikzpicture}%
     }
}
\endinput