summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex
blob: 78d4e5f5bc6ba41cb1bf0d1eb769ee5051ee272b (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
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
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
% \LaTeX-Main\
%% The LaTeX package tcolorbox - version 1.20 (2012/03/16)
%% tcolorbox.tex: Manual
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2006-2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `author-maintained'.
%%
%% This work consists of all files listed in README
%%
\documentclass[a4paper,11pt]{ltxdoc}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{lmodern,parskip,array,ifthen,calc,makeidx}
\usepackage{amsmath,amssymb}
\usepackage[svgnames,table,hyperref]{xcolor}
\usepackage{tikz}
\usepackage[pdftex,bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref}
\urlstyle{sf}

\usepackage[a4paper,left=2.5cm,right=2.5cm,top=1.5cm,bottom=1.5cm,
    marginparsep=5mm,marginparwidth=10mm,
    headheight=0mm,headsep=0cm,
    footskip=1.5cm,includeheadfoot]{geometry}
\usepackage{fancyhdr}
\fancyhf{}
\fancyfoot[C]{\thepage}%
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\pagestyle{fancy}
\tolerance=2000%
\setlength{\emergencystretch}{20pt}%

\RequirePackage{csquotes}
\RequirePackage[style=numeric-comp,sorting=nyt,
  maxnames=8,minnames=8,abbreviate=false,backend=biber]{biblatex}
\DeclareFieldFormat{url}{\newline\url{#1}}%
\DeclareListFormat{language}{}%
\setlength{\bibitemsep}{\smallskipamount}
\addbibresource{\jobname.bib}

\usepackage[listings,theorems,documentation]{tcolorbox}

\tcbmakedocSubKey{docTcbKey}{tcb}
\tcbmakedocSubKey{langTcbKey}{tcb/doclang}

\hypersetup{
  pdftitle={Manual for the tcolorbox package},
  pdfauthor={Thomas F. Sturm},
  pdfsubject={colored boxes},
  pdfkeywords={colored boxes, LaTeX examples, theorems}
}

\def\version{1.20}%
\def\datum{2012/03/16}%
\makeindex

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{center}
\vspace*{5mm}\par
{\bfseries\LARGE The \texttt{tcolorbox} package\par}
{\large Manual for version \version\ (\datum)\par}\bigskip
{\large Thomas F.~Sturm%
  \footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik,
    Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany;
     email: \href{mailto:thomas.sturm@unibw.de}{thomas.sturm@unibw.de}} }
\end{center}
\bigskip
\begin{absquote}
  \begin{center}\bfseries Abstract\end{center}
  |tcolorbox| provides an environment for colored and framed text boxes with a
  heading line. Optionally, such a box can be split in an upper and a lower
  part. The package |tcolorbox| can be used for the setting of \LaTeX\ examples where
  one part of the box displays the source code and the other part shows the
  output. Another common use case is the setting of theorems. The package supports
  saving and reuse of source code and text parts.
\end{absquote}


\tableofcontents


\clearpage
\section{Introduction}
The package originates from the first edition of my book
\flqq{\citetitle{sturm:2011b}\frqq~\cite{sturm:2011b}
in about 2006.
For the \LaTeX\ examples and tutorials given there, I wanted to have
accentuated and colored boxes to display source code and
compiled text in combination.
Since, in my opinion, this type of boxes is also quite useful to highlight definitions
and theorems, I applied them for my lecture notes in
mathematics \cite{sturm:2007b,sturm:2008b,sturm:2010a}
as well.
With this package, you are invited to apply these boxes for similar projects.


\subsection{Loading the Package}
The base package |tcolorbox| loads the packages
|pgf| \cite{tantau:2010c}, |calc| \cite{thorub:2007a}, and |verbatim| \cite{schoepf:2001a}.
|tcolorbox| itself is loaded in the usual manner in the preamble:
\begin{dispListing}
\usepackage{tcolorbox}
\end{dispListing}
The package takes option keys in the key-value syntax.
Alternatively, you may use these keys later in the preamble with
\refCom{tcbuselibrary} (see there).
For example, the key to typeset listings is:
\begin{dispListing}
\usepackage[listings]{tcolorbox}
\end{dispListing}


\subsection{Libraries}\label{sec:bibliothek}
The base package |tcolorbox| is extendable by program libraries.
This is done by usage of option keys while loading the package or inside
the preamble by applying the following macro with the same set of keys.

\begin{docCommand}{tcbuselibrary}{\marg{key list}}
  Loads the libraries given by the \meta{key list}.
\begin{dispListing}
\tcbuselibrary{listings,theorems}
\end{dispListing}
\end{docCommand}

The following keys are used inside |\tcbuselibrary| respectively
|\usepackage| without the key tree path |/tcb/library/|.

\begin{docTcbKey}[library]{listings}{}{no value}
  Loads the package |listings| \cite{heinz:2007a} and provides additional
  macros for typesetting listings which are described in section \ref{sec:listings}
  from page \pageref{sec:listings}.
\end{docTcbKey}

\begin{docTcbKey}[library]{theorems}{}{no value}
  Provides additional
  macros for typesetting theorems which are described in section \ref{sec:theorems}
  from page \pageref{sec:theorems}.
\end{docTcbKey}

\begin{docTcbKey}[library]{documentation}{}{no value}
  Provides additional
  macros for typesetting \LaTeX\ documentations
  which are described in section \ref{sec:documentation}
  from page \pageref{sec:documentation}.
\end{docTcbKey}


\clearpage
\section{Macros for Box Creation}

\begin{docEnvironment}{tcolorbox}{\oarg{options}}
  This is the main environment to create an accentuated colored text box with
  rounded corners and, optionally, two parts. The appearance of this box
  is controlled by numerous options.
  In the most simple case the source code

\begin{dispListing}
\begin{tcolorbox}
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispListing}

creates the following compiled text box:
\begin{tcolorbox}
This is a \textbf{tcolorbox}.
\end{tcolorbox}

The text content of the box can be divided
in an upper and a lower part
by the command \refCom{tcblower}. Visually, both parts are separated by a line.
For example:

\begin{dispListing}
\begin{tcolorbox}
This is another \textbf{tcolorbox}.
\tcblower
Here, you see the lower part of the box.
\end{tcolorbox}
\end{dispListing}

This code gives the following box:
\begin{tcolorbox}
This is another \textbf{tcolorbox}.
\tcblower
Here, you see the lower part of the box.
\end{tcolorbox}

The \meta{options} control the appearance and several functions of the boxes,
see section \ref{sec:optkeys} for the complete list.
A quick example is given here:

\begin{dispExample}
\begin{tcolorbox}[colback=red!5,colframe=red!75!black,title=My nice heading]
This is another \textbf{tcolorbox}.
\tcblower
Here, you see the lower part of the box.
\end{tcolorbox}
\end{dispExample}
\end{docEnvironment}


\begin{docCommand}{tcblower}{}
  Used inside \refEnv{tcolorbox} to separate the upper box part from
  the optional lower box part.
\end{docCommand}


\begin{docCommand}{tcbset}{\marg{options}}
  Sets options for every following \refEnv{tcolorbox} inside the current \TeX\ group.
  For example, the colors of the boxes may be defined for the whole document by this:
\begin{dispListing}
\tcbset{colback=red!5,colframe=red!75!black}
\end{dispListing}
\end{docCommand}


\clearpage
\section{Option Keys}\label{sec:optkeys}
For the \meta{options} in \refEnv{tcolorbox} respectively \refCom{tcbset}
the following |pgf| keys can be applied. The key tree path |/tcb/| is not to
be used inside these macros. It is easy to add your own style keys using
the syntax for |pgf| keys, see \cite{tantau:2010c,sturm:2011b} or the examples
starting from page \pageref{sec:latextutorial}.


\subsection{Title}
\begin{docTcbKey}{title}{=\meta{text}}{no default, initially empty}
  Creates a heading line with \meta{text} as content.
\begin{dispExample}
\begin{tcolorbox}[title=My heading line]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{notitle}{}{no value, initially set}
  Removes the title line if set before.
\end{docTcbKey}


\begin{docTcbKey}{adjusted title}{=\meta{text}}{style, no default, initially unset}
  Creates a heading line with \meta{text} as content. The minimal height of
  this line is adjusted to fit the text '\"Apgjy'. This option makes sense
  for single line headings if boxes are set side by side with equal height.
  Note that it is very easy to trick this adjustment.
\begin{dispExample}
\tcbset{colback=White,arc=0mm,width=(\linewidth-4pt)/4,
equal height group=AT,before=,after=\hfill,fonttitle=\bfseries}

The following titles are not adjusted:\\
\foreach \n in {xxx,ggg,AAA,\"Agypten}
{\begin{tcolorbox}[title=\n,colframe=red!75!black]
  Some content.\end{tcolorbox}}
Now, we try again with adjusted titles:\\
\foreach \n in {xxx,ggg,AAA,\"Agypten}
{\begin{tcolorbox}[adjusted title=\n,colframe=blue!75!black]
  Some content.\end{tcolorbox}}
\end{dispExample}
\end{docTcbKey}


\clearpage
\subsection{Lower Part}
\begin{docTcbKey}{lowerbox}{=\meta{mode}}{no default, initially \texttt{visible}}
  Controls the treatment of the lower part of the box.
  Feasible values for \meta{mode} are:
  \begin{itemize}
  \item |visible|: usual type setting of the lower part,
  \item |invisible|: empty space instead of the lower part contents,
  \item |ignored|: the lower part is not used (here).
  \end{itemize}
  The last two values are usually applied in connection with |savelowerto|.
\begin{dispExample}
\begin{tcolorbox}[lowerbox=invisible]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part (but invisible).
\end{tcolorbox}

\begin{tcolorbox}[lowerbox=ignored]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part (but ignored).
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{savelowerto}{=\meta{file name}}{no default, initially empty}
  Saves the content of the lower box in a file for an optional later usage.
\begin{dispExample}
\begin{tcolorbox}[lowerbox=invisible,savelowerto=\jobname_bspsave.tex]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part which may be quite complex:
$\displaystyle f(x)=\frac{1+x^2}{1-x^2}$.
\end{tcolorbox}

Now, we load the saved text:\\
\input{\jobname_bspsave.tex}
\end{dispExample}
\end{docTcbKey}


\clearpage
\begin{docTcbKey}{savedelimiter}{=\meta{name}}{no default, initially \texttt{tcolorbox}}
  Used in connection with new environment definitions which extend
  |tcolorbox| and use or allow the option |savelowerto|.
  To catch the end of the new box environment \meta{name} has to be the name of
  this environment. Additionally, the environment definition has to use
  |\tcolorbox| instead of
  |\begin{tcolorbox}| and |\endtcolorbox| instead of |\end{tcolorbox}|.
\begin{dispExample}
\newenvironment{mybox}[1]{%
  \tcolorbox[savedelimiter=mybox,
             savelowerto=\jobname_bspsave2.tex,
             lowerbox=ignored,
             colback=red!5,colframe=red!75!black,fonttitle=\bfseries,title=#1]}%
  {\endtcolorbox}

\begin{mybox}{My Example}
Upper part.
\tcblower
Saved lower part!
\end{mybox}

Now, the saved part is used:
\begin{tcolorbox}[colback=green!5]
\input{\jobname_bspsave2.tex}
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}



\subsection{Colors and Fonts}
\begin{docTcbKey}{colback}{=\meta{color}}{no default, initially \texttt{black!5}}
  Sets the background \meta{color} of the box.
\begin{dispExample}
\begin{tcolorbox}[colback=white]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{colframe}{=\meta{color}}{no default, initially \texttt{black!75}}
  Sets the frame \meta{color} of the box.
\begin{dispExample}
\begin{tcolorbox}[colframe=red!50!yellow]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{coltext}{=\meta{color}}{no default, initially \texttt{black}}
  Sets the text \meta{color} of the box.
\begin{dispExample}
\begin{tcolorbox}[coltext=yellow,colback=blue!50,colframe=blue]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{coltitle}{=\meta{color}}{no default, initially \texttt{white}}
  Sets the title text \meta{color} of the box.
\begin{dispExample}
\begin{tcolorbox}[coltitle=blue!50!black,colframe=blue!25,title=Test]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{fontupper}{=\meta{text}}{no default, initially empty}
  Sets \meta{text} before the content of the upper part (e.\,g.\ font settings).
\begin{dispExample}
\begin{tcolorbox}[fontupper=Hello!~\sffamily]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{fontlower}{=\meta{text}}{no default, initially empty}
  Sets \meta{text} before the content of the lower part (e.\,g.\ font settings).
\begin{dispExample}
\begin{tcolorbox}[fontlower=\sffamily\bfseries]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\clearpage
\begin{docTcbKey}{fonttitle}{=\meta{text}}{no default, initially empty}
  Sets \meta{text} before the content of the title text (e.\,g.\ font settings).
\begin{dispExample}
\begin{tcolorbox}[fonttitle=\sffamily\bfseries\large,title=Hello]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\subsection{Geometry}
\begin{docTcbKey}{width}{=\meta{length}}{no default, initially \cs{linewidth}}
  Sets the total width of the colored box to \meta{length}.
  See also \refKey{/tcb/height}.
\begin{dispExample}
\begin{tcolorbox}[width=\linewidth/2]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{boxrule}{=\meta{length}}{no default, initially \texttt{0.5mm}}
  Sets the frame width to \meta{length}.
\begin{dispExample}
\begin{tcolorbox}[boxrule=2mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{arc}{=\meta{length}}{no default, initially \texttt{1mm}}
  Sets the radius of the four frame arcs to \meta{length}.
\begin{dispExample}
\begin{tcolorbox}[arc=0mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[arc=4mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{boxsep}{=\meta{length}}{no default, initially \texttt{1mm}}
  Sets a common padding of \meta{length} between the text content and the
  frame of the box. This value is added to the key values of
  |left|, |right|, |top|, |bottom|, and |middle| at the appropriate places.
\begin{dispExample}
\begin{tcolorbox}[boxsep=5mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{left}{=\meta{length}}{style, no default, initially \texttt{4mm}}
  Sets the left space between all text parts and frame (additional to |boxsep|).
  This is an abbreviation for setting
  |lefttitle|, |leftupper|, and |leftlower| to the same value.
\begin{dispExample}
\begin{tcolorbox}[left=0mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{lefttitle}{=\meta{length}}{no default, initially \texttt{4mm}}
  Sets the left space between title text and frame (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[lefttitle=3cm,title=My Title]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{leftupper}{=\meta{length}}{no default, initially \texttt{4mm}}
  Sets the left space between upper text and frame (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[leftupper=3cm,title=My Title]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{leftlower}{=\meta{length}}{no default, initially \texttt{4mm}}
  Sets the left space between lower text and frame (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[leftlower=3cm]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{right}{=\meta{length}}{style, no default, initially \texttt{4mm}}
  Sets the right space between all text parts and frame (additional to |boxsep|).
  This is an abbreviation for setting
  |righttitle|, |rightupper|, and |rightlower| to the same value.
\begin{dispExample}
\begin{tcolorbox}[width=5cm,right=2cm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}



\begin{docTcbKey}{righttitle}{=\meta{length}}{no default, initially \texttt{4mm}}
  Sets the right space between title text and frame (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[width=5cm,righttitle=2cm,title=My very long title text]
This is a \textbf{tcolorbox} with standard upper box dimensions.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{rightupper}{=\meta{length}}{no default, initially \texttt{4mm}}
  Sets the right space between upper text and frame (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[width=5cm,rightupper=2cm,title=My very long title text]
This is a \textbf{tcolorbox} with compressed upper box dimensions.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{rightlower}{=\meta{length}}{no default, initially \texttt{4mm}}
  Sets the right space between lower text and frame (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[width=5cm,rightlower=2cm]
This is a \textbf{tcolorbox} with standard upper box dimensions.
\tcblower
This is the lower part with large space at right.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}



\begin{docTcbKey}{top}{=\meta{length}}{no default, initially \texttt{2mm}}
  Sets the top space between text and frame (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[top=0mm]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{bottom}{=\meta{length}}{no default, initially \texttt{2mm}}
  Sets the bottom space between text and frame (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[bottom=0mm]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\clearpage
\begin{docTcbKey}{middle}{=\meta{length}}{no default, initially \texttt{2mm}}
  Sets the space between upper and lower text to the separation line
  (additional to |boxsep|).
\begin{dispExample}
\begin{tcolorbox}[middle=0mm,boxsep=0mm]
This is a \textbf{tcolorbox}.
\tcblower
This is the lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}



\subsection{Height Control}
In a typical usage scenario, the height of a |tcolorbox| is computed automatically
to fit the content. Nevertheless, the height can be set to a fixed value
or to fit commonly for several boxes, e.\,g. if boxes are set side by side.


\begin{docTcbKey}{natural height}{}{no value, initially set}
  Sets the total height of the colored box to its natural height depending
  on the box content.
\end{docTcbKey}

\begin{docTcbKey}{height}{=\meta{length}}{no default}
  Sets the total height of the colored box to \meta{length} independent
  of the box content.
\begin{dispExample}
\tcbset{width=(\linewidth-2mm)/3,before=,after=\hfill,
colframe=blue!75!black,colback=white}

\begin{tcolorbox}[height=1cm,valign=center]
  This box has a height of 1cm.
\end{tcolorbox}
\begin{tcolorbox}[height=2cm,valign=center]
  This box has a height of 2cm.
\end{tcolorbox}
\begin{tcolorbox}[height=3cm,split=0.5,valign=center,valign lower=center]
  This box has a height of 3cm.
  \tcblower
  Lower part.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{space}{=\meta{fraction}}{no default, initially 0}
  If the height of a |tcolorbox| is not the natural height, the space
  difference between the forced and the natural size is distributed
  between the upper and the lower part of the box. This space could also
  be negative.
  \meta{fraction} with a value between 0 and 1 is the amount of space
  which is added to the upper part, the rest is added to the lower part.
  If there is no lower part, then all of the space is added to
  the upper part always.
\begin{dispExample}
\tcbset{width=(\linewidth-2mm)/3,before=,after=\hfill,
colframe=blue!75!black,colback=white,height=3cm}

\foreach \f in {0.2,0.4,0.7}
{\begin{tcolorbox}[space=\f]
    This is the upper part.
    \tcblower
    This is the lower part.
\end{tcolorbox}}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{space to upper}{}{style}
  This is an abbreviation for |space=1|, i.\,e. all extra space is added
  to the upper part.
\end{docTcbKey}

\begin{docTcbKey}{space to lower}{}{style, initially set}
  This is an abbreviation for |space=0|, i.\,e. all extra space is added
  to the lower part (if there is any).
\end{docTcbKey}

\begin{docTcbKey}{space to both}{}{style}
  This is an abbreviation for |space=0.5|, i.\,e. the extra space
  equally distributed between the upper and the lower part.
\begin{dispExample}
\tcbset{width=(\linewidth-2mm)/3,before=,after=\hfill,
colframe=blue!75!black,colback=white,height=3cm}

\foreach \myspace in {space to upper,space to both,space to lower}
{\begin{tcolorbox}[\myspace]
    This is the upper part.
    \tcblower
    This is the lower part.
\end{tcolorbox}}
\end{dispExample}
\end{docTcbKey}


\clearpage
\begin{docTcbKey}{split}{=\meta{fraction}}{no default}
  If the height of a |tcolorbox| is not the natural height, the
  \meta{fraction} with a value between 0 and 1 determines the positioning
  of the segmentation between the upper and the lower part. Here, 0 stands
  for top and 1 for bottom. Note that the box is split regardless of
  the actual dimensions of the text parts!
\begin{dispExample}
\tcbset{width=(\linewidth-2mm)/3,before=,after=\hfill,height=3cm,
colback=white,colframe=blue!75!black,valign=center,valign lower=center}

\foreach \f in {0.1,0.5,0.8}
{\begin{tcolorbox}[split=\f]
This is the upper part.
\tcblower
This is the lower part with a lot of text in several lines.
\end{tcolorbox}}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{valign}{=\meta{alignment}}{no default, initially |top|}
  If the height of a |tcolorbox| is not the natural height, |valign|
  determines the vertical \meta{alignment} of the upper part.
  Feasible values are |top|, |center|, and |bottom|. For a box with natural
  height, these values are meaningless.
\begin{dispExample}
\tcbset{width=(\linewidth-2mm)/3,before=,after=\hfill,
colframe=blue!75!black,colback=white,height=2cm}

\foreach \myalign in {top,center,bottom}
{\begin{tcolorbox}[valign=\myalign]
  This is a \textbf{tcolorbox}.
\end{tcolorbox}}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{valign lower}{=\meta{alignment}}{no default, initially |top|}
  This key has the same meaning for the lower part as |valign|
  for the upper part, i.\,e. it determines
  the vertical \meta{alignment} of the lower part with feasible values
  |top|, |center|, and |bottom|.
\end{docTcbKey}


\clearpage
\begin{docTcbKey}{equal height group}{=\meta{id}}{no default}
  Boxes which are members of an |equal height group| will all get the
  same height, i.\,e. the maximum of all their natural heights. The
  \meta{id} serves to distinguish between different height groups.
  This \meta{id} should contain only characters which are feasible
  for \TeX\ macro names, typically alphabetic characters but no numerals
  and spaces. Note that you have to compile twice to see changes and
  that height groups are global definitions.


\begin{dispExample}
\tcbset{width=(\linewidth-2mm)/3,before=,after=\hfill,arc=0mm,
colframe=blue!75!black,colback=white,fonttitle=\bfseries}

\begin{tcolorbox}[equal height group=A,adjusted title={One}]
  My smallest box.
\end{tcolorbox}%
\begin{tcolorbox}[equal height group=A,adjusted title={Two}]
  This box is also small.
  \tcblower
  But with a lower part.
\end{tcolorbox}%
\begin{tcolorbox}[equal height group=A,adjusted title={Three}]
  This box contains a lot of text just to fill the space
  with word flowing and flowing and flowing until the box
  is filled with all of it.
\end{tcolorbox}\linebreak
%
\tcbset{width=(\linewidth-1mm)/2,before=,after=\hfill,arc=0mm,
colframe=red!75!black,colback=white}
%
\begin{tcolorbox}[equal height group=B]
  Now, we use another equal height group.
\end{tcolorbox}%
\begin{tcolorbox}[equal height group=B]
  \begin{equation*}
    \int\limits_{0}^{1} x^2 = \frac13.
  \end{equation*}
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{minimum for equal height group}{=\meta{id}:\meta{length}}{no default, initially unset}
  Plants a \meta{length} into the equal height group with
  the given \meta{id}. This ensures that the height will not drop below
  \meta{length}. Note that you cannot reduce a computed height value
  by using this key with a small value.
  The difference to applying \refKey{/tcb/height} directly is that the boxes
  are never too small for their content.

\begin{dispExample}
\tcbset{colframe=blue!75!black,colback=white,arc=0mm,
  before=,after=\hfill,fonttitle=\bfseries,left=2mm,right=2mm,
  width=3.5cm,
  equal height group=C,
  minimum for equal height group=C:3.5cm}

\begin{tcolorbox}
  My first box. All boxes will get 3.5cm times 3.5cm
  if the content height is not too large.
\end{tcolorbox}%
\begin{tcolorbox}
  My second box.
  \tcblower
  This is the lower part.
\end{tcolorbox}%
\begin{tcblisting}{}
\textbf{Mixed}
with a listing.
\end{tcblisting}
\begin{tcolorbox}[title={Fourth box}]
  My final box.
\end{tcolorbox}%
\end{dispExample}
\end{docTcbKey}


\clearpage
\subsection{Floating Objects}
\begin{docTcbKey}{floatplacement}{=\meta{values}}{no default, initially \texttt{htb}}
  Sets \meta{values} as default values for the usage of |float|.
  Feasible are the usual parameters for floating objects.
\begin{dispListing}
\begin{tcolorbox}[floatplacement=t,float,
                  title=Floating box from |floatplacement|]
  This floating box is placed at the top of a page.
\end{tcolorbox}
\end{dispListing}
\tcbusetemp
\end{docTcbKey}


\begin{docTcbKey}{float}{\colOpt{=\meta{values}}}{default from \texttt{floatplacement}}
  Turns the box to a floating object where \meta{values} are the
  usual parameters for such floating objects.
  If they are not used, the placement uses the default values given by
 |floatplacement|.
\begin{dispListing}
\begin{tcolorbox}[float, title=Floating box from |float|]
  This box floats to a feasible place automatically. You do not have to
  use a numbering for this floating object.
\end{tcolorbox}
\end{dispListing}
\tcbusetemp
\end{docTcbKey}


\subsection{Embedding into the Surroundings}
\begin{docTcbKey}{before}{=\meta{macros}}{no default, initially \cs{par}\cs{pagebreak[0]}\cs{noindent}}
  Sets the \meta{macros} which are executed before the colored box.
  They are not used for floating boxes.
\end{docTcbKey}

\begin{docTcbKey}{after}{=\meta{macros}}{no default, initially \cs{par}}
  Sets the \meta{macros} which are executed after the colored box.
  They are not used for floating boxes.
\end{docTcbKey}

\begin{docTcbKey}{parskip}{}{style, no value}
  Sets the keys |before| and |after| to their default values.
  This is recommended, if the package |parskip| is used and there is no better
  idea for |before| and |after|.
\end{docTcbKey}

\begin{docTcbKey}{noparskip}{}{style, no value}
  Sets the keys |before| and |after| to values which are
  recommended, if the package |parskip| is \emph{not} used and there is no better
  idea for |before| and |after|.
\begin{dispListing}
\tcbset{noparskip/.style={before={\par\smallskip\pagebreak[0]\noindent},
                          after={\par\smallskip}}}
\end{dispListing}
\end{docTcbKey}




\clearpage
\subsection{Bounding Box}
Normally, every |tcolorbox| has a bounding box which fits exactly to the
dimensions of the outer frame. Therefore, \LaTeX\ reserves exactly the space
needed for the box.
This behavior can be changed by enlarging (or shrinking) the bounding box.
If the bounding box is enlarged, the |tcolorbox| will get some clearance
around it. If the bounding box is shrunk, i.\,e.\ enlarged with negative
values, the |tcolorbox| will overlap to other parts of the page.
For example, the |tcolorbox| could be stretched into the page margin.

\begin{docTcbKey}{enlarge top by}{=\meta{length}}{no default, initially |0mm|}
  Enlarges the bounding box distance to the top of the box by \meta{length}.
\begin{dispExample}
\tcbset{colframe=blue!75!black,colback=white}

\begin{tcolorbox}[enlarge top by=-5mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[enlarge top by=5mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{enlarge bottom by}{=\meta{length}}{no default, initially |0mm|}
  Enlarges the bounding box distance to the bottom of the box by \meta{length}.
\begin{dispExample}
\tcbset{colframe=blue!75!black,colback=white}

\begin{tcolorbox}[enlarge bottom by=5mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[enlarge bottom by=-5mm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{enlarge left by}{=\meta{length}}{no default, initially |0mm|}
  Enlarges the bounding box distance to the left side of the box by \meta{length}.
\begin{dispExample}
\tcbset{colframe=blue!75!black,colback=white}

\begin{tcolorbox}[enlarge left by=2cm,width=\linewidth-2cm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[enlarge left by=-2cm,width=\linewidth+2cm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{enlarge right by}{=\meta{length}}{no default, initially |0mm|}
  Enlarges the bounding box distance to the right side of the box by \meta{length}.
\begin{dispExample}
\tcbset{colframe=blue!75!black,colback=white}

\begin{tcolorbox}[enlarge right by=-2cm,width=\linewidth+2cm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[enlarge right by=2cm,width=\linewidth-2cm]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{toggle enlargement}{=\meta{toggle preset}}{no default, initially |none|}
  According to the \meta{toggle preset}, the left and the right enlargements of
  the bounding box are switched or not. Feasible values are:
  \begin{itemize}
  \item |none|: no switching.
  \item |forced|: the values of the left and right enlargement are switched.
  \item |evenpage|: if the page is an even page, the values of the left and
    right enlargement are switched. Note that the page number detection may
    fail in certain cases. For these cases, use the |forced| value.
  \end{itemize}
\begin{dispExample}
\tcbset{colframe=blue!75!black,colback=white,
enlarge left by=-20mm,enlarge right by=5mm,width=\linewidth+15mm}

\begin{tcolorbox}[toggle enlargement=none]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[toggle enlargement=forced]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
\begin{tcolorbox}[toggle enlargement=evenpage]
  This page is an \ifthenelse{\isodd{\thepage}}{odd}{even} page.
  Therefore, the left and right enlargements
  \ifthenelse{\isodd{\thepage}}{are not}{are} toggled (with some luck).
\end{tcolorbox}
\end{dispExample}

\begin{dispListing}
\begin{tcolorbox}[colframe=red!60!black,colback=red!15!white,
  fonttitle=\bfseries,title=Floating box from \texttt{toggle enlargement},
  width=\textwidth+20mm,enlarge right by=-20mm,
  toggle enlargement=evenpage,float=t]
  This page is an \ifthenelse{\isodd{\thepage}}{odd}{even} page.
  Therefore, the left and right enlargements
  \ifthenelse{\isodd{\thepage}}{are not}{are} toggled (with some luck; otherwise
  use |forced|). This box stretches to the right margin on odd pages and to the left
  margin on even pages. The current document is one-sided -- this feature makes
  sense for two-sided documents only.
\end{tcolorbox}
\end{dispListing}
\tcbusetemp
\end{docTcbKey}

\enlargethispage*{1cm}

\subsection{Files}
\begin{docTcbKey}{tempfile}{=\meta{file name}}{no default, initially \cs{jobname.tcbtemp}}
  Sets \meta{file name} as name for the temporary file which is used inside
  \refEnv{tcbwritetemp} and \refCom{tcbusetemp} implicitely.
\end{docTcbKey}


\clearpage
\section{Saving and Loading of Verbatim Texts}
The following macros are slightly modified versions of the original macros
from the known packages |moreverb| and |verbatim|.
They are used implicitly inside of a |tcolorbox| environment,
but they can be used outside also.
\enlargethispage*{1.5cm}

\begin{docEnvironment}{tcbverbatimwrite}{\marg{file name}}
  Saves the \meta{environment content} to a file named by \meta{file name}.
  \TeX\ macros inside the environment are not expanded.
\begin{dispExample}
\begin{tcbverbatimwrite}{\jobname_verbexp.tex}
  This text is saved \textit{as is}.
\end{tcbverbatimwrite}

Now, we are using the file:\par
\input{\jobname_verbexp.tex}
\end{dispExample}

This environment may be used inside an own environment. Note, that inside
the environment definition |\tcbverbatimwrite| has to be used instead of
|\begin{tcbverbatimwrite}| and |\endtcbverbatimwrite| instead of |\end{tcbverbatimwrite}|.
\begin{dispExample}
\newenvironment{myverbatim}{%
  \begingroup\tcbverbatimwrite{\jobname_myverb.tex}}%
  {\endtcbverbatimwrite\endgroup}

\begin{myverbatim}
  This is the text which is saved by my own environment.
\end{myverbatim}

Now, we are using the file:\par
\input{\jobname_myverb.tex}
\end{dispExample}
\end{docEnvironment}

\begin{docEnvironment}{tcbwritetemp}{}
  Has the same function as \refEnv{tcbverbatimwrite}, but uses the key value
  of |tempfile| for the file name.
\begin{dispExample}
\begin{tcbwritetemp}
  This text is saved \textit{as is}.
\end{tcbwritetemp}

Now, we are using the file:\par
\tcbusetemp
\end{dispExample}
\end{docEnvironment}


\begin{docCommand}{tcbusetemp}{}
  Loads the current temporary file which was saved by \refEnv{tcbwritetemp}.
\end{docCommand}



\clearpage
\section{Library 'listings'}\label{sec:listings}
The library is loaded by a package option or inside the preamble by:
\begin{dispListing}
\tcbuselibrary{listings}
\end{dispListing}
This also loads the package |listings| \cite{heinz:2007a}.

\subsection{Macros of the Library}

\begin{docEnvironment}{tcblisting}{\marg{options}}
  Creates a colored box based on a \refEnv{tcolorbox}.
  Controlled by the given \meta{options}, the
  environment content is typesetted normally and/or as a listing.
  Furthermore, the \meta{options} control appearance and functions of
  the |tcolorbox|.
  By default, the listing is interpreted as a \LaTeX\ listing.
\begin{dispExample}
\begin{tcblisting}{colback=red!5,colframe=red!75!black}
This is a \LaTeX\ example which displays the text as source code
and in compiled form.
\end{tcblisting}
\end{dispExample}
\begin{dispExample}
\begin{tcblisting}{colback=yellow!5,colframe=yellow!50!black,listing only,
    title=This is source code in another language (XML), fonttitle=\bfseries,
  listing options={language=XML,columns=fullflexible,keywordstyle=\color{red}}}
<?xml version="1.0"?>
<project name="Package tcolorbox" default="documentation" basedir=".">
  <description>
    Apache Ant build file (http://ant.apache.org/)
  </description>
</project>
\end{tcblisting}
\end{dispExample}
\end{docEnvironment}


\clearpage
\begin{docEnvironment}{tcboutputlisting}{}
  Saves the environment content to a file which is named by the key value of
  |listing file|. Later, this file can be loaded by
  |\tcbinputlisting| or |\tcbuselistingtext| or |\tcbuselistinglisting|.
\begin{dispExample}
\begin{tcboutputlisting}
This \textbf{text} is written to a standardized file for later usage.
\end{tcboutputlisting}
\end{dispExample}
\end{docEnvironment}


\begin{docCommand}{tcbinputlisting}{\marg{options}}
  Creates a colored boxed based on a |tcolorbox|. The text content is read
  from a file named by the key value of |listing file|. Apart from that,
  the function is equal to that of \refEnv{tcblisting}.
\begin{dispExample}
\tcbinputlisting{colback=red!5,colframe=red!75!black,text only}
\tcbinputlisting{colback=green!5,colframe=green!75!black,listing only}
\end{dispExample}
\end{docCommand}


\begin{docCommand}{tcbuselistingtext}{}
  Loads text from a file named by the key value of |listing file|.
\begin{dispExample}
\tcbuselistingtext
\end{dispExample}
\end{docCommand}


\begin{docCommand}{tcbuselistinglisting}{}
  Typesets text as listing from a file named by the key value of |listing file|.
\begin{dispExample}
\tcbuselistinglisting
\end{dispExample}
\end{docCommand}


\begin{docCommand}{tcbusetemplisting}{}
  Typesets text as listing from a temporary file which was written by
  \refEnv{tcbwritetemp}.
\end{docCommand}


\clearpage
\subsection{Option Keys of the Library}
For the \meta{options} in \refEnv{tcblisting} respectively \refCom{tcbinputlisting}
the following |pgf| keys can be applied. The key tree path |/tcb/| is not to
be used inside these macros.

\begin{docTcbKey}{listing file}{=\meta{file name}}{no default, initially \cs{jobname.listing}}
  Sets the \meta{file name} of the file which is used to save listings.
\end{docTcbKey}

\begin{docTcbKey}{listing options}{=\meta{key list}}{no default, initially |style=tcblatex|}
  Sets the options from the package |listings| \cite{heinz:2007a}
  which are used during typesetting of the listing.
  For \LaTeX\ listings, there is a predefined |listings| style named |tcblatex|
  which can be used.
\begin{dispExample}
\begin{tcblisting}{colback=red!5,colframe=red!25,left=6mm,
listing options={style=tcblatex,numbers=left,numberstyle=\tiny\color{red!75!black}}}
This is a \LaTeX\ example which displays the text as source code
and in compiled form. Additionally, we use line numbers here.
\end{tcblisting}
\end{dispExample}
\end{docTcbKey}


\begin{docTcbKey}{listing style}{=\meta{style}}{no default, initially |tcblatex|}
  Abbreviation for |listing options={style=...}|. This key sets a \meta{style}
  for the |listings| package, see \cite{heinz:2007a}.
  For \LaTeX, there is a predefined style named |tcblatex|.
\begin{dispExample}
\begin{tcblisting}{colback=red!5,colframe=red!75!black,
listing style=tcblatex}
Here, we use the predefined style.
\end{tcblisting}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{listing and text}{}{no value, initially set}
  Typesets the environment content as listing in the upper part and
  as compiled text in the lower part.
\begin{dispExample}
\begin{tcblisting}{colback=red!5,colframe=red!75!black,listing and text}
This is a \LaTeX\ example.
\end{tcblisting}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{text and listing}{}{no value}
  Typesets the environment content as compiled text in the upper part and
  as listing in the lower part.
\begin{dispExample}
\begin{tcblisting}{colback=red!5,colframe=red!75!black,text and listing}
This is a \LaTeX\ example.
\end{tcblisting}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{listing only}{}{no value}
  Typesets the environment content as listing.
\begin{dispExample}
\begin{tcblisting}{colback=red!5,colframe=red!75!black,listing only}
This is a \LaTeX\ example.
\end{tcblisting}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{text only}{}{no value}
  Typesets the environment content as compiled text.
\begin{dispExample}
\begin{tcblisting}{colback=red!5,colframe=red!75!black,text only}
This is a \LaTeX\ example.
\end{tcblisting}
\end{dispExample}
\end{docTcbKey}



\clearpage
\subsection{Creation of \LaTeX\ Tutorials}\label{sec:latextutorial}
The following source code gives a guideline for the creation of \LaTeX\ tutorials.
In the next section, a framework for \LaTeX\ exercises is described.
All examples shall be numbered optionally.

Firstly, some additional |tcb| keys are defined for the appearance and automatic
numbering.

\begin{dispListing}
\newcounter{texexp}

\tcbset{
  texexp/.style={colframe=red!50!yellow!50!black, colback=red!50!yellow!5!white,
      coltitle=red!50!yellow!3!white,
      fonttitle=\small\sffamily\bfseries, fontupper=\small, fontlower=\small},
  example/.code 2 args={\refstepcounter{texexp}\label{#2}%
      \pgfkeysalso{texexp,title={Example \thetexexp: #1}}},
}
\end{dispListing}
\tcbusetemp


\begin{dispExample}
\begin{tcblisting}{texexp}
This is a \LaTeX\ example which displays the text as source code
and in compiled form.
\end{tcblisting}
\end{dispExample}


\begin{dispExample}
\begin{tcblisting}{example={Direct application of \texttt{example}}{firstExample}}
Here, we use Example \ref{firstExample} with a title line.
\end{tcblisting}
\end{dispExample}

For the next examples, two environments
|texexp| and |texexptitled|
are defined for abbreviation.

\begin{dispListing}
\newenvironment{texexp}[1]{\tcblisting{texexp,#1}}{\endtcblisting}

\newenvironment{texexptitled}[3][]{\tcblisting{example={#2}{#3},#1}}{\endtcblisting}
\end{dispListing}
\tcbusetemp

For special cases, |tcolorbox| with the key
|texexp| can be used instead of these two environments.

Now, we have a flexible box for \LaTeX\ examples which is demonstrated in
the following.

\begin{dispExample}
\begin{texexp}{}
This is a \LaTeX\ example which displays the text as source code
and in compiled form.
\end{texexp}
\end{dispExample}


\begin{dispExample}
\begin{texexp}{text and listing}
This is a \LaTeX\ example which displays the text as source code
and in compiled form.
\end{texexp}
\end{dispExample}


\begin{dispExample}
\begin{texexp}{listing only}
This is a \LaTeX\ example which displays the text as source code only.
\end{texexp}
\end{dispExample}


\begin{dispExample}
\begin{texexp}{text only}
This is a \LaTeX\ example which displays the text in compiled form only.
\end{texexp}
\end{dispExample}


\begin{dispExample}
\begin{texexptitled}{An Example with a Heading}{heading1}
This is a \LaTeX\ example with a numbered heading line
which can be referred to.
\end{texexptitled}
Here, we see Example \ref{heading1}.
\end{dispExample}


\begin{dispExample}
\begin{texexptitled}[listing only]{Another Example with a Heading}{heading2}
The keys can be used in combination. Here, an example with a heading line
and source code only is given.
\end{texexptitled}
Here, we see Example \ref{heading2}.
\end{dispExample}


\begin{dispListing}
\begin{texexptitled}[float]{A floating Example with a Heading}{heading3}
This is another \LaTeX\ example with numbered heading line.
But now, the box is a floating object.
\end{texexptitled}
\end{dispListing}
\tcbusetemp

\begin{dispExample}
The floating box of the last example is seen as Example \ref{heading3}
on page \pageref{heading3}.
\end{dispExample}


\begin{dispExample}
\begin{tcolorbox}[example={Direct application of the style |texexp|}{texexpbox1}]
\begin{lstlisting}[style=tcblatex]
Some \LaTeX\ source code.
\end{lstlisting}
\tcblower
For special cases, the environment |tcolorbox| with style
|example| can be used directly. As one can see, the upper and the lower
part of the box can be used uncoupled also.
\end{tcolorbox}
\end{dispExample}


\subsection{Creation of \LaTeX\ Exercises}
In the following, a guideline is given for the creation of \LaTeX\ exercises
with solutions. These solutions are saved to disk for application at a place of
choice.
Therefore, all used exercises are logged to a file |\jobname.sol| for automatic
processing. The solution contents themselves are saved to a subdirectory named
|solutions|.

\begin{dispListing}
\newcounter{texercise}

\newwrite\solout
\def\openoutsol{\immediate\openout\solout\jobname.sol}
\def\solfile#1{solutions/texercise#1.tex}
\def\writesol#1{\immediate\write\solout{\noexpand\processsol{\thetexercise}{#1}}}%
\def\closeoutsol{\immediate\closeout\solout}
\def\inputsol{\IfFileExists{\jobname.sol}{\input{\jobname.sol}}{}}
\end{dispListing}
\tcbusetemp

\begin{itemize}
\item Before the first exercise is given,
  |\openoutsol| has to be called to start logging.
\item The solution is given as content of a \refEnv{tcboutputlisting}
  environment. Note, that you can use this content also inside the
  exercise with \refCom{tcbuselistingtext} in compiled form.
\item After the last exercise is given (and before using the solutions),
  |\closeoutsol| has to be called to stop logging.
\item The solutions are loaded by |\inputsol|.
\end{itemize}

Inside the excercise text, there may be text parts which are needed as
\LaTeX\ source code and as compiled text as well. These parts can be
saved by \refEnv{tcbwritetemp} and used in compiled form by \refCom{tcbusetemp}
or as source code by \refCom{tcbusetemplisting}.

At first, we generate some new keys. Since exercises und solutions should
be numbered, we force to use a label \meta{marker} while using the style |texercise|.
Automatically, the label |exe:|\meta{marker} is used to mark the exercise
and the label |sol:|\meta{marker} is used to mark the solution.

\begin{dispListing}
\tcbset{
texercisestyle/.style={arc=0.5mm, colframe=blue!25!yellow!90!white,
  colback=blue!25!yellow!5!white, coltitle=blue!25!yellow!40!black,
  fonttitle=\small\sffamily\bfseries, fontupper=\small, fontlower=\small},
texercise/.code={\refstepcounter{texercise}\label{exe:#1}\writesol{#1}%
  \pgfkeysalso{texercisestyle,
    listing file={\solfile\thetexercise},
    title={Exercise \arabic{texercise}\hfill\mdseries Solution on page \pageref{sol:#1}}
  }}
}
\end{dispListing}
\tcbusetemp

With these preparations, the kernel environment |texercise| for our
exercises is created quickly:

\begin{dispListing}
\newenvironment{texercise}[2][]{%
  \tcolorbox[texercise=#2,savedelimiter=texercise,#1]}%
  {\endtcolorbox}
\end{dispListing}
\tcbusetemp

The following examples demonstrate the application.
\openoutsol


\begin{dispExample}
\begin{texercise}{tabular_example}
\textit{Create the following table:}\par\smallskip%
\begin{tcboutputlisting}
\begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|p{3cm}|}\hline
\multicolumn{4}{|c|}{\bfseries\itshape Das alte Italien}\\\hline
\multicolumn{2}{|c|}{\bfseries Antike} &
\multicolumn{2}{c|}{\bfseries Mittelalter}\\\hline
\multicolumn{1}{|c|}{\itshape Republik}&
\multicolumn{1}{c|}{\itshape Kaiserreich}&
\multicolumn{1}{c|}{\itshape Franken}&
\multicolumn{1}{c|}{\itshape Teilstaaten}\\\hline
In den Zeiten der r\"{o}mischen Republik standen dem Staat jeweils zwei
Konsuln vor, deren Machtbefugnisse identisch waren. &
Das r\"{o}mische Kaiserreich wurde von einem Alleinherrscher, dem Kaiser,
regiert.
& In der V\"{o}lkerwanderungszeit \"{u}bernahmen die Goten und sp\"{a}ter die
Franken die Vorherrschaft.
& Im sp\"{a}teren Mittelalter regierten F\"{u}rsten einen Fleckenteppich
von Einzelstaaten.\\\hline
\end{tabular}
\end{tcboutputlisting}
\tcbuselistingtext%
\end{texercise}
\end{dispExample}


\begin{dispExample}
\begin{texercise}{macro_oneparam}
\begin{tcboutputlisting}
\newcommand{\headingline}[1]{%
  \begin{center}\Large\bfseries #1\end{center}}
\end{tcboutputlisting}
\tcbuselistingtext%

Create a new macro \verb+\headingline+ which produces the
following output:\par\smallskip
\begin{tcbwritetemp}
\headingline{Very important heading}
\end{tcbwritetemp}
\tcbusetemplisting\tcbusetemp%
\end{texercise}
\end{dispExample}



\begin{dispExample}
\begin{texercise}{macro_twoparam}
\begin{tcboutputlisting}
\newcommand{\minitable}[2]{%
  \begin{center}\begin{tabular}{p{10cm}}\hline%
  \multicolumn{1}{c}{\bfseries#1}\\\hline%
  #2\\\hline%
  \end{tabular}\end{center}}
\end{tcboutputlisting}
\tcbuselistingtext%
Create a new macro \verb+\minitable+ which produces the
following output:\par\smallskip
\begin{tcbwritetemp}
\minitable{My heading}{In this tiny tabular, there is only a heading
  and some text below which has a width of ten centimeters.}
\end{tcbwritetemp}
\tcbusetemplisting\par\smallskip\tcbusetemp%
\end{texercise}
\end{dispExample}


\begin{dispExample}
\begin{texercise}{macro_threeparam}
\begin{tcboutputlisting}
\newcommand{\synop}[3]{%
  \begin{tabular}{@{}p{(\linewidth-\tabcolsep*2-\arrayrulewidth)/2}|%
    p{(\linewidth-\tabcolsep*2-\arrayrulewidth)/2}@{}}\hline
  \multicolumn{2}{c}{\bfseries #1}\\\hline
  \multicolumn{1}{c|}{\itshape English}&
  \multicolumn{1}{c}{\itshape German}\\\hline
  #2 & #3
  \end{tabular}}
\end{tcboutputlisting}
\tcbuselistingtext%
Create a new macro \verb+\synop+ which typesets a synoptic text according
to the following example. Base your macro on a tabular which takes the
total line width.\par\smallskip
\begin{tcbwritetemp}
\synop{Neil Armstrong}%
{That's one small step for a man, one giant leap for mankind.}%
{Das ist ein kleiner Schritt f\"{u}r einen Mann,
   ein riesiger Sprung f\"{u}r die Menschheit.}
\end{tcbwritetemp}
\tcbusetemplisting\par\smallskip\tcbusetemp%
\end{texercise}
\end{dispExample}



\closeoutsol
\subsection{Solutions for the given \LaTeX\ Exercises}

For all solutions, a macro |\processsol| was written to the file |\jobname.sol|.
Now, we need a definition for this macro to use the solutions.

\begin{dispListing}
\newcommand{\processsol}[2]{%
  \tcbinputlisting{texercisestyle,listing only,
    title={Solution for Exercise \ref{exe:#2} on page \pageref{exe:#2}\label{sol:#2}},
    listing file={\solfile#1}%
  }}
\end{dispListing}
\tcbusetemp

The loading of all solutions is done by:

\begin{dispListing}
\inputsol
\end{dispListing}

With this, we get:

\tcbusetemp


\clearpage
\section{Library 'theorems'}\label{sec:theorems}
The library is loaded by a package option or inside the preamble by:
\begin{dispListing}
\tcbuselibrary{theorems}
\end{dispListing}

\subsection{Macros of the Library}

\begin{docCommand}{tcbmaketheorem}{\marg{name}\marg{display name}\marg{options}\marg{counter}\marg{prefix}}
  Creates a new environment \meta{name} based on |tcolorbox| to frame a
  (mathematical) theorem. The \meta{display name} is used in the title line
  with a number, e.\,g. \mbox{\flqq Theorem 5.1\frqq}.
  The \meta{options} are given to the underlying |tcolorbox| to control
  the appearance.
  The \meta{counter} is used for automatic numbering.
  The new environment \meta{name} takes one optional and two mandatory
  parameters. The optional parameter supplements the options and should be
  used only in rare cases.
  The first mandatory parameter is the title text for the theorem and
  the second mandatory parameter is a \meta{marker}. The theorem is
  automatically labeled with \meta{prefix}|:|\meta{marker}.
\begin{dispExample}
\tcbmaketheorem{theo}{My Theorem}{colback=green!5,colframe=green!35!black,
  fonttitle=\bfseries}{texercise}{th}

\begin{theo}{This is my title}{theoexample}
  This is the text of the theorem. As can be seen, the counter \texttt{texercise}
  is reused. The theorem is numbered with \ref{th:theoexample} and is
  given on page \pageref{th:theoexample}.
\end{theo}
\end{dispExample}
\end{docCommand}

%

\subsection{Option Keys of the Library}
\enlargethispage*{1cm}

\begin{docTcbKey}{theorem}{=\marg{display name}\marg{counter}\marg{title}\marg{marker}}{no default}
  This key is internally used by \refCom{tcbmaketheorem}, but can be used
  directly in a |tcolorbox| for a more flexible approach.
  The \meta{display name} is used together with the increased \meta{counter} value
  and the \meta{title} for the title line of the box. Additionally, a
  |\label| with the given \meta{marker} is created.
\begin{dispExample}
\begin{tcolorbox}[colback=green!10,colframe=green!50!black,arc=4mm,
                  theorem={Test}{texercise}{Direct usage}{myMarker}]
Here, we see the test \ref{myMarker}.
\end{tcolorbox}
\end{dispExample}
For a common appearance inside the document, the key |theorem| should not be
used directly as in the example above, but as part of a new environment
created by hand or using \refCom{tcbmaketheorem}.
\end{docTcbKey}

%

\subsection{Examples for Definitions and Theorems}
In the following, the application of \refCom{tcbmaketheorem}
to highlight mathematical definitions, theorems, or the like is demonstrated.

At first, additional |tcb| keys are created for the appearance of
the colored boxes. It is assumed that theorems and corollaries should be
identically colored.
All following environments are numbered with a common counter, but this
can be changed easily. Here, the counter output is supplemented by
the section number.

\begin{dispListing}
\newcounter{mytheorem}[section]
\def\themytheorem{\thesection.\arabic{mytheorem}}

\tcbset{
  defstyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape,
              arc=0mm, colback=blue!5,colframe=blue!75!black},
  theostyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape,
               colback=red!10,colframe=red!75!black},
}
\end{dispListing}
\tcbusetemp

By \refCom{tcbmaketheorem}, commonly numbered theorem environments are
created now. |defstyle| and |theostyle| are used for the appearance.

\begin{dispListing}
\tcbmaketheorem{Definition}{Definition}{defstyle}{mytheorem}{def}
\tcbmaketheorem{Theorem}{Theorem}{theostyle}{mytheorem}{theo}
\tcbmaketheorem{Corollary}{Corollary}{theostyle}{mytheorem}{cor}
\end{dispListing}
\tcbusetemp

Now, everything is prepared for the following examples.

\begin{dispExample}
The following theorem is numbered as Theorem \ref{theo:diffbarstetig} and
referenced with the marker \texttt{theo:diffbarstetig}.\bigskip

\begin{Theorem}{Differenzierbarkeit bedingt Stetigkeit, wobei diese Benennung
  zu Testzwecken ungew\"{o}hnlich lang ist}{diffbarstetig}%
  Eine Funktion $f:I\to\mathbb{R}$ ist in $x_0\in I$ stetig, wenn $f$ in
  $x_0$ differenzierbar ist.
\end{Theorem}
\end{dispExample}


\begin{dispExample}
The following definition is numbered as Definition \ref{def:diffbarkeit} and
referenced with the marker \texttt{def:diffbarkeit}.\bigskip

\begin{Definition}{Differenzierbarkeit}{diffbarkeit}
  Eine Funktion $f:~I\to\mathbb{R}$ auf einem Intervall $I$ hei\ss{}t in
  $x_0\in I$ differenzierbar oder linear approximierbar,
  wenn der Grenzwert
  \begin{equation*}
  \lim\limits_{x\to x_0}\frac{f(x)-f(x_0)}{x-x_0}=
  \lim\limits_{h\to 0}\frac{f(x_0+h)-f(x_0)}{h}
  \end{equation*}
  existiert. Bei Existenz hei\ss{}t dieser Grenzwert Ableitung
  oder Differentialquotient von $f$ in $x_0$ und man
  schreibt f\"{u}r ihn
  \begin{equation*}
  f'(x_0)\quad\text{oder}\quad\frac{df}{dx}(x_0).
  \end{equation*}
\end{Definition}
\end{dispExample}


\begin{dispExample}
The following corollary is numbered as Corollary \ref{cor:nullstellen} and
referenced with the marker \texttt{cor:nullstellen}.\bigskip

\begin{Corollary}{Nullstellenexistenz}{nullstellen}
  Ist $f:[a,b]\to\mathbb{R}$ stetig und haben $f(a)$ und $f(b)$ entgegengesetzte
  Vorzeichen, also $f(a)f(b)<0$, so besitzt $f$ eine Nullstelle $x_0\in]a,b[$,
  also $f(x_0)=0$.
\end{Corollary}
\end{dispExample}


\begin{dispExample}
\begin{Theorem}[boxrule=2mm]{Hinreichende Bedingung
                             f\"{u}r Wendepunkte}{wendehinreichend}%
  $f$ sei eine auf einem Intervall $]a,b[$ dreimal stetig differenzierbare Funktion.
  Ist $f''(x_0)=0$ in $x_0\in]a,b[$ und $f'''(x_0)\ne 0$, so ist
  $(x_0,f(x_0))$ ein Wendepunkt von $f$.
\end{Theorem}
\end{dispExample}



\clearpage
\section{Library 'documentation'}\label{sec:documentation}
This library has the single purpose to support \LaTeX\ package documentations
like this one. Actually, the visual nature follows the approach from
Till Tantau's |pgf| \cite{tantau:2010c} documentation.
Typically, this library is assumed to be used in conjunction with the
class |ltxdoc| or alike.

The library is loaded by a package option or inside the preamble by:
\begin{dispListing}
  \tcbuselibrary{documentation}
\end{dispListing}
This also loads the library 'listings', see section \ref{sec:listings},
and a bunch of packages, namely
|doc|, |pifont|, |marvosym|, |hyperref|, and |makeidx|.


\subsection{Macros of the Library}

\begin{docEnvironment}{docCommand}{\marg{name}\marg{parameters}}
  Documents a \LaTeX\ macro with given \meta{name} where \meta{name} is
  written without backslash. This macro takes mandatory or optional \meta{parameters}.
  It is automatically indexed and can be referenced with
  \refCom{refCom}\marg{name}.
\begin{dispExample}
\begin{docCommand}{foomakedocSubKey}{\marg{name}\marg{key path}}
  Creates a new environment \meta{name} based on \refEnv{docKey} for the
  documentation of keys with the given \meta{key path}.
\end{docCommand}
\end{dispExample}
\end{docEnvironment}


{\let\xdocEnvironment\docEnvironment
\let\endxdocEnvironment\enddocEnvironment
\begin{xdocEnvironment}{docEnvironment}{\marg{name}\marg{parameters}}
  Documents a \LaTeX\ environment with given \meta{name}.
  This environment takes mandatory or optional \meta{parameters}.
  It is automatically indexed and can be referenced with
  \refCom{refEnv}\marg{name}.
\begin{dispExample}
\begin{docEnvironment}{foocolorbox}{\oarg{options}}
  This is the main environment to create an accentuated colored text box with
  rounded corners and, optionally, two parts.
\end{docEnvironment}
\end{dispExample}
\end{xdocEnvironment}}

\clearpage
\begin{docEnvironment}{docKey}{\oarg{key path}\marg{name}\marg{parameters}\marg{description}}
  Documents a key with given \meta{name} and an optional \meta{key path}.
  This key takes mandatory or optional \meta{parameters} as value
  with a short \meta{description}.
  It is automatically indexed and can be referenced with
  \refCom{refKey}\marg{name}.
\begin{dispExample}
\begin{docKey}[foo]{footitle}{=\meta{text}}{no default, initially empty}
  Creates a heading line with \meta{text} as content.
\end{docKey}
\end{dispExample}
\end{docEnvironment}


\begin{docCommand}{docAuxCommand}{\marg{name}}
  Documents an auxiliary or minor \LaTeX\ macro with given \meta{name}
  where \meta{name} is written without backslash.
  This macro is automatically indexed.
\begin{dispExample}
The macro \docAuxCommand{fooaux} holds some interesting data.
\end{dispExample}
\end{docCommand}


\begin{docCommand}{docColor}{\marg{name}}
  Documents a color with given \meta{name}. The color is automatically indexed.
\begin{dispExample}
The color \docColor{foocolor} is available.
\end{dispExample}
\end{docCommand}


\begin{docCommand}{cs}{\marg{name}}
  Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a command word \meta{name}
  where the backslash is prefixed. The library overwrites the original macro.
\begin{dispExample}
This is a \cs{foocommand}.
\end{dispExample}
\end{docCommand}

\begin{docCommand}{meta}{\marg{text}}
  Macro from |doc| \cite{mittelbach:2011a} to typeset a meta \meta{text}.
\begin{dispExample}
This is a \meta{text}.
\end{dispExample}
\end{docCommand}

\begin{docCommand}{marg}{\marg{text}}
  Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a \meta{text} with
  curly brackets as a mandatory argument. The library overwrites the original macro.
\begin{dispExample}
This is a mandatory \marg{argument}.
\end{dispExample}
\end{docCommand}

\clearpage
\begin{docCommand}{oarg}{\marg{text}}
  Macro from |ltxdoc| \cite{carlisle:2007a} to typeset a \meta{text} with
  square brackets as an optional argument. The library overwrites the original macro.
\begin{dispExample}
This is an optional \oarg{argument}.
\end{dispExample}
\end{docCommand}


\begin{docCommand}{brackets}{\marg{text}}
  Sets the given \meta{text} with curly brackets.
\begin{dispExample}
  Here we use \brackets{some text}.
\end{dispExample}
\end{docCommand}



{\let\xdispExample\dispExample
  \let\endxdispExample\enddispExample
\begin{docEnvironment}{dispExample}{}
  Creates a colored box based on a \refEnv{tcolorbox}.
  It displays the environment content as source code in the upper part
  and as compiled text in the lower part of the box.
  The appearance is controlled by \refKey{/tcb/documentation listing style}
  and the style \refKey{/tcb/docexample}. It may be
  changed by redefining this style.
\begin{xdispExample}
\begin{dispExample}
This is a \LaTeX\ example.
\end{dispExample}
\end{xdispExample}
\end{docEnvironment}}


\begin{docEnvironment}{dispListing}{}
  Creates a colored box based on a \refEnv{tcolorbox}.
  It displays the environment content as source code.
  The appearance is controlled by \refKey{/tcb/documentation listing style}
  and the style \refKey{/tcb/docexample}. It may be
  changed by redefining this style.
\begin{dispExample}
\begin{dispListing}
This is a \LaTeX\ example.
\end{dispListing}
\end{dispExample}
\end{docEnvironment}

\clearpage
\begin{docEnvironment}{absquote}{}
  Used to typeset an abstract as quoted and small text.
\begin{dispExample}
\begin{absquote}
|tcolorbox| provides an environment for colored and framed text boxes with a
heading line. Optionally, such a box can be split in an upper and a lower part.
\end{absquote}
\end{dispExample}
\end{docEnvironment}

\begin{docCommand}{tcbmakedocSubKey}{\marg{name}\marg{key path}}
  Creates a new environment \meta{name} based on \refEnv{docKey} for the
  documentation of keys with the given \meta{key path} as default.
  The new environment \meta{name} takes the same para\-meters as \refEnv{docKey} itself.
\begin{dispExample}
\tcbmakedocSubKey{docFooKey}{foo}

\begin{docFooKey}{foodummy}{=\meta{nothing}}{no default, initially empty}
Some key.
\end{docFooKey}
\end{dispExample}
\end{docCommand}


\begin{docCommand}{refCom}{\marg{name}}
  References a documented \LaTeX\ macro with given \meta{name} where \meta{name} is
  written without backslash.
\begin{dispExample}
We have created \refCom{foomakedocSubKey} as an example.
\end{dispExample}
\end{docCommand}

\begin{docCommand}{refEnv}{\marg{name}}
  References a documented \LaTeX\ environment with given \meta{name}.
\begin{dispExample}
We have created \refEnv{foocolorbox} as an example.
\end{dispExample}
\end{docCommand}

\begin{docCommand}{refKey}{\marg{name}}
  References a documented key with given \meta{name} where \meta{name}
  is the full path name of the key.
\begin{dispExample}
We have created \refKey{/foo/footitle} as an example.
\end{dispExample}
\end{docCommand}

\clearpage
\begin{docCommand}{colDef}{\marg{text}}
Sets \meta{text} with the definition color, see \refKey{/tcb/color definition}.
\begin{dispExample}
This is my \colDef{text}.
\end{dispExample}
\end{docCommand}

\begin{docCommand}{colOpt}{\marg{text}}
  Sets \meta{text} with the option color, see \refKey{/tcb/color option}.
\begin{dispExample}
This is my \colOpt{text}.
\end{dispExample}
\end{docCommand}



\subsection{Option Keys of the Library}

\begin{docTcbKey}{docexample}{}{style, no value}
  Sets the style for \refEnv{dispExample} and \refEnv{dispListing}
  with the colors |ExampleBack| and |ExampleFrame|.
  To change the appearance of the examples, this style could be
  redefined.
\end{docTcbKey}

\begin{docTcbKey}{documentation listing style}{=\meta{listing style}}{no default, initially |tcbdocumentation|}
  Sets a \meta{listing style} for the |listings| package \cite{heinz:2007a}.
  It is used inside \refEnv{dispExample} and \refEnv{dispListing} to typeset
  the listings. Note that this is not identical to the key
  \refKey{/tcb/listing style} which is used for 'normal' listings.
\end{docTcbKey}


\begin{docTcbKey}{color definition}{=\meta{color}}{no default, initially |Definition|}
  Sets the highlight color used by macro and key definitions.
\end{docTcbKey}

\begin{docTcbKey}{color option}{=\meta{color}}{no default, initially |Option|}
  Sets the color used for optional arguments.
\end{docTcbKey}

\begin{docTcbKey}{color hyperlink}{=\meta{color}}{no default, initially |Hyperlink|}
  Sets the color for all hyper-links, i.\,e. all internal and external links.
\end{docTcbKey}

\begin{docTcbKey}{before example}{=\meta{macros}}{no default, initially \cs{par}\cs{smallskip}}
  Sets the \meta{macros} which are executed before \refEnv{dispExample} and \refEnv{dispListing}
  additional to \refKey{/tcb/before}.
\end{docTcbKey}

\begin{docTcbKey}{after example}{=\meta{macros}}{no default, initially empty}
  Sets the \meta{macros} which are executed after \refEnv{dispExample} and \refEnv{dispListing}
  additional to \refKey{/tcb/after}.
\end{docTcbKey}

\begin{docTcbKey}{index actual}{=\meta{character}}{no default, initially |@|}
  Sets the character for 'actual' in automatic indexing.
\end{docTcbKey}

\begin{docTcbKey}{index quote}{=\meta{character}}{no default, initially |"|}
  Sets the character for 'quote' in automatic indexing.
\end{docTcbKey}

\begin{docTcbKey}{index level}{=\meta{character}}{no default, initially |!|}
  Sets the character for 'level' in automatic indexing.
\end{docTcbKey}

\begin{docTcbKey}{index default settings}{}{style, no value}
  Sets the |makeindex| default values for
  \refKey{/tcb/index actual},
  \refKey{/tcb/index quote}, and
  \refKey{/tcb/index level}.
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{index german settings}{}{style, no value}
  Sets the |makeindex| values recommended for German language texts.
  This is identical to setting the following:
\begin{dispListing}
\tcbset{index actual={=},index quote={!},index level={>}}
\end{dispListing}
\end{docTcbKey}

The following keys are provided for language specific settings.
The English language is predefined.

\begin{docTcbKey}{english language}{}{style, no value}
  Sets all language specific settings to English.
\end{docTcbKey}

\begin{langTcbKey}{color}{=\meta{text}}{no default, initially |color|}
  Text used in the index for colors.
\end{langTcbKey}

\begin{langTcbKey}{colors}{=\meta{text}}{no default, initially |Colors|}
  Heading text in the index for colors.
\end{langTcbKey}

\begin{langTcbKey}{environment content}{=\meta{text}}{no default, initially |environment content|}
  Text used in \refEnv{docEnvironment}.
\end{langTcbKey}

\begin{langTcbKey}{environment}{=\meta{text}}{no default, initially |environment|}
  Text used in the index for environments.
\end{langTcbKey}

\begin{langTcbKey}{environments}{=\meta{text}}{no default, initially |Environments|}
  Heading text in the index for environments.
\end{langTcbKey}

\begin{langTcbKey}{key}{=\meta{text}}{no default, initially |key|}
  Text used in the index for keys.
\end{langTcbKey}

\begin{langTcbKey}{index}{=\meta{text}}{no default, initially |Index|}
  Heading text for the index.
\end{langTcbKey}

\begin{langTcbKey}{pageshort}{=\meta{text}}{no default, initially |P.|}
  Short text for page references.
\end{langTcbKey}


\subsection{Predefined Colors of the Library}
The following colors are predefined. They are used as default colors
in some library commands.

\def\dispColor#1{\docColor{#1}~\tikz[baseline=1mm]\path[fill=#1,draw] (0,0) rectangle (0.4,0.4);~}

\dispColor{Option},
\dispColor{Definition},
\dispColor{ExampleFrame},
\dispColor{ExampleBack},
\dispColor{Hyperlink}.


% Actually, it is not a good idea to include the references like this!
% Do not follow this bad example ...
\begin{tcbverbatimwrite}{\jobname.bib}
@manual{heinz:2007a,
   author    = {Carsten Heinz and Brooks Moses},
   title     = {The Listings Package},
   url       = {http://mirror.ctan.org/macros/latex/contrib/listings/listings.pdf},
   note      = {Version 1.4},
   month     = feb,
   year      = 2007,
   language  = {english}
}

@manual{schoepf:2001a,
  author    = {Rainer Sch{\"o}pf and Bernd Raichle and Chris Rowley},
   title     = {A New Implementation of {\LaTeX}'s verbatim and verbatim* Environments},
   url       = {http://mirror.ctan.org/macros/latex/required/tools/verbatim.pdf},
   date      = {2001-03-12},
}

@techreport{sturm:2007b,
   author      = {Thomas F. Sturm},
   title       = {Mathematik 1 (B.Eng.)},
   type        = {Vorlesungs-Skriptum},
   institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen},
   address     = {Neubiberg},
   url         = {http://www.unibw.de/bw/Fakultat/we2/Sturm},
   year        = 2007,
   language    = {german}
}

@techreport{sturm:2008b,
   author      = {Thomas F. Sturm},
   title       = {Mathematik 2 (B.Eng.)},
   type        = {Vorlesungs-Skriptum},
   institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen},
   address     = {Neubiberg},
   url         = {http://www.unibw.de/bw/Fakultat/we2/Sturm},
   year        = 2008,
   language    = {german}
}

@techreport{sturm:2010a,
   author      = {Thomas F. Sturm},
   title       = {H{\"o}here Mathematik: Fortgeschrittene mathematische Methoden (M.Eng.)},
   type        = {Vorlesungs-Skriptum},
   institution = {Universit{\"a}t der Bundeswehr M{\"u}nchen},
   address     = {Neubiberg},
   url         = {http://www.unibw.de/bw/Fakultat/we2/Sturm},
   year        = 2010,
   language    = {german}
}

@book{sturm:2011b,
   author      = {Thomas F. Sturm},
   title       = {\LaTeX\ -- Einf{\"u}hrung in das Textsatzsystem},
   publisher   = {Regionales Rechenzentrum f{\"u}r Niedersachsen (RRZN)},
   address     = {Hannover},
   edition     = 8,
   series      = {RRZN-Handb{\"u}cher},
   url         = {http://www.rrzn.uni-hannover.de/buecher.html},
   month       = sep,
   year        = 2011,
   language    = {german}
}

@manual{tantau:2010c,
   author    = {Till Tantau},
   title     = {The TikZ and PGF Packages},
   subtitle  = {Manual for version 2.10},
   url       = {http://mirror.ctan.org/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf},
   date      = {2010-10-25},
}

@manual{thorub:2007a,
   author    = {Kresten Krab Thorub and Frank Jensen and Chris Rowley},
   title     = {The calc package -- Infix notation arithmetic in \LaTeX},
   url       = {http://mirror.ctan.org/macros/latex/required/tools/},
   day       = 22,
   month     = aug,
   year      = 2007,
   language  = {english}
}

@manual{carlisle:2007a,
  author    = {David Carlisle},
  title     = {The file ltxdoc.dtx for use with \LaTeXe},
  url       = {http://mirror.ctan.org/macros/latex/base/ltxdoc.dtx},
  date      = {2007-11-11}
}

@manual{mittelbach:2011a,
  author    = {Frank Mittelbach},
  title     = {The doc and shortvrb Packages},
  url       = {http://mirror.ctan.org/macros/latex/base/doc.dtx},
  date      = {2011-06-30}
}

\end{tcbverbatimwrite}

\clearpage
\printbibliography[heading=bibintoc]

\printindex

\end{document}