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
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
|
%%
%% This is file `mdframed.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% mdframed.dtx (with options: `package')
%% ----------------------------------------------------------------
%% Working with the command fbox or fcolorbox, one has to
%% handle page breaks by hand. The present package defines the
%% environment mdframed which automatically deals with page breaks.
%%
%% Author's name: Marco Daniel and Elke Schubert (!new)
%% License type: lppl
%%
%% ==================================================
%% ========Is based on the idea of framed.sty========
%% ==================================================
%% ===== Currently the package has a beta-Status ====
%% ==================================================
%% WITH THANKS TO (alphabetically):
%% ROLF NIEPRASCHK
%% HEIKO OBERDIEK
%% HERBERT VOSS
%%
%% Copyright (c) 2010 Marco Daniel
%%
%% This package may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
%%
%% =================================================
%% Erstellung eines Rahmens, der am Seitenende keine
%% horizontale Linie einfuegt
%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
%% _______________
%% | page 1 |
%% | Text |
%% | __Text__ |
%% | | Text | |
%% P A G E B R E A K
%% | | Text | |
%% | |_Text_| |
%% | Text |
%% |____page 2___|
%%
%% >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
%% ==================================================
%%
\def\mdversion{v1.0c}
\def\mdframedpackagename{mdframed}
\def\md@maindate@svn$#1: #2 #3 #4-#5-#6 #7 #8${#4/#5/#6\space }
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{mdframed}%
[\md@maindate@svn$Id: mdframed.dtx 273 2011-12-10 09:21:09Z marco $%
\mdversion: \mdframedpackagename]
\newcommand*\md@PackageWarning[1]{\PackageWarning{\mdframedpackagename}{#1}}
\newcommand*\md@PackageInfo[1]{\PackageInfo{\mdframedpackagename}{#1}}
\newcommand*\md@LoadFile@IfExist[1]{%
\IfFileExists{#1.sty}{%
\RequirePackage{#1}%
}{%
\md@PackageWarning{The file #1 does not exist^^J
but needed by \mdframedpackagename^^J
see documentation fo further information
}%
}
}
\RequirePackage{kvoptions}
\RequirePackage{etex}
\RequirePackage{etoolbox}[2011/01/03]
\RequirePackage{zref-abspage}
\RequirePackage{color}
\SetupKeyvalOptions{family=mdf,prefix=mdf@}
\newlength{\md@templength}
\def\md@iflength#1{%
\afterassignment\md@iflength@check%
\md@templength=#1\mdf@defaultunit\relax\relax
\expandafter\endgroup\next
}
\def\md@iflength@check#1{%
\begingroup
\ifx\relax#1\@empty
\def\next{\@secondoftwo}
\else
\def\next{\@firstoftwo}
\expandafter\md@iflength@cleanup
\fi
}
\def\md@iflength@cleanup#1\relax{}
\newrobustcmd*{\mdf@option@length}[2]{%
\expandafter\newlength\csname mdf@#1@length\endcsname%
\expandafter\setlength\csname mdf@#1@length\endcsname{#2}%
}
\newrobustcmd*{\mdf@define@key@length}[1]{%
\define@key{mdf}{#1}{%
\def\@tempa{##1}
\md@iflength{\@tempa}%
{\csxdef{mdfl@#1}{\the\md@templength}}%
{\csxdef{mdfl@#1}{\the\md@templength}}%
\expandafter\setlength\csname mdf@#1@length\endcsname{\csname mdfl@#1\endcsname}%
}%
}
\DeclareListParser*{\mdf@dolist}{,}
\def\mdf@do@lengthoption#1{%
\mdf@lengthoption@doubledo#1\@nil%
}
\def\mdf@lengthoption@doubledo#1==#2\@nil{%
\mdf@option@length{#1}{#2}%
\mdf@define@key@length{#1}%
}
\def\mdf@do@stringoption#1{%
\mdf@stringoption@doubledo#1\@nil%
}
\def\mdf@stringoption@doubledo#1==#2\@nil{%
\expandafter\gdef\csname mdf@#1\endcsname{#2}%
\define@key{mdf}{#1}{%
\csdef{mdf@#1}{##1}%
}%
}
\def\mdf@do@booloption#1{%
\mdf@booloption@doubledo#1\@nil%
}
\def\mdf@booloption@doubledo#1==#2\@nil{%
\newbool{mdf@#1}\setbool{mdf@#1}{#2}%
\define@key{mdf}{#1}[#2]{%
\setbool{mdf@#1}{##1}%
}%
}
\def\mdf@do@alignoption#1{%
\mdf@alignoption@tripledo#1\@nil%
}
\def\mdf@alignoption@tripledo#1==#2==#3\@nil{%
\csdef{mdf@align@#1@left}{\null\hspace*{#2}}%
\csdef{mdf@align@#1@right}{\hspace*{#3}\null}%
}
\newcounter{mdf@globalstyle@cnt}
\defcounter{mdf@globalstyle@cnt}{0}
\newcommand*\mdfglobal@style{0}
\define@key{mdf}{style}{%
\md@PackageWarning{package option style is depreciated^^J
use framemethod instead\MessageBreak}%
\renewcommand*\mdfglobal@style{#1}%
\defcounter{mdf@globalstyle@cnt}{#1}%
\ifcase\value{mdf@globalstyle@cnt}\relax
%0 <- kein Grafikpaket
\or\md@LoadFile@IfExist{tikz}%
\or\md@LoadFile@IfExist{pstricks-add}%
\or\defcounter{mdf@globalstyle@cnt}{2}%
\md@LoadFile@IfExist{pstricks-add}%
\or\md@LoadFile@IfExist{pstricks-add}%
\else\md@PackageWarning{Unknown global style \value{mdf@globalstyle@cnt}}%
\fi%
}
\providecommand*\mdf@framemethod{}
\def\md@framemethod@i{}%
\def\md@framemethod@ii{}%
\def\md@framemethod@iii{}%
\define@key{mdf}{framemethod}[default]{%
\lowercase{\def\md@tempa{#1}}
\forcsvlist{\listadd\md@framemethod@i}{default,tex,latex,none,0}
\forcsvlist{\listadd\md@framemethod@ii}{pgf,tikz,1}
\forcsvlist{\listadd\md@framemethod@iii}{pstricks,ps,2,postscript}
\xifinlist{\md@tempa}{\md@framemethod@i}%
{\def\mdf@@framemethod{default}\defcounter{mdf@globalstyle@cnt}{0}}%
{\xifinlist{\md@tempa}{\md@framemethod@ii}%
{\def\mdf@@framemethod{tikz}\defcounter{mdf@globalstyle@cnt}{1}}%
{\xifinlist{\md@tempa}{\md@framemethod@iii}%
{\def\mdf@@framemethod{pstricks}\defcounter{mdf@globalstyle@cnt}{2}}%
{%
\md@LoadFile@IfExist{#1}%
}%
}%
}%
\ifcase\value{mdf@globalstyle@cnt}\relax%
%0 <- kein Grafikpaket
\or\md@LoadFile@IfExist{tikz}%
\or\md@LoadFile@IfExist{pstricks-add}%
\or\md@LoadFile@IfExist{pstricks-add}%
\fi%
}
\mdf@dolist{\mdf@do@lengthoption}{%
{skipabove==\z@},%
{skipbelow==\z@},%
{leftmargin==\z@},%
{rightmargin==\z@},%
{margin==20pt},%
{innerleftmargin==10pt},%
{innerrightmargin==10pt},%
{innertopmargin==0.4\baselineskip},%
{innerbottommargin==0.4\baselineskip},%
{splittopskip==\z@},%
{splitbottomskip==\z@},%
{outermargin==-999pt},%
{innermargin==-999pt},%
{linewidth==0.4pt},%
{innerlinewidth==\z@},%
{middlelinewidth==\expandafter\mdf@linewidth@length},%
{outerlinewidth==\z@},%
{roundcorner==\z@},%
{footenotedistance==\medskipamount},
{userdefinedwidth==\linewidth}
}
\mdf@dolist{\mdf@do@stringoption}{%
{defaultunit==pt},%
{settings=={}},%
{linecolor==black},%
{backgroundcolor==white},%
{fontcolor==black},%
{innerlinecolor==\mdf@linecolor},%
{outerlinecolor==\mdf@linecolor},%
{middlelinecolor==\mdf@linecolor},%
{psroundlinecolor==\mdf@backgroundcolor},%
{frametitle=={}},%
{frametitlefont==\bfseries\large},%
{printheight==none},%
}
\mdf@dolist{\mdf@do@booloption}{%
{ntheorem==false},%
{topline==true},%
{leftline==true},%
{bottomline==true},%
{rightline==true},%
{hidealllines==false},%
{nobreak==false},%
{footnoteinside==true},%
}
\mdf@dolist{\mdf@do@alignoption}{%
{left==\mdf@leftmargin@length==\z@},%
{center==\fill==\fill},%
{right==\fill==\mdf@rightmargin@length},%
{outer==\fill==\mdf@rightmargin@length},%not supported yet
{outer==\mdf@leftmargin@length==\fill},%not supported yet
}
\newcommand*\mdf@align{}%
\newcommand*\mdf@makeboxalign@left{\null\hspace*{\mdf@leftmargin@length}}%
\newcommand*\mdf@makeboxalign@right{}%
\define@key{mdf}{align}[left]{%
\ifcsundef{mdf@align@#1@left}{%
\md@PackageWarning{Unknown alignment #1\MessageBreak}%
\letcs\mdf@makeboxalign@left{mdf@align@left@left}%
\letcs\mdf@makeboxalign@right{mdf@align@left@right}%
}{%
\def\mdf@makeboxalign@left{\csuse{mdf@align@#1@left}}%
\def\mdf@makeboxalign@right{\csuse{mdf@align@#1@right}}%
}%
}
\def\mdf@tikzset@local{\tikzset{tikzsetting/.style={}}}
\define@key{mdf}{tikzsetting}{%
\def\mdf@tikzset@local{\tikzset{tikzsetting/.style={#1}}}%
}
\define@key{mdf}{apptotikzsetting}{%
\appto\mdf@tikzset@local{#1}%
}
\def\mdf@psset@local{}
\define@key{mdf}{pstrickssetting}{%
\def\mdf@psset@local{#1}
}
\def\mdf@xcolor{}
\define@key{mdf}{xcolor}[none]{%
\@ifpackageloaded{xcolor}{%
\let\mdf@xcolor\@empty %ignoriere die Eingabe der Optionen
}{%
\def\@tempa{none}%
\ifx\mdf@xcolor\@tempa
\else
\PassOptionsToPackage{\mdf@xcolor}{xcolor}%
\RequirePackage{xcolor}%
\fi%
}%
}
\define@key{mdf}{needspace}[\z@]{%
\begingroup%
\setlength{\dimen@}{#1}%
\vskip\z@\@plus\dimen@%
\penalty -100\vskip\z@\@plus -\dimen@%
\vskip\dimen@%
\penalty 9999%
\vskip -\dimen@%
\vskip\z@skip % hide the previous |\vskip| from |\addvspace|
\endgroup%
}
\DeclareDefaultOption{%
\md@PackageWarning{Unknown Option '\CurrentOption' for mdframed}}
\ProcessKeyvalOptions*\relax
\newcommand*{\mdfsetup}{\setkeys{mdf}}
\define@key{mdf}{style}{%
\ifcsundef{mdf@definestyle@#1}{%
\md@PackageWarning{Unknown definedstyle #1^^J
You have to define a style ^^J
via \string\mdfdefinedstyle\MessageBreak
}%
}%
{\expandafter\expandafter\expandafter\mdfsetup%
\expandafter\expandafter\expandafter{\csname mdf@definestyle@#1\endcsname}}%
}%
\let\md@PackageNoInfo\@gobble
\newrobustcmd*\md@ifstrequal@expand{%
\expandafter\ifstrequal\expandafter{\mdf@printheight}%
}
\newrobustcmd*\md@print@space{%
%case "none"
\md@ifstrequal@expand{none}{\def\md@tempa{NoInfo}}{%
%case "info"
\md@ifstrequal@expand{info}{\def\md@tempa{Info}}{%
%case "warning"
\md@ifstrequal@expand{warning}{\def\md@tempa{Warning}}{%
%case "unknown"
\md@PackageWarning{Unknown key for printheight=\mdf@printheight^^J
use none, info or warning}%
\def\md@tempa{none}%
}%
}%
}%
\def\md@PackageInfoSpace{\csname md@Package\md@tempa\endcsname}%
}
\def\md@lrbox#1{%
\edef\reserved@a{%
\endgroup
\setbox#1\vbox{%
\begingroup\aftergroup}%
\def\noexpand\@currenvir{\@currenvir}%
\def\noexpand\@currenvline{\on@line}}%
\reserved@a
\@endpefalse
\@parboxrestore
\begingroup%
\color@setgroup
\color{\mdf@fontcolor}%
\hsize=\md@horizontalspaceofbox%
\columnwidth=\hsize%
\textwidth=\hsize%
\linewidth=\hsize%
\@parboxrestore
\bgroup\md@@frametitle\egroup\noindent%
\ignorespaces}
\def\endmd@lrbox{\endgroup\unskip\color@endgroup}
\let\md@trivlist\trivlist
\let\endmd@trivlist\endtrivlist
\patchcmd\endmd@trivlist\@endparenv\md@endparenv{}{}
\def\md@endparenv{%
\addpenalty\@endparpenalty\addvspace\mdf@skipbelow@length\@endpetrue}
\newrobustcmd*\mdf@makebox@out[2][\linewidth]{%
\noindent\hb@xt@\z@{%
\noindent\makebox[\dimexpr #1\relax][l]{#2}%
\hss}%
}%
\newrobustcmd*\mdf@makebox@in[2][\mdf@userdefinedwidth@length]{%
\noindent\makebox[\dimexpr #1\relax][l]{#2}%
}
\newrobustcmd*\mdfdefinestyle[2]{%
\csdef{mdf@definestyle@#1}{#2}%
}
\newrobustcmd*\mdfapptodefinestyle[2]{%
\ifcsundef{mdf@definestyle@#1}%
{\md@PackageWarning{Unknown style #1}}%
{\csappto{mdf@definestyle@#1}{,#2}}%
}
\newrobustcmd*\newmdenv[2][]{%
\newenvironment{#2}{%
\mdfsetup{#1}%
\begin{mdframed}%
}{%
\end{mdframed}%
}%
}
\newrobustcmd*\renewmdenv[2][]{%
\expandafter\let\csname #2\endcsname\relax%
\expandafter\let\csname end#2\endcsname\relax%
\newmdenv[#1]{#2}%
}%
\newrobustcmd*\newmdtheoremenv{%
\kernel@ifnextchar[%]
{\newmdtheoremenv@i}{\newmdtheoremenv@i[]}%
}
\def\newmdtheoremenv@i[#1]#2{%
\kernel@ifnextchar[%]
{\newmdtheoremenv@ii[#1]#2}{\newmdtheoremenv@ii[#1]#2[]}%
}
\def\newmdtheoremenv@ii[#1]#2[#3]#4{%
\kernel@ifnextchar[%]
{\newmdtheoremenv@iii[#1]#2[#3]#4}{\newmdtheoremenv@iii[#1]#2[#3]#4[]}%
}
\def\newmdtheoremenv@iii[#1]#2[#3]#4[#5]{%
\ifboolexpr{ test {\ifblank {#3}} and test {\ifblank {#5}} }%
{%
\newtheorem{#2}{#4}%
}{%
\ifboolexpr{ not (test {\ifblank {#3}}) and not (test {\ifblank {#5}}) }%
{\md@PackageWarning{You can't such a comibination for newmdtheoremenv^^J
Instead mdframed uses newtheorem{#2}{#4}}%
\newtheorem{#2}{#4}%
}%
{%
\notblank{#3}{\newtheorem{#2}[#3]{#4}}{}%
\notblank{#5}{\newtheorem{#2}{#4}[#5]}{}%
}%
}%
\BeforeBeginEnvironment{#2}{\begin{mdframed}[#1]}%
\AfterEndEnvironment{#2}{\end{mdframed}}%
}
\let\mdraggedtitle\raggedright
\providecommand*\mdframedtitleenv[1]{%
\@afterindentfalse
{\parindent \z@
\setlength{\parfillskip}{\z@ plus 1fil}%
\mdraggedtitle\nobreak\mdf@frametitlefont#1\relax%
\par}%
\@afterheading}
\newrobustcmd*\md@@frametitle{%
\ifx\mdf@frametitle\@empty\relax%
\else
\color@begingroup\@nobreaktrue%
\mdframedtitleenv{\mdf@frametitle}%
\color@endgroup
\fi%
}
\newrobustcmd*\md@checkntheorem{%
\ifbool{mdf@ntheorem}% %%% Pruefen ob ntheorem gesetzt ist
{\ifundef{\theorempreskipamount}%
{\md@PackageWarning{You have not loaded ntheorem yet}}%
{\setlength{\theorempreskipamount}{\z@}%
\setlength{\theorempostskipamount}{\z@}%
}%
}{}%
}
\newrobustcmd*\md@footnoterule{%
\kern0\p@%
\hrule \@width 1in \kern 2.6\p@}
\newrobustcmd*\md@footnoteoutput{%
\ifvoid\@mpfootins\else
\nobreak%
\vskip\mdf@footenotedistance@length%
\normalcolor%
\md@footnoterule
\unvbox\@mpfootins
\fi%
}
\newrobustcmd*\md@footnoteinput{%
\def\@mpfn{mpfootnote}%
\def\thempfn{\thempfootnote}%
\c@mpfootnote\z@%
\let\@footnotetext\@mpfootnotetext%
}
\newrobustcmd*\mdf@load@style{%
\ifcase\value{mdf@globalstyle@cnt}\relax%
\input{md-frame-0.mdf}%
\or\input{md-frame-1.mdf}%
\or\input{md-frame-2.mdf}%
\or\input{md-frame-3.mdf}%
\else%
\IfFileExists{md-frame-\value{mdf@globalstyle@cnt}.mdf}%
{\input{md-frame-\value{mdf@globalstyle@cnt}.mdf}}%
{%
\input{md-frame-0.mdf}%
\md@PackageWarning{The style number \value{mdf@globalstyle@cnt} does not exist^^J
mdframed ues instead style=0 \mdframedpackagename}%
}%
\fi%
}%
\mdf@load@style
\newrobustcmd*\md@styledefinition{%
\ifnumequal{\value{mdf@globalstyle@cnt}}{0}%
{\deflength{\mdf@innerlinewidth@length}{\z@}%
\deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}%
\deflength{\mdf@outerlinewidth@length}{\z@}%
\let\mdf@innerlinecolor\mdf@linecolor%
\let\mdf@middlelinecolor\mdf@linecolor%
\let\mdf@outerlinecolor\mdf@linecolor%
}{}%
\ifnumequal{\value{mdf@globalstyle@cnt}}{2}%
{\deflength{\mdf@innerlinewidth@length}{\z@}%
\deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}%
\deflength{\mdf@outerlinewidth@length}{\z@}%
\let\mdf@innerlinecolor\mdf@linecolor%
}{}%
\ifnumequal{\value{mdf@globalstyle@cnt}}{3}%
{\deflength{\mdf@innerlinewidth@length}{\z@}%
\deflength{\mdf@middlelinewidth@length}{\mdf@linewidth@length}%
\deflength{\mdf@outerlinewidth@length}{\z@}%
\let\mdf@innerlinecolor\mdf@linecolor%
}{}%
}
\let\md@reserved@a\@empty
\newrobustcmd*\detected@md@put@frame{%
\ifmdf@nobreak%Option nobreak=true?
\def\md@reserved@a{\md@put@frame@standalone}%
\else
\def\md@reserved@a{\md@put@frame}%
\ifnum\@floatpenalty<0\relax%Detecting float
\if@twocolumn%
\ifx\@captype\@undefined
\def\md@reserved@a{\md@put@frame}%
\else
\md@PackageInfo{mdframed inside float ^^J
mdframed uses option nobreak \mdframedpackagename}%
\def\md@reserved@a{\md@put@frame@standalone}%
\fi
\else
\md@PackageInfo{mdframed inside float ^^J
mdframed uses option nobreak \mdframedpackagename}%
\def\md@reserved@a{\md@put@frame@standalone}%
\fi%
\fi%
\if@minipage%
\md@PackageInfo{mdframed inside minipage ^^J
mdframed uses option nobreak \mdframedpackagename}%
\def\md@reserved@a{\md@put@frame@standalone}%
\fi%
\ifinner%
\md@PackageInfo{mdframed inside a box ^^J
mdframed uses option nobreak \mdframedpackagename}%
\def\md@reserved@a{\md@put@frame@standalone}%
\fi%
\fi%
\md@reserved@a%
}
\newrobustcmd*\md@hidealllines@check{%
\ifbool{mdf@hidealllines}{%
\setbool{mdf@leftline}{false}%
\setbool{mdf@rightline}{false}%
\setbool{mdf@topline}{false}%
\setbool{mdf@bottomline}{false}%
}{}%
}
\newlength\mdfboundingboxwidth
\newlength\mdfboundingboxtotalwidth
\newlength\mdfboundingboxheight
\newlength\mdfboundingboxdepth
\newlength\mdfboundingboxtotalheight
\newlength\md@freevspace@length
\newlength\md@horizontalwidthofbox@length
\newlength\md@verticalmarginwhole@length
\providecommand*\ptTps{}
\newrobustcmd\mdfcreateextratikz{}
\def\mdframed{\@ifnextchar[\mdframed@i\mdframed@ii}%
\def\mdframed@ii{\mdframed@i[]}%
\def\mdframed@i[#1]{% default-Umgebung
\begingroup
%%Ueberlegung- wie es besser geht!!!! WICHTIG
\mdfsetup{userdefinedwidth=\linewidth,#1}
\md@hidealllines@check%
\mdf@settings%
\md@twoside@checklength%
\let\width\z@%
\let\height\z@%
\setlength{\topsep}{\mdf@skipabove@length}%
\begingroup%
\let\partopsep\z@%
\expandafter\endgroup%
\begin{md@trivlist}\item\relax%
\md@checkntheorem%
\md@styledefinition%
\md@footnoteinput%
\md@horizontalmargin@equation%
\begin{md@lrbox}{\@tempboxa}%
}%
\def\endmdframed{%
\ifmdf@footnoteinside%
\def\md@reserveda{%
\md@footnoteoutput%
\end{md@lrbox}%
\detected@md@put@frame}%
\else%
\def\md@reserveda{%
\end{md@lrbox}%
\detected@md@put@frame%
\md@footnoteoutput%
}%
\fi%
\md@reserveda%
\end{md@trivlist}%
\hrule \@height\z@ \@width\hsize
\endgroup\@endparenv%
}
\newtoggle{md:checktwoside}
\settoggle{md:checktwoside}{false}
\newrobustcmd*\md@twoside@checklength{%
\if@twoside
\ifboolexpr{ test {\ifdimequal{\mdf@outermargin@length}{-999pt}}
and
test {\ifdimequal{\mdf@innermargin@length}{-999pt}}
}%
{%
\md@PackageInfo{You haven't set the outermargin/innermargin^^
mdframed will use leftmargin/rightmargin}%
\settoggle{md:checktwoside}{false}%
}%
{\settoggle{md:checktwoside}{true}}%
\iftoggle{md:checktwoside}{%
\ifdimequal{\mdf@outermargin@length}{-999pt}%
{\setlength\mdf@rightmargin@length{\z@}}%
{\setlength\mdf@rightmargin@length{\mdf@outermargin@length}}%
\ifdimequal{\mdf@innermargin@length}{-999pt}%
{\setlength\mdf@leftmargin@length{\z@}}%
{\setlength\mdf@leftmargin@length{\mdf@innermargin@length}}%
}{}%
\fi%
}
\newcounter{md@zref@counter}%keine doppelten laebes
\zref@newprop*{md@pagevalue}[0]{\number\value{page}}
\zref@addprop{\ZREF@mainlist}{md@pagevalue}
\newrobustcmd*\md@zref@label{%
\stepcounter{md@zref@counter}
\zref@label{md@pagelabel-\number\value{md@zref@counter}}%
}
\newrobustcmd*\if@md@pageodd{%
\zref@refused{md@pagelabel-\the\value{md@zref@counter}}%
\ifodd\zref@extract{md@pagelabel-\the\value{md@zref@counter}}{md@pagevalue}%
\edef\md@reserveda{\md@pageisodd}%
\else
\edef\md@reserveda{\md@pageiseven}%
\fi
\md@reserveda%
}
\newrobustcmd*\md@pageisodd{%
\ifdimequal{\mdf@outermargin@length}{-999pt}%
{\setlength\mdf@rightmargin@length{\z@}}%
{\setlength\mdf@rightmargin@length{\mdf@outermargin@length}}%
\ifdimequal{\mdf@innermargin@length}{-999pt}%
{\setlength\mdf@leftmargin@length{\z@}}%
{\setlength\mdf@leftmargin@length{\mdf@innermargin@length}}%
}
\newrobustcmd*\md@pageiseven{%
\ifdimequal{\mdf@outermargin@length}{-999pt}%
{\setlength\mdf@leftmargin@length{\z@}}%
{\setlength\mdf@leftmargin@length{\mdf@outermargin@length}}%
\ifdimequal{\mdf@innermargin@length}{-999pt}%
{\setlength\mdf@rightmargin@length{\z@}}%
{\setlength\mdf@rightmargin@length{\mdf@innermargin@length}}%
}
\newrobustcmd*\md@@setzref{\md@zref@label\if@md@pageodd}
\newrobustcmd*\md@freepagevspace{%
\penalty\@M \vskip 2\baselineskip \vskip\height
\penalty9999 \vskip -2\baselineskip \vskip-\height
\penalty9999
\ifdimequal{\pagegoal}{\maxdimen}%
{\md@freevspace@length\vsize}%
{\md@freevspace@length=\pagegoal\relax%
\advance\md@freevspace@length by -\pagetotal\relax%
}%
}
\newrobustcmd*\md@advancelength@orizontalmargin@add[1]{%
\advance\md@horizontalspaceofbox by -\csname mdf@#1@length\endcsname\relax%
}
\newlength\md@horizontalspaceofbox
\newrobustcmd*\md@horizontalmargin@equation{%
\setlength{\md@horizontalspaceofbox}{\mdf@userdefinedwidth@length}%
\mdf@dolist{\md@advancelength@orizontalmargin@add}{%
leftmargin,outerlinewidth,middlelinewidth,%
innerlinewidth,innerleftmargin,innerrightmargin,%
innerlinewidth,middlelinewidth,outerlinewidth,%
rightmargin}%
\notbool{mdf@leftline}{%
\advance\md@horizontalspaceofbox by \mdf@innerlinewidth@length\relax%
\advance\md@horizontalspaceofbox by \mdf@middlelinewidth@length\relax%
\advance\md@horizontalspaceofbox by \mdf@outerlinewidth@length\relax%
}{}%
\notbool{mdf@rightline}{%
\advance\md@horizontalspaceofbox by \mdf@innerlinewidth@length\relax%
\advance\md@horizontalspaceofbox by \mdf@middlelinewidth@length\relax%
\advance\md@horizontalspaceofbox by \mdf@outerlinewidth@length\relax%
}{}%
%%% Beruecksichtigung, dass Auszaehlung bzw. list-Umgebung enthalten
\ifdimless{\md@horizontalspaceofbox}{3cm}%
{\md@PackageWarning{You have only a width of 3cm}}{}
\hsize=\md@horizontalspaceofbox%
}
\newrobustcmd*\md@keeplines@single{%
\notbool{mdf@topline}{%
\advance\md@verticalmarginwhole@length by -\mdf@middlelinewidth@length%
}{}%
\notbool{mdf@bottomline}{%
\advance\md@verticalmarginwhole@length by -\mdf@middlelinewidth@length%
}{}%
}
\newrobustcmd*\md@advancelength@verticalmarginwhole[1]{%
\advance\md@verticalmarginwhole@length by \csname mdf@#1@length\endcsname\relax%
}
\newrobustcmd*\md@advancelength@freevspace@sub[1]{%
\advance\dimen@ by -\csname mdf@#1@length\endcsname\relax%
}
\newrobustcmd*\md@advancelength@freevspace@add[1]{%
\advance\dimen@ by \csname mdf@#1@length\endcsname\relax%
}
\protected@edef\md@reset{\boxmaxdepth\the\boxmaxdepth
\splittopskip\the\splittopskip}%
\newrobustcmd*\md@put@frame@standalone{\relax%
\ifvoid\@tempboxa\relax
\md@PackageWarning{The environment is empty\MessageBreak}%
\let\md@reserved@a\relax%
\else
%Hier berechnung Box-Inhalt+Rahmen oben und unten
\setlength{\md@verticalmarginwhole@length}%
{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}%
\mdf@dolist{\md@advancelength@verticalmarginwhole}{%
outerlinewidth,middlelinewidth,innerlinewidth,innertopmargin,
innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}%
\md@keeplines@single%
\def\md@reserved@a{\md@putbox@single}%
\fi
\md@reserved@a%
}
\def\md@put@frame{\relax%
\ifvoid\@tempboxa\relax
\md@PackageWarning{The environment is empty\MessageBreak}%
\let\md@reserved@a\relax%
\else
\md@print@space%
\md@freepagevspace%
\md@PackageInfoSpace{\the\md@freevspace@length before the beginning of ^^J
the environment ending on input line \MessageBreak}%
\ifdimless{\md@freevspace@length}{2\baselineskip}
{\md@PackageInfo{Not enough space on this page}
\vfill\eject%
\def\md@reserved@a{\md@put@frame}%
}{%
%Hier berechnung Box-Inhalt+Rahmen oben und unten
\setlength{\md@verticalmarginwhole@length}%
{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}%
\mdf@dolist{\md@advancelength@verticalmarginwhole}{%
outerlinewidth,middlelinewidth,innerlinewidth,innertopmargin,
innerbottommargin,innerlinewidth,middlelinewidth,outerlinewidth}%
\md@keeplines@single%
\ifdimless{\md@verticalmarginwhole@length}{\md@freevspace@length}%
{%passt auf Seite%
\begingroup
\iftoggle{md:checktwoside}{\md@@setzref}{}%
\md@putbox@single
\endgroup
\let\md@reserved@a\relax}%
{\def\md@reserved@a{\md@put@frame@i}}%passt nicht auf Seite
}%
\fi
\md@reserved@a%
}
\def\md@put@frame@i{%Box muss gesplittet werden -- Ausgabe der ersten Teilbox
%Berechnung der Splittgroesse -- Linien und Abstand oben
\md@freepagevspace%
\dimen@=\the\md@freevspace@length%
\dimen@i=\mdf@innertopmargin@length%
\advance\dimen@i by \mdf@linewidth@length%
\advance\dimen@i by 2\baselineskip%
\ifdim\dimen@<\dimen@i\relax
\hrule \@height\z@ \@width\hsize%
\vfill\eject%
\def\md@reserved@a{\md@put@frame}%
\else%
\mdf@dolist{\md@advancelength@freevspace@sub}{%
outerlinewidth,middlelinewidth,innerlinewidth,%
innertopmargin,splitbottomskip}%
\ifbool{mdf@topline}{}{\advance\dimen@ by \mdf@middlelinewidth@length}%
\ifdimless{\ht\@tempboxa+\dp\@tempboxa}{\dimen@}%
{\md@PackageWarning{You got a bad break\MessageBreak
you have to change it manually\MessageBreak
by changing the text, the space\MessageBreak
or something else}%
\advance\dimen@ by -1.8\baselineskip\relax%
}{}%
\advance\dimen@ by -1pt\relax%Box darf nicht zu Groß werden.
\splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
\setbox\tw@\vsplit\@tempboxa to \dimen@
\ifdimgreater{\ht\tw@+\dp\tw@}{\dimen@}{%Falsch gesplittet
\md@PackageInfo{Box was splittet wrong\MessageBreak}%
\dimen@i=\dimen@
\advance\dimen@ by -\ht\tw@
\advance\dimen@ by -\dp\tw@
\advance\dimen@i by 0.5\dimen@
\splittopskip\z@%
\setbox\@tempboxa\vbox{\unvbox\tw@%
%benoetigt um Tiefe zu haben
\hrule \@height\dp\strutbox \@width\z@
\unvbox\@tempboxa}
\splittopskip\mdf@splittopskip@length%
\setbox\tw@\vsplit\@tempboxa to \dimen@i
}{}%
\setbox\@tempboxa\vbox{\unvbox\@tempboxa}%PRUEFEN!!!!
\ifvoid\@tempboxa
\md@PackageWarning{You got a bad break\MessageBreak
because the splittet box is empty\MessageBreak
You have to change the page settings\MessageBreak
like enlargethispage or something else}%
\setbox\@tempboxa\vbox{\box\tw@\box\@tempboxa}%
\def\md@reserved@a{\md@put@frame}%
\fi
\ifvoid\tw@%%pruefe, ob erste Box leer ist
\hrule \@height\z@ \@width\hsize
\vfill\eject%
\def\md@reserved@a{\md@put@frame}%
\else
\ifdimequal{\ht\tw@}{0pt}%
{\hrule \@height\z@ \@width\hsize%
\vfill\eject%
\setbox\@tempboxa\vbox{\unvbox\tw@\unvbox\@tempboxa}
\def\md@reserved@a{\md@put@frame}%
}%
{%
\begingroup
\iftoggle{md:checktwoside}{\md@@setzref}{}%
\md@putbox@first%%%Groesse des Splittens passt
\endgroup
\hrule \@height\z@ \@width\hsize
\vfill\eject%
\def\md@reserved@a{\md@put@frame@ii}%
}%
\fi%
\fi%
\md@reserved@a%
}
\def\md@put@frame@ii{%Ausgabe der mittleren Box(en) wenn vorhanden
\setlength{\md@freevspace@length}{\vsize}%
\setlength{\dimen@}{\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax}%
\mdf@dolist{\md@advancelength@freevspace@add}{%
outerlinewidth,middlelinewidth,innerlinewidth,%
innerbottommargin}%%%Addition der Linien unten
\ifbool{mdf@bottomline}{}{\advance\dimen@ by -\mdf@middlelinewidth@length\relax}%
\ifdimgreater{\dimen@}{\md@freevspace@length}%
{%
\advance\md@freevspace@length by -\mdf@splitbottomskip@length
\splitmaxdepth\z@ \splittopskip\mdf@splittopskip@length%
\setbox\tw@\vsplit\@tempboxa to \md@freevspace@length%
% \setbox\tw@\vbox{\unvbox\tw@}%PRUEFEN!!!
\setbox\@tempboxa\vbox{\unvbox\@tempboxa}%PRUEFEN!!!!
\ifvoid\@tempboxa\relax%
\md@PackageWarning{You got a bad break\MessageBreak
because the split box is empty\MessageBreak
You have to change the settings}%
\fi%
\begingroup
\iftoggle{md:checktwoside}{\md@@setzref}{}%
\md@putbox@middle%
\endgroup
\hrule \@height\z@ \@width\hsize
\vfill\eject
\def\md@reserved@a{\md@put@frame@ii}%
}%Hier die Ausgabe der mittleren Box
{\ifvoid\@tempboxa
\md@PackageWarning{You got a bad break\MessageBreak
because the last split box is empty\MessageBreak
You have to change the settings}%
\fi%
\begingroup
\iftoggle{md:checktwoside}{\md@@setzref}{}%
\md@putbox@second%
\endgroup
\let\md@reserved@a\relax%
}%Hier kommt die Ausgabe der letzten Box
\md@reserved@a%
}
\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{framemethod}%
\DisableKeyvalOption[action=warning,package=mdframed]{mdf}{xcolor}%
\endinput
%%
%% ================================================================
%% Copyright (C) 2011 by Marco Daniel
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License (LPPL), either
%% version 1.3c of this license or (at your option) any later
%% version. The latest version of this license is in the file:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% This work is "maintained" (as per LPPL maintenance status) by
%% Marco Daniel.
%%
%% Have fun!
%%
%% ================================================================
%%
%% End of file `mdframed.sty'.
|