summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.theorems.tex
blob: 58542326d1be4a5d720a86c2fc57475a73722b25 (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
% !TeX root = tcolorbox.tex
% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox)
\clearpage
\section{Library \mylib{theorems}}\label{sec:theorems}
The library is loaded by a package option or inside the preamble by:
\begin{dispListing}
\tcbuselibrary{theorems}
\end{dispListing}
This also loads the package |amsmath|.

\subsection{Macros of the Library}

\begin{docCommand}{newtcbtheorem}{\oarg{init options}\marg{name}\marg{display name}\marg{options}\marg{prefix}}
  Creates new environments \meta{name} and \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 \meta{init options} allow to set up automatic numbering,
  see \Vref{sec:initkeys}.\par
  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}.\par
  The new environment \meta{name}|*| takes one optional and one mandatory
  parameter and represents an unnumbered variant of the environment \meta{name}.
  This variant is not labeled and not listed in lists of theorems.
%\enlargethispage*{20mm}
\inputpreamblelisting{F}
\begin{dispExample}
\begin{mytheo}{This is my title}{theoexample}
  This is the text of the theorem. The counter is automatically assigned and,
  in this example, prefixed with the section number. This theorem is numbered with
  \ref{th:theoexample} and is given on page \pageref{th:theoexample}.
\end{mytheo}
\end{dispExample}

\begin{dispExample}
\begin{mytheo}[label=myownlabel]{This is my title}{}
  The label parameter can be left empty without \LaTeX\ error.
  Or you may use an own label to reference Theorem \ref{myownlabel}.
\end{mytheo}
\end{dispExample}

\begin{dispExample}
\begin{mytheo}{}{}
  The title can also be left empty without problem. Note that the ':'
  vanished magically.
\end{mytheo}
\end{dispExample}

\begin{dispExample}
\begin{mytheo*}{Unnumbered Theorem}
  This theorem is not numbered.
\end{mytheo*}
\end{dispExample}

\begin{dispExample}
\begin{mytheo*}{}
  This theorem has no number and no title.
\end{mytheo*}
\end{dispExample}
\end{docCommand}


\begin{docCommand}{renewtcbtheorem}{\oarg{init options}\marg{name}\marg{display name}\marg{options}\marg{prefix}}
  Operates like \refCom{newtcbtheorem}, but based on |\renewenvironment| instead of |\newenvironment|.
  An existing environment is redefined.
\end{docCommand}


\begin{docCommand}{tcbmaketheorem}{\marg{name}\marg{display name}\marg{options}\marg{counter}\marg{prefix}}
\begin{marker}
\refCom{newtcbtheorem} supersedes this macro.
\end{marker}
\begin{deprecated}
  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}.
\end{deprecated}
\end{docCommand}

\clearpage
\begin{docCommand}{tcboxmath}{\oarg{options}\marg{mathematical box content}}
  Creates a \refEnv{tcolorbox} which is fitted to the width of the given
  \meta{mathematical box content}. This box is intended to be applied as
  part of a larger formula and may be used as replacement for the |\boxed|
  macro of |amsmath|.

\begin{dispExample}
\begin{equation}
\tcbset{fonttitle=\scriptsize}
\tcboxmath[colback=LightBlue!25!white,colframe=blue]{ a^2 = 16 }
\quad \Rightarrow \quad
\tcboxmath[colback=Salmon!25!white,colframe=red,title=Implication]%
  { a = 4 ~\vee~ a=-4. }
\end{equation}
\end{dispExample}
\end{docCommand}

\begin{docCommand}{tcbhighmath}{\oarg{options}\marg{mathematical box content}}
  This is a special case of the \refCom{tcboxmath} macro which uses
  the style \refKey{/tcb/highlight math}.
  It is intended to provide context sensitive highlighting of formula parts.
  The color settings via \refKey{/tcb/highlight math style} may be different
  inside theorems or other colored areas and outside.

\begin{dispExample}
\tcbset{myformula/.style={colback=yellow!10!white,colframe=red!50!black,
  every box/.style={highlight math style={colback=LightBlue!50!white,colframe=Navy}}
  }}

\begin{align}
  \tcbhighmath{\sum\limits_{n=1}^{\infty} \frac{1}{n}} &= \infty.\\
  \int x^2 ~\text{d}x                     &= \frac13 x^3 + c.
\end{align}

\begin{tcolorbox}[ams align,myformula]
  \tcbhighmath{\sum\limits_{n=1}^{\infty} \frac{1}{n}} &= \infty.\\
  \int x^2 ~\text{d}x                     &= \frac13 x^3 + c.
\end{tcolorbox}
\end{dispExample}
\end{docCommand}


\clearpage
\subsection{Option Keys of the Library}


\begin{docTcbKey}{separator sign}{=\meta{sign}}{no default, initial |:|}
  The given \meta{sign} is used inside the title text of a theorem
  as separater between display name combined with number and
  the specific title text. It is omitted, if there is no specific title text.

\begin{dispExample}
% \usepackage{amssymb}
\newtcbtheorem[use counter from=mytheo]{sometheorem}{Theorem}%
  {colback=white,colframe=red!50!black,fonttitle=\bfseries,
   separator sign={\ $\blacktriangleright$}}{theo}
\begin{sometheorem}{My example}{}
My theorem text.
\end{sometheorem}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{separator sign colon}{}{style, no value, initially set}
Sets \refKey{/tcb/separator sign} to the default colon |:| sign.
\end{docTcbKey}

\begin{docTcbKey}{separator sign dash}{}{style, no value}
Sets \refKey{/tcb/separator sign} to an en-dash sign.
\begin{dispExample}
\newtcbtheorem[use counter from=mytheo]{sometheorem}{Theorem}%
  {colback=white,colframe=red!50!black,fonttitle=\bfseries,
   separator sign dash}{theo}
\begin{sometheorem}{My example}{}
My theorem text.
\end{sometheorem}
\end{dispExample}
\end{docTcbKey}


\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}
% \newcounter{texercise}%  preamble
\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} or using its successor
\refCom{newtcbtheorem}.
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{highlight math}{}{style, no value}
  Predefined style which is used for \refCom{tcbhighmath}.
  It can be changed comfortable with \refKey{/tcb/highlight math style}.
\end{docTcbKey}


\begin{docTcbKey}{highlight math style}{=\meta{style definition}}{style, no default}
  Changes the definition for \refKey{/tcb/highlight math} to the given
  \meta{style definition}. See \refCom{tcbhighmath} for another example.
\begin{dispExample}
% \tcbuselibrary{skins}
\tcbset{highlight math style={enhanced,%<-- needed for the 'remember' options
  colframe=red,colback=red!10!white,boxsep=0pt}}
\begin{align*}
\tcbhighmath[remember as=fx]{f(x)}
     &= \int\limits_{1}^{x} \frac{1}{t^2}~dt
      = \left[ -\frac{1}{t} \right]_{1}^{x}\\
     &= -\frac{1}{x} + \frac{1}{1}\\
     &=
\tcbhighmath[remember,overlay={%
    \draw[blue,very thick,->] (fx.south) to[bend right] ([yshift=2mm]frame.west);}]
  {1-\frac{1}{x}.}
\end{align*}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{math upper}{}{style, no value}
  Sets the upper part to mathematical mode with font |\displaystyle|.
\end{docTcbKey}

\begin{docTcbKey}{math lower}{}{style, no value}
  Sets the lower part to mathematical mode with font |\displaystyle|.
\end{docTcbKey}

\begin{docTcbKey}{math}{}{style, no value}
  Sets the upper part \emph{and} lower part to mathematical mode with font |\displaystyle|.
\begin{dispExample}
\begin{tcolorbox}[math,colback=yellow!10!white,colframe=red!50!black]
  \sum\limits_{n=1}^{\infty} \frac{1}{n} = \infty.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\clearpage
\begin{marker}
  The following styles are only tested to work with the original |amsmath| environments.
  If e.g. the |equation| environment is redefined as |gather|, then
  \refKey{/tcb/ams equation} should / could not be used. Obviously, you are encouraged
  to use \refKey{/tcb/ams gather} in this case.
\end{marker}

\begin{docTcbKey}{ams equation upper}{}{style, no value}
  Adds an |amsmath| |equation| environment to the begin and to the end
  if the upper part.
\end{docTcbKey}

\begin{docTcbKey}{ams equation lower}{}{style, no value}
  Adds an |amsmath| |equation| environment to the begin and to the end
  if the lower part.
\end{docTcbKey}

\begin{docTcbKey}{ams equation}{}{style, no value}
  Adds an |amsmath| |equation| environment to the begin and to the end
  if the upper \emph{and} lower part.
\begin{dispExample}
\begin{tcolorbox}[ams equation,colback=yellow!10!white,colframe=red!50!black]
  \sum\limits_{n=1}^{\infty} \frac{1}{n} = \infty.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{ams equation* upper}{}{style, no value}
  Adds an |amsmath| |equation*| environment to the begin and to the end
  if the upper part.
\end{docTcbKey}

\begin{docTcbKey}{ams equation* lower}{}{style, no value}
  Adds an |amsmath| |equation*| environment to the begin and to the end
  if the lower part.
\end{docTcbKey}

\begin{docTcbKey}{ams equation*}{}{style, no value}
  Adds an |amsmath| |equation*| environment to the begin and to the end
  if the upper \emph{and} lower part.
\begin{dispExample}
\begin{tcolorbox}[ams equation*,colback=yellow!10!white,colframe=red!50!black]
  \sum\limits_{n=1}^{\infty} \frac{1}{n} = \infty.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{ams align upper}{}{style, no value}
  Adds an |amsmath| |align| environment to the begin and to the end
  if the upper part.
\end{docTcbKey}

\begin{docTcbKey}{ams align lower}{}{style, no value}
  Adds an |amsmath| |align| environment to the begin and to the end
  if the lower part.
\end{docTcbKey}

\begin{docTcbKey}{ams align}{}{style, no value}
  Adds an |amsmath| |align| environment to the begin and to the end
  if the upper \emph{and} lower part.
\begin{dispExample}
\begin{tcolorbox}[ams align,colback=yellow!10!white,colframe=red!50!black]
  \sum\limits_{n=1}^{\infty} \frac{1}{n} &= \infty.\\
  \int x^2 ~\text{d}x                     &= \frac13 x^3 + c.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{ams align* upper}{}{style, no value}
  Adds an |amsmath| |align*| environment to the begin and to the end
  if the upper part.
\end{docTcbKey}

\begin{docTcbKey}{ams align* lower}{}{style, no value}
  Adds an |amsmath| |align*| environment to the begin and to the end
  if the lower part.
\end{docTcbKey}

\begin{docTcbKey}{ams align*}{}{style, no value}
  Adds an |amsmath| |align*| environment to the begin and to the end
  if the upper \emph{and} lower part.
\begin{dispExample}
\begin{tcolorbox}[ams align*,colback=yellow!10!white,colframe=red!50!black]
  \sum\limits_{n=1}^{\infty} \frac{1}{n} &= \infty.\\
  \int x^2 ~\text{d}x                     &= \frac13 x^3 + c.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\clearpage
\begin{docTcbKey}{ams gather upper}{}{style, no value}
  Adds an |amsmath| |gather| environment to the begin and to the end
  if the upper part.
\end{docTcbKey}

\begin{docTcbKey}{ams gather lower}{}{style, no value}
  Adds an |amsmath| |gather| environment to the begin and to the end
  if the lower part.
\end{docTcbKey}

\begin{docTcbKey}{ams gather}{}{style, no value}
  Adds an |amsmath| |gather| environment to the begin and to the end
  if the upper \emph{and} lower part.
\begin{dispExample}
\begin{tcolorbox}[ams gather,colback=yellow!10!white,colframe=red!50!black]
  \sum\limits_{n=1}^{\infty} \frac{1}{n} = \infty.\\
  \int x^2 ~\text{d}x = \frac13 x^3 + c.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\begin{docTcbKey}{ams gather* upper}{}{style, no value}
  Adds an |amsmath| |gather*| environment to the begin and to the end
  if the upper part.
\end{docTcbKey}

\begin{docTcbKey}{ams gather* lower}{}{style, no value}
  Adds an |amsmath| |gather*| environment to the begin and to the end
  if the lower part.
\end{docTcbKey}

\begin{docTcbKey}{ams gather*}{}{style, no value}
  Adds an |amsmath| |gather*| environment to the begin and to the end
  if the upper \emph{and} lower part.
\begin{dispExample}
\begin{tcolorbox}[ams gather*,colback=yellow!10!white,colframe=red!50!black]
  \sum\limits_{n=1}^{\infty} \frac{1}{n} = \infty.\\
  \int x^2 ~\text{d}x = \frac13 x^3 + c.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}


\clearpage
\begin{docTcbKey}{ams nodisplayskip upper}{}{style, no value}
  Neutralizes the |\abovedisplayskip| of a following |align| or |gather|
  environment for the upper part. Note that the text content has to
  start with such a formula.
\end{docTcbKey}


\begin{docTcbKey}{ams nodisplayskip lower}{}{style, no value}
  Neutralizes the |\abovedisplayskip| of a following |align| or |gather|
  environment for the lower part. Note that the text content has to
  start with such a formula.
\end{docTcbKey}


\begin{docTcbKey}{ams nodisplayskip}{}{style, no value}
  Neutralizes the |\abovedisplayskip| of a following |align| or |gather|
  environment for the upper part \emph{and} lower part.
  Note that the text content has to start with such a formula.
\begin{dispExample}
\begin{tcolorbox}[ams nodisplayskip,colback=yellow!10!white,colframe=red!50!black]
  \begin{gather}
  \sum\limits_{n=1}^{\infty} \frac{1}{n} = \infty.\\
  \int x^2 ~\text{d}x = \frac13 x^3 + c.
  \end{gather}
  And now for something completely different.
\end{tcolorbox}
\end{dispExample}
\end{docTcbKey}

\bigskip
New colored mathematical environments are easily created using
\refCom{newtcolorbox}:

\begin{dispExample}
\newtcolorbox{mymath}{ams gather*,colback=yellow!10!white,colframe=red!50!black}

\begin{mymath}
  \sum\limits_{n=1}^{\infty} \frac{1}{n} = \infty.\\
  \int x^2 ~\text{d}x = \frac13 x^3 + c.
\end{mymath}
\end{dispExample}

\bigskip
\begin{marker}
  All described options like \refKey{/tcb/ams gather upper}, \refKey{/tcb/ams gather lower},
  \refKey{/tcb/ams gather} are (partially) setting (overwritting) the
  keys \refKey{/tcb/before upper}, \refKey{/tcb/after upper},
  \refKey{/tcb/before lower}, \refKey{/tcb/after lower}.\par
  Therefore, e.\,g.\ |\tcbset{ams gather,before upper={\text{Pythagoras:}}}|
  produces an invalid result. For this case, you are invited to use\\
  |\tcbset{ams gather,before upper app={\text{Pythagoras:}}}|,\\
  see \refKey{/tcb/before upper app}.
\end{marker}

%
\clearpage
\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 subsection number.

\inputpreamblelisting{G}

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

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,toptitle=-1.5mm,bottomtitle=-1.5mm]{%
    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}

\begin{dispExample}
% \usepackage{varioref}
% \usepackage{cleveref}
% \tcbuselibrary{skins}
\newtcbtheorem[use counter from=Definition]{YetAnotherTheorem}{Theorem}%
  {label type=theorem,enhanced,frame hidden,
  boxrule=2mm,titlerule=0mm,toptitle=1mm,bottomtitle=1mm,
  fonttitle=\bfseries\large,fontupper=\normalsize,
  coltitle=green!35!black,colbacktitle=green!15!white,
  colback=green!50!yellow!15!white,borderline={1pt}{0pt}{green!25!blue},
  }{theo}

\begin{YetAnotherTheorem}{Mittelwertsatz f\"{u}r $n$ Variable}{meanvaluetheorem}%
  Es sei $n\in\mathbb{N}$, $D\subseteq\mathbb{R}^n$ eine offene Menge und
  $f\in C^{1}(D,\mathbb{R})$. Dann gibt es auf jeder Strecke
  $[x_0,x]\subset D$ einen Punkt $\xi\in[x_0,x]$, so dass gilt
  \begin{equation*}
  f(x)-f(x_0) = \operatorname{grad} f(\xi)^{\top}(x-x_0)
  \end{equation*}
\end{YetAnotherTheorem}

\medskip
Here, |cleveref| support is used to reference \Cref{theo:meanvaluetheorem}
on \Cpageref{theo:meanvaluetheorem}. This \namecref{theo:meanvaluetheorem}
can also be referenced by |\Vref| resulting in \Vref{theo:meanvaluetheorem}.
\end{dispExample}

\begin{marker}
Note that \refKey{/tcb/label type} was used in the example above to feed
|cleveref| \cite{cubitt:2013a} with the needed name information.
\end{marker}

\clearpage

\begin{dispExample}
Here, using |\Vref| resulting in \Vref{theo:meanvaluetheorem} is more interesting\ldots
\end{dispExample}


\begin{dispExample}
% \tcbuselibrary{skins}
\newtcbtheorem[use counter from=Definition]{YetAnotherTheorem}{Theorem}%
  {enhanced,arc=0mm,outer arc=0mm,
  boxrule=0mm,toprule=1mm,bottomrule=1mm,left=1mm,right=1mm,
  titlerule=0mm,toptitle=0mm,bottomtitle=1mm,top=0mm,
  colframe=red!50!black,colback=red!5!white,coltitle=red!50!black,
  title style={top color=yellow!50!white,bottom color=red!5!white,
    middle color=yellow!50!white},
  fonttitle=\bfseries\sffamily\normalsize,fontupper=\normalsize\itshape,
  }{theo}

\begin{YetAnotherTheorem}{Mittelwertsatz f\"{u}r $n$ Variable}{mittelwertsatz_n2}%
  Es sei $n\in\mathbb{N}$, $D\subseteq\mathbb{R}^n$ eine offene Menge und
  $f\in C^{1}(D,\mathbb{R})$. Dann gibt es auf jeder Strecke
  $[x_0,x]\subset D$ einen Punkt $\xi\in[x_0,x]$, so dass gilt
  \begin{equation*}
  f(x)-f(x_0) = \operatorname{grad} f(\xi)^{\top}(x-x_0)
  \end{equation*}
\end{YetAnotherTheorem}
\end{dispExample}


\clearpage
You need more attention for your theorems? Here, you are \ldots

\begin{dispExample}
% tcbuselibrary{skins}  % preamble
\begin{Theorem}[enhanced,
    fuzzy halo=3mm with yellow,
    fuzzy halo=2mm with red,
    fuzzy halo=1mm with yellow,
    watermark color=red!35!white,
    watermark text={Overacting\\Fundamental Theorem}]%
  {Fundamental Theorem of Theorems}{fundamental}%
  \lipsum[1-2]
\end{Theorem}
\end{dispExample}


Using \refCom{newtcbtheorem} is a convenient way to generate a new
theorem type. On the other hand, it enforces to use a titled |tcolorbox|.
If you prefer to have an embedded title, you may create a new theorem
type with the more flexible \refCom{newtcolorbox} macro:

\begin{dispExample}
% \tcbuselibrary{skins}
\newtcolorbox[use counter from=Definition]{YetAnotherTheorem}[3][%
  enhanced,colframe=blue!50!black,colback=yellow!20!white,
  drop fuzzy shadow=blue!50!black!50!white,boxrule=0.4pt,
  fontupper=\itshape]{%
  before upper={\textcolor{red!50!black}{\upshape\bfseries
    Theorem~\thetcbcounter\ (#2)}\quad},
  list entry={\numberline{\thetcbcounter}#2},%
  label={theo:#3},#1}

\begin{YetAnotherTheorem}{Mittelwertsatz f\"{u}r $n$ Variable}{mittelwertsatz_n3}%
  Es sei $n\in\mathbb{N}$, $D\subseteq\mathbb{R}^n$ eine offene Menge und
  $f\in C^{1}(D,\mathbb{R})$. Dann gibt es auf jeder Strecke
  $[x_0,x]\subset D$ einen Punkt $\xi\in[x_0,x]$, so dass gilt
  \begin{equation*}
  f(x)-f(x_0) = \operatorname{grad} f(\xi)^{\top}(x-x_0)
  \end{equation*}
\end{YetAnotherTheorem}
\end{dispExample}