summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/mdframed/md-tikz-1.mdf
blob: e4e0b6538649e88f00a4e5063c16aed04c32a00a (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
%%==================================================%%
%%= 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.


%%Allgemeine Einstellungen fuer tikz
\def\md@tikz@settings{%
       \setlength{\mdf@innerlinewidth@tikz}{\mdf@innerlinewidth}%
       \setlength{\mdf@outerlinewidth@tikz}{\mdf@outerlinewidth}%
       \setlength{\mdf@middlelinewidth@tikz}{\mdf@middlelinewidth}%
%wenn das Innere der Doppellinie 0pt breit ist, muss Grenze zwischen innerer und äußerer Linie einer Farbe zugeordnet werden
          \ifdimequal{\mdf@middlelinewidth@tikz}{\z@}%
                       {\ifdimequal{\mdf@innerlinewidth@tikz}{\z@}%
                            {\ifdimequal{\mdf@outerlinewidth@tikz}{\z@}%
                              {\let\mdf@middlelinecolor\mdf@backgroundcolor}%
                              {\let\mdf@middlelinecolor\mdf@outerlinecolor}%
                            }%
                            {\let\mdf@middlelinecolor\mdf@innerlinecolor}%
                        }{}%
          \ifdimequal{\mdf@innerlinewidth@tikz}{\z@}%
                       {\ifdimequal{\mdf@outerlinewidth@tikz}{\z@}%
                            {\ifdimequal{\mdf@middlelinewidth@tikz}{\z@}%
                              {}%
                              {\let\mdf@middlelinecolor\mdf@linecolor}%
                            }%
                            {}%
                        }{}%
        \setlength\mdf@xmargin@tikz{\mdf@margin}%         % links und rechts
        \setlength\mdf@ymargin@tikz{0.4\baselineskip}%    % oben und unten
        \tikzset{mdftext/.style={inner sep=0pt,outer sep=0pt}}%,font=\color{\mdf@fontcolor}
        \tikzset{mdfcorners/.style={rounded corners=\mdf@roundcorner}}%
        \tikzset{mdfbackground/.style={fill=\mdf@backgroundcolor}}%
        \ifdimgreater{\mdf@outerlinewidth@tikz}{\z@}%
            {\tikzset{mdfborderA/.style={draw=\mdf@outerlinecolor,line width=2\mdf@outerlinewidth@tikz+\mdf@middlelinewidth@tikz}}}%
            {\tikzset{mdfborderA/.style={}}}%
        \ifdimgreater{\mdf@innerlinewidth@tikz}{\z@}%
            {\tikzset{mdfborderI/.style={draw=\mdf@innerlinecolor,line width=2\mdf@innerlinewidth@tikz+\mdf@middlelinewidth@tikz}}}%
            {\tikzset{mdfborderI/.style={}}}%
       \tikzset{mdfmiddle/.style={draw=\mdf@middlelinecolor,line width=\mdf@middlelinewidth@tikz}}%
 % bei abgerundeten Ecken Kontrolle, dass der Rahmen nicht zu dicht an der Textbox ist
        \setlength{\mdf@rounded@tikz}{\mdf@roundcorner}% 
             \pgfmathsetlengthmacro\r{\mdf@rounded@tikz/3}%
             \ifdimless{\mdf@ymargin@tikz}{\r}{\setlength\mdf@ymargin@tikz{\r}}{}%
             %\ifdimless{\mdf@xmargin@tikz}{\r}{\setlength\mdf@xmargin@tikz{\r}}{}%
}
%
\def\md@putbox@single{%
   \leftline{\null\hspace*{\mdf@leftmargin}%%
       \md@tikz@settings%
        \setlength\mdfboxwidth{\wd\@tempboxa}%
        \setlength\mdfboxheight{\ht\@tempboxa}%
        \begin{tikzpicture}
	         \coordinate(O)at(0,0);
                 \pgfmathsetlengthmacro\x{\mdfboxwidth+2*\mdf@xmargin@tikz+2*\mdf@innerlinewidth@tikz+\mdf@middlelinewidth@tikz}
                 \pgfmathsetlengthmacro\y{\mdfboxheight+2*\mdf@ymargin@tikz+2*\mdf@innerlinewidth@tikz+\mdf@middlelinewidth@tikz}
                 \coordinate(P)at(\x,\y);
                 \begin{scope}
		      \clip[preaction=mdfborderA][postaction={mdfbackground,mdfborderI}][mdfcorners](O)--(O|-P)--(P)--(P|-O)--cycle;
	         \end{scope}
                 \path[mdfmiddle,mdfcorners](O)--(O|-P)--(P)--(P|-O)--cycle;
                 \node[mdftext]at(0.5*\x,0.5*\y){\box\@tempboxa};
       \end{tikzpicture}%
     }
}

\def\md@putbox@first{%
   \leftline{\null\hspace*{\mdf@leftmargin}%%
       \md@tikz@settings%
        \setlength\mdfboxwidth{\wd\tw@}%
        \setlength\mdfboxheight{\ht\tw@}%
        \begin{tikzpicture}
%                \draw[use as bounding box,white] (0,0) rectangle (%
%                           \mdfboxwidth+2*\mdf@xmargin@tikz+2*\mdf@innerlinewidth@tikz+\mdf@middlelinewidth@tikz+\mdf@outerlinewidth@tikz,%
%                           \mdfboxheight+2\mdf@ymargin@tikz+\mdf@innerlinewidth@tikz+0.5\mdf@middlelinewidth@tikz);
	         \coordinate(O) at (0,0);
                 \pgfmathsetlengthmacro\x{\mdfboxwidth+2*\mdf@xmargin@tikz+2*\mdf@innerlinewidth@tikz+\mdf@middlelinewidth@tikz}
                 \pgfmathsetlengthmacro\y{\mdfboxheight+2\mdf@ymargin@tikz+\mdf@innerlinewidth@tikz+0.5*\mdf@middlelinewidth@tikz}
                 \coordinate(P)at(\x,\y-0.8\mdf@ymargin@tikz);
                 \clip(-\mdf@outerlinewidth@tikz-0.5*\mdf@middlelinewidth@tikz,0)%
                      rectangle(\x+\mdf@outerlinewidth@tikz+0.5*\mdf@middlelinewidth@tikz,%
                                \y+\mdf@outerlinewidth@tikz+0.5*\mdf@middlelinewidth@tikz);
                 \begin{scope}
                     \clip[preaction=mdfborderA][postaction={mdfbackground,mdfborderI}][mdfcorners](O)--(O|-P)--(P)--(P|-O);
                 \end{scope}
                 \path[mdfmiddle,mdfcorners](O)--(O|-P)--(P)--(P|-O);
                 \node[mdftext]at(0.5*\x,0.5*\y-0.5*\mdf@innerlinewidth@tikz-0.25*\mdf@middlelinewidth@tikz-0.8\mdf@ymargin@tikz){\box\tw@};
     \end{tikzpicture}%
     }
}


\def\md@putbox@middle{%
   \leftline{\null\hspace*{\mdf@leftmargin}%%
        \md@tikz@settings%
        \setlength\mdfboxwidth{\wd\tw@}%
        \setlength\mdfboxheight{\ht\tw@}%
        \setlength{\mdf@ymargin@tikz}{0.4\baselineskip}
        \begin{tikzpicture}
	         \coordinate(O)at(0,0);
                 \pgfmathsetlengthmacro\x{\mdfboxwidth+2*\mdf@xmargin@tikz+2*\mdf@innerlinewidth@tikz+\mdf@middlelinewidth@tikz}
                 \pgfmathsetlengthmacro\y{\mdfboxheight%
                                          +2*\mdf@ymargin@tikz%
                                          +4*\mdf@innerlinewidth@tikz%
                                          +2*\mdf@middlelinewidth@tikz%
                                          +0*\mdf@outerlinewidth@tikz}
                 \coordinate(P)at(\x,\y);
                 \clip(-\mdf@outerlinewidth@tikz-0.5*\mdf@middlelinewidth@tikz,2*\mdf@outerlinewidth@tikz+\mdf@middlelinewidth@tikz)%
                       rectangle(\x+\mdf@outerlinewidth@tikz+0.5*\mdf@middlelinewidth@tikz,\y-2*\mdf@outerlinewidth@tikz-\mdf@middlelinewidth@tikz);
                 \begin{scope}
                        \clip[preaction=mdfborderA][postaction={mdfbackground,mdfborderI}](O)--(O|-P)--(P)--(P|-O);
                 \end{scope}
                 \path[mdfmiddle](O)--(O|-P)--(P)--(P|-O);
                 \node[mdftext,]at(0.5*\x,0.5*\y){\box\tw@};
       \end{tikzpicture}%
     }
}

\def\md@putbox@second{%
   \leftline{\null\hspace*{\mdf@leftmargin}%%
       \md@tikz@settings
        \setlength\mdfboxwidth{\wd\@tempboxa}%
        \setlength\mdfboxheight{\ht\@tempboxa}%
        \begin{tikzpicture}
                 \coordinate(O)at(0,0);
                 \pgfmathsetlengthmacro\x{\mdfboxwidth+2*\mdf@xmargin@tikz+2*\mdf@innerlinewidth@tikz+\mdf@middlelinewidth@tikz}
                 \pgfmathsetlengthmacro\y{\mdfboxheight+1*\mdf@ymargin@tikz+\mdf@innerlinewidth@tikz+0.5*\mdf@middlelinewidth@tikz}
                 \coordinate(P)at(\x,\y+\mdf@ymargin@tikz);
                 \clip(-\mdf@outerlinewidth@tikz-0.5*\mdf@middlelinewidth@tikz,-\mdf@outerlinewidth@tikz-0.5*\mdf@middlelinewidth@tikz)%
                      rectangle(\x+\mdf@outerlinewidth@tikz+0.5*\mdf@middlelinewidth@tikz,\y);
                 \begin{scope}
                      \clip[preaction=mdfborderA][postaction={mdfbackground,mdfborderI}][mdfcorners](P-|O)--(O)--(O-|P)--(P);
                 \end{scope}
                 \path[mdfmiddle,mdfcorners](P-|O)--(O)--(O-|P)--(P);
                 \node[mdftext] at (0.5*\x,0.5*\y+0.5*\mdf@innerlinewidth@tikz+0.25*\mdf@middlelinewidth@tikz+0.25*\mdf@ymargin@tikz){\box\@tempboxa};
       \end{tikzpicture}%
     }
}