diff options
30 files changed, 6069 insertions, 4662 deletions
diff --git a/Master/texmf-dist/doc/latex/tcolorbox/CHANGES b/Master/texmf-dist/doc/latex/tcolorbox/CHANGES index eff7b2a76f0..52598a4266e 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/CHANGES +++ b/Master/texmf-dist/doc/latex/tcolorbox/CHANGES @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13)
+%% The LaTeX package tcolorbox - version 2.10 (2013/04/09)
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2006-2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
@@ -122,3 +122,45 @@ version 2.02 (2013/03/13) - new key 'nobeforeafter'
- new macro '\tcbline' in the 'skins' library to draw 'just lines'
- new key 'colbacktitle' for the 'skins' library
+
+version 2.10 (2013/04/09)
+- bug fix: \tcbox ignored font settings
+- outdated documentation in German removed from package
+- new core package keys:
+ 'oversize', 'tcbox raise', 'tcbox raise base',
+ 'before title', 'after title', 'before upper', 'after upper', 'before lower',
+ 'after lower', 'center title', 'center upper', 'center lower',
+ 'tabularx*', 'tabularx', 'tikz upper', 'tikz lower',
+ 'shrink tight', 'extrude left by', 'extrude right by', 'extrude top by',
+ 'extrude bottom by', 'extrude by'
+- the 'theorems' library now loads 'amsmath'
+- new macros for the 'theorems' library:
+ '\tcboxmath', '\tcbhighmath'
+- new keys for the 'theorems' library:
+ 'math upper', 'math lower', 'math', 'highlight math', 'highlight math style',
+ 'ams equation upper', 'ams equation lower', 'ams equation', 'ams equation* upper',
+ 'ams equation* lower', 'ams equation*', 'ams align upper', 'ams align lower',
+ 'ams align', 'ams align* upper', 'ams align* lower', 'ams align*',
+ 'ams gather upper', 'ams gather lower', 'ams gather', 'ams gather* upper',
+ 'ams gather* lower', 'ams gather*',
+ 'ams nodisplayskip upper', 'ams nodisplayskip lower', 'ams nodisplayskip'
+- new library 'hooks' for hook options with the new keys:
+ 'before upper app', 'before upper pre', 'after upper app', 'after upper pre',
+ 'before lower app', 'before lower pre', 'after lower app', 'after lower pre',
+ 'before title app', 'before title pre', 'after title app', 'after title pre',
+ 'before app', 'before pre', 'after app', 'after pre',
+ 'overlay unbroken app', 'overlay unbroken pre', 'overlay first app', 'overlay first pre',
+ 'overlay middle app', 'overlay middle pre', 'overlay last app', 'overlay last pre',
+ 'overlay app', 'overlay pre', 'overlay broken app', 'overlay broken pre',
+ 'overlay unbroken and first app', 'overlay unbroken and first pre',
+ 'overlay middle and last app', 'overlay middle and last pre',
+ 'watermark tikz app', 'watermark tikz pre', 'watermark tikz app on', 'watermark tikz pre on',
+ 'watermark graphics app', 'watermark graphics pre', 'watermark graphics app on', 'watermark graphics pre on',
+ 'watermark text app', 'watermark text pre', 'watermark text app on', 'watermark text pre on',
+ 'frame code app', 'frame code pre', 'interior titled code app', 'interior titled code pre',
+ 'interior code app', 'interior code pre', 'segmentation code app', 'segmentation code pre',
+ 'title code app', 'title code pre'
+- colorization of source code snippets in the documentation
+
+
+
diff --git a/Master/texmf-dist/doc/latex/tcolorbox/README b/Master/texmf-dist/doc/latex/tcolorbox/README index ea80478254d..03bcfc8e4bd 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/README +++ b/Master/texmf-dist/doc/latex/tcolorbox/README @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% %% ------------------------------------------------------------------------------------------- %% Copyright (c) 2006-2013 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> @@ -31,15 +31,16 @@ Contents of the package 'tcolorbox.sty' LaTeX package file (style file) 'tcbbreakable.code.tex' LaTeX package file (library of tcolorbox) 'tcbdocumenation.code.tex' LaTeX package file (library of tcolorbox) + 'tcbhooks.code.tex' LaTeX package file (library of tcolorbox) 'tcblistings.code.tex' LaTeX package file (library of tcolorbox) 'tcblistingsutf8.code.tex' LaTeX package file (library of tcolorbox) 'tcbskins.code.tex' LaTeX package file (library of tcolorbox) 'tcbtheorems.code.tex' LaTeX package file (library of tcolorbox) 'tcolorbox.pdf' Documentation for tcolorbox - 'tcolorbox.tex' Source code of the documentation + 'tcolorbox.tex' Source code of the documentation (main file) + '*.doc.*' Source code of the documentation (include files) 'tcolorbox-example.tex' Example file for package usage 'tcolorbox-example.pdf' Compiled example - 'tcolorbox-german.pdf' Outdated documentation in German 'Basilica_5.png' Example picture Installation @@ -50,6 +51,7 @@ Alternatively, put the files to their respective locations within the TeX instal 'tcolorbox.sty' -> /tex/latex/tcolorbox 'tcbbreakable.code.tex' -> /tex/latex/tcolorbox 'tcbdocumenation.code.tex' -> /tex/latex/tcolorbox + 'tcbhooks.code.tex' -> /tex/latex/tcolorbox 'tcblistings.code.tex' -> /tex/latex/tcolorbox 'tcblistingsutf8.code.tex' -> /tex/latex/tcolorbox 'tcbtheorems.code.tex' -> /tex/latex/tcolorbox diff --git a/Master/texmf-dist/doc/latex/tcolorbox/README.TEXLIVE b/Master/texmf-dist/doc/latex/tcolorbox/README.TEXLIVE deleted file mode 100644 index eb8fb652cb7..00000000000 --- a/Master/texmf-dist/doc/latex/tcolorbox/README.TEXLIVE +++ /dev/null @@ -1,7 +0,0 @@ -The following files have been removed in the TeX Live installation of -the current package, typically due to duplication, lack of space, or -missing source code. You can find these files on CTAN at - http://mirror.ctan.org/macros/latex/contrib/tcolorbox -If questions or concerns, email tex-live@tug.org. - - tcolorbox-german.pdf diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf Binary files differindex 7bdddd52a23..6c54a56761a 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.pdf diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex index 88871ada03d..f3b99f8ea71 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox-example.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcolorbox-example.tex: an example for tcolorbox %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.abstract.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.abstract.tex new file mode 100644 index 00000000000..7d8ae3860b1 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.abstract.tex @@ -0,0 +1,32 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\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} + +\begin{tcolorbox}[breakable,skin=enhanced,title={Contents},fonttitle=\bfseries\Large, + colback=yellow!10!white,colframe=red!50!black,before=\par\bigskip\noindent, + watermark color=yellow!75!red!25!white, + watermark text={\bfseries\Large Contents}, + frame style={drop shadow} + ] +\makeatletter +\@starttoc{toc} +\makeatother +\end{tcolorbox} diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.bib b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.bib new file mode 100644 index 00000000000..1225e06ac09 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.bib @@ -0,0 +1,117 @@ +@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/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/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/sturm}, + year = 2010, + language = {german} +} + +@book{sturm:2012k, + author = {Thomas F. Sturm}, + title = {\LaTeX\ -- Einführung in das Textsatzsystem}, + publisher = {Regionales Rechenzentrum für Niedersachsen (RRZN)}, + address = {Hannover}, + edition = 9, + series = {RRZN-Handb\"ucher}, + url = {http://www.rrzn.uni-hannover.de/buch.html?&titel=latex}, + date = {2012-05}, + 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{carlisle:1999a, + author = {David Carlisle}, + title = {The tabularx package}, + url = {hhttp://mirror.ctan.org/macros/latex/required/tools/tabularx.pdf}, + date = {1999-01-07} +} + + +@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} +} + +@manual{breitenlohner:1998a, + author = {Peter Breitenlohner}, + title = {The $\varepsilon$-\TeX\ manual}, + version = {2}, + url = {http://ftp.gwdg.de/pub/ctan/systems/e-tex/v2/doc/etex_man.pdf}, + date = {1998-02}, +} + +@manual{oberdiek:2011a, + author = {Heiko Oberdiek}, + title = {The listingsutf8 package}, + url = {http://mirror.ctan.org/macros/latex/contrib/oberdiek/listingsutf8.pdf}, + date = {2011-11-10}, +} + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.breakable.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.breakable.tex new file mode 100644 index 00000000000..e959499b45f --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.breakable.tex @@ -0,0 +1,323 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\clearpage +\section{Library 'breakable'}\label{sec:breakable} +The library is loaded by a package option or inside the preamble by: +\begin{dispListing} +\tcbuselibrary{breakable} +\end{dispListing} + +\subsection{Technical Overview} +The library 'breakable' supports the automatic breaking of a |tcolorbox|. +This feature is enabled by \refKey{/tcb/breakable} +and disabled by \refKey{/tcb/unbreakable}. + +{ +\tcbset{colframe=Navy,colback=AliceBlue,fonttitle=\bfseries, + watermark color=AliceBlue!85!Navy,enhanced} +If a |tcolorbox| is set to be \refKey{/tcb/breakable}, then the following +algorithm is executed: +\begin{enumerate} +\item The box content is read to a box register similar but not identical + to the unbreakable case. +\item If the total box fits into the current page, it is shipped out visibly + unbroken and the algorithm stops. + \begin{tcolorbox}[title=Unbroken Box,watermark text=unbroken] + The box. + \end{tcolorbox} +\item Otherwise, it is checked if at least \refKey{/tcb/lines before break} + of the upper box can be placed on the current page. + If not, a page break is inserted and the algorithm goes back to Step 2. +\item Now, the \emph{break sequence} starts. + The upper box part or the lower box part is split such that it fits + into the current page. The fitting part is named \emph{first part} of + the \emph{break sequence} and shipped out. + \begin{tcolorbox}[title=Broken Box,watermark text=first,skin=enhancedfirst] + The box. + \end{tcolorbox} +\item + If the remaining content of the total box + fits into the current page, the algorithm continues with Step 7, else + with Step 6. +\item + The upper box part or the lower box part is split such that it fits + into the current page. The fitting part is named \emph{middle part} of + the \emph{break sequence} and shipped out. + Then, the algorithm goes back to Step 5. + \begin{tcolorbox}[watermark text=middle,skin=enhancedmiddle] + The box. + \end{tcolorbox} +\item + The remaining part is named \emph{last part} of + the \emph{break sequence} and shipped out. The algorithm stops. + \begin{tcolorbox}[watermark text=last,skin=enhancedlast] + The box. + \end{tcolorbox} +\end{enumerate} +} + +The algorithm takes care that the optional segmentation line never appears at +the end of a box. The optional lower box part is also checked to +have at least \refKey{/tcb/lines before break}. + +\clearpage +In principal, all boxes of the \emph{break sequence} share the same geometric +parameters. The differences are: +\begin{itemize} +\item The given \refKey{/tcb/before} and \refKey{/tcb/after} values are + used only before the \emph{first} and after the \emph{last} part + of the \emph{break sequence}. +\item A special behavior between the parts of the \emph{break sequence} can + be given by \refKey{/tcb/toprule at break}, + \refKey{/tcb/bottomrule at break}, + \refKey{/tcb/enlarge top at break by}, and + \refKey{/tcb/enlarge bottom at break by}. +\item The \refKey{/tcb/skin} decides \emph{how} the \emph{first}, \emph{middle}, + and \emph{last} part look like. Actually, every part type has its own + skin given by the options \refKey{/tcb/skin first}, \refKey{/tcb/skin middle}, and + \refKey{/tcb/skin last}. Typically, these options are set automatically by + the main skin, see Subsection \ref{subsec:breaksequence} from + page \pageref{subsec:breaksequence}. +\end{itemize} + + +\subsection{Limitations and Known Bugs} +\begin{itemize} +\item The box content is a \TeX\ |\vbox| register which has a + restricted capacity. Therefore, you cannot place hundreds of pages + inside a |tcolorbox|. +\item Footnotes can be used inside an \refKey{/tcb/unbreakable} box + but not inside a \refKey{/tcb/breakable} box, even if it is not broken + actually. Other different behaviors may and will be effective. +\item You can nest an unbreakable |tcolorbox| inside another |tcolorbox|, + even inside a breakable one. But you should not nest a breakable box + inside a breakable box since this will give a mess. Inside a breakable box, + the further breaking is disabled by default. If you really want to or + have to use the keys \refKey{/tcb/breakable} or \refKey{/tcb/unbreakable} + inside the content of an outer |tcolorbox|, you have to guard this with a + \TeX\ group. +\item If your text content contains some text color changing commands, + your color will not survive the break to the next box\footnote{The reason is that + I am to dumb to catch the current color at the split point. If you know the trick, + let me know.}. +\end{itemize} + + +\clearpage +\subsection{Main Option Keys} +\begin{docTcbKey}{breakable}{}{no value} + Allows the |tcolorbox| to be breakable. If the box is larger than the + available space at the current page, the box is automatically broken + and continued to the next next page. All sorts of |tcolorbox| can be made + breakable. It depends on the skin how the breaking looks like. + If you do not know better, use \refKey{/tcb/enhanced} for breaking a box. + The parts of the \emph{break sequence} are numbered + by the counter |tcbbreakpart|. + \begin{dispListing} + % \usepackage{lipsum} % preamble + \tcbset{colback=red!5!white,colframe=red!75!black, + watermark color=yellow!25!white,watermark text=\arabic{tcbbreakpart}, + fonttitle=\bfseries} + + \begin{tcolorbox}[breakable,enhanced,title=My breakable box] + \lipsum[1-6] + \end{tcolorbox} + \end{dispListing} +\end{docTcbKey} +{\tcbusetemp} + + +\begin{docTcbKey}{unbreakable}{}{no value, initially set} + Sets the |tcolorbox| to be unbreakable. +\end{docTcbKey} + + +\begin{docTcbKey}{title after break}{=\meta{text}}{no default, initially empty} + The \refKey{/tcb/title} is used only for the \emph{first} part of a + \emph{break sequence}. Use |title after break| to create a heading line + with \meta{text} as content for all following parts. +\end{docTcbKey} + + +\begin{docTcbKey}{notitle after break}{}{no value, initially set} + Removes the title line or following parts in a \emph{break sequence} if set before. +\end{docTcbKey} + + +\begin{docTcbKey}{adjusted title after break}{=\meta{text}}{style, no default, initially unset} + Works like \refKey{/tcb/adjusted title} but applied to \refKey{/tcb/title after break}. +\end{docTcbKey} + + +\begin{docTcbKey}{lines before break}{=\meta{number}}{no default, initially |2|} + Assures that the given \meta{number} of lines of the upper box part or + the lower box part are placed before a break happens. +\end{docTcbKey} + + + +\begin{docTcbKey}{shrink break goal}{=\meta{length}}{no default, initially |0pt|} + This is an emergency parameter if the break algorithm produces unpleasant + breaks. It shrinks the goal height of the current box part by \meta{length} + which may result in smaller boxes. Never use negative values. +\end{docTcbKey} + + +\clearpage +\subsection{Option Keys for the Break Appearance} + +\begin{docTcbKey}{toprule at break}{=\meta{length}}{no default, initially \texttt{0.5mm}} + Sets the line width of the top rule to \meta{length} \emph{if} the box is \refKey{/tcb/breakable}. + In this case, it is applied to \emph{middle} and \emph{last} parts in a + break sequence. Note that \refKey{/tcb/toprule} overwrites this value + if used afterwards. +\end{docTcbKey} + + +\begin{docTcbKey}{bottomrule at break}{=\meta{length}}{no default, initially \texttt{0.5mm}} + Sets the line width of the bottom rule to \meta{length} \emph{if} the box is \refKey{/tcb/breakable}. + In this case, it is applied to \emph{first} and \emph{middle} parts in a + break sequence. Note that \refKey{/tcb/bottomrule} overwrites this value + if used afterwards. +\end{docTcbKey} + + + + +\begin{docTcbKey}{topsep at break}{=\meta{length}}{no default, initially \texttt{0mm}} + Additional vertical space of \meta{length} which is added at the top of + \emph{middle} and \emph{last} parts in a break sequence. In general, + it is not advisable to change this value if these parts start with a rule or a title. +\end{docTcbKey} + +\begin{docTcbKey}{bottomsep at break}{=\meta{length}}{no default, initially \texttt{0mm}} + Additional vertical space of \meta{length} which is added at the bottom of + \emph{first} and \emph{middle} parts in a break sequence. + In general, it is not advisable to change this value if these parts end with a rule. +\end{docTcbKey} + +\begin{docTcbKey}{pad before break}{=\meta{length}}{style, no default, initially \texttt{3.5mm}} + Sets the total amount of vertical space after the text content and before the + break point to \meta{length}. This style sets \refKey{/tcb/toprule at break} to |0pt| + and changes \refKey{/tcb/topsep at break} as required. + In general, it is not advisable to change this value if the + \emph{middle} and \emph{last} parts in a break sequence start with a rule or a title. +\end{docTcbKey} + +\begin{docTcbKey}{pad after break}{=\meta{length}}{style, no default, initially \texttt{3.5mm}} + Sets the total amount of vertical space after the break point and before the + text content to \meta{length}. This style sets \refKey{/tcb/bottomrule at break} to |0pt| + and changes \refKey{/tcb/bottomsep at break} as required. + In general, it is not advisable to change this value if the + \emph{first} and \emph{middle} parts in a break sequence end with a rule. +\end{docTcbKey} + +\begin{docTcbKey}{pad at break}{=\meta{length}}{style, no default, initially \texttt{3.5mm}} + Abbreviation for setting \meta{length} to \refKey{/tcb/pad before break} + and \refKey{/tcb/pad after break}. +\end{docTcbKey} + + +\begin{dispListing} +% \usepackage{lipsum} % preamble +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,breakable,pad at break=0mm, + title={For this box, the pad space at the break point is set to 0mm}] + \lipsum[1-2] +\end{tcolorbox} +\end{dispListing} +{\tcbusetemp} + + + +\begin{docTcbKey}{enlarge top at break by}{=\meta{length}}{no default, initially \texttt{0mm}} + Enlarges the bounding box distance to the top of the box by \meta{length} + \emph{if} the box is \refKey{/tcb/breakable}. + In this case, it is applied to \emph{middle} and \emph{last} parts in a + break sequence. + \refKey{/tcb/enlarge top by} overwrites this key. +\end{docTcbKey} + + +\begin{docTcbKey}{enlarge bottom at break by}{=\meta{length}}{no default, initially \texttt{0mm}} + Enlarges the bounding box distance to the bottom of the box by \meta{length} + \emph{if} the box is \refKey{/tcb/breakable}. + In this case, it is applied to \emph{first} and \emph{middle} parts in a + break sequence. \refKey{/tcb/enlarge bottom by} overwrites this key. +\end{docTcbKey} + + +\clearpage +\subsection{Break Sequence for the Skins}\label{subsec:breaksequence} +The following diagrams document the \emph{break sequence} for different +skins. Depending on the main skin of a |tcolorbox|, the actual skins of +the \emph{break sequence} parts are displayed. + +\def\tcbbreakskininto#1#2#3#4#5{% +\begin{center}\begin{tikzpicture} +\tcbset{width=5cm,colframe=Navy,colback=AliceBlue,fonttitle=\bfseries, + watermark color=AliceBlue!85!Navy,#5 + } +\node[above] (unbroken) at (0,0) {\begin{tcolorbox}[title=Unbroken Box,skin=#1,watermark text=unbroken,height=3.8cm] +\texttt{skin=#1} +\end{tcolorbox}}; +\node[above] (first) at (8,2.4) {\begin{tcolorbox}[title=Broken Boxes,skin=#2,watermark text=first,height=1.4cm] +\texttt{skin=#2} +\end{tcolorbox}}; +\node[above] (middle) at (8,1.2) {\begin{tcolorbox}[skin=#3,watermark text=middle,height=1cm] +\texttt{skin=#3} +\end{tcolorbox}}; +\node[above] (last) at (8,0) {\begin{tcolorbox}[skin=#4,watermark text=last,height=1cm] +\texttt{skin=#4} +\end{tcolorbox}}; +\path[draw=FireBrick,line width=2pt,->] (unbroken) edge (first.west) edge (middle.west) edge (last.west); +\end{tikzpicture}\end{center}} + +\tcbbreakskininto{standard}{standard}{standard}{standard}{watermark text/.style={}} +\tcbbreakskininto{enhanced}{enhancedfirst}{enhancedmiddle}{enhancedlast}{} +\tcbbreakskininto{enhancedfirst}{enhancedfirst}{enhancedmiddle}{enhancedmiddle}{} +\tcbbreakskininto{enhancedmiddle}{enhancedmiddle}{enhancedmiddle}{enhancedmiddle}{} +\tcbbreakskininto{enhancedlast}{enhancedmiddle}{enhancedmiddle}{enhancedlast}{} +\tcbbreakskininto{freelance}{freelance}{freelance}{freelance}{} +\tcbbreakskininto{bicolor}{bicolorfirst}{bicolormiddle}{bicolorlast}{bicolor} +\tcbbreakskininto{bicolorfirst}{bicolorfirst}{bicolormiddle}{bicolormiddle}{bicolor} +\tcbbreakskininto{bicolormiddle}{bicolormiddle}{bicolormiddle}{bicolormiddle}{bicolor} +\tcbbreakskininto{bicolorlast}{bicolormiddle}{bicolormiddle}{bicolorlast}{bicolor} +\tcbbreakskininto{beamer}{beamerfirst}{beamermiddle}{beamerlast}{beamer} +\tcbbreakskininto{beamerfirst}{beamerfirst}{beamermiddle}{beamermiddle}{beamer} +\tcbbreakskininto{beamermiddle}{beamermiddle}{beamermiddle}{beamermiddle}{beamer} +\tcbbreakskininto{beamerlast}{beamermiddle}{beamermiddle}{beamerlast}{beamer} +\clearpage +\tcbbreakskininto{widget}{widgetfirst}{widgetmiddle}{widgetlast}{widget} +\tcbbreakskininto{widgetfirst}{widgetfirst}{widgetmiddle}{widgetmiddle}{widget} +\tcbbreakskininto{widgetmiddle}{widgetmiddle}{widgetmiddle}{widgetmiddle}{widget} +\tcbbreakskininto{widgetlast}{widgetmiddle}{widgetmiddle}{widgetlast}{widget} +\tcbbreakskininto{draft}{draft}{draft}{draft}{draft} + + +\clearpage +\subsection{Break by Hand (Faked Break)} +Since the appearance of broken boxes is done by skins, it is quite easy +to 'fake a break'. For this, you actually don't need the 'breakable' library at +all. + +\begin{dispExample} +\tcbset{enhanced,equal height group=fakedbreak, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/3,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox}[title=My broken box,skin=enhancedfirst] +This is a box which breaks from one column to another +\end{tcolorbox}\hfill +\begin{tcolorbox}[skin=enhancedmiddle] +column. I am sorry to say that this is a trick. +Nevertheless, you may use this trick for your +\end{tcolorbox}\hfill +\begin{tcolorbox}[skin=enhancedlast] +own purposes. +\end{tcolorbox} +\end{dispExample} + + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coremacros.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coremacros.tex new file mode 100644 index 00000000000..bce81fdaa22 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coremacros.tex @@ -0,0 +1,103 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\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!white,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. The upper and the lower part are treated + as separate functional units. If you only want to draw a line, see + \refCom{tcbline}. +\end{docCommand} + + +\clearpage +\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!white,colframe=red!75!black} +\end{dispListing} +\end{docCommand} + + +\begin{docCommand}{tcbox}{\oarg{options}\marg{box content}} + Creates a \refEnv{tcolorbox} which is fitted to the width of the given + \meta{box content}. In principal, most \meta{options} for a \refEnv{tcolorbox} + can be used for |\tcbox| with some restrictions. A |\tcbox| cannot have + a lower part and cannot be broken. + +\begin{dispExample} +\tcbset{colframe=blue!50!black,colback=white,colupper=red!50!black, + fonttitle=\bfseries,before=,after=,center title} + +Text \tcbox[tcbox raise base]{Hello World}\hfill +% +\tcbox[left=0mm,right=0mm,top=0mm,bottom=0mm,boxsep=0mm, + toptitle=0.5mm,bottomtitle=0.5mm,title=My table]{% + \arrayrulecolor{blue!50!black}\renewcommand{\arraystretch}{1.2}% + \begin{tabular}{r|c|l} + One & Two & Three \\\hline\hline + Men & Mice & Lions \\\hline + Upper & Middle & Lower + \end{tabular}}\hfill +% +\tcbox[colback=blue!85!black, + left=0mm,right=0mm,top=0mm,bottom=0mm,boxsep=1mm,arc=0mm,boxrule=0.5pt, + title=My picture]{% + \includegraphics[width=5cm]{Basilica_5.png}} +\end{dispExample} +\end{docCommand} + + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex new file mode 100644 index 00000000000..f78733ea23a --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex @@ -0,0 +1,1500 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\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:2012k} 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 given by \refKey{/tcb/adjust text}. + 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} + + +\begin{docTcbKey}{adjust text}{=\meta{text}}{no default, initially \texttt{\"Apgjy}} + This sets the reference text for \refKey{/tcb/adjusted title}. If your texts + never exceed '\"Apgjy' in depth and height you don't need to care about this option. +\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,colback=white] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part (but invisible). +\end{tcolorbox} + +\begin{tcolorbox}[lowerbox=ignored,colback=white] +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,colback=white] +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!white,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!white}} + 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!white}} + 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}{colupper}{=\meta{color}}{no default, initially \texttt{black}} + Sets the text \meta{color} of the upper part. +\begin{dispExample} +\begin{tcolorbox}[colupper=yellow,colback=blue!50,colframe=blue] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{collower}{=\meta{color}}{no default, initially \texttt{black}} + Sets the text \meta{color} of the lower part. +\begin{dispExample} +\begin{tcolorbox}[collower=yellow,colback=blue!50,colframe=blue] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{coltext}{=\meta{color}}{style, no default, initially \texttt{black}} + Sets the text \meta{color} of the box. This is an abbreviation for setting + |colupper| and |collower| to the same value. +\begin{dispExample} +\begin{tcolorbox}[coltext=yellow,colback=blue!50,colframe=blue] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\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} + + +\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} + +\bigskip +\begin{marker} + More color options are provided by using skins documented in + Section \ref{sec:skins} from page \pageref{sec:skins}. +\end{marker} + +\clearpage +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[width=\linewidth/2] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{toprule}{=\meta{length}}{no default, initially \texttt{0.5mm}} + Sets the line width of the top rule to \meta{length}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[toprule=3mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{bottomrule}{=\meta{length}}{no default, initially \texttt{0.5mm}} + Sets the line width of the bottom rule to \meta{length}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[bottomrule=3mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{leftrule}{=\meta{length}}{no default, initially \texttt{0.5mm}} + Sets the line width of the left rule to \meta{length}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[leftrule=3mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{rightrule}{=\meta{length}}{no default, initially \texttt{0.5mm}} + Sets the line width of the right rule to \meta{length}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[rightrule=3mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{titlerule}{=\meta{length}}{no default, initially \texttt{0.5mm}} + Sets the line width of the rule below the title to \meta{length}. +\begin{dispExample} +\tcbset{enhanced,colback=red!5!white,colframe=red!75!black, + colbacktitle=red!90!black} + +\begin{tcolorbox}[titlerule=3mm,title=This is the title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{boxrule}{=\meta{length}}{style, no default, initially \texttt{0.5mm}} + Sets all rules of the frame to \meta{length}, i.\,e.\ + \refKey{/tcb/toprule}, \refKey{/tcb/bottomrule}, \refKey{/tcb/leftrule}, + \refKey{/tcb/rightrule}, and \refKey{/tcb/titlerule}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[boxrule=3mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{arc}{=\meta{length}}{no default, initially \texttt{1mm}} + Sets the inner radius of the four frame arcs to \meta{length}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\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} + + +\begin{docTcbKey}{outer arc}{=\meta{length}}{no default, initially unset} + Sets the outer radius of the four frame arcs to \meta{length}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[arc=4mm,outer arc=1mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{auto outer arc}{}{no value, initially set} + Sets the outer radius of the four frame arcs automatically in + dependency of the inner radius given by \refKey{/tcb/arc}. +\end{docTcbKey} + + +\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} +\tcbset{colback=red!5!white,colframe=red!75!black,width=(\linewidth-4mm)/2, + before=,after=\hfill} + +\begin{tcolorbox}[boxsep=5mm] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\begin{tcolorbox}[boxsep=5mm,draft] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[leftupper=3cm,title=My Title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{leftlower}{=\meta{length}}{no default, initially \texttt{4mm}} + Sets the left space between lower text and frame (additional to |boxsep|). +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[leftlower=3cm] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\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} + + +\clearpage +\begin{docTcbKey}{rightlower}{=\meta{length}}{no default, initially \texttt{4mm}} + Sets the right space between lower text and frame (additional to |boxsep|). +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[top=0mm] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{toptitle}{=\meta{length}}{no default, initially \texttt{0mm}} + Sets the top space between title and frame (additional to |boxsep|). +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[toptitle=3mm,title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{bottom}{=\meta{length}}{no default, initially \texttt{2mm}} + Sets the bottom space between text and frame (additional to |boxsep|). +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[bottom=0mm] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{bottomtitle}{=\meta{length}}{no default, initially \texttt{0mm}} + Sets the bottom space between title and frame (additional to |boxsep|). +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[bottomtitle=3mm,title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\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} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[middle=0mm,boxsep=0mm] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{oversize}{}{style} + Sets the text width of the upper part to the current line width. + This is achieved by changed the keys \refKey{/tcb/width} + \refKey{/tcb/enlarge left by}, and + \refKey{/tcb/enlarge right by} appropriately. + The resulting box is overlapping into the left and right margin of + the page. + Note that this style option has to be given \emph{after} all other + geometry keys! +\begin{dispListing} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\textit{Normal text for comparison:}\\ +\lipsum[2] + +\begin{tcolorbox}[oversize,title=Oversized box] +\lipsum[2] +\end{tcolorbox} + +\begin{tcolorbox}[title=Normal box] +\lipsum[2] +\end{tcolorbox} +\end{dispListing} +\end{docTcbKey} + +{\tcbusetemp} + + + +\clearpage +\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. + +\bigskip +\begin{marker} + The height control keys are only applicable to unbreakable boxes. + If a box is set to be \refKey{/tcb/breakable}, the height is always + computed according to the \emph{natural height}. +\end{marker} +\bigskip + + +\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{Box Content Additions}\label{subsec:contentadditions} +The following options introduce some arbitrary \meta{code} to the content +of a |tcolorbox|. These additions can be given at the begin or at the end +of the title, the upper part, or the lower part. + +\begin{docTcbKey}{before title}{=\meta{code}}{no default, initially unset} + The given \meta{code} is placed \emph{after} the color and font settings + and \emph{before} the content of the title. +\begin{dispExample} +\tcbset{before title={\textcolor{yellow}{\large Important:}~}, + colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{after title}{=\meta{code}}{no default, initially unset} + The given \meta{code} is placed \emph{after} the content of the title. +\begin{dispExample} +\tcbset{after title={\hfill\colorbox{Navy}{approved}}, + colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{before upper}{=\meta{code}}{no default, initially unset} + The given \meta{code} is placed \emph{after} the color and font settings + and \emph{before} the content of the upper part. +\begin{dispExample} +\tcbset{before upper={\textit{The story:}\par}, + colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{after upper}{=\meta{code}}{no default, initially unset} + The given \meta{code} is placed \emph{after} the content of the upper part. +\begin{dispExample} +\tcbset{after upper={\par\hfill\textit{Read more next week}}, + colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{before lower}{=\meta{code}}{no default, initially unset} + The given \meta{code} is placed \emph{after} the color and font settings + and \emph{before} the content of the lower part. +\begin{dispExample} +\tcbset{before lower=\textit{Behold:~},colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox} +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{after lower}{=\meta{code}}{no default, initially unset} + The given \meta{code} is placed \emph{after} the content of the lower part. +\begin{dispExample} +\tcbset{after lower=\ \textit{This is the end.}, + colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox} +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{center title}{}{style, no value, initially unset} + This style sets \refKey{/tcb/before title} and \refKey{/tcb/after title} + to |\begin{center}| and |\end{center}|. +\begin{dispExample} +\tcbset{center title,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{center upper}{}{style, no value, initially unset} + This style sets \refKey{/tcb/before upper} and \refKey{/tcb/after upper} + to |\begin{center}| and |\end{center}|. +\begin{dispExample} +\tcbset{center upper,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{center lower}{}{style, no value, initially unset} + This style sets \refKey{/tcb/before lower} and \refKey{/tcb/after lower} + to |\begin{center}| and |\end{center}|. +\begin{dispExample} +\tcbset{center lower,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[title=My title] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{tabularx}{=\meta{preamble}}{style} + This style sets \refKey{/tcb/before lower} and \refKey{/tcb/after lower} + and several geometry keys to support a |tabularx| with the + given \meta{preamble}. + The package |tabularx| \cite {carlisle:1999a} has to be loaded separately. +\begin{dispExample} +% \usepackage{array,tabularx} +\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}% see tabularx +\tcbset{enhanced,fonttitle=\bfseries\large,fontupper=\normalsize\sffamily, + colback=yellow!10!white,colframe=red!50!black,colbacktitle=Salmon!30!white, + coltitle=black,center title} + +\begin{tcolorbox}[tabularx={X||Y|Y|Y|Y||Y},title=My table] +Group & One & Two & Three & Four & Sum\\\hline\hline +Red & 1000.00 & 2000.00 & 3000.00 & 4000.00 & 10000.00\\\hline +Green & 2000.00 & 3000.00 & 4000.00 & 5000.00 & 14000.00\\\hline +Blue & 3000.00 & 4000.00 & 5000.00 & 6000.00 & 18000.00\\\hline\hline +Sum & 6000.00 & 9000.00 & 12000.00 & 15000.00 & 42000.00 +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{tabularx*}{=\marg{code}\marg{preamble}}{style} + This is a variant of \refKey{/tcb/tabularx} which adds some \meta{code} + before the table starts. +\begin{dispExample} +% \usepackage{array,tabularx} +\tcbset{enhanced,fonttitle=\bfseries\large,fontupper=\normalsize\sffamily, + colback=yellow!10!white,colframe=red!50!black,colbacktitle=Salmon!30!white, + coltitle=black,center title} + +\begin{tcolorbox}[tabularx*={\arrayrulewidth0.5mm}{X|X|X},title=My table] +One & Two & Three \\\hline\hline +1000.00 & 2000.00 & 3000.00\\\hline +2000.00 & 3000.00 & 4000.00 +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{tikz upper}{\colOpt{=\meta{options}}}{style} + This style adds a centered |tikzpicture| environment to the begin and + to the end of the upper part. +\begin{dispExample} +% \usepackage{tikz} + +\begin{tcolorbox}[tikz upper,fonttitle=\bfseries,colback=white,colframe=black, + title=TikZ drawing] + \path[fill=yellow,draw=yellow!75!red] (0,0) circle (1cm); + \fill[red] (45:5mm) circle (1mm); + \fill[red] (135:5mm) circle (1mm); + \draw[line width=1mm,red] (215:5mm) arc (215:325:5mm); +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{tikz lower}{\colOpt{=\meta{options}}}{style} + This style adds a centered |tikzpicture| environment to the begin and + to the end of the lower part. +\begin{dispExample} +% \usepackage{tikz} +% \usetikzlibrary{skins,listings} +\tcbset{tikz lower,listing and text,fonttitle=\bfseries, + bicolor,colback=LightBlue!50!white,colbacklower=white,colframe=black} + +\begin{tcblisting}{title=TikZ drawing} +\path[fill=yellow,draw=yellow!75!red] (0,0) circle (1cm); +\fill[red] (45:5mm) circle (1mm); +\fill[red] (135:5mm) circle (1mm); +\draw[line width=1mm,red] (215:5mm) arc (215:325:5mm); +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\subsection{Overlays}\label{subsec:overlays} +With an overlay, arbitrary \meta{graphical code} can be added to a +|tcolorbox|. This code is executed \emph{after} the frame and interior are +drawn and \emph{before} the text content is drawn. Therefore, you can +decorate the |tcolorbox| with your own extensions. +Common special cases are \emph{watermarks} which are implemented using overlays. +See Subsection \ref{subsec:watermarks} from page \pageref{subsec:watermarks} if +you want to add \emph{watermarks}. +\begin{marker} +If you use the core package only, the \meta{graphical code} has to be |pgf| code +and there is not much assistance for positioning. +Therefore, the usage of the \refKey{/tcb/enhanced} mode from the library skins +is recommended which allows |tikz| code and gives access to +\refKey{/tcb/geometry nodes} for positioning. +\end{marker} + +\begin{docTcbKey}{overlay}{=\meta{graphical code}}{no default, initially unset} + Adds \meta{graphical code} to the box drawing process. This \meta{graphical code} + is drawn \emph{after} the frame and interior and \emph{before} the text content. + +\begin{dispExample} +% \tcbuselibrary{skins} % preamble +\tcbset{frogbox/.style={enhanced,colback=green!10,colframe=green!65!black, + enlarge top by=5.5mm, + overlay={\foreach \x in {2cm,3.5cm} { + \begin{scope}[shift={([xshift=\x]frame.north west)}] + \path[draw=green!65!black,fill=green!10,line width=1mm] (0,0) arc (0:180:5mm); + \path[fill=black] (-0.2,0) arc (0:180:1mm); + \end{scope}}}]}} + +\begin{tcolorbox}[frogbox,title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} + +\begin{dispExample} +% \usetikzlibrary{patterns} % preamble +% \tcbuselibrary{skins} % preamble +\tcbset{ribbonbox/.style={enhanced,colback=red!5!white,colframe=red!75!black, + fonttitle=\bfseries, + overlay={\path[fill=blue!75!white,draw=blue,double=white!85!blue, + preaction={opacity=0.6,fill=blue!75!white}, + line width=0.1mm,double distance=0.2mm, + pattern=fivepointed stars,pattern color=white!75!blue] + ([xshift=-0.2mm,yshift=-1.02cm]frame.north east) + -- ++(-1,1) -- ++(-0.5,0) -- ++(1.5,-1.5) -- cycle;}}} + +\begin{tcolorbox}[ribbonbox,title=My title] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{no overlay}{}{style, no default, initially set} + Removes the overlay if set before. +\end{docTcbKey} + +\begin{docTcbKey}{overlay broken}{=\meta{graphical code}}{no default, initially unset} + If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, + then the \meta{graphical code} is added to the box drawing process. + \refKey{/tcb/overlay} overwrites this key. +\end{docTcbKey} + +\begin{docTcbKey}{overlay unbroken}{=\meta{graphical code}}{no default, initially unset} + If the box is set to be \refKey{/tcb/breakable} but \emph{is not} broken actually + or if the box is set to be \refKey{/tcb/unbreakable}, + then the \meta{graphical code} is added to the box drawing process. + \refKey{/tcb/overlay} overwrites this key. +\end{docTcbKey} + +\begin{docTcbKey}{overlay first}{=\meta{graphical code}}{no default, initially unset} + If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, + then the \meta{graphical code} is added to the box drawing process for + the \emph{first} part of the break sequence. + \refKey{/tcb/overlay} overwrites this key. +\end{docTcbKey} + +\begin{docTcbKey}{overlay middle}{=\meta{graphical code}}{no default, initially unset} + If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, + then the \meta{graphical code} is added to the box drawing process for + the \emph{middle} parts (if any) of the break sequence. + \refKey{/tcb/overlay} overwrites this key. +\end{docTcbKey} + +\begin{docTcbKey}{overlay last}{=\meta{graphical code}}{no default, initially unset} + If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, + then the \meta{graphical code} is added to the box drawing process for + the \emph{last} part of the break sequence. + \refKey{/tcb/overlay} overwrites this key. +\end{docTcbKey} + +\begin{docTcbKey}{overlay unbroken and first}{=\meta{graphical code}}{no default, initially unset} + This is an optimized abbreviation for setting + \refKey{/tcb/overlay unbroken} and + \refKey{/tcb/overlay first} together. + \refKey{/tcb/overlay} overwrites this key. +\end{docTcbKey} + +\begin{docTcbKey}{overlay middle and last}{=\meta{graphical code}}{no default, initially unset} + This is an optimized abbreviation for setting + \refKey{/tcb/overlay middle} and + \refKey{/tcb/overlay last} together. + \refKey{/tcb/overlay} overwrites this key. +\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} +\tcbset{enhanced,colback=red!5!white,colframe=red!75!black, + watermark color=red!15!white} + +\begin{tcolorbox}[floatplacement=t,float, + title=Floating box from |floatplacement|, + watermark text={I am floating}] + This floating box is placed at the top of a page. +\end{tcolorbox} +\end{dispListing} +\end{docTcbKey} +{\tcbusetemp} + + +\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|, + enhanced,watermark text={I'm also floating}] + This box floats to a feasible place automatically. You do not have to + use a numbering for this floating object. +\end{tcolorbox} +\end{dispListing} +\end{docTcbKey} +{\tcbusetemp} + + +\clearpage +\subsection{Embedding into the Surroundings}\label{subsec:surroundings} +Typically, but not necessarily, a |tcolorbox| is put inside a separate paragraph +and has some vertical space before and after it. +This behavior is controlled by the keys |before| and |after|. + +\begin{docTcbKey}{before}{=\meta{code}}{no default, initially see \refKey{/tcb/autoparskip}} + Sets the \meta{code} which is executed before the colored box. + It is not used for floating boxes. +\end{docTcbKey} + +\begin{docTcbKey}{after}{=\meta{code}}{no default, initially see \refKey{/tcb/autoparskip}} + Sets the \meta{code} which is executed after the colored box. + It is not used for floating boxes. +\end{docTcbKey} + +\begin{docTcbKey}{parskip}{}{style, no value} + Sets the keys |before| and |after| to values which are + recommended, if the package |parskip| \emph{is} used and there is no better + idea for |before| and |after|. +\begin{dispListing} +\tcbset{parskip/.style={before={\par\pagebreak[0]\noindent}, + after={\par}}} +\end{dispListing} +\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} + +\begin{docTcbKey}{autoparskip}{}{style, no value, initially set} + Tries to detect the usage of the package |parskip| and sets + the keys |before| and |after| accordingly. Actually, the following is done: + \begin{itemize} + \item If the length of |\parskip| is greater than |0pt| at the begin of the document, + \refKey{/tcb/parskip} is executed. Here, the usage of package |parskip| is \emph{assumed}. + \item Otherwise, if the length of |\parskip| is not greater than |0pt| at the begin of the document, + \refKey{/tcb/noparskip} is executed. Here, the absence of package |parskip| is \emph{assumed}. + \end{itemize} + |autoparskip| is the default for the package |tcolorbox|, if |before| or |after| + are not changed otherwise. +\end{docTcbKey} + +\begin{docTcbKey}{nobeforeafter}{}{style, no value} + Abbreviation for clearing the keys |before| and |after|. The colored box + is not put into a paragraph and there is no space before or after the box. +\begin{dispExample} +\tcbset{myone/.style={colback=LightGreen,colframe=DarkGreen, + equal height group=nobefaf,width=\linewidth/4,nobeforeafter}} +\begin{tcolorbox}[myone,title=Box 1]Box 1\end{tcolorbox}% +\begin{tcolorbox}[myone,title=Box 2]Box 2\end{tcolorbox}% +\begin{tcolorbox}[myone,title=Box 3]Box 3\end{tcolorbox}% +\begin{tcolorbox}[myone,title=Box 4]Box 4\end{tcolorbox} +\end{dispExample} +\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} + + +\clearpage +\begin{marker} +The following keys should not be used with breakable boxes or boxes with a +lower part. +\end{marker} + +\begin{docTcbKey}{shrink tight}{}{style, no value, initially unset} + The total colored box is shrunk to the dimensions of the upper + part. There should be no lower part and no title. + This style sets the \refKey{/tcb/boxsep} to |0pt| and other geometry keys + to fitting values. This option is likely to be used with the following + extrusion keys. +\begin{dispExample} +\tcbset{colframe=blue!75!black,colback=white,arc=0mm,boxrule=0.4pt, + tcbox raise base,shrink tight} + +\begin{tcolorbox} +This is a \textbf{tcolorbox}. +\end{tcolorbox} + +Lorem \tcbox{ipsum} dolor sit amet, consectetuer adipiscing elit. +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{extrude left by}{=\meta{length}}{style, no default, initially unset} + The (upper part of the) colored box is extruded by the given \meta{length} to the left side. + The inner width and the bounding box is kept unchanged and the operation + is additiv! +\begin{dispExample} +\tcbset{enhanced,colframe=red,colback=yellow!25!white, + frame style={opacity=0.25},interior style={opacity=0.5}, + tcbox raise base,shrink tight,extrude by=2mm} + +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, +vestibulum ut, placerat ac, adipiscing vitae, felis. +\tcbox[extrude left by=1cm]{Curabitur} dictum gravida mauris. +Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{extrude right by}{=\meta{length}}{style, no default, initially unset} + The (upper part of the) colored box is extruded by the given \meta{length} to the right side. + The inner width and the bounding box is kept unchanged and the operation + is additiv! +\begin{dispExample} +\tcbset{enhanced,colframe=red,colback=yellow!25!white, + frame style={opacity=0.25},interior style={opacity=0.5}, + tcbox raise base,shrink tight,extrude by=2mm} + +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, +vestibulum ut, placerat ac, adipiscing vitae, felis. +\tcbox[extrude right by=1cm]{Curabitur} dictum gravida mauris. +Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{extrude top by}{=\meta{length}}{style, no default, initially unset} + The (upper part of the) colored box is extruded by the given \meta{length} to the top side. + The inner width and the bounding box is kept unchanged and the operation + is additiv! +\begin{dispExample} +\tcbset{enhanced,colframe=red,colback=yellow!25!white, + frame style={opacity=0.25},interior style={opacity=0.5}, + tcbox raise base,shrink tight,extrude by=2mm} + +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, +vestibulum ut, placerat ac, adipiscing vitae, felis. +\tcbox[extrude top by=1cm]{Curabitur} dictum gravida mauris. +Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{extrude bottom by}{=\meta{length}}{style, no default, initially unset} + The (upper part of the) colored box is extruded by the given \meta{length} to the bottom side. + The inner width and the bounding box is kept unchanged and the operation + is additiv! +\begin{dispExample} +\tcbset{enhanced,colframe=red,colback=yellow!25!white, + frame style={opacity=0.25},interior style={opacity=0.5}, + tcbox raise base,shrink tight,extrude by=2mm} + +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, +vestibulum ut, placerat ac, adipiscing vitae, felis. +\tcbox[extrude bottom by=1cm]{Curabitur} dictum gravida mauris. +Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna. +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{extrude by}{=\meta{length}}{style, no default, initially unset} + The (upper part of the) colored box is extruded by the given \meta{length} to all sides. + The inner width and the bounding box is kept unchanged and the operation + is additiv! +\begin{dispExample} +\tcbset{enhanced,colframe=red,colback=yellow!25!white, + frame style={opacity=0.25},interior style={opacity=0.5}, + tcbox raise base,shrink tight,extrude by=2mm} + +Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit, +vestibulum ut, placerat ac, adipiscing vitae, felis. \tcbox{Curabitur} dictum +gravida mauris. \tcbox[colframe=Green,interior style={opacity=0.0}]{Nam} +arcu libero, nonummy eget, consectetuer id, \tcbox{vulputate} a, magna. Donec +vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus +et malesuada fames ac turpis egestas. \tcbox{Mauris ut leo.} +\end{dispExample} +\end{docTcbKey} + + + +\clearpage +\subsection{Text Characteristics} +\begin{docTcbKey}{parbox}{\colOpt{=\meta{boolean value}}}{default |true|, initially |true|} + The text inside a |tcolorbox| is formatted using a \LaTeX\ |minipage| + if the box is unbreakable. If breakable, the box tries a mimicry of + a |minipage|. In a |minipage| or |parbox|, paragraphs are formatted slightly different + as the main text. If the key value is set to |false|, the normal main text + behavior is restored. In some situations, this has some unwanted side + effects. It is recommended to use this experimental setting only + where you really want to have this feature. +\end{docTcbKey} + +\begin{dispListing} +% \usepackage{lipsum} % preamble +\tcbset{width=(\linewidth-2mm)/2,nobeforeafter,arc=1mm, + colframe=blue!75!black,colback=white,fonttitle=\bfseries,fontupper=\small, + left=2mm,right=2mm,top=1mm,bottom=1mm,equal height group=parbox} + +\begin{tcolorbox}[parbox,adjusted title={parbox=true (normal)}] + \lipsum[1-2] +\end{tcolorbox}\hfill% +\begin{tcolorbox}[parbox=false,adjusted title={parbox=false}] + \lipsum[1-2] +\end{tcolorbox}% +\end{dispListing} +{\tcbusetemp} + +\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} + +\subsection{\texttt{\textbackslash tcbox} Specials} +The following options are applicable for \refCom{tcbox} and \refCom{tcboxmath} +only. + +\begin{docTcbKey}{tcbox raise}{=\meta{length}}{no default, initially \texttt{0pt}} + Raises the \refCom{tcbox} by the given \meta{length}. + % Sets the line width of the right rule to \meta{length}. +\begin{dispExample} +\tcbset{colframe=blue!50!black,colback=white,colupper=red!50!black, + fonttitle=\bfseries,before=,after=,center title} + +Test\dotfill +\tcbox[tcbox raise base]{Hello World 1}\dotfill +\tcbox{Hello World 2}\dotfill +\tcbox[tcbox raise=5mm]{Hello World 3} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{tcbox raise base}{}{style, no value, initially unset} + Raises the \refCom{tcbox} such that the base of its content matches + the base of the environmental line; see example above. +\end{docTcbKey} + + +\subsection{Skins} +There are additional option keys which change the appearance of a |tcolorbox|. +If only the core package is used, there is only one \emph{skin} and these +keys are meaningless. +The library 'skins' adds more skins. The appropriate option keys for skins of +the core package are therefore described in section \ref{sec:skincorekeys} from +page \pageref{sec:skincorekeys}. + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.documentation.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.documentation.tex new file mode 100644 index 00000000000..b6a9405acb0 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.documentation.tex @@ -0,0 +1,343 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\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|. + +For UTF-8 support, load: +\begin{dispListing} + \tcbuselibrary{listingsutf8,documentation} +\end{dispListing} + + +\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}. + + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.hooks.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.hooks.tex new file mode 100644 index 00000000000..d83df4d7d52 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.hooks.tex @@ -0,0 +1,426 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\clearpage +\section{Library 'hooks'}\label{sec:hooks} +The library is loaded by a package option or inside the preamble by: +\begin{dispListing} +\tcbuselibrary{hooks} +\end{dispListing} + +For the skin related options, the library 'skins' has to be loaded +separately. + + +\subsection{Concept of Hooks} +A hook is a placeholder in some \LaTeX\ code where additional code +can be added. For example, the \LaTeX\ macro |\AtBeginDocument| adds code to a +hook which is placed at the begin of every document. + +Several option keys of |tcolorbox| allow to provide some code which is +added to specific places of a colored box. For example, \refKey{/tcb/before upper} +places code before the content of the upper part. A following usage of this +key overwrites any prior settings. + +The library 'hooks' extends \refKey{/tcb/before upper} and several more +existing keys to 'hookable' versions, e.\,g.\ +\refKey{/tcb/before upper app} and \refKey{/tcb/before upper pre}. +The 'hookable' keys don't overwrite prior settings but either \emph{app}end +or \emph{pre}pend the newly given code to the existing code. + +The general naming convention (with some small exceptions) is: +\begin{itemize} +\item \meta{option key} |app|: works like \meta{option key} but + \emph{app}ends its code to the existing code. +\item \meta{option key} |pre|: works like \meta{option key} but + \emph{pre}pends its code to the existing code. +\end{itemize} +If the original \meta{option key} is used (again), all code will be overwritten. +Therefore, the order of the option key usage is crucial. + + + +\begin{dispExample} +% \usepackage{array,tabularx} +\newcolumntype{Y}{>{\raggedleft\arraybackslash}X}% see tabularx +\tcbset{enhanced,fonttitle=\bfseries\large,fontupper=\normalsize\sffamily, + colback=yellow!10!white,colframe=red!50!black,colbacktitle=Salmon!30!white, + coltitle=black,center title, + tabularx={X||Y|Y|Y|Y||Y},% this sets 'before upper' and 'after upper' + before upper app={Group & One & Two & Three & Four & Sum\\\hline\hline} } + +\begin{tcolorbox}[title=My table] +Red & 1000.00 & 2000.00 & 3000.00 & 4000.00 & 10000.00\\\hline +Green & 2000.00 & 3000.00 & 4000.00 & 5000.00 & 14000.00\\\hline +Blue & 3000.00 & 4000.00 & 5000.00 & 6000.00 & 18000.00\\\hline\hline +Sum & 6000.00 & 9000.00 & 12000.00 & 15000.00 & 42000.00 +\end{tcolorbox} +\end{dispExample} + + + +\clearpage +\subsection{Box Content Additions}\label{subsec:hookscontentadditions} +The following option keys extend the options given in Subsection \ref{subsec:contentadditions} +from page \pageref{subsec:contentadditions}. + +\begin{docTcbKey}{before title app}{=\meta{code}}{no default} + Appends the given \meta{code} to \refKey{/tcb/before title} \emph{after} the color and font settings + and \emph{before} the content of the title. +\end{docTcbKey} + +\begin{docTcbKey}{before title pre}{=\meta{code}}{no default} + Prepends the given \meta{code} to \refKey{/tcb/before title} \emph{after} the color and font settings + and \emph{before} the content of the title. +\end{docTcbKey} + +\begin{docTcbKey}{after title app}{=\meta{code}}{no default} + Appends the given \meta{code} to \refKey{/tcb/after title} \emph{after} the content of the title. +\end{docTcbKey} + +\begin{docTcbKey}{after title pre}{=\meta{code}}{no default} + Prepends the given \meta{code} to \refKey{/tcb/after title} \emph{after} the content of the title. +\end{docTcbKey} + +\begin{docTcbKey}{before upper app}{=\meta{code}}{no default} + Appends the given \meta{code} to \refKey{/tcb/before upper} \emph{after} the color and font settings + and \emph{before} the content of the upper part. +\end{docTcbKey} + +\begin{docTcbKey}{before upper pre}{=\meta{code}}{no default} + Prepends the given \meta{code} to \refKey{/tcb/before upper} \emph{after} the color and font settings + and \emph{before} the content of the upper part. +\end{docTcbKey} + +\begin{docTcbKey}{after upper app}{=\meta{code}}{no default} + Appends the given \meta{code} to \refKey{/tcb/after upper} \emph{after} the content of the upper part. +\end{docTcbKey} + +\begin{docTcbKey}{after upper pre}{=\meta{code}}{no default} + Prepends the given \meta{code} to \refKey{/tcb/after upper} \emph{after} the content of the upper part. +\begin{dispExample} +% \tcbuselibrary{theorems} +\tcbset{ams align,% this sets 'before upper' and 'after upper' + colback=yellow!10!white,colframe=red!50!black, + before upper app={\frac{2}{\sqrt{2}}&=\sqrt{2}.\\}, + after upper pre={\\\sin\left(\frac{\pi}{2}\right)&=1.}, +} + +\begin{tcolorbox} + \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}{before lower app}{=\meta{code}}{no default} + Appends the given \meta{code} to \refKey{/tcb/before lower} \emph{after} the color and font settings + and \emph{before} the content of the lower part. +\end{docTcbKey} + +\begin{docTcbKey}{before lower pre}{=\meta{code}}{no default} + Prepends the given \meta{code} to \refKey{/tcb/before lower} \emph{after} the color and font settings + and \emph{before} the content of the lower part. +\end{docTcbKey} + +\begin{docTcbKey}{after lower app}{=\meta{code}}{no default} + Appends the given \meta{code} to \refKey{/tcb/after lower} \emph{after} the content of the lower part. +\end{docTcbKey} + +\begin{docTcbKey}{after lower pre}{=\meta{code}}{no default} + Prepends the given \meta{code} to \refKey{/tcb/after lower} \emph{after} the content of the lower part. +\end{docTcbKey} + + +\subsection{Embedding into the Surroundings} +The following option keys extend the options given in Subsection \ref{subsec:surroundings} +from page \pageref{subsec:surroundings}. + +\begin{marker} +The 'hookable' versions are usable inside the document. +In the preamble, they can only be used after explicit setting of +\refKey{/tcb/before} and \refKey{/tcb/after} or by e.\,g.\ \refKey{/tcb/parskip}. +\end{marker} + +\begin{docTcbKey}{before app}{=\meta{code}}{no default} + Appends the given \meta{code} to \refKey{/tcb/before} before the colored box. +\end{docTcbKey} + +\begin{docTcbKey}{before pre}{=\meta{code}}{no default} + Prepends the given \meta{code} to \refKey{/tcb/before} before the colored box. +\end{docTcbKey} + +\begin{docTcbKey}{after app}{=\meta{code}}{no default} + Appends the given \meta{code} to \refKey{/tcb/after} after the colored box. +\end{docTcbKey} + +\begin{docTcbKey}{after pre}{=\meta{code}}{no default} + Prepends the given \meta{code} to \refKey{/tcb/after} after the colored box. +\end{docTcbKey} + +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[title=My title,before app={The box follows:\\[4pt]}, + after app={This is the end.}] +This is a \textbf{tcolorbox}. +\end{tcolorbox} +\end{dispExample} + + +\clearpage +\subsection{Overlays} +The following option keys extend the options given in Subsection \ref{subsec:overlays} +from page \pageref{subsec:overlays}. + +\begin{docTcbKey}{overlay app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/overlay}. + + +\begin{dispExample} +% \usetikzlibrary{patterns} % preamble +% \tcbuselibrary{skins} % preamble +\tcbset{frogbox/.style={enhanced,colback=green!10,colframe=green!65!black, + enlarge top by=5.5mm, + overlay={\foreach \x in {2cm,3.5cm} { + \begin{scope}[shift={([xshift=\x]frame.north west)}] + \path[draw=green!65!black,fill=green!10,line width=1mm] (0,0) arc (0:180:5mm); + \path[fill=black] (-0.2,0) arc (0:180:1mm); + \end{scope}}}]}} +\tcbset{ribbon/.style={overlay app={% + \path[fill=blue!75!white,draw=blue,double=white!85!blue, + preaction={opacity=0.6,fill=blue!75!white}, + line width=0.1mm,double distance=0.2mm, + pattern=fivepointed stars,pattern color=white!75!blue] + ([xshift=-0.2mm,yshift=-1.02cm]frame.north east) + -- ++(-1,1) -- ++(-0.5,0) -- ++(1.5,-1.5) -- cycle;}}} + +\begin{tcolorbox}[frogbox,title=My title] +This is a \textbf{tcolorbox}. +\end{tcolorbox} + +\begin{tcolorbox}[frogbox,ribbon,title=My title] +This is a \textbf{tcolorbox}.\par +Here, we apply a second overlay. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{overlay pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/overlay}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay unbroken app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay unbroken pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay first app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/overlay first}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay first pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/overlay first}. +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{overlay middle app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/overlay middle}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay middle pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/overlay middle}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay last app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/overlay last}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay last pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/overlay last}. +\end{docTcbKey} + + +\begin{docTcbKey}{overlay broken app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/overlay broken}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay broken pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/overlay broken}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay unbroken and first app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken and first}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay unbroken and first pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/overlay unbroken and first}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay middle and last app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/overlay middle and last}. +\end{docTcbKey} + +\begin{docTcbKey}{overlay middle and last pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/overlay middle and last}. +\end{docTcbKey} + +\clearpage +\subsection{Watermarks} +The following option keys extend the options given in Subsection \ref{subsec:watermarks} +from page \pageref{subsec:watermarks}. + +\begin{marker} +Watermarks are special overlays. The 'hooks' library allows the combination +of several watermarks and overlays. +\end{marker} + +\begin{docTcbKey}{watermark text app}{=\meta{text}}{no default} + Appends a \refKey{/tcb/watermark text} to the colored box. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title,watermark graphics=Basilica_5.png, + watermark opacity=0.25, + watermark text app=Basilica,watermark color=Navy + ] +\lipsum[1-2] +\tcblower +This example uses a public domain picture from\\ +\url{http://commons.wikimedia.org/wiki/File:Basilica_5.png} +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{watermark text pre}{=\meta{text}}{no default} + Prepends a \refKey{/tcb/watermark text} to the colored box. +\end{docTcbKey} + +\begin{docTcbKey}{watermark text app on}{=\meta{part} is \meta{text}}{no default} + Appends a \refKey{/tcb/watermark text on} the named \meta{part} of a break sequence. +\end{docTcbKey} + +\begin{docTcbKey}{watermark text pre on}{=\meta{part} is \meta{text}}{no default} + Prepends a \refKey{/tcb/watermark text on} the named \meta{part} of a break sequence. +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{watermark graphics app}{=\meta{file name}}{no default} + Appends a \refKey{/tcb/watermark graphics} referenced by \meta{file name} to the colored box. +\end{docTcbKey} + +\begin{docTcbKey}{watermark graphics pre}{=\meta{file name}}{no default} + Prepends a \refKey{/tcb/watermark graphics} referenced by \meta{file name} to the colored box. +\end{docTcbKey} + +\begin{docTcbKey}{watermark graphics app on}{=\meta{part} is \meta{file name}}{no default} + Appends a \refKey{/tcb/watermark graphics on} the named \meta{part} of a break sequence. + The picture is referenced by \meta{file name}. +\end{docTcbKey} + + +\begin{docTcbKey}{watermark graphics pre on}{=\meta{part} is \meta{file name}}{no default} + Prepends a \refKey{/tcb/watermark graphics on} the named \meta{part} of a break sequence. + The picture is referenced by \meta{file name}. +\end{docTcbKey} + + +\begin{docTcbKey}{watermark tikz app}{=\meta{graphical code}}{no default} + Appends a \refKey{/tcb/watermark tikz} with the given |tikz| \meta{graphical code} to the colored box. +\end{docTcbKey} + +\begin{docTcbKey}{watermark tikz pre}{=\meta{graphical code}}{no default} + Prepends a \refKey{/tcb/watermark tikz} with the given |tikz| \meta{graphical code} to the colored box. + +\begin{dispExample} +% \usepackage{tikz} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, + watermark color=Navy,watermark opacity=0.25, + smiley/.style={watermark tikz pre={% + \path[fill=yellow,draw=yellow!75!red] (0,0) circle (1cm); + \fill[red] (45:5mm) circle (1mm); + \fill[red] (135:5mm) circle (1mm); + \draw[line width=1mm,red] (215:5mm) arc (215:325:5mm);}}} + +\begin{tcolorbox}[enhanced,title=My title, watermark text=Watermark, + smiley] +\lipsum[1-2] +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{watermark tikz app on}{=\meta{part} is \meta{graphical code}}{no default} + Appends a \refKey{/tcb/watermark tikz on} the named \meta{part} of a break sequence. +\end{docTcbKey} + +\begin{docTcbKey}{watermark tikz pre on}{=\meta{part} is \meta{graphical code}}{no default} + Prepends a \refKey{/tcb/watermark tikz on} the named \meta{part} of a break sequence. +\end{docTcbKey} + + +\subsection{Skin Code} +The following option keys extend the options given in Subsection \ref{subsec:addcodeoptions} +from page \pageref{subsec:addcodeoptions}. + +\begin{marker} +The following code options are applicable only for skins which +use engines of type |freelance|. If you intend to add only a few things +to an existing skin, you should consider using overlays instead. +\end{marker} + +\begin{docTcbKey}{frame code app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/frame code}. +\end{docTcbKey} + +\begin{docTcbKey}{frame code pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/frame code}. +\end{docTcbKey} + +\begin{docTcbKey}{interior titled code app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/interior titled code}. +\begin{dispExample} +\begin{tcolorbox}[title=My title,freelance,colframe=Navy, + frame code app={\draw[yellow,line width=1cm] ( + frame.south west)--(frame.north east);}, + interior titled code app={\draw[red,line width=1cm] + (frame.north west)--(frame.south east);}, + ] +\lipsum[1] +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{interior titled code pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/interior titled code}. +\end{docTcbKey} + +\begin{docTcbKey}{interior code app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/interior code}. +\end{docTcbKey} + +\begin{docTcbKey}{interior code pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/interior code}. +\end{docTcbKey} + +\begin{docTcbKey}{segmentation code app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/segmentation code}. +\end{docTcbKey} + +\begin{docTcbKey}{segmentation code pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/segmentation code}. +\end{docTcbKey} + + +\begin{docTcbKey}{title code app}{=\meta{graphical code}}{no default} + Appends the given \meta{graphical code} to \refKey{/tcb/title code}. +\end{docTcbKey} + +\begin{docTcbKey}{title code pre}{=\meta{graphical code}}{no default} + Prepends the given \meta{graphical code} to \refKey{/tcb/title code}. +\end{docTcbKey} + + + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.index.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.index.tex new file mode 100644 index 00000000000..8348f4a842b --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.index.tex @@ -0,0 +1,3 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\printindex diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.intro.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.intro.tex new file mode 100644 index 00000000000..88b99c5db49 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.intro.tex @@ -0,0 +1,101 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\clearpage +\section{Introduction} +The package originates from the first edition of my book +\flqq{\citetitle{sturm:2012k}\frqq~\cite{sturm:2012k} +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. + +Starting with version 2.00, all internal calculations are not longer performed +by the package |calc| \cite{thorub:2007a} but +by $\varepsilon$-\TeX\ \cite{breitenlohner:1998a} expressions since +$\varepsilon$-\TeX\ is assumed to be used by everybody (hopefully). +The breaking news for version 2.00 is the support for breakable boxes. +This new feature allows new applications of the package without +affecting the core package too much if you do not need boxes to break automatically. + + +\subsection{Loading the Package} +The base package |tcolorbox| loads the packages +|pgf| \cite{tantau:2010c} 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} + + +\clearpage +\subsection{Libraries}\label{sec:bibliothek} +The base package |tcolorbox| is extendable by program libraries. +This is done by using 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]{listingsutf8}{}{no value} + Loads the packages |listings| \cite{heinz:2007a} and + |listingsutf8| \cite{oberdiek:2011a} for UTF-8 support. + This is a variant of the library 'listings' + and is 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} + +\begin{docTcbKey}[library]{skins}{}{no value} + Loads the package |tikz| \cite{tantau:2010c} and provides additional + styles (skins) for the appearance of the colored boxes; see + Section \ref{sec:skins} from page \pageref{sec:skins}. +\end{docTcbKey} + +\begin{docTcbKey}[library]{breakable}{}{no value} + Provides support for automatic box breaking from one page to another; + see Section \ref{sec:breakable} from page \pageref{sec:breakable}. +\end{docTcbKey} + +\begin{docTcbKey}[library]{hooks}{}{no value} + Extends several option keys to 'hookable' keys; + see Section \ref{sec:hooks} from page \pageref{sec:hooks}. +\end{docTcbKey} + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.listings.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.listings.tex new file mode 100644 index 00000000000..21fd295e39d --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.listings.tex @@ -0,0 +1,553 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\clearpage +\section{Library 'listings' / 'listingsutf8'}\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}. + +Alternatively, if your sources are encoded with UTF-8, you can use the support from +the package |listingsutf8| \cite{oberdiek:2011a} by loading the library +variant 'listingsutf8'. +\begin{dispListing} +\tcbuselibrary{listingsutf8} +\tcbset{listing utf8=latin1}% optional; 'latin1' is the default. +\end{dispListing} +This also loads the packages |listings| \cite{heinz:2007a} +and |listingsutf8| \cite{oberdiek:2011a}. + + + +\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 typeset 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!white,colframe=red!75!black} +This is a \LaTeX\ example which displays the text as source code +and in compiled form. +\end{tcblisting} +\end{dispExample} +{\tcbset{breakable}\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!white,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!white,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!white,colframe=red!75!black, +listing style=tcblatex} +Here, we use the predefined style. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{listing inputencoding}{=\meta{encoding}}{no default, initially \texttt{\cs inputencodingname}} + Sets the input encoding value for the predefined listing style |tcblatex| + and |tcbdocumentation| from the library 'documentation'. + The initial value is derived from the package |inputenc| if used. +\end{docTcbKey} + + +\begin{docTcbKey}{listing utf8}{=\meta{one-byte-encoding}}{style, no default, initially |latin1|} + Abbreviation for using \refKey{/tcb/listing inputencoding} + together with UTF-8 support from the package |listingsutf8| \cite{oberdiek:2011a}. + This option is available only for the library variant 'listingsutf8'. + The \meta{one-byte-encoding} is one of + the applicable encodings from \cite{oberdiek:2011a}, e.\,g.\ |latin1|. +\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!white,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!white,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!white,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!white,colframe=red!75!black,text only} +This is a \LaTeX\ example. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{comment}{=\meta{text}}{no default, initially empty} + Records a comment with \meta{text} as content. The comment is displayed + only in conjunction with \refKey{/tcb/listing and comment} + and \refKey{/tcb/comment and listing}. +\begin{dispExample} +\begin{tcblisting}{comment={This comment is really only a comment}, + colback=red!5!white,colframe=red!75!black} +This is a \textbf{tcolorbox}. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{listing and comment}{}{no value} + Typesets the environment content as listing in the upper part and + a given comment in the lower part. +\begin{dispExample} +\begin{tcblisting}{colback=red!5!white,colframe=red!75!black,listing and comment, + comment={This is my comment. It may contain line breaks.\par + It can even use the environment content + \flqq\ignorespaces\tcbuselistingtext\unskip\frqq}} +This is a \LaTeX\ example. +\end{tcblisting} +\end{dispExample} +\end{docTcbKey} + + + +\begin{docTcbKey}{comment and listing}{}{no value} + Typesets a given comment in the upper part and + the environment content as listing in the lower part. +\begin{dispExample} +\begin{tcblisting}{colback=red!5!white,colframe=red!75!black,comment and listing, +comment={This is my comment.}} +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} % preamble + +\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} % preamble + +\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 exercise 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 and 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 + + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.references.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.references.tex new file mode 100644 index 00000000000..8cfebb8cbe8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.references.tex @@ -0,0 +1,4 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\clearpage +\printbibliography[heading=bibintoc] diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.skins.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.skins.tex new file mode 100644 index 00000000000..6b331cc9413 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.skins.tex @@ -0,0 +1,1718 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\clearpage +\section{Library 'skins'}\label{sec:skins} +The library is loaded by a package option or inside the preamble by: +\begin{dispListing} +\tcbuselibrary{skins} +\end{dispListing} +This also loads the package |tikz| \cite{tantau:2010c}. Typically but not necessarily, +the following skins use |tikz| instead of |pgf|. + +\subsection{Technical Overview and Core Package Option Keys}\label{sec:skincorekeys} +From a technical point of view, a \emph{skin} is a style definition for the +appearance of a |tcolorbox|. The core package provides some additional +option keys for skins but only a single skin called \refSkin{standard}. +The 'skins' library adds several more skins. To change a skin, only one +option from the core package has to be set. + +\begin{docTcbKey}{skin}{=\meta{name}}{style, no default, initially \texttt{standard}} + Sets the current skin to \meta{name}. This is a style definition which sets all the following + keys, i.\,e.\ for many use cases there is nothing more to do. +\begin{dispExample} +\tcbset{colback=Salmon!50!white,colframe=FireBrick!75!black, + width=(\linewidth-8mm)/2,before=,after=\hfill,equal height group=ske} + +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox} +\begin{tcolorbox}[skin=beamer,beamer,adjusted title=My title] + This is my content. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{marker} + On first read, you may skip the rest of this subsection and proceed to + Subsection \ref{subsec:addstyleoptions} on page \pageref{subsec:addstyleoptions}. + All following keys in this subsection are automatically set by the selected skin + and you may never have to temper with them. + Nevertheless, they can be used after a skin was selected to modify + this skin. +\end{marker} + + +\begin{docTcbKey}{skin first}{=\meta{name}}{style, no default, initially \texttt{standard}} + If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, + then the skin for the \emph{first} part of the break sequence + is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}. + Typically, this key is set by a \refKey{/tcb/skin}. +\end{docTcbKey} + + +\begin{docTcbKey}{skin middle}{=\meta{name}}{style, no default, initially \texttt{standard}} + If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, + then the skin for the \emph{middle} parts (if any) of the break sequence + is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}. + Typically, this key is set by a \refKey{/tcb/skin}. +\end{docTcbKey} + + +\begin{docTcbKey}{skin last}{=\meta{name}}{style, no default, initially \texttt{standard}} + If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, + then the skin for the \emph{last} part of the break sequence + is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}. + Typically, this key is set by a \refKey{/tcb/skin}. +\end{docTcbKey} + + + + +\begin{docTcbKey}{graphical environment}{=\meta{name}}{no default, initially \texttt{pgfpicture}} + Sets the graphical environment for the |tcolorbox| to \meta{name}. + Feasible values are |pgfpicture| and |tikzpicture| or environments which + inherit from one of these two. This key is set by a \refKey{/tcb/skin} and + may seldom be used directly. +\end{docTcbKey} + +The skin of a |tcolorbox| is drawn by up to four \emph{engines}. +Afterwards, the text content is drawn which is not part of a skin. +The four steps are: +\begin{enumerate} +\item The \emph{frame} of the box. +\item The \emph{interior} of the box. The interior of a box with title is + drawn differently from a box without title. +\item The \emph{segmentation} (line) of the box, if there is a lower part. +\item The \emph{title area} of the box, if there is a title. +\end{enumerate} + +Every engine for the up to four steps can be set to one of the following types: +\begin{enumerate} +\item |standard|: the original code from the core package. +\item |path|: a |tikz| path which can be controlled by options. +\item |pathfirst|: a |tikz| path which can be controlled by options. +\item |pathmiddle|: a |tikz| path which can be controlled by options. +\item |pathlast|: a |tikz| path which can be controlled by options. +\item |freelance|: arbitrary user code. +\end{enumerate} +%\clearpage + +\begin{docTcbKey}{frame engine}{=\meta{name}}{no default, initially \texttt{standard}} + Sets the \emph{frame} drawing engine for a box to \meta{name}. + Typically, this key is set by a \refKey{/tcb/skin}. + Feasible values for \meta{name} are: + \begin{itemize} + \item |standard|: the original code from the core package, + \item |path|: a |tikz| path which is controlled by \refKey{/tcb/frame style}, + \item |pathfirst|: a |tikz| path which is controlled by \refKey{/tcb/frame style}, + \item |pathmiddle|: a |tikz| path which is controlled by \refKey{/tcb/frame style}, + \item |pathlast|: a |tikz| path which is controlled by \refKey{/tcb/frame style}, + \item |freelance|: arbitrary user code which is given by \refKey{/tcb/frame code}. + \end{itemize} +\end{docTcbKey} + +\begin{docTcbKey}{interior titled engine}{=\meta{name}}{no default, initially \texttt{standard}} + Sets the \emph{interior} drawing engine for a titled box to \meta{name}. + Typically, this key is set by a \refKey{/tcb/skin}. + Feasible values for \meta{name} are: + \begin{itemize} + \item |standard|: the original code from the core package, + \item |path|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, + \item |pathfirst|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, + \item |pathmiddle|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, + \item |pathlast|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, + \item |freelance|: arbitrary user code which is given by \refKey{/tcb/interior titled code}. + \end{itemize} +\end{docTcbKey} + +\begin{docTcbKey}{interior engine}{=\meta{name}}{no default, initially \texttt{standard}} + Sets the \emph{interior} drawing engine for an untitled box to \meta{name}. + Typically, this key is set by a \refKey{/tcb/skin}. + Feasible values for \meta{name} are: + \begin{itemize} + \item |standard|: the original code from the core package, + \item |path|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, + \item |pathfirst|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, + \item |pathmiddle|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, + \item |pathlast|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, + \item |freelance|: arbitrary user code which is given by \refKey{/tcb/interior code}. + \end{itemize} +\end{docTcbKey} + +\begin{docTcbKey}{segmentation engine}{=\meta{name}}{no default, initially \texttt{standard}} + Sets the \emph{segmentation} (line) drawing engine for a box to \meta{name}. + Typically, this key is set by a \refKey{/tcb/skin}. + Feasible values for \meta{name} are: + \begin{itemize} + \item |standard|: the original code from the core package, + \item |path|: a |tikz| path which is controlled by \refKey{/tcb/segmentation style}, + \item |freelance|: arbitrary user code which is given by \refKey{/tcb/segmentation code}. + \end{itemize} +\end{docTcbKey} + +\begin{docTcbKey}{title engine}{=\meta{name}}{no default, initially \texttt{standard}} + Sets the \emph{title area} drawing engine for a titled box to \meta{name}. + Typically, this key is set by a \refKey{/tcb/skin}. + Feasible values for \meta{name} are: + \begin{itemize} + \item |standard|: the original code from the core package, + \item |path|: a |tikz| path which is controlled by \refKey{/tcb/title style}, + \item |pathfirst|: a |tikz| path which is controlled by \refKey{/tcb/title style}, + \item |pathmiddle|: a |tikz| path which is controlled by \refKey{/tcb/title style}, + \item |pathlast|: a |tikz| path which is controlled by \refKey{/tcb/title style}, + \item |freelance|: arbitrary user code which is given by \refKey{/tcb/title code}. + \end{itemize} +\end{docTcbKey} + +\begin{docTcbKey}{geometry nodes}{\colOpt{=\meta{boolean value}}}{default |true|, initially |false|} + If set to |true|, up to four |tikz| nodes are defined for a |tcolorbox| + which are named |frame|, |interior|, |segmentation|, and |title|. These nodes + describe the boundaries of the equally named parts of a |tcolorbox|. + They are used by all engines of type |path| and they may be used by engines + of type |freelance|. Typically, this key is set by a \refKey{/tcb/skin}. +\begin{dispExample} +\tcbset{colback=Salmon!50!white,colframe=FireBrick!75!black, + width=(\linewidth-8mm)/2,before=,after=\hfill,equal height group=geon} + +\begin{tcolorbox}[adjusted title=The title] + The upper part.\tcblower The lower part. +\end{tcolorbox} +\begin{tcolorbox}[adjusted title=The title,skin=freelance, + frame code={\path[draw=red,fill=red!25] + (frame.south west) rectangle (frame.north east);}, + interior titled code={\path[draw=blue,fill=blue!25] + (interior.south west) rectangle (interior.north east);}, + segmentation code={\path[draw=green,fill=green!25] + (segmentation.south west) rectangle (segmentation.north east);}, + title code={\path[draw=black,fill=brown!75!black] + (title.south west) rectangle (title.north east);}] + The upper part.\tcblower The lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\subsection{Style Option Keys}\label{subsec:addstyleoptions} +The following style options are applicable for all skins which +use engines of type |path|, |pathfirst|, |pathmiddle|, or |pathlast|. +Especially, the skin \refSkin{enhanced} supports \emph{all} of them +and \refSkin{standard} \emph{none}. + +\begin{docTcbKey}{frame style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} + The \meta{\texttt{\upshape tikz} keys} are used inside the |tikz| path command + for drawing the \emph{frame} of the box.\\ + This option is available if the \refKey{/tcb/frame engine} is set to + |path|, |pathfirst|, |pathmiddle|, or |pathlast|. + It is \emph{not} available for |standard| and it \emph{may} be + applicable for |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title, + frame style={left color=red!75!black,right color=blue!75!black}] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{interior style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} + The \meta{\texttt{\upshape tikz} keys} are used inside the |tikz| path command + for drawing the \emph{interior} of the box. They are used for the titled + and for the untitled version as well.\\ + This option is available if the \refKey{/tcb/interior titled engine} + or \refKey{/tcb/interior engine} is set to + |path|, |pathfirst|, |pathmiddle|, or |pathlast|. + It is \emph{not} available for |standard| and it \emph{may} be + applicable for |freelance|. +\begin{dispExample} +\tcbset{colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title, + interior style={left color=red!20!white,right color=yellow!50!white}] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\clearpage +\begin{docTcbKey}{segmentation style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} + The \meta{\texttt{\upshape tikz} keys} are used inside the |tikz| path command + for drawing the \emph{segmentation} line of the box.\\ + This option is available if the \refKey{/tcb/segmentation engine} + is set to |path|. + It is \emph{not} available for |standard| and it \emph{may} be + applicable for |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title, + segmentation style={double=white,draw=blue,double distance=1pt,solid}] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{title style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} + The \meta{\texttt{\upshape tikz} keys} are used inside the |tikz| path command + for drawing the \emph{title area} of the box.\\ + This option is available if the \refKey{/tcb/title engine} is set to + |path|, |pathfirst|, |pathmiddle|, or |pathlast|. + It is \emph{not} available for |standard| and it \emph{may} be + applicable for |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,coltitle=blue!50!black, + fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title, + title style={left color=blue!15!yellow,right color=red!85!black}] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{colbacktitle}{=\meta{color}}{style, no default, initially unset} + Abbreviation for setting \refKey{/tcb/title style} to |fill=|\meta{color}. + This fills the background of the title area with the given \meta{color}.\\ + This option is available if the \refKey{/tcb/title engine} is set to + |path|, |pathfirst|, |pathmiddle|, or |pathlast|. + It is \emph{not} available for |standard| and it \emph{may} be + applicable for |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,coltitle=blue!50!black, + fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title,colbacktitle=yellow!50!white] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + + +\clearpage +\subsection{Code Option Keys}\label{subsec:addcodeoptions} +The following code options are applicable for all skins which +use engines of type |freelance|. +Especially, the skin \refSkin{freelance} supports \emph{all} of them, +\refSkin{standard} and \refSkin{enhanced} \emph{none} of them. + + +\begin{docTcbKey}{frame code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} + The given \meta{graphical code} is used for drawing the \emph{frame} of the box.\\ + This option is available only if the \refKey{/tcb/frame engine} is set to |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[freelance,frame code={ + \foreach \n in {north east,north west,south east,south west} + {\path [fill=red!75!black] (interior.\n) circle (3mm); }; }] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{interior titled code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} + The given \meta{graphical code} is used + for drawing the \emph{interior} of the box, if the box comes with a title.\\ + This option is available only if the \refKey{/tcb/interior titled engine} is set to |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[freelance,title=My title,interior titled code={ + \path[draw=red!5!white,line width=5mm,line cap=round] + ([xshift=3mm,yshift=-3mm]interior.north west) + --([xshift=-3mm,yshift=3mm]interior.south east) + ([xshift=3mm,yshift=3mm]interior.south west) + --([xshift=-3mm,yshift=-3mm]interior.north east);}] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{interior code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} + The given \meta{graphical code} is used + for drawing the \emph{interior} of the box, if the box is without a title.\\ + This option is available only if the \refKey{/tcb/interior engine} is set to |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black} + +\begin{tcolorbox}[freelance,interior code={ + \path[draw=red!5!white,line width=5mm,line cap=round] + ([xshift=3mm,yshift=-3mm]interior.north west) + --([xshift=-3mm,yshift=3mm]interior.south east) + ([xshift=3mm,yshift=3mm]interior.south west) + --([xshift=-3mm,yshift=-3mm]interior.north east);}] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{segmentation code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} + The given \meta{graphical code} is used for drawing the + \emph{segmentation} area of the box.\\ + This option is available only if the \refKey{/tcb/segmentation engine} is set to |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[freelance,title=My title,segmentation code={ + \path[top color=red!5!white,bottom color=red!5!white,middle color=blue] + (segmentation.south west) rectangle (segmentation.north east);}] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{title code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} + The given \meta{graphical code} is used for drawing the + \emph{title} area of the box.\\ + This option is available only if the \refKey{/tcb/title engine} is set to |freelance|. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, + coltitle=black} + +\begin{tcolorbox}[freelance,title=My title,title code={ + \path[draw=yellow,solid,decorate,line width=2mm, + decoration={coil,aspect=0,segment length=10.1mm}] + ([xshift=1mm]title.west) -- ([xshift=-1mm]title.east);}] +This is a \textbf{tcolorbox}. +\tcblower +This is the lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\clearpage +\subsection{Watermark Option Keys}\label{subsec:watermarks} +The following watermark options are applicable for all skins which +use |tikzpicture| as \refKey{/tcb/graphical environment}. +Therefore, the skin \refSkin{standard} does not support these watermarks, +but all other skins, e.\,g.\ \refSkin{enhanced}. + +\begin{marker} +The watermark options rely on the more general overlay options described in +Section \ref{subsec:overlays} from page \pageref{subsec:overlays}. +Therefore, \emph{watermarks} and \emph{overlays} cannot be used mixed. +But a mixture is possible with the 'hooks' library, see Section \ref{sec:hooks}. +\end{marker} + + +\begin{docTcbKey}{watermark text}{=\meta{text}}{no default, initially unset} + Writes some \meta{text} in the center of the interior region of a |tcolorbox|. + This \meta{text} is written \emph{after} the + frame and interior are drawn and \emph{before} the text content is drawn. + It is zoomed or stretched according the values of + \refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title,watermark text=My Watermark] +\lipsum[1] +\tcblower +\lipsum[2] +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{watermark text on}{=\meta{part} is \meta{text}}{no default, initially unset} + This option writes some \meta{text} in the center of the interior region of a |tcolorbox| + as described for \refKey{/tcb/watermark text}. + But this is done only for boxes named \meta{part} of a break sequence, see + \refKey{/tcb/breakable}.\\ + Feasible values for \meta{part} are: + \begin{itemize} + \item |broken|: all broken box parts, + \item |unbroken|: unbroken boxes only, + \item |first|: first parts of a break sequence, + \item |middle|: middle parts of a break sequence, + \item |last|: last parts of a break sequence, + \item |unbroken and first|: unbroken boxes and first parts of a break sequence, + \item |middle and last|: middle and last parts of a break sequence. + \end{itemize} +\end{docTcbKey} + + +\clearpage + + +\begin{docTcbKey}{watermark graphics}{=\meta{file name}}{no default, initially unset} + Draws an external picture referenced by \meta{file name} + in the center of the interior region of a |tcolorbox|. + The picture is drawn \emph{after} the + frame and interior are drawn and \emph{before} the text content is drawn. + It is zoomed or stretched according the values of + \refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title,watermark graphics=Basilica_5.png, + watermark opacity=0.15] +\lipsum[1-2] +\tcblower +This example uses a public domain picture from\\ +\url{http://commons.wikimedia.org/wiki/File:Basilica_5.png} +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + +\begin{docTcbKey}{watermark graphics on}{=\meta{part} is \meta{file name}}{no default, initially unset} + This option draws a picture referenced by \meta{file name} in the center of the interior region of a |tcolorbox| + as described for \refKey{/tcb/watermark graphics}. + But this is done only for boxes named \meta{part} of a break sequence, see + \refKey{/tcb/breakable}.\\ + Feasible values for \meta{part} are: + \begin{itemize} + \item |broken|: all broken box parts, + \item |unbroken|: unbroken boxes only, + \item |first|: first parts of a break sequence, + \item |middle|: middle parts of a break sequence, + \item |last|: last parts of a break sequence, + \item |unbroken and first|: unbroken boxes and first parts of a break sequence, + \item |middle and last|: middle and last parts of a break sequence. + \end{itemize} +\end{docTcbKey} + + + +\clearpage +\begin{docTcbKey}{watermark tikz}{=\meta{graphical code}}{no default, initially unset} + Draws the given |tikz| \meta{graphical code} + in the center of the interior region of a |tcolorbox|. + The code is executed \emph{after} the + frame and interior are drawn and \emph{before} the text content is drawn. + The result is zoomed or stretched according the values of + \refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title, + watermark tikz={\draw[line width=2mm] (interior) circle (1cm) + node{\fontfamily{ptm}\fontseries{b}\fontsize{20mm}{20mm}\selectfont ?};}] +\lipsum[1] +\tcblower +\lipsum[2] +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + + +\begin{docTcbKey}{watermark tikz on}{=\meta{part} is \meta{graphical code}}{no default, initially unset} + This option draws the given |tikz| \meta{graphical code} in the center of the interior region of a |tcolorbox| + as described for \refKey{/tcb/watermark tikz}. + But this is done only for boxes named \meta{part} of a break sequence, see + \refKey{/tcb/breakable}.\\ + Feasible values for \meta{part} are: + \begin{itemize} + \item |broken|: all broken box parts, + \item |unbroken|: unbroken boxes only, + \item |first|: first parts of a break sequence, + \item |middle|: middle parts of a break sequence, + \item |last|: last parts of a break sequence, + \item |unbroken and first|: unbroken boxes and first parts of a break sequence, + \item |middle and last|: middle and last parts of a break sequence. + \end{itemize} +\end{docTcbKey} + + +\begin{docTcbKey}{no watermark}{}{style, no default, initially set} + Removes the watermark if set before. This is an alias for + \refKey{/tcb/no overlay}. +\end{docTcbKey} + + +\clearpage +\begin{docTcbKey}{watermark opacity}{=\meta{fraction}}{no default, initially |1.00|} + Sets the opacity value $\in[0,1]$ for a watermark. +\begin{dispExample} +\tcbset{enhanced,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, + watermark text=Watermark,nobeforeafter,width=(\linewidth-2mm)/2} + +\begin{tcolorbox}[title=Opacity 1.00,watermark opacity=1.00] +\lipsum[2] +\end{tcolorbox}\hfill% +\begin{tcolorbox}[title=Opacity 0.50,watermark opacity=0.50] +\lipsum[2] +\end{tcolorbox}% +\end{dispExample} +\end{docTcbKey} + +\enlargethispage{5mm} +\begin{docTcbKey}{watermark zoom}{=\meta{fraction}}{no default, initially |0.75|} + Sets the zoom value for a watermark. The zoom respects the aspect ratio. + The value $1.0$ means to fill the whole box. +\begin{dispExample} +\tcbset{enhanced,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, + watermark text=Watermark,nobeforeafter,width=(\linewidth-2mm)/2} + +\begin{tcolorbox}[title=Zoom 1.00,watermark zoom=1.00] +\lipsum[2] +\end{tcolorbox}\hfill% +\begin{tcolorbox}[title=Zoom 0.50,watermark zoom=0.50] +\lipsum[2] +\end{tcolorbox}% +\end{dispExample} +\end{docTcbKey} + +\clearpage + +\begin{docTcbKey}{watermark stretch}{=\meta{fraction}}{no default, initially unset} + Sets the stretch value for a watermark. The stretch value is applied to width + and height in relation to the box dimensions. It does not respect the aspect ratio. + The value $1.0$ means to fill the whole box. +\begin{dispExample} +\tcbset{enhanced,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, + watermark graphics=Basilica_5.png,watermark opacity=0.15, + nobeforeafter,width=(\linewidth-2mm)/2} + +\begin{tcolorbox}[title=Stretch 1.00,watermark stretch=1.00] +\lipsum[2] +\end{tcolorbox}\hfill% +\begin{tcolorbox}[title=Stretch 0.50,watermark stretch=0.50] +\lipsum[2] +\end{tcolorbox}% +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{watermark color}{=\meta{color}}{no default, initially mixed background and frame color} + Sets the color for the watermark. +\begin{dispExample} +\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} + +\begin{tcolorbox}[enhanced,title=My title,watermark text=My Watermark, + watermark color=yellow!50!red] +\lipsum[1] +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + + + +\clearpage +\tcbset{skintable/.style={colframe=red!50!yellow!50!black, + colback=red!50!yellow!5!white,coltitle=red!50!yellow!3!white, + fonttitle=\bfseries,before=\par\smallskip, + title=Environment and engines for the skin '\texttt{#1}'}} + +\subsection{Skin 'standard'}\label{subsec:skinstandard} +\begin{marker}Note that the option keys \refKey{/tcb/frame style}, + \refKey{/tcb/interior style}, + \refKey{/tcb/segmentation style}, and + \refKey{/tcb/title style} are not be applicable to the standard skin. + Also, watermarks (see Subsection \ref{subsec:watermarks}) + are not usable with the standard skin. +\end{marker} + +\begin{docSkin}{standard} + This is the standard skin from the core package. All drawing engines + are set to type |standard|. The drawing is based on |pgf| commands and + does not need the |tikz| package. +\begin{tcolorbox}[skintable=standard] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |pgfpicture|\\ + \refKey{/tcb/frame engine}: \> |standard|\\ + \refKey{/tcb/interior titled engine}: \> |standard|\\ + \refKey{/tcb/interior engine}: \> |standard|\\ + \refKey{/tcb/segmentation engine}: \> |standard|\\ + \refKey{/tcb/title engine}: \> |standard| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + +\begin{docTcbKey}{standard}{}{style, no value} + This is an abbreviation for setting |skin=standard|. +\end{docTcbKey} + +\begin{dispExample} +\tcbset{standard,equal height group=standard, + colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\clearpage +\subsection{Skin family 'enhanced'} +\begin{marker} +If you like the standard appearance of a |tcolorbox| but you want to +have some 'enhanced' features, the |enhanced| skin is what you are looking for. +\end{marker} + +\begin{docSkin}{enhanced} + This skin translates the drawing commands of the core package into |tikz| + path commands. Therefore, it allows all |tikz| high level options for + these paths and has more flexibility compared to the \refSkin{standard} skin. + You pay for this with some prolonged compilation time. + The |tikz| path options can + be given with the option keys + \refKey{/tcb/frame style}, + \refKey{/tcb/interior style}, + \refKey{/tcb/segmentation style}, and + \refKey{/tcb/title style}. +\begin{tcolorbox}[skintable=enhanced] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |path|\\ + \refKey{/tcb/interior titled engine}: \> |path|\\ + \refKey{/tcb/interior engine}: \> |path|\\ + \refKey{/tcb/segmentation engine}: \> |path|\\ + \refKey{/tcb/title engine}: \> |path| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{docTcbKey}{enhanced}{}{style, no value} + This is an abbreviation for setting |skin=enhanced|. +\end{docTcbKey} + +\begin{dispExample} +\tcbset{enhanced,equal height group=enhanced, + colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + +\begin{dispExample} +% \usetikzlibrary{shadings} % preamble +\tcbset{skin=enhanced,fonttitle=\bfseries, + frame style={upper left=blue,upper right=red,lower left=yellow,lower right=green}, + interior style={white,opacity=0.5}, + segmentation style={black,solid,opacity=0.2,line width=1pt}} + +\begin{tcolorbox}[title=Nice box in rainbow colors] + With the 'enhanced' skin, it is quite easy to produce fancy looking effects. + \tcblower + Note that this is still a \texttt{tcolorbox}. +\end{tcolorbox} +\end{dispExample} + + +\begin{dispExample} +% \usetikzlibrary{shadows} % preamble +% \usetikzlibrary{decorations.pathmorphing} % preamble +\tcbset{skin=enhanced,fonttitle=\bfseries,boxrule=1mm, + frame style={draw=FireBrick,fill=Salmon,drop shadow}, + interior style={draw=FireBrick,top color=Salmon!10,bottom color=Salmon!20}, + segmentation style={draw=FireBrick,solid,decorate, + decoration={coil,aspect=0,segment length=10.1mm}}} + +\begin{tcblisting}{title=A listing box with shadow and some specials} +Of course, skins can be used for listings also. +\begin{equation} + \int\limits_1^2 \frac{1}{x}~dx = \ln(2). +\end{equation} +\end{tcblisting} +\end{dispExample} + +\clearpage + + +\begin{docCommand}{tcbline}{} + Sometimes, a line is only a line. With \refCom{tcblower} you separate + the box content into two functional units. |\tcbline| draws only a line + which looks like the segmentation line between upper and lower part. + Furthermore, you can use |\tcbline| more than just once. + |\tcbline| always uses the |path| drawing engine. Therefore, + the \refKey{/tcb/segmentation style} can be applied. + +\begin{dispExample} +\tcbset{enhanced,colframe=blue!50!black,colback=white} + +\begin{tcolorbox}[colupper=red!50!black,collower=green!50!black] +\lipsum[1] +\tcbline +\lipsum[2] +\tcblower +\lipsum[3] +\tcbline +\lipsum[4] +\end{tcolorbox} +\end{dispExample} +\end{docCommand} + + +\clearpage +\begin{docSkin}{enhancedfirst} +This is a flavor of \refSkin{enhanced} which is used as a \emph{first} part +in a break sequence for \refSkin{enhanced}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=enhancedfirst] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathfirst|\\ + \refKey{/tcb/interior titled engine}: \> |pathfirst|\\ + \refKey{/tcb/interior engine}: \> |pathfirst|\\ + \refKey{/tcb/segmentation engine}: \> |path|\\ + \refKey{/tcb/title engine}: \> |pathfirst| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{dispExample} +\tcbset{skin=enhancedfirst,equal height group=enhancedfirst, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + + +\clearpage +\begin{docSkin}{enhancedmiddle} +This is a flavor of \refSkin{enhanced} which is used as a \emph{middle} part +in a break sequence for \refSkin{enhanced}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=enhancedmiddle] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathmiddle|\\ + \refKey{/tcb/interior titled engine}: \> |pathmiddle|\\ + \refKey{/tcb/interior engine}: \> |pathmiddle|\\ + \refKey{/tcb/segmentation engine}: \> |path|\\ + \refKey{/tcb/title engine}: \> |pathmiddle| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{dispExample} +\tcbset{skin=enhancedmiddle,equal height group=enhancedmiddle, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\begin{docTcbKey}{marker}{}{style, no value} + This styles relies on the skin \refSkin{enhancedmiddle}. It is + intended to be used as an optical marker like a highlighter pen. +\begin{dispExample} +\begin{marker} +\lipsum[2] +\end{marker} +\end{dispExample} +\end{docTcbKey} + + + + +\clearpage +\begin{docSkin}{enhancedlast} +This is a flavor of \refSkin{enhanced} which is used as a \emph{last} part +in a break sequence for \refSkin{enhanced}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=enhancedlast] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathlast|\\ + \refKey{/tcb/interior titled engine}: \> |pathlast|\\ + \refKey{/tcb/interior engine}: \> |pathlast|\\ + \refKey{/tcb/segmentation engine}: \> |path|\\ + \refKey{/tcb/title engine}: \> |pathlast| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + +\begin{dispExample} +\tcbset{skin=enhancedlast,equal height group=enhancedlast, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + + + +\clearpage +\subsection{Skin 'freelance'} +\begin{docSkin}{freelance} + This skin gives full freedom for the appearance of the |tcolorbox|. + All drawing engines are set to type |freelance|; they use the |tikz| package + and compute the \refKey{/tcb/geometry nodes}. + This skin is useful for boxes which should differ much from the normal + appearance. Note that this difference has to be programmed by the user. + The drawing code can be given + with the following option keys. As default value, the code from the |standard| + skin is set. +\begin{tcolorbox}[skintable=freelance] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |freelance|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |freelance| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + +\begin{docTcbKey}{freelance}{}{style, no value} + This is an abbreviation for setting |skin=freelance|. +\end{docTcbKey} + +\begin{dispExample} +\tcbset{freelance,equal height group=freelance, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + +\clearpage +\begin{dispExample} + \tcbset{skin=freelance,boxrule=2mm,enlarge top by=2mm,enlarge bottom by=2mm, + enlarge left by=3mm,enlarge right by=3mm,width=\linewidth-6mm, + frame code={\path[top color=FireBrick,bottom color=FireBrick,middle color=FireBrick!50, + draw=FireBrick!75!black,double=Gold,rounded corners=1mm] + (frame.south west) -- ([xshift=-3mm]frame.west) -- (frame.north west) + -- ([yshift=2mm]frame.north) -- (frame.north east) -- ([xshift=3mm]frame.east) + -- (frame.south east) -- ([yshift=-2mm]frame.south) -- cycle;}, + interior titled code={\path[outer color=Gold,inner color=white,draw=Gold, + double=FireBrick!75!black,rounded corners=5mm] + (interior.south west) rectangle (interior.north east);}, + segmentation code={\path[draw=FireBrick,opacity=0.25] ([xshift=2cm]segmentation.west) + -- (segmentation.north) -- ([xshift=-2cm]segmentation.east) + -- (segmentation.south) -- cycle;}} + +\begin{tcolorbox}[title=My title] + This is the upper part. + \tcblower + This is the lower part. +\end{tcolorbox} +\end{dispExample} + +\clearpage +\subsection{Skin family 'bicolor'} +\begin{docSkin}{bicolor} + This skin is quite similar to the \refSkin{standard} and \refSkin{enhanced} skin. + But instead of a segmentation line, the optional lower part of the box is filled with a + different color or drawn with a different style. +\begin{tcolorbox}[skintable=bicolor] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |path|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |path| + \end{tabbing} +\end{tcolorbox} + \begin{itemize} + \item The most basic usage of this skin is to set the background color of + the lower part by \refKey{/tcb/colbacklower} and all other options like for + the \refSkin{standard} skin. +\begin{dispExample} +\begin{tcolorbox}[skin=bicolor,title=The title, + colframe=FireBrick!75!black,colback=Salmon!50!white,colbacklower=Salmon] + The upper part. + \tcblower + The lower part. +\end{tcolorbox} +\end{dispExample} + \item The more advanced usage of this skin is to apply the \refKey{/tcb/frame style} + and the \refKey{/tcb/interior style} like for + the \refSkin{enhanced} skin. Also, the \refKey{/tcb/segmentation style} can be + used, but it is applied to the whole lower part. +\begin{dispExample} +\begin{tcolorbox}[skin=bicolor,title=The title, + frame style={top color=FireBrick, + bottom color=FireBrick!15!white,draw=black}, + interior style={left color=Salmon,right color=Salmon!50!white}, + segmentation style={right color=Salmon,left color=Salmon!50!white}] + The upper part. + \tcblower + The lower part. +\end{tcolorbox} +\end{dispExample} + \end{itemize} +\end{docSkin} + +\begin{docTcbKey}{bicolor}{}{style, no value} + This is an abbreviation for setting |skin=bicolor|. +\end{docTcbKey} + + +\begin{dispExample} +\tcbset{bicolor,equal height group=bicolor, + colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + +\begin{docTcbKey}{colbacklower}{=\meta{color}}{no default, initially \texttt{black!15!white}} + Sets the background \meta{color} of the lower part. It depends on the skin, + if this value is used. +\end{docTcbKey} + +\begin{dispExample} +\tcbset{gitexample/.style={listing and comment,comment={#1}, + skin=bicolor,boxrule=1mm,fonttitle=\bfseries,coltitle=black, + frame style={draw=black,left color=Gold,right color=Goldenrod!50!Gold}, + colback=black,colbacklower=Goldenrod!75!Gold, + colupper=white,collower=black, + listing options={language={bash},aboveskip=0pt,belowskip=0pt,nolol, + basicstyle=\ttfamily\bfseries,extendedchars=true}}} + +\begin{tcblisting}{title={Snapshot of the staging area}, + gitexample={The option '-a' automatically stages all tracked and modified + files before the commit.\par + This can be combined with the message option '-m' + as seen in the third line.}} +git commit +git commit -a +git commit -am 'changes to my example' +\end{tcblisting} +\end{dispExample} + + +\clearpage + + +\begin{docSkin}{bicolorfirst} +This is a flavor of \refSkin{bicolor} which is used as a \emph{first} part +in a break sequence for \refSkin{bicolor}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=bicolorfirst] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathfirst|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |pathfirst| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + +\begin{dispExample} +\tcbset{skin=bicolorfirst,equal height group=bicolorfirst, + colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\clearpage +\begin{docSkin}{bicolormiddle} +This is a flavor of \refSkin{bicolor} which is used as a \emph{middle} part +in a break sequence for \refSkin{bicolor}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=bicolormiddle] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathmiddle|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |pathmiddle| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{dispExample} +\tcbset{skin=bicolormiddle,equal height group=bicolormiddle, + colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\clearpage +\begin{docSkin}{bicolorlast} +This is a flavor of \refSkin{bicolor} which is used as a \emph{last} part +in a break sequence for \refSkin{bicolor}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=bicolorlast] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathlast|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |pathlast| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{dispExample} +\tcbset{skin=bicolorlast,equal height group=bicolorlast, + colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + + +\clearpage +\subsection{Skin family 'beamer'} + +\begin{docSkin}{beamer} + This skin resembles boxes known from the |beamer| class and therefore is + called 'beamer'. It uses the normal colors from the core package but shades + them a little bit. To use this skin, the |tikz| libraries |shadings| + and |shadows| have to be included in the preamble by: +\begin{dispListing} +\usetikzlibrary{shadings,shadows} +\end{dispListing} +The appearance of the skin can be controlled by \refKey{/tcb/frame style} +and \refKey{/tcb/interior style}, if needed. Here, the \emph{segmentation} +cannot be controlled by a style. +\begin{tcolorbox}[skintable=beamer] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |path|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |path| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + + +\begin{docTcbKey}{beamer}{}{style, no value} + This is an abbreviation for setting |skin=beamer|. + \begin{marker}It also changes the geometry and some style options.\end{marker} +\end{docTcbKey} + + + +\begin{dispExample} +\tcbset{beamer,equal height group=beamer, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + + +\begin{dispExample} +\begin{tcolorbox}[beamer,colback=Salmon!50!white,colframe=FireBrick!75!black, + adjusted title=A colored box with the 'beamer' skin] +This box looks like a box provided by the \texttt{beamer} class. +\end{tcolorbox} +\end{dispExample} + + + + +\begin{docSkin}{beamerfirst} +This is a flavor of \refSkin{beamer} which is used as a \emph{first} part +in a break sequence for \refSkin{beamer}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=beamerfirst] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathfirst|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |pathfirst| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{dispExample} +\tcbset{beamer,skin=beamerfirst,equal height group=beamerfirst, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\clearpage + +\begin{docSkin}{beamermiddle} +This is a flavor of \refSkin{beamer} which is used as a \emph{middle} part +in a break sequence for \refSkin{beamer}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=beamermiddle] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathmiddle|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |pathmiddle| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{dispExample} +\tcbset{beamer,skin=beamermiddle,equal height group=beamermiddle, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\clearpage +\begin{docSkin}{beamerlast} +This is a flavor of \refSkin{beamer} which is used as a \emph{last} part +in a break sequence for \refSkin{beamer}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=beamerlast] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathlast|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |pathlast| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + +\begin{dispExample} +\tcbset{beamer,skin=beamerlast,equal height group=beamerlast, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + + +\clearpage +\subsection{Skin family 'widget'} +\begin{docSkin}{widget} + This skin uses the normal colors from the core package but shades + them a little bit. To use this skin, the |tikz| library |shadings| + has to be included in the preamble by: +\begin{dispListing} +\usetikzlibrary{shadings} +\end{dispListing} +The appearance of the skin can be controlled by \refKey{/tcb/frame style}, +\refKey{/tcb/interior style}, and \refKey{/tcb/segmentation style}, +if needed. +\begin{tcolorbox}[skintable=widget] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |path|\\ + \refKey{/tcb/interior titled engine}: \> |path|\\ + \refKey{/tcb/interior engine}: \> |path|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |freelance| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{docTcbKey}{widget}{}{style, no value} + This is an abbreviation for setting |skin=widget|. + \begin{marker}It also changes the geometry and some style options.\end{marker} +\end{docTcbKey} + + +\begin{dispExample} +\tcbset{widget,equal height group=widget, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\begin{dispExample} +\begin{tcolorbox}[widget,colback=Salmon!50!white,colframe=FireBrick!75!black, + adjusted title=A colored box with the 'widget' skin] +This is my content. +\end{tcolorbox} +\end{dispExample} + + + +\begin{docSkin}{widgetfirst} +This is a flavor of \refSkin{widget} which is used as a \emph{first} part +in a break sequence for \refSkin{widget}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=widgetfirst] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathfirst|\\ + \refKey{/tcb/interior titled engine}: \> |pathfirst|\\ + \refKey{/tcb/interior engine}: \> |pathfirst|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |freelance| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{dispExample} +\tcbset{widget,skin=widgetfirst,equal height group=widgetfirst, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + +\clearpage + +\begin{docSkin}{widgetmiddle} +This is a flavor of \refSkin{widget} which is used as a \emph{middle} part +in a break sequence for \refSkin{widget}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=widgetmiddle] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathmiddle|\\ + \refKey{/tcb/interior titled engine}: \> |pathmiddle|\\ + \refKey{/tcb/interior engine}: \> |pathmiddle|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |freelance| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + +\begin{dispExample} +\tcbset{widget,skin=widgetmiddle,equal height group=widgetmiddle, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\clearpage +\begin{docSkin}{widgetlast} +This is a flavor of \refSkin{widget} which is used as a \emph{last} part +in a break sequence for \refSkin{widget}. +Nevertheless, this skin can be applied independently. +\begin{tcolorbox}[skintable=widgetlast] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |pathlast|\\ + \refKey{/tcb/interior titled engine}: \> |pathlast|\\ + \refKey{/tcb/interior engine}: \> |pathlast|\\ + \refKey{/tcb/segmentation engine}: \> |freelance|\\ + \refKey{/tcb/title engine}: \> |freelance| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + + +\begin{dispExample} +\tcbset{widget,skin=widgetlast,equal height group=widgetlast, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\clearpage + +\subsection{Skin 'draft'}\label{subsec:draft} + +\begin{docSkin}{draft} + This skin is intended to be used while drafting new geometric settings + for a |tcolorbox|. +\begin{tcolorbox}[skintable=draft] + \begin{tabbing} + \refKey{/tcb/interior titled engine}: \=\kill + \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ + \refKey{/tcb/frame engine}: \> |freelance|\\ + \refKey{/tcb/interior titled engine}: \> |freelance|\\ + \refKey{/tcb/interior engine}: \> |freelance|\\ + \refKey{/tcb/segmentation engine}: \> |path|\\ + \refKey{/tcb/title engine}: \> |path| + \end{tabbing} +\end{tcolorbox} +\end{docSkin} + +\begin{docTcbKey}{draft}{}{style, no value} + This is an abbreviation for setting |skin=draft|. +\end{docTcbKey} + + +\begin{dispExample} +\tcbset{draft,equal height group=draft, + colback=LightGreen,colframe=DarkGreen, + width=(\linewidth-6mm)/4,nobeforeafter, + left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} +% +\begin{tcolorbox} + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox} + This is my content. + \tcblower + More content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. +\end{tcolorbox}\hfill +\begin{tcolorbox}[adjusted title=My title] + This is my content. + \tcblower + More content. +\end{tcolorbox} +\end{dispExample} + + +\begin{dispExample} +\vspace*{3mm} +\begin{tcolorbox}[draft,title=A colored box with the 'draft' skin] +\lipsum[1-3] +\tcblower +\lipsum[4-6] +\end{tcolorbox} +\end{dispExample} + + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.theorems.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.theorems.tex new file mode 100644 index 00000000000..c890a8a6223 --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.theorems.tex @@ -0,0 +1,404 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\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} +This also loads the package |amsmath|. + +\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} + + +\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} + +\clearpage +\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, + 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}{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} + + +\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 an example. +\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} + + +% +\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 section number. + +\begin{dispListing} +%\newcounter{mytheorem}[section] % preamble +\def\themytheorem{\thesection.\arabic{mytheorem}} + +\tcbset{ + defstyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape, + arc=0mm, colback=blue!5!white,colframe=blue!75!black}, + theostyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape, + colback=red!10!white,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,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} + +You need more attention for your theorems? Here, you are \ldots + +\begin{dispExample} +% tcbuselibrary{skins} % preamble +\begin{Theorem}[enhanced,frame style={circular glow={fill=yellow}}, + watermark color=red!35!white, + watermark text={Overacting\\Fundamental Theorem}]% + {Fundamental Theorem of Theorems}{fundamental}% + \lipsum[1-2] +\end{Theorem} +\end{dispExample} + + + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.verbatim.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.verbatim.tex new file mode 100644 index 00000000000..03494e42e1e --- /dev/null +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.verbatim.tex @@ -0,0 +1,57 @@ +% !TeX root = tcolorbox.tex +% include file of tcolorbox.tex (manual of the LaTeX package tcolorbox) +\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} + diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf Binary files differindex bd14a6815b8..0143cbf750b 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.pdf diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex index 3e850e0e023..fbd073bd790 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.tex @@ -1,5 +1,5 @@ % \LaTeX-Main\ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcolorbox.tex: Manual %% %% ------------------------------------------------------------------------------------------- @@ -49,15 +49,17 @@ \DeclareFieldFormat{url}{\newline\url{#1}}% \DeclareListFormat{language}{}% \setlength{\bibitemsep}{\smallskipamount} -\addbibresource{\jobname.bib} +\addbibresource{tcolorbox.doc.bib} \usetikzlibrary{shadings,shadows} \usetikzlibrary{decorations.pathmorphing} \usetikzlibrary{patterns} +\usepackage{array,tabularx} +\usepackage{amsmath} \usepackage{lipsum} -\usepackage[listings,theorems,documentation,skins,breakable]{tcolorbox} +\usepackage[listings,theorems,documentation,skins,breakable,hooks]{tcolorbox} \tcbset{skin=enhanced} \tcbmakedocSubKey{docTcbKey}{tcb} @@ -80,4635 +82,136 @@ pdfkeywords={colored boxes, LaTeX examples, theorems} } -\def\version{2.02}% -\def\datum{2013/03/13}% +\def\version{2.10}% +\def\datum{2013/04/09}% \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} - -\begin{tcolorbox}[breakable,skin=enhanced,title={Contents},fonttitle=\bfseries\Large, - colback=yellow!10!white,colframe=red!50!black,before=\par\bigskip\noindent, - watermark color=yellow!75!red!25!white, - watermark text={\bfseries\Large Contents}, - frame style={drop shadow} - ] -\makeatletter -\@starttoc{toc} -\makeatother -\end{tcolorbox} - -\clearpage -\section{Introduction} -The package originates from the first edition of my book -\flqq{\citetitle{sturm:2012k}\frqq~\cite{sturm:2012k} -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. - -Starting with version 2.00, all internal calculations are not longer performed -by the package |calc| \cite{thorub:2007a} but -by $\varepsilon$-\TeX\ \cite{breitenlohner:1998a} expressions since -$\varepsilon$-\TeX\ is assumed to be used by everybody (hopefully). -The breaking news for version 2.00 is the support for breakable boxes. -This new feature allows new applications of the package without -affecting the core package too much if you do not need boxes to break automatically. - - -\subsection{Loading the Package} -The base package |tcolorbox| loads the packages -|pgf| \cite{tantau:2010c} 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} - - -\clearpage -\subsection{Libraries}\label{sec:bibliothek} -The base package |tcolorbox| is extendable by program libraries. -This is done by using 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]{listingsutf8}{}{no value} - Loads the packages |listings| \cite{heinz:2007a} and - |listingsutf8| \cite{oberdiek:2011a} for UTF-8 support. - This is a variant of the library 'listings' - and is 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} - -\begin{docTcbKey}[library]{skins}{}{no value} - Loads the package |tikz| \cite{tantau:2010c} and provides additional - styles (skins) for the appearance of the colored boxes; see - Section \ref{sec:skins} from page \pageref{sec:skins}. -\end{docTcbKey} - -\begin{docTcbKey}[library]{breakable}{}{no value} - Provides support for automatic box breaking from one page to another; - see Section \ref{sec:breakable} from page \pageref{sec:breakable}. -\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!white,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. The upper and the lower part are treated - as separate functional units. If you only want to draw a line, see - \refCom{tcbline}. -\end{docCommand} - - -\clearpage -\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!white,colframe=red!75!black} -\end{dispListing} -\end{docCommand} - - -\begin{docCommand}{tcbox}{\oarg{options}\marg{box content}} - Creates a \refEnv{tcolorbox} which is fitted to the width of the given - \meta{box content}. In principal, most \meta{options} for a \refEnv{tcolorbox} - can be used for |tcbox| with some restrictions. A |tcbox| cannot have - a lower part and cannot be broken. - -\begin{dispExample} -\tcbset{colframe=blue!50!black,colback=white,colupper=red!50!black, - fonttitle=\bfseries,before=,after=} - -\tcbox{Hello World}\hfill -% -\tcbox[left=0mm,right=0mm,top=0mm,bottom=0mm,boxsep=0mm, - toptitle=0.5mm,bottomtitle=0.5mm,title=\centering My table]{% - \arrayrulecolor{blue!50!black}\renewcommand{\arraystretch}{1.2}% - \begin{tabular}{r|c|l} - One & Two & Three \\\hline\hline - Men & Mice & Lions \\\hline - Upper & Middle & Lower - \end{tabular}}\hfill -% -\tcbox[colback=blue!85!black, - left=0mm,right=0mm,top=0mm,bottom=0mm,boxsep=1mm,arc=0mm,boxrule=0.5pt, - title=\centering My picture]{% - \includegraphics[width=5cm]{Basilica_5.png}} -\end{dispExample} -\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:2012k} 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 given by \refKey{/tcb/adjust text}. - 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} - - -\begin{docTcbKey}{adjust text}{=\meta{text}}{no default, initially \texttt{\"Apgjy}} - This sets the reference text for \refKey{/tcb/adjusted title}. If your texts - never exceed '\"Apgjy' in depth and height you don't need to care about this option. -\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,colback=white] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part (but invisible). -\end{tcolorbox} - -\begin{tcolorbox}[lowerbox=ignored,colback=white] -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,colback=white] -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!white,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!white}} - 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!white}} - 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}{colupper}{=\meta{color}}{no default, initially \texttt{black}} - Sets the text \meta{color} of the upper part. -\begin{dispExample} -\begin{tcolorbox}[colupper=yellow,colback=blue!50,colframe=blue] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{collower}{=\meta{color}}{no default, initially \texttt{black}} - Sets the text \meta{color} of the lower part. -\begin{dispExample} -\begin{tcolorbox}[collower=yellow,colback=blue!50,colframe=blue] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{coltext}{=\meta{color}}{style, no default, initially \texttt{black}} - Sets the text \meta{color} of the box. This is an abbreviation for setting - |colupper| and |collower| to the same value. -\begin{dispExample} -\begin{tcolorbox}[coltext=yellow,colback=blue!50,colframe=blue] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\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} - - -\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} - -\bigskip -\begin{marker} - More color options are provided by using skins documented in - Section \ref{sec:skins} from page \pageref{sec:skins}. -\end{marker} - -\clearpage -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[width=\linewidth/2] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{toprule}{=\meta{length}}{no default, initially \texttt{0.5mm}} - Sets the line width of the top rule to \meta{length}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[toprule=3mm] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{bottomrule}{=\meta{length}}{no default, initially \texttt{0.5mm}} - Sets the line width of the bottom rule to \meta{length}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[bottomrule=3mm] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{leftrule}{=\meta{length}}{no default, initially \texttt{0.5mm}} - Sets the line width of the left rule to \meta{length}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[leftrule=3mm] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\clearpage -\begin{docTcbKey}{rightrule}{=\meta{length}}{no default, initially \texttt{0.5mm}} - Sets the line width of the right rule to \meta{length}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[rightrule=3mm] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\begin{docTcbKey}{titlerule}{=\meta{length}}{no default, initially \texttt{0.5mm}} - Sets the line width of the rule below the title to \meta{length}. -\begin{dispExample} -\tcbset{enhanced,colback=red!5!white,colframe=red!75!black, - colbacktitle=red!90!black} - -\begin{tcolorbox}[titlerule=3mm,title=This is the title] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{boxrule}{=\meta{length}}{style, no default, initially \texttt{0.5mm}} - Sets all rules of the frame to \meta{length}, i.\,e.\ - \refKey{/tcb/toprule}, \refKey{/tcb/bottomrule}, \refKey{/tcb/leftrule}, - \refKey{/tcb/rightrule}, and \refKey{/tcb/titlerule}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[boxrule=3mm] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\begin{docTcbKey}{arc}{=\meta{length}}{no default, initially \texttt{1mm}} - Sets the inner radius of the four frame arcs to \meta{length}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\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} - - -\begin{docTcbKey}{outer arc}{=\meta{length}}{no default, initially unset} - Sets the outer radius of the four frame arcs to \meta{length}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[arc=4mm,outer arc=1mm] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{auto outer arc}{}{no value, initially set} - Sets the outer radius of the four frame arcs automatically in - dependency of the inner radius given by \refKey{/tcb/arc}. -\end{docTcbKey} - - -\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} -\tcbset{colback=red!5!white,colframe=red!75!black,width=(\linewidth-4mm)/2, - before=,after=\hfill} - -\begin{tcolorbox}[boxsep=5mm] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\begin{tcolorbox}[boxsep=5mm,draft] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[leftupper=3cm,title=My Title] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\begin{docTcbKey}{leftlower}{=\meta{length}}{no default, initially \texttt{4mm}} - Sets the left space between lower text and frame (additional to |boxsep|). -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[leftlower=3cm] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\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} - - -\clearpage -\begin{docTcbKey}{rightlower}{=\meta{length}}{no default, initially \texttt{4mm}} - Sets the right space between lower text and frame (additional to |boxsep|). -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[top=0mm] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{toptitle}{=\meta{length}}{no default, initially \texttt{0mm}} - Sets the top space between title and frame (additional to |boxsep|). -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[toptitle=3mm,title=My title] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\clearpage -\begin{docTcbKey}{bottom}{=\meta{length}}{no default, initially \texttt{2mm}} - Sets the bottom space between text and frame (additional to |boxsep|). -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[bottom=0mm] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\begin{docTcbKey}{bottomtitle}{=\meta{length}}{no default, initially \texttt{0mm}} - Sets the bottom space between title and frame (additional to |boxsep|). -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[bottomtitle=3mm,title=My title] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\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} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[middle=0mm,boxsep=0mm] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\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. - -\bigskip -\begin{marker} - The height control keys are only applicable to unbreakable boxes. - If a box is set to be \refKey{/tcb/breakable}, the height is always - computed according to the \emph{natural height}. -\end{marker} -\bigskip - - -\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{Overlays}\label{subsec:overlays} -With an overlay, arbitrary \meta{graphical code} can be added to a -|tcolorbox|. This code is executed \emph{after} the frame and interior are -drawn and \emph{before} the text content is drawn. Therefore, you can -decorate the |tcolorbox| with your own extensions. -Common special cases are \emph{watermarks} which are implemented using overlays. -See Subsection \ref{subsec:watermarks} from page \pageref{subsec:watermarks} if -you want to add \emph{watermarks}. -\begin{marker} -If you use the core package only, the \meta{graphical code} has to be |pgf| code -and there is not much assistance for positioning. -Therefore, the usage of the \refKey{/tcb/enhanced} mode from the library skins -is recommended which allows |tikz| code and gives access to -\refKey{/tcb/geometry nodes} for positioning. -\end{marker} - -\begin{docTcbKey}{overlay}{=\meta{graphical code}}{no default, initially unset} - Adds \meta{graphical code} to the box drawing process. This \meta{graphical code} - is drawn \emph{after} the frame and interior and \emph{before} the text content. - -\begin{dispExample} -% \tcbuselibrary{skins} % preamble -\tcbset{frogbox/.style={enhanced,colback=green!10,colframe=green!65!black, - enlarge top by=5.5mm, - overlay={\foreach \x in {2cm,3.5cm} { - \begin{scope}[shift={([xshift=\x]frame.north west)}] - \path[draw=green!65!black,fill=green!10,line width=1mm] (0,0) arc (0:180:5mm); - \path[fill=black] (-0.2,0) arc (0:180:1mm); - \end{scope}}}]}} - -\begin{tcolorbox}[frogbox,title=My title] -This is a \textbf{tcolorbox}. -\end{tcolorbox} -\end{dispExample} - -\begin{dispExample} -% \usetikzlibrary{patterns} % preamble -% \tcbuselibrary{skins} % preamble -\tcbset{ribbonbox/.style={enhanced,colback=red!5!white,colframe=red!75!black, - fonttitle=\bfseries, - overlay={\path[fill=blue!75!white,draw=blue,double=white!85!blue, - preaction={opacity=0.6,fill=blue!75!white}, - line width=0.1mm,double distance=0.2mm, - pattern=fivepointed stars,pattern color=white!75!blue] - ([xshift=-0.2mm,yshift=-1.02cm]frame.north east) - -- ++(-1,1) -- ++(-0.5,0) -- ++(1.5,-1.5) -- cycle;}}} - -\begin{tcolorbox}[ribbonbox,title=My title] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\begin{docTcbKey}{no overlay}{}{style, no default, initially set} - Removes the overlay if set before. -\end{docTcbKey} - -\begin{docTcbKey}{overlay broken}{=\meta{graphical code}}{no default, initially unset} - If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, - then the \meta{graphical code} is added to the box drawing process. - \refKey{/tcb/overlay} overwrites this key. -\end{docTcbKey} - -\begin{docTcbKey}{overlay unbroken}{=\meta{graphical code}}{no default, initially unset} - If the box is set to be \refKey{/tcb/breakable} but \emph{is not} broken actually - or if the box is set to be \refKey{/tcb/unbreakable}, - then the \meta{graphical code} is added to the box drawing process. - \refKey{/tcb/overlay} overwrites this key. -\end{docTcbKey} - -\begin{docTcbKey}{overlay first}{=\meta{graphical code}}{no default, initially unset} - If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, - then the \meta{graphical code} is added to the box drawing process for - the \emph{first} part of the break sequence. - \refKey{/tcb/overlay} overwrites this key. -\end{docTcbKey} - -\begin{docTcbKey}{overlay middle}{=\meta{graphical code}}{no default, initially unset} - If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, - then the \meta{graphical code} is added to the box drawing process for - the \emph{middle} parts (if any) of the break sequence. - \refKey{/tcb/overlay} overwrites this key. -\end{docTcbKey} - -\begin{docTcbKey}{overlay last}{=\meta{graphical code}}{no default, initially unset} - If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, - then the \meta{graphical code} is added to the box drawing process for - the \emph{last} part of the break sequence. - \refKey{/tcb/overlay} overwrites this key. -\end{docTcbKey} - -\begin{docTcbKey}{overlay unbroken and first}{=\meta{graphical code}}{no default, initially unset} - This is an optimized abbreviation for setting - \refKey{/tcb/overlay unbroken} and - \refKey{/tcb/overlay first} together. - \refKey{/tcb/overlay} overwrites this key. -\end{docTcbKey} - -\begin{docTcbKey}{overlay middle and last}{=\meta{graphical code}}{no default, initially unset} - This is an optimized abbreviation for setting - \refKey{/tcb/overlay middle} and - \refKey{/tcb/overlay last} together. - \refKey{/tcb/overlay} overwrites this key. -\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} -\tcbset{enhanced,colback=red!5!white,colframe=red!75!black, - watermark color=red!15!white} - -\begin{tcolorbox}[floatplacement=t,float, - title=Floating box from |floatplacement|, - watermark text={I am floating}] - This floating box is placed at the top of a page. -\end{tcolorbox} -\end{dispListing} -\end{docTcbKey} -{\tcbusetemp} - - -\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|, - enhanced,watermark text={I'm also floating}] - This box floats to a feasible place automatically. You do not have to - use a numbering for this floating object. -\end{tcolorbox} -\end{dispListing} -\end{docTcbKey} -{\tcbusetemp} - - -\clearpage -\subsection{Embedding into the Surroundings} -Typically, but not necessarily, a |tcolorbox| is put inside a separate paragraph -and has some vertical space before and after it. -This behavior is controlled by the keys |before| and |after|. - -\begin{docTcbKey}{before}{=\meta{macros}}{no default, initially see \refKey{/tcb/autoparskip}} - 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 see \refKey{/tcb/autoparskip}} - 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 values which are - recommended, if the package |parskip| \emph{is} used and there is no better - idea for |before| and |after|. -\begin{dispListing} -\tcbset{parskip/.style={before={\par\pagebreak[0]\noindent}, - after={\par}}} -\end{dispListing} -\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} - -\begin{docTcbKey}{autoparskip}{}{style, no value, initially set} - Tries to detect the usage of the package |parskip| and sets - the keys |before| and |after| accordingly. Actually, the following is done: - \begin{itemize} - \item If the length of |\parskip| is greater than |0pt| at the begin of the document, - \refKey{/tcb/parskip} is executed. Here, the usage of package |parskip| is \emph{assumed}. - \item Otherwise, if the length of |\parskip| is not greater than |0pt| at the begin of the document, - \refKey{/tcb/noparskip} is executed. Here, the absence of package |parskip| is \emph{assumed}. - \end{itemize} - |autoparskip| is the default for the package |tcolorbox|, if |before| or |after| - are not changed otherwise. -\end{docTcbKey} - -\begin{docTcbKey}{nobeforeafter}{}{style, no value} - Abbreviation for clearing the keys |before| and |after|. The colored box - is not put into a paragraph and there is no space before or after the box. -\begin{dispExample} -\tcbset{myone/.style={colback=LightGreen,colframe=DarkGreen, - equal height group=nobefaf,width=\linewidth/4,nobeforeafter}} -\begin{tcolorbox}[myone,title=Box 1]Box 1\end{tcolorbox}% -\begin{tcolorbox}[myone,title=Box 2]Box 2\end{tcolorbox}% -\begin{tcolorbox}[myone,title=Box 3]Box 3\end{tcolorbox}% -\begin{tcolorbox}[myone,title=Box 4]Box 4\end{tcolorbox} -\end{dispExample} -\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} - -\clearpage - - -\subsection{Text Characteristics} -\begin{docTcbKey}{parbox}{\colOpt{=\meta{boolean value}}}{default |true|, initially |true|} - The text inside a |tcolorbox| is formatted using a \LaTeX\ |minipage| - if the box is unbreakable. If breakable, the box tries a mimicry of - a |minipage|. In a |minipage| or |parbox|, paragraphs are formatted slightly different - as the main text. If the key value is set to |false|, the normal main text - behavior is restored. In some situations, this has some unwanted side - effects. It is recommended to use this experimental setting only - where you really want to have this feature. -\end{docTcbKey} - -\begin{dispListing} -% \usepackage{lipsum} % preamble -\tcbset{width=(\linewidth-2mm)/2,nobeforeafter,arc=1mm, - colframe=blue!75!black,colback=white,fonttitle=\bfseries,fontupper=\small, - left=2mm,right=2mm,top=1mm,bottom=1mm,equal height group=parbox} - -\begin{tcolorbox}[parbox,adjusted title={parbox=true (normal)}] - \lipsum[1-2] -\end{tcolorbox}\hfill% -\begin{tcolorbox}[parbox=false,adjusted title={parbox=false}] - \lipsum[1-2] -\end{tcolorbox}% -\end{dispListing} -{\tcbusetemp} - -\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} - -\subsection{Skins} -There are additional option keys which change the appearance of a |tcolorbox|. -If only the core package is used, there is only one \emph{skin} and these -keys are meaningless. -The library 'skins' adds more skins. The appropriate option keys for skins of -the core package are therefore described in section \ref{sec:skincorekeys} from -page \pageref{sec:skincorekeys}. - - -\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' / 'listingsutf8'}\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}. - -Alternatively, if your sources are encoded with UTF-8, you can use the support from -the package |listingsutf8| \cite{oberdiek:2011a} by loading the library -variant 'listingsutf8'. -\begin{dispListing} -\tcbuselibrary{listingsutf8} -\tcbset{listing utf8=latin1}% optional; 'latin1' is the default. -\end{dispListing} -This also loads the packages |listings| \cite{heinz:2007a} -and |listingsutf8| \cite{oberdiek:2011a}. - - - -\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 typeset 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!white,colframe=red!75!black} -This is a \LaTeX\ example which displays the text as source code -and in compiled form. -\end{tcblisting} -\end{dispExample} -{\tcbset{breakable}\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!white,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!white,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!white,colframe=red!75!black, -listing style=tcblatex} -Here, we use the predefined style. -\end{tcblisting} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{listing inputencoding}{=\meta{encoding}}{no default, initially \texttt{\cs inputencodingname}} - Sets the input encoding value for the predefined listing style |tcblatex| - and |tcbdocumentation| from the library 'documentation'. - The initial value is derived from the package |inputenc| if used. -\end{docTcbKey} - - -\begin{docTcbKey}{listing utf8}{=\meta{one-byte-encoding}}{style, no default, initially |latin1|} - Abbreviation for using \refKey{/tcb/listing inputencoding} - together with UTF-8 support from the package |listingsutf8| \cite{oberdiek:2011a}. - This option is available only for the library variant 'listingsutf8'. - The \meta{one-byte-encoding} is one of - the applicable encodings from \cite{oberdiek:2011a}, e.\,g.\ |latin1|. -\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!white,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!white,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!white,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!white,colframe=red!75!black,text only} -This is a \LaTeX\ example. -\end{tcblisting} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\begin{docTcbKey}{comment}{=\meta{text}}{no default, initially empty} - Records a comment with \meta{text} as content. The comment is displayed - only in conjunction with \refKey{/tcb/listing and comment} - and \refKey{/tcb/comment and listing}. -\begin{dispExample} -\begin{tcblisting}{comment={This comment is really only a comment}, - colback=red!5!white,colframe=red!75!black} -This is a \textbf{tcolorbox}. -\end{tcblisting} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{listing and comment}{}{no value} - Typesets the environment content as listing in the upper part and - a given comment in the lower part. -\begin{dispExample} -\begin{tcblisting}{colback=red!5!white,colframe=red!75!black,listing and comment, - comment={This is my comment. It may contain line breaks.\par - It can even use the environment content - \flqq\ignorespaces\tcbuselistingtext\unskip\frqq}} -This is a \LaTeX\ example. -\end{tcblisting} -\end{dispExample} -\end{docTcbKey} - - - -\begin{docTcbKey}{comment and listing}{}{no value} - Typesets a given comment in the upper part and - the environment content as listing in the lower part. -\begin{dispExample} -\begin{tcblisting}{colback=red!5!white,colframe=red!75!black,comment and listing, -comment={This is my comment.}} -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 exercise 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 and 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!white,colframe=blue!75!black}, - theostyle/.style={fonttitle=\bfseries\upshape, fontupper=\slshape, - colback=red!10!white,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,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} - -You need more attention for your theorems? Here, you are \ldots - -\begin{dispExample} -% tcbuselibrary{skins} % preamble -\begin{Theorem}[enhanced,frame style={circular glow={fill=yellow}}, - watermark color=red!35!white, - watermark text={Overacting\\Fundamental Theorem}]% - {Fundamental Theorem of Theorems}{fundamental}% - \lipsum[1-2] -\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|. - -For UTF-8 support, load: -\begin{dispListing} - \tcbuselibrary{listingsutf8,documentation} -\end{dispListing} - - -\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}. - - -\clearpage -\section{Library 'skins'}\label{sec:skins} -The library is loaded by a package option or inside the preamble by: -\begin{dispListing} -\tcbuselibrary{skins} -\end{dispListing} -This also loads the package |tikz| \cite{tantau:2010c}. Typically but not necessarily, -the following skins use |tikz| instead of |pgf|. - -\subsection{Technical Overview and Core Package Option Keys}\label{sec:skincorekeys} -From a technical point of view, a \emph{skin} is a style definition for the -appearance of a |tcolorbox|. The core package provides some additional -option keys for skins but only a single skin called \refSkin{standard}. -The 'skins' library adds several more skins. To change a skin, only one -option from the core package has to be set. - -\begin{docTcbKey}{skin}{=\meta{name}}{style, no default, initially \texttt{standard}} - Sets the current skin to \meta{name}. This is a style definition which sets all the following - keys, i.\,e.\ for many use cases there is nothing more to do. -\begin{dispExample} -\tcbset{colback=Salmon!50!white,colframe=FireBrick!75!black, - width=(\linewidth-8mm)/2,before=,after=\hfill,equal height group=ske} - -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox} -\begin{tcolorbox}[skin=beamer,beamer,adjusted title=My title] - This is my content. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{marker} - On first read, you may skip the rest of this subsection and proceed to - Subsection \ref{subsec:addstyleoptions} on page \pageref{subsec:addstyleoptions}. - All following keys in this subsection are automatically set by the selected skin - and you may never have to temper with them. - Nevertheless, they can be used after a skin was selected to modify - this skin. -\end{marker} - - -\begin{docTcbKey}{skin first}{=\meta{name}}{style, no default, initially \texttt{standard}} - If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, - then the skin for the \emph{first} part of the break sequence - is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}. - Typically, this key is set by a \refKey{/tcb/skin}. -\end{docTcbKey} - - -\begin{docTcbKey}{skin middle}{=\meta{name}}{style, no default, initially \texttt{standard}} - If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, - then the skin for the \emph{middle} parts (if any) of the break sequence - is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}. - Typically, this key is set by a \refKey{/tcb/skin}. -\end{docTcbKey} - - -\begin{docTcbKey}{skin last}{=\meta{name}}{style, no default, initially \texttt{standard}} - If the box is set to be \refKey{/tcb/breakable} and \emph{is} broken actually, - then the skin for the \emph{last} part of the break sequence - is set to \meta{name}, see Subsection \ref{subsec:breaksequence} on page \pageref{subsec:breaksequence}. - Typically, this key is set by a \refKey{/tcb/skin}. -\end{docTcbKey} - - - - -\begin{docTcbKey}{graphical environment}{=\meta{name}}{no default, initially \texttt{pgfpicture}} - Sets the graphical environment for the |tcolorbox| to \meta{name}. - Feasible values are |pgfpicture| and |tikzpicture| or environments which - inherit from one of these two. This key is set by a \refKey{/tcb/skin} and - may seldom be used directly. -\end{docTcbKey} - -The skin of a |tcolorbox| is drawn by up to four \emph{engines}. -Afterwards, the text content is drawn which is not part of a skin. -The four steps are: -\begin{enumerate} -\item The \emph{frame} of the box. -\item The \emph{interior} of the box. The interior of a box with title is - drawn differently from a box without title. -\item The \emph{segmentation} (line) of the box, if there is a lower part. -\item The \emph{title area} of the box, if there is a title. -\end{enumerate} - -Every engine for the up to four steps can be set to one of the following types: -\begin{enumerate} -\item |standard|: the original code from the core package. -\item |path|: a |tikz| path which can be controlled by options. -\item |pathfirst|: a |tikz| path which can be controlled by options. -\item |pathmiddle|: a |tikz| path which can be controlled by options. -\item |pathlast|: a |tikz| path which can be controlled by options. -\item |freelance|: arbitrary user code. -\end{enumerate} -%\clearpage - -\begin{docTcbKey}{frame engine}{=\meta{name}}{no default, initially \texttt{standard}} - Sets the \emph{frame} drawing engine for a box to \meta{name}. - Typically, this key is set by a \refKey{/tcb/skin}. - Feasible values for \meta{name} are: - \begin{itemize} - \item |standard|: the original code from the core package, - \item |path|: a |tikz| path which is controlled by \refKey{/tcb/frame style}, - \item |pathfirst|: a |tikz| path which is controlled by \refKey{/tcb/frame style}, - \item |pathmiddle|: a |tikz| path which is controlled by \refKey{/tcb/frame style}, - \item |pathlast|: a |tikz| path which is controlled by \refKey{/tcb/frame style}, - \item |freelance|: arbitrary user code which is given by \refKey{/tcb/frame code}. - \end{itemize} -\end{docTcbKey} - -\begin{docTcbKey}{interior titled engine}{=\meta{name}}{no default, initially \texttt{standard}} - Sets the \emph{interior} drawing engine for a titled box to \meta{name}. - Typically, this key is set by a \refKey{/tcb/skin}. - Feasible values for \meta{name} are: - \begin{itemize} - \item |standard|: the original code from the core package, - \item |path|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, - \item |pathfirst|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, - \item |pathmiddle|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, - \item |pathlast|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, - \item |freelance|: arbitrary user code which is given by \refKey{/tcb/interior titled code}. - \end{itemize} -\end{docTcbKey} - -\begin{docTcbKey}{interior engine}{=\meta{name}}{no default, initially \texttt{standard}} - Sets the \emph{interior} drawing engine for an untitled box to \meta{name}. - Typically, this key is set by a \refKey{/tcb/skin}. - Feasible values for \meta{name} are: - \begin{itemize} - \item |standard|: the original code from the core package, - \item |path|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, - \item |pathfirst|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, - \item |pathmiddle|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, - \item |pathlast|: a |tikz| path which is controlled by \refKey{/tcb/interior style}, - \item |freelance|: arbitrary user code which is given by \refKey{/tcb/interior code}. - \end{itemize} -\end{docTcbKey} - -\begin{docTcbKey}{segmentation engine}{=\meta{name}}{no default, initially \texttt{standard}} - Sets the \emph{segmentation} (line) drawing engine for a box to \meta{name}. - Typically, this key is set by a \refKey{/tcb/skin}. - Feasible values for \meta{name} are: - \begin{itemize} - \item |standard|: the original code from the core package, - \item |path|: a |tikz| path which is controlled by \refKey{/tcb/segmentation style}, - \item |freelance|: arbitrary user code which is given by \refKey{/tcb/segmentation code}. - \end{itemize} -\end{docTcbKey} - -\begin{docTcbKey}{title engine}{=\meta{name}}{no default, initially \texttt{standard}} - Sets the \emph{title area} drawing engine for a titled box to \meta{name}. - Typically, this key is set by a \refKey{/tcb/skin}. - Feasible values for \meta{name} are: - \begin{itemize} - \item |standard|: the original code from the core package, - \item |path|: a |tikz| path which is controlled by \refKey{/tcb/title style}, - \item |pathfirst|: a |tikz| path which is controlled by \refKey{/tcb/title style}, - \item |pathmiddle|: a |tikz| path which is controlled by \refKey{/tcb/title style}, - \item |pathlast|: a |tikz| path which is controlled by \refKey{/tcb/title style}, - \item |freelance|: arbitrary user code which is given by \refKey{/tcb/title code}. - \end{itemize} -\end{docTcbKey} - -\begin{docTcbKey}{geometry nodes}{\colOpt{=\meta{boolean value}}}{default |true|, initially |false|} - If set to |true|, up to four |tikz| nodes are defined for a |tcolorbox| - which are named |frame|, |interior|, |segmentation|, and |title|. These nodes - describe the boundaries of the equally named parts of a |tcolorbox|. - They are used by all engines of type |path| and they may be used by engines - of type |freelance|. Typically, this key is set by a \refKey{/tcb/skin}. -\begin{dispExample} -\tcbset{colback=Salmon!50!white,colframe=FireBrick!75!black, - width=(\linewidth-8mm)/2,before=,after=\hfill,equal height group=geon} - -\begin{tcolorbox}[adjusted title=The title] - The upper part.\tcblower The lower part. -\end{tcolorbox} -\begin{tcolorbox}[adjusted title=The title,skin=freelance, - frame code={\path[draw=red,fill=red!25] - (frame.south west) rectangle (frame.north east);}, - interior titled code={\path[draw=blue,fill=blue!25] - (interior.south west) rectangle (interior.north east);}, - segmentation code={\path[draw=green,fill=green!25] - (segmentation.south west) rectangle (segmentation.north east);}, - title code={\path[draw=black,fill=brown!75!black] - (title.south west) rectangle (title.north east);}] - The upper part.\tcblower The lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\subsection{Style Option Keys}\label{subsec:addstyleoptions} -The following style options are applicable for all skins which -use engines of type |path|, |pathfirst|, |pathmiddle|, or |pathlast|. -Especially, the skin \refSkin{enhanced} supports \emph{all} of them -and \refSkin{standard} \emph{none}. - -\begin{docTcbKey}{frame style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} - The \meta{\texttt{\upshape tikz} keys} are used inside the |tikz| path command - for drawing the \emph{frame} of the box.\\ - This option is available if the \refKey{/tcb/frame engine} is set to - |path|, |pathfirst|, |pathmiddle|, or |pathlast|. - It is \emph{not} available for |standard| and it \emph{may} be - applicable for |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title, - frame style={left color=red!75!black,right color=blue!75!black}] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{interior style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} - The \meta{\texttt{\upshape tikz} keys} are used inside the |tikz| path command - for drawing the \emph{interior} of the box. They are used for the titled - and for the untitled version as well.\\ - This option is available if the \refKey{/tcb/interior titled engine} - or \refKey{/tcb/interior engine} is set to - |path|, |pathfirst|, |pathmiddle|, or |pathlast|. - It is \emph{not} available for |standard| and it \emph{may} be - applicable for |freelance|. -\begin{dispExample} -\tcbset{colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title, - interior style={left color=red!20!white,right color=yellow!50!white}] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\clearpage -\begin{docTcbKey}{segmentation style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} - The \meta{\texttt{\upshape tikz} keys} are used inside the |tikz| path command - for drawing the \emph{segmentation} line of the box.\\ - This option is available if the \refKey{/tcb/segmentation engine} - is set to |path|. - It is \emph{not} available for |standard| and it \emph{may} be - applicable for |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title, - segmentation style={double=white,draw=blue,double distance=1pt,solid}] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{title style}{=\meta{\texttt{\upshape tikz} keys}}{style, no default} - The \meta{\texttt{\upshape tikz} keys} are used inside the |tikz| path command - for drawing the \emph{title area} of the box.\\ - This option is available if the \refKey{/tcb/title engine} is set to - |path|, |pathfirst|, |pathmiddle|, or |pathlast|. - It is \emph{not} available for |standard| and it \emph{may} be - applicable for |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,coltitle=blue!50!black, - fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title, - title style={left color=blue!15!yellow,right color=red!85!black}] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\begin{docTcbKey}{colbacktitle}{=\meta{color}}{style, no default, initially unset} - Abbreviation for setting \refKey{/tcb/title style} to |fill=|\meta{color}. - This fills the background of the title area with the given \meta{color}.\\ - This option is available if the \refKey{/tcb/title engine} is set to - |path|, |pathfirst|, |pathmiddle|, or |pathlast|. - It is \emph{not} available for |standard| and it \emph{may} be - applicable for |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,coltitle=blue!50!black, - fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title,colbacktitle=yellow!50!white] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - - -\clearpage -\subsection{Code Option Keys}\label{subsec:addcodeoptions} -The following code options are applicable for all skins which -use engines of type |freelance|. -Especially, the skin \refSkin{freelance} supports \emph{all} of them, -\refSkin{standard} and \refSkin{enhanced} \emph{none} of them. - - -\begin{docTcbKey}{frame code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} - The given \meta{graphical code} is used for drawing the \emph{frame} of the box.\\ - This option is available only if the \refKey{/tcb/frame engine} is set to |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[freelance,frame code={ - \foreach \n in {north east,north west,south east,south west} - {\path [fill=red!75!black] (interior.\n) circle (3mm); }; }] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\begin{docTcbKey}{interior titled code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} - The given \meta{graphical code} is used - for drawing the \emph{interior} of the box, if the box comes with a title.\\ - This option is available only if the \refKey{/tcb/interior titled engine} is set to |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[freelance,title=My title,interior titled code={ - \path[draw=red!5!white,line width=5mm,line cap=round] - ([xshift=3mm,yshift=-3mm]interior.north west) - --([xshift=-3mm,yshift=3mm]interior.south east) - ([xshift=3mm,yshift=3mm]interior.south west) - --([xshift=-3mm,yshift=-3mm]interior.north east);}] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\begin{docTcbKey}{interior code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} - The given \meta{graphical code} is used - for drawing the \emph{interior} of the box, if the box is without a title.\\ - This option is available only if the \refKey{/tcb/interior engine} is set to |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black} - -\begin{tcolorbox}[freelance,interior code={ - \path[draw=red!5!white,line width=5mm,line cap=round] - ([xshift=3mm,yshift=-3mm]interior.north west) - --([xshift=-3mm,yshift=3mm]interior.south east) - ([xshift=3mm,yshift=3mm]interior.south west) - --([xshift=-3mm,yshift=-3mm]interior.north east);}] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - -\begin{docTcbKey}{segmentation code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} - The given \meta{graphical code} is used for drawing the - \emph{segmentation} area of the box.\\ - This option is available only if the \refKey{/tcb/segmentation engine} is set to |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[freelance,title=My title,segmentation code={ - \path[top color=red!5!white,bottom color=red!5!white,middle color=blue] - (segmentation.south west) rectangle (segmentation.north east);}] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\begin{docTcbKey}{title code}{\colOpt{=\meta{graphical code}}}{code, default from |standard|} - The given \meta{graphical code} is used for drawing the - \emph{title} area of the box.\\ - This option is available only if the \refKey{/tcb/title engine} is set to |freelance|. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, - coltitle=black} - -\begin{tcolorbox}[freelance,title=My title,title code={ - \path[draw=yellow,solid,decorate,line width=2mm, - decoration={coil,aspect=0,segment length=10.1mm}] - ([xshift=1mm]title.west) -- ([xshift=-1mm]title.east);}] -This is a \textbf{tcolorbox}. -\tcblower -This is the lower part. -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\clearpage -\subsection{Watermark Option Keys}\label{subsec:watermarks} -The following watermark options are applicable for all skins which -use |tikzpicture| as \refKey{/tcb/graphical environment}. -Therefore, the skin \refSkin{standard} does not support these watermarks, -but all other skins, e.\,g.\ \refSkin{enhanced}. - -\begin{marker} -The watermark options rely on the more general overlay options described in -Section \ref{subsec:overlays} from page \pageref{subsec:overlays}. -Therefore, \emph{watermarks} and \emph{overlays} cannot be used mixed. -\end{marker} - - -\begin{docTcbKey}{watermark text}{=\meta{text}}{no default, initially unset} - Writes some \meta{text} in the center of the interior region of a |tcolorbox|. - This \meta{text} is written \emph{after} the - frame and interior are drawn and \emph{before} the text content is drawn. - It is zoomed or stretched according the values of - \refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title,watermark text=My Watermark] -\lipsum[1] -\tcblower -\lipsum[2] -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{watermark text on}{=\meta{part} is \meta{text}}{no default, initially unset} - This option writes some \meta{text} in the center of the interior region of a |tcolorbox| - as described for \refKey{/tcb/watermark text}. - But this is done only for boxes named \meta{part} of a break sequence, see - \refKey{/tcb/breakable}.\\ - Feasible values for \meta{part} are: - \begin{itemize} - \item |broken|: all broken box parts, - \item |unbroken|: unbroken boxes only, - \item |first|: first parts of a break sequence, - \item |middle|: middle parts of a break sequence, - \item |last|: last parts of a break sequence, - \item |unbroken and first|: unbroken boxes and first parts of a break sequence, - \item |middle and last|: middle and last parts of a break sequence. - \end{itemize} -\end{docTcbKey} - - -\clearpage - - -\begin{docTcbKey}{watermark graphics}{=\meta{file name}}{no default, initially unset} - Draws an external picture referenced by \meta{file name} - in the center of the interior region of a |tcolorbox|. - The picture is drawn \emph{after} the - frame and interior are drawn and \emph{before} the text content is drawn. - It is zoomed or stretched according the values of - \refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title,watermark graphics=Basilica_5.png, - watermark opacity=0.15] -\lipsum[1-2] -\tcblower -This example uses a public domain picture from\\ -\url{http://commons.wikimedia.org/wiki/File:Basilica_5.png} -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - -\begin{docTcbKey}{watermark graphics on}{=\meta{part} is \meta{file name}}{no default, initially unset} - This option draws a picture referenced by \meta{file name} in the center of the interior region of a |tcolorbox| - as described for \refKey{/tcb/watermark graphics}. - But this is done only for boxes named \meta{part} of a break sequence, see - \refKey{/tcb/breakable}.\\ - Feasible values for \meta{part} are: - \begin{itemize} - \item |broken|: all broken box parts, - \item |unbroken|: unbroken boxes only, - \item |first|: first parts of a break sequence, - \item |middle|: middle parts of a break sequence, - \item |last|: last parts of a break sequence, - \item |unbroken and first|: unbroken boxes and first parts of a break sequence, - \item |middle and last|: middle and last parts of a break sequence. - \end{itemize} -\end{docTcbKey} - - - -\clearpage -\begin{docTcbKey}{watermark tikz}{=\meta{graphical code}}{no default, initially unset} - Draws the given |tikz| \meta{graphical code} - in the center of the interior region of a |tcolorbox|. - The code is executed \emph{after} the - frame and interior are drawn and \emph{before} the text content is drawn. - The result is zoomed or stretched according the values of - \refKey{/tcb/watermark zoom} or \refKey{/tcb/watermark stretch}. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title, - watermark tikz={\draw[line width=2mm] (interior) circle (1cm) - node{\fontfamily{ptm}\fontseries{b}\fontsize{20mm}{20mm}\selectfont ?};}] -\lipsum[1] -\tcblower -\lipsum[2] -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - - -\begin{docTcbKey}{watermark tikz on}{=\meta{part} is \meta{graphical code}}{no default, initially unset} - This option draws the given |tikz| \meta{graphical code} in the center of the interior region of a |tcolorbox| - as described for \refKey{/tcb/watermark tikz}. - But this is done only for boxes named \meta{part} of a break sequence, see - \refKey{/tcb/breakable}.\\ - Feasible values for \meta{part} are: - \begin{itemize} - \item |broken|: all broken box parts, - \item |unbroken|: unbroken boxes only, - \item |first|: first parts of a break sequence, - \item |middle|: middle parts of a break sequence, - \item |last|: last parts of a break sequence, - \item |unbroken and first|: unbroken boxes and first parts of a break sequence, - \item |middle and last|: middle and last parts of a break sequence. - \end{itemize} -\end{docTcbKey} - - -\begin{docTcbKey}{no watermark}{}{style, no default, initially set} - Removes the watermark if set before. This is an alias for - \refKey{/tcb/no overlay}. -\end{docTcbKey} - - -\clearpage -\begin{docTcbKey}{watermark opacity}{=\meta{fraction}}{no default, initially |1.00|} - Sets the opacity value $\in[0,1]$ for a watermark. -\begin{dispExample} -\tcbset{enhanced,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, - watermark text=Watermark,nobeforeafter,width=(\linewidth-2mm)/2} - -\begin{tcolorbox}[title=Opacity 1.00,watermark opacity=1.00] -\lipsum[2] -\end{tcolorbox}\hfill% -\begin{tcolorbox}[title=Opacity 0.50,watermark opacity=0.50] -\lipsum[2] -\end{tcolorbox}% -\end{dispExample} -\end{docTcbKey} - -\enlargethispage{5mm} -\begin{docTcbKey}{watermark zoom}{=\meta{fraction}}{no default, initially |0.75|} - Sets the zoom value for a watermark. The zoom respects the aspect ratio. - The value $1.0$ means to fill the whole box. -\begin{dispExample} -\tcbset{enhanced,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, - watermark text=Watermark,nobeforeafter,width=(\linewidth-2mm)/2} - -\begin{tcolorbox}[title=Zoom 1.00,watermark zoom=1.00] -\lipsum[2] -\end{tcolorbox}\hfill% -\begin{tcolorbox}[title=Zoom 0.50,watermark zoom=0.50] -\lipsum[2] -\end{tcolorbox}% -\end{dispExample} -\end{docTcbKey} - -\clearpage - -\begin{docTcbKey}{watermark stretch}{=\meta{fraction}}{no default, initially unset} - Sets the stretch value for a watermark. The stretch value is applied to width - and height in relation to the box dimensions. It does not respect the aspect ratio. - The value $1.0$ means to fill the whole box. -\begin{dispExample} -\tcbset{enhanced,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries, - watermark graphics=Basilica_5.png,watermark opacity=0.15, - nobeforeafter,width=(\linewidth-2mm)/2} - -\begin{tcolorbox}[title=Stretch 1.00,watermark stretch=1.00] -\lipsum[2] -\end{tcolorbox}\hfill% -\begin{tcolorbox}[title=Stretch 0.50,watermark stretch=0.50] -\lipsum[2] -\end{tcolorbox}% -\end{dispExample} -\end{docTcbKey} - -\begin{docTcbKey}{watermark color}{=\meta{color}}{no default, initially mixed background and frame color} - Sets the color for the watermark. -\begin{dispExample} -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,title=My title,watermark text=My Watermark, - watermark color=yellow!50!red] -\lipsum[1] -\end{tcolorbox} -\end{dispExample} -\end{docTcbKey} - - - -\clearpage -\tcbset{skintable/.style={colframe=red!50!yellow!50!black, - colback=red!50!yellow!5!white,coltitle=red!50!yellow!3!white, - fonttitle=\bfseries,before=\par\smallskip, - title=Environment and engines for the skin '\texttt{#1}'}} - -\subsection{Skin 'standard'}\label{subsec:skinstandard} -\begin{marker}Note that the option keys \refKey{/tcb/frame style}, - \refKey{/tcb/interior style}, - \refKey{/tcb/segmentation style}, and - \refKey{/tcb/title style} are not be applicable to the standard skin. - Also, watermarks (see Subsection \ref{subsec:watermarks}) - are not usable with the standard skin. -\end{marker} - -\begin{docSkin}{standard} - This is the standard skin from the core package. All drawing engines - are set to type |standard|. The drawing is based on |pgf| commands and - does not need the |tikz| package. -\begin{tcolorbox}[skintable=standard] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |pgfpicture|\\ - \refKey{/tcb/frame engine}: \> |standard|\\ - \refKey{/tcb/interior titled engine}: \> |standard|\\ - \refKey{/tcb/interior engine}: \> |standard|\\ - \refKey{/tcb/segmentation engine}: \> |standard|\\ - \refKey{/tcb/title engine}: \> |standard| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - -\begin{docTcbKey}{standard}{}{style, no value} - This is an abbreviation for setting |skin=standard|. -\end{docTcbKey} - -\begin{dispExample} -\tcbset{standard,equal height group=standard, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\clearpage -\subsection{Skin family 'enhanced'} -\begin{marker} -If you like the standard appearance of a |tcolorbox| but you want to -have some 'enhanced' features, the |enhanced| skin is what you are looking for. -\end{marker} - -\begin{docSkin}{enhanced} - This skin translates the drawing commands of the core package into |tikz| - path commands. Therefore, it allows all |tikz| high level options for - these paths and has more flexibility compared to the \refSkin{standard} skin. - You pay for this with some prolonged compilation time. - The |tikz| path options can - be given with the option keys - \refKey{/tcb/frame style}, - \refKey{/tcb/interior style}, - \refKey{/tcb/segmentation style}, and - \refKey{/tcb/title style}. -\begin{tcolorbox}[skintable=enhanced] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |path|\\ - \refKey{/tcb/interior titled engine}: \> |path|\\ - \refKey{/tcb/interior engine}: \> |path|\\ - \refKey{/tcb/segmentation engine}: \> |path|\\ - \refKey{/tcb/title engine}: \> |path| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{docTcbKey}{enhanced}{}{style, no value} - This is an abbreviation for setting |skin=enhanced|. -\end{docTcbKey} - -\begin{dispExample} -\tcbset{enhanced,equal height group=enhanced, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - -\begin{dispExample} -% \usetikzlibrary{shadings} % preamble -\tcbset{skin=enhanced,fonttitle=\bfseries, - frame style={upper left=blue,upper right=red,lower left=yellow,lower right=green}, - interior style={white,opacity=0.5}, - segmentation style={black,solid,opacity=0.2,line width=1pt}} - -\begin{tcolorbox}[title=Nice box in rainbow colors] - With the 'enhanced' skin, it is quite easy to produce fancy looking effects. - \tcblower - Note that this is still a \texttt{tcolorbox}. -\end{tcolorbox} -\end{dispExample} - - -\begin{dispExample} -% \usetikzlibrary{shadows} % preamble -% \usetikzlibrary{decorations.pathmorphing} % preamble -\tcbset{skin=enhanced,fonttitle=\bfseries,boxrule=1mm, - frame style={draw=FireBrick,fill=Salmon,drop shadow}, - interior style={draw=FireBrick,top color=Salmon!10,bottom color=Salmon!20}, - segmentation style={draw=FireBrick,solid,decorate, - decoration={coil,aspect=0,segment length=10.1mm}}} - -\begin{tcblisting}{title=A listing box with shadow and some specials} -Of course, skins can be used for listings also. -\begin{equation} - \int\limits_1^2 \frac{1}{x}~dx = \ln(2). -\end{equation} -\end{tcblisting} -\end{dispExample} - -\clearpage - - -\begin{docCommand}{tcbline}{} - Sometimes, a line is only a line. With \refCom{tcblower} you separate - the box content into two functional units. |\tcbline| draws only a line - which looks like the segmentation line between upper and lower part. - Furthermore, you can use |\tcbline| more than just once. - |\tcbline| always uses the |path| drawing engine. Therefore, - the \refKey{/tcb/segmentation style} can be applied. - -\begin{dispExample} -\tcbset{enhanced,colframe=blue!50!black,colback=white} - -\begin{tcolorbox}[colupper=red!50!black,collower=green!50!black] -\lipsum[1] -\tcbline -\lipsum[2] -\tcblower -\lipsum[3] -\tcbline -\lipsum[4] -\end{tcolorbox} -\end{dispExample} -\end{docCommand} - - -\clearpage -\begin{docSkin}{enhancedfirst} -This is a flavor of \refSkin{enhanced} which is used as a \emph{first} part -in a break sequence for \refSkin{enhanced}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=enhancedfirst] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathfirst|\\ - \refKey{/tcb/interior titled engine}: \> |pathfirst|\\ - \refKey{/tcb/interior engine}: \> |pathfirst|\\ - \refKey{/tcb/segmentation engine}: \> |path|\\ - \refKey{/tcb/title engine}: \> |pathfirst| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{dispExample} -\tcbset{skin=enhancedfirst,equal height group=enhancedfirst, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - - -\clearpage -\begin{docSkin}{enhancedmiddle} -This is a flavor of \refSkin{enhanced} which is used as a \emph{middle} part -in a break sequence for \refSkin{enhanced}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=enhancedmiddle] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathmiddle|\\ - \refKey{/tcb/interior titled engine}: \> |pathmiddle|\\ - \refKey{/tcb/interior engine}: \> |pathmiddle|\\ - \refKey{/tcb/segmentation engine}: \> |path|\\ - \refKey{/tcb/title engine}: \> |pathmiddle| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{dispExample} -\tcbset{skin=enhancedmiddle,equal height group=enhancedmiddle, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\begin{docTcbKey}{marker}{}{style, no value} - This styles relies on the skin \refSkin{enhancedmiddle}. It is - intended to be used as an optical marker like a highlighter pen. -\begin{dispExample} -\begin{marker} -\lipsum[2] -\end{marker} -\end{dispExample} -\end{docTcbKey} - - - - -\clearpage -\begin{docSkin}{enhancedlast} -This is a flavor of \refSkin{enhanced} which is used as a \emph{last} part -in a break sequence for \refSkin{enhanced}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=enhancedlast] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathlast|\\ - \refKey{/tcb/interior titled engine}: \> |pathlast|\\ - \refKey{/tcb/interior engine}: \> |pathlast|\\ - \refKey{/tcb/segmentation engine}: \> |path|\\ - \refKey{/tcb/title engine}: \> |pathlast| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - -\begin{dispExample} -\tcbset{skin=enhancedlast,equal height group=enhancedlast, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - - - -\clearpage -\subsection{Skin 'freelance'} -\begin{docSkin}{freelance} - This skin gives full freedom for the appearance of the |tcolorbox|. - All drawing engines are set to type |freelance|; they use the |tikz| package - and compute the \refKey{/tcb/geometry nodes}. - This skin is useful for boxes which should differ much from the normal - appearance. Note that this difference has to be programmed by the user. - The drawing code can be given - with the following option keys. As default value, the code from the |standard| - skin is set. -\begin{tcolorbox}[skintable=freelance] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |freelance|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |freelance| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - -\begin{docTcbKey}{freelance}{}{style, no value} - This is an abbreviation for setting |skin=freelance|. -\end{docTcbKey} - -\begin{dispExample} -\tcbset{freelance,equal height group=freelance, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - -\clearpage -\begin{dispExample} - \tcbset{skin=freelance,boxrule=2mm,enlarge top by=2mm,enlarge bottom by=2mm, - enlarge left by=3mm,enlarge right by=3mm,width=\linewidth-6mm, - frame code={\path[top color=FireBrick,bottom color=FireBrick,middle color=FireBrick!50, - draw=FireBrick!75!black,double=Gold,rounded corners=1mm] - (frame.south west) -- ([xshift=-3mm]frame.west) -- (frame.north west) - -- ([yshift=2mm]frame.north) -- (frame.north east) -- ([xshift=3mm]frame.east) - -- (frame.south east) -- ([yshift=-2mm]frame.south) -- cycle;}, - interior titled code={\path[outer color=Gold,inner color=white,draw=Gold, - double=FireBrick!75!black,rounded corners=5mm] - (interior.south west) rectangle (interior.north east);}, - segmentation code={\path[draw=FireBrick,opacity=0.25] ([xshift=2cm]segmentation.west) - -- (segmentation.north) -- ([xshift=-2cm]segmentation.east) - -- (segmentation.south) -- cycle;}} - -\begin{tcolorbox}[title=My title] - This is the upper part. - \tcblower - This is the lower part. -\end{tcolorbox} -\end{dispExample} - -\clearpage -\subsection{Skin family 'bicolor'} -\begin{docSkin}{bicolor} - This skin is quite similar to the \refSkin{standard} and \refSkin{enhanced} skin. - But instead of a segmentation line, the optional lower part of the box is filled with a - different color or drawn with a different style. -\begin{tcolorbox}[skintable=bicolor] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |path|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |path| - \end{tabbing} -\end{tcolorbox} - \begin{itemize} - \item The most basic usage of this skin is to set the background color of - the lower part by \refKey{/tcb/colbacklower} and all other options like for - the \refSkin{standard} skin. -\begin{dispExample} -\begin{tcolorbox}[skin=bicolor,title=The title, - colframe=FireBrick!75!black,colback=Salmon!50!white,colbacklower=Salmon] - The upper part. - \tcblower - The lower part. -\end{tcolorbox} -\end{dispExample} - \item The more advanced usage of this skin is to apply the \refKey{/tcb/frame style} - and the \refKey{/tcb/interior style} like for - the \refSkin{enhanced} skin. Also, the \refKey{/tcb/segmentation style} can be - used, but it is applied to the whole lower part. -\begin{dispExample} -\begin{tcolorbox}[skin=bicolor,title=The title, - frame style={top color=FireBrick, - bottom color=FireBrick!15!white,draw=black}, - interior style={left color=Salmon,right color=Salmon!50!white}, - segmentation style={right color=Salmon,left color=Salmon!50!white}] - The upper part. - \tcblower - The lower part. -\end{tcolorbox} -\end{dispExample} - \end{itemize} -\end{docSkin} - -\begin{docTcbKey}{bicolor}{}{style, no value} - This is an abbreviation for setting |skin=bicolor|. -\end{docTcbKey} - - -\begin{dispExample} -\tcbset{bicolor,equal height group=bicolor, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - -\begin{docTcbKey}{colbacklower}{=\meta{color}}{no default, initially \texttt{black!15!white}} - Sets the background \meta{color} of the lower part. It depends on the skin, - if this value is used. -\end{docTcbKey} - -\begin{dispExample} -\tcbset{gitexample/.style={listing and comment,comment={#1}, - skin=bicolor,boxrule=1mm,fonttitle=\bfseries,coltitle=black, - frame style={draw=black,left color=Gold,right color=Goldenrod!50!Gold}, - colback=black,colbacklower=Goldenrod!75!Gold, - colupper=white,collower=black, - listing options={language={bash},aboveskip=0pt,belowskip=0pt,nolol, - basicstyle=\ttfamily\bfseries,extendedchars=true}}} - -\begin{tcblisting}{title={Snapshot of the staging area}, - gitexample={The option '-a' automatically stages all tracked and modified - files before the commit.\par - This can be combined with the message option '-m' - as seen in the third line.}} -git commit -git commit -a -git commit -am 'changes to my example' -\end{tcblisting} -\end{dispExample} - - -\clearpage - - -\begin{docSkin}{bicolorfirst} -This is a flavor of \refSkin{bicolor} which is used as a \emph{first} part -in a break sequence for \refSkin{bicolor}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=bicolorfirst] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathfirst|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |pathfirst| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - -\begin{dispExample} -\tcbset{skin=bicolorfirst,equal height group=bicolorfirst, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\clearpage -\begin{docSkin}{bicolormiddle} -This is a flavor of \refSkin{bicolor} which is used as a \emph{middle} part -in a break sequence for \refSkin{bicolor}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=bicolormiddle] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathmiddle|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |pathmiddle| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{dispExample} -\tcbset{skin=bicolormiddle,equal height group=bicolormiddle, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\clearpage -\begin{docSkin}{bicolorlast} -This is a flavor of \refSkin{bicolor} which is used as a \emph{last} part -in a break sequence for \refSkin{bicolor}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=bicolorlast] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathlast|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |pathlast| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{dispExample} -\tcbset{skin=bicolorlast,equal height group=bicolorlast, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - - -\clearpage -\subsection{Skin family 'beamer'} - -\begin{docSkin}{beamer} - This skin resembles boxes known from the |beamer| class and therefore is - called 'beamer'. It uses the normal colors from the core package but shades - them a little bit. To use this skin, the |tikz| libraries |shadings| - and |shadows| have to be included in the preamble by: -\begin{dispListing} -\usetikzlibrary{shadings,shadows} -\end{dispListing} -The appearance of the skin can be controlled by \refKey{/tcb/frame style} -and \refKey{/tcb/interior style}, if needed. Here, the \emph{segmentation} -cannot be controlled by a style. -\begin{tcolorbox}[skintable=beamer] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |path|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |path| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - - -\begin{docTcbKey}{beamer}{}{style, no value} - This is an abbreviation for setting |skin=beamer|. - \begin{marker}It also changes the geometry and some style options.\end{marker} -\end{docTcbKey} - - - -\begin{dispExample} -\tcbset{beamer,equal height group=beamer, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - - -\begin{dispExample} -\begin{tcolorbox}[beamer,colback=Salmon!50!white,colframe=FireBrick!75!black, - adjusted title=A colored box with the 'beamer' skin] -This box looks like a box provided by the \texttt{beamer} class. -\end{tcolorbox} -\end{dispExample} - - - - -\begin{docSkin}{beamerfirst} -This is a flavor of \refSkin{beamer} which is used as a \emph{first} part -in a break sequence for \refSkin{beamer}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=beamerfirst] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathfirst|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |pathfirst| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{dispExample} -\tcbset{beamer,skin=beamerfirst,equal height group=beamerfirst, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\clearpage - -\begin{docSkin}{beamermiddle} -This is a flavor of \refSkin{beamer} which is used as a \emph{middle} part -in a break sequence for \refSkin{beamer}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=beamermiddle] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathmiddle|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |pathmiddle| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{dispExample} -\tcbset{beamer,skin=beamermiddle,equal height group=beamermiddle, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\clearpage -\begin{docSkin}{beamerlast} -This is a flavor of \refSkin{beamer} which is used as a \emph{last} part -in a break sequence for \refSkin{beamer}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=beamerlast] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathlast|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |pathlast| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - -\begin{dispExample} -\tcbset{beamer,skin=beamerlast,equal height group=beamerlast, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - - -\clearpage -\subsection{Skin family 'widget'} -\begin{docSkin}{widget} - This skin uses the normal colors from the core package but shades - them a little bit. To use this skin, the |tikz| library |shadings| - has to be included in the preamble by: -\begin{dispListing} -\usetikzlibrary{shadings} -\end{dispListing} -The appearance of the skin can be controlled by \refKey{/tcb/frame style}, -\refKey{/tcb/interior style}, and \refKey{/tcb/segmentation style}, -if needed. -\begin{tcolorbox}[skintable=widget] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |path|\\ - \refKey{/tcb/interior titled engine}: \> |path|\\ - \refKey{/tcb/interior engine}: \> |path|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |freelance| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{docTcbKey}{widget}{}{style, no value} - This is an abbreviation for setting |skin=widget|. - \begin{marker}It also changes the geometry and some style options.\end{marker} -\end{docTcbKey} - - -\begin{dispExample} -\tcbset{widget,equal height group=widget, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\begin{dispExample} -\begin{tcolorbox}[widget,colback=Salmon!50!white,colframe=FireBrick!75!black, - adjusted title=A colored box with the 'widget' skin] -This is my content. -\end{tcolorbox} -\end{dispExample} - - - -\begin{docSkin}{widgetfirst} -This is a flavor of \refSkin{widget} which is used as a \emph{first} part -in a break sequence for \refSkin{widget}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=widgetfirst] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathfirst|\\ - \refKey{/tcb/interior titled engine}: \> |pathfirst|\\ - \refKey{/tcb/interior engine}: \> |pathfirst|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |freelance| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{dispExample} -\tcbset{widget,skin=widgetfirst,equal height group=widgetfirst, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - -\clearpage - -\begin{docSkin}{widgetmiddle} -This is a flavor of \refSkin{widget} which is used as a \emph{middle} part -in a break sequence for \refSkin{widget}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=widgetmiddle] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathmiddle|\\ - \refKey{/tcb/interior titled engine}: \> |pathmiddle|\\ - \refKey{/tcb/interior engine}: \> |pathmiddle|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |freelance| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - -\begin{dispExample} -\tcbset{widget,skin=widgetmiddle,equal height group=widgetmiddle, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\clearpage -\begin{docSkin}{widgetlast} -This is a flavor of \refSkin{widget} which is used as a \emph{last} part -in a break sequence for \refSkin{widget}. -Nevertheless, this skin can be applied independently. -\begin{tcolorbox}[skintable=widgetlast] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |pathlast|\\ - \refKey{/tcb/interior titled engine}: \> |pathlast|\\ - \refKey{/tcb/interior engine}: \> |pathlast|\\ - \refKey{/tcb/segmentation engine}: \> |freelance|\\ - \refKey{/tcb/title engine}: \> |freelance| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - - -\begin{dispExample} -\tcbset{widget,skin=widgetlast,equal height group=widgetlast, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\clearpage - -\subsection{Skin 'draft'}\label{subsec:draft} - -\begin{docSkin}{draft} - This skin is intended to be used while drafting new geometric settings - for a |tcolorbox|. -\begin{tcolorbox}[skintable=draft] - \begin{tabbing} - \refKey{/tcb/interior titled engine}: \=\kill - \refKey{/tcb/graphical environment}: \> |tikzpicture|\\ - \refKey{/tcb/frame engine}: \> |freelance|\\ - \refKey{/tcb/interior titled engine}: \> |freelance|\\ - \refKey{/tcb/interior engine}: \> |freelance|\\ - \refKey{/tcb/segmentation engine}: \> |path|\\ - \refKey{/tcb/title engine}: \> |path| - \end{tabbing} -\end{tcolorbox} -\end{docSkin} - -\begin{docTcbKey}{draft}{}{style, no value} - This is an abbreviation for setting |skin=draft|. -\end{docTcbKey} - - -\begin{dispExample} -\tcbset{draft,equal height group=draft, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/4,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox} - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox} - This is my content. - \tcblower - More content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. -\end{tcolorbox}\hfill -\begin{tcolorbox}[adjusted title=My title] - This is my content. - \tcblower - More content. -\end{tcolorbox} -\end{dispExample} - - -\begin{dispExample} -\vspace*{3mm} -\begin{tcolorbox}[draft,title=A colored box with the 'draft' skin] -\lipsum[1-3] -\tcblower -\lipsum[4-6] -\end{tcolorbox} -\end{dispExample} - - -\clearpage -\section{Library 'breakable'}\label{sec:breakable} -The library is loaded by a package option or inside the preamble by: -\begin{dispListing} -\tcbuselibrary{breakable} -\end{dispListing} - -\subsection{Technical Overview} -The library 'breakable' supports the automatic breaking of a |tcolorbox|. -This feature is enabled by \refKey{/tcb/breakable} -and disabled by \refKey{/tcb/unbreakable}. - -{ -\tcbset{colframe=Navy,colback=AliceBlue,fonttitle=\bfseries, - watermark color=AliceBlue!85!Navy,enhanced} -If a |tcolorbox| is set to be \refKey{/tcb/breakable}, then the following -algorithm is executed: -\begin{enumerate} -\item The box content is read to a box register similar but not identical - to the unbreakable case. -\item If the total box fits into the current page, it is shipped out visibly - unbroken and the algorithm stops. - \begin{tcolorbox}[title=Unbroken Box,watermark text=unbroken] - The box. - \end{tcolorbox} -\item Otherwise, it is checked if at least \refKey{/tcb/lines before break} - of the upper box can be placed on the current page. - If not, a page break is inserted and the algorithm goes back to Step 2. -\item Now, the \emph{break sequence} starts. - The upper box part or the lower box part is split such that it fits - into the current page. The fitting part is named \emph{first part} of - the \emph{break sequence} and shipped out. - \begin{tcolorbox}[title=Broken Box,watermark text=first,skin=enhancedfirst] - The box. - \end{tcolorbox} -\item - If the remaining content of the total box - fits into the current page, the algorithm continues with Step 7, else - with Step 6. -\item - The upper box part or the lower box part is split such that it fits - into the current page. The fitting part is named \emph{middle part} of - the \emph{break sequence} and shipped out. - Then, the algorithm goes back to Step 5. - \begin{tcolorbox}[watermark text=middle,skin=enhancedmiddle] - The box. - \end{tcolorbox} -\item - The remaining part is named \emph{last part} of - the \emph{break sequence} and shipped out. The algorithm stops. - \begin{tcolorbox}[watermark text=last,skin=enhancedlast] - The box. - \end{tcolorbox} -\end{enumerate} -} - -The algorithm takes care that the optional segmentation line never appears at -the end of a box. The optional lower box part is also checked to -have at least \refKey{/tcb/lines before break}. - -\clearpage -In principal, all boxes of the \emph{break sequence} share the same geometric -parameters. The differences are: -\begin{itemize} -\item The given \refKey{/tcb/before} and \refKey{/tcb/after} values are - used only before the \emph{first} and after the \emph{last} part - of the \emph{break sequence}. -\item A special behavior between the parts of the \emph{break sequence} can - be given by \refKey{/tcb/toprule at break}, - \refKey{/tcb/bottomrule at break}, - \refKey{/tcb/enlarge top at break by}, and - \refKey{/tcb/enlarge bottom at break by}. -\item The \refKey{/tcb/skin} decides \emph{how} the \emph{first}, \emph{middle}, - and \emph{last} part look like. Actually, every part type has its own - skin given by the options \refKey{/tcb/skin first}, \refKey{/tcb/skin middle}, and - \refKey{/tcb/skin last}. Typically, these options are set automatically by - the main skin, see Subsection \ref{subsec:breaksequence} from - page \pageref{subsec:breaksequence}. -\end{itemize} - - -\subsection{Limitations and Known Bugs} -\begin{itemize} -\item The box content is a \TeX\ |\vbox| register which has a - restricted capacity. Therefore, you cannot place hundreds of pages - inside a |tcolorbox|. -\item Footnotes can be used inside an \refKey{/tcb/unbreakable} box - but not inside a \refKey{/tcb/breakable} box, even if it is not broken - actually. Other different behaviors may and will be effective. -\item You can nest an unbreakable |tcolorbox| inside another |tcolorbox|, - even inside a breakable one. But you should not nest a breakable box - inside a breakable box since this will give a mess. Inside a breakable box, - the further breaking is disabled by default. If you really want to or - have to use the keys \refKey{/tcb/breakable} or \refKey{/tcb/unbreakable} - inside the content of an outer |tcolorbox|, you have to guard this with a - \TeX\ group. -\item If your text content contains some text color changing commands, - your color will not survive the break to the next box\footnote{The reason is that - I am to dumb to catch the current color at the split point. If you know the trick, - let me know.}. -\end{itemize} - - -\clearpage -\subsection{Main Option Keys} -\begin{docTcbKey}{breakable}{}{no value} - Allows the |tcolorbox| to be breakable. If the box is larger than the - available space at the current page, the box is automatically broken - and continued to the next next page. All sorts of |tcolorbox| can be made - breakable. It depends on the skin how the breaking looks like. - If you do not know better, use \refKey{/tcb/enhanced} for breaking a box. - The parts of the \emph{break sequence} are numbered - by the counter |tcbbreakpart|. - \begin{dispListing} - % \usepackage{lipsum} % preamble - \tcbset{colback=red!5!white,colframe=red!75!black, - watermark color=yellow!25!white,watermark text=\arabic{tcbbreakpart}, - fonttitle=\bfseries} - - \begin{tcolorbox}[breakable,enhanced,title=My breakable box] - \lipsum[1-6] - \end{tcolorbox} - \end{dispListing} -\end{docTcbKey} -{\tcbusetemp} - - -\begin{docTcbKey}{unbreakable}{}{no value, initially set} - Sets the |tcolorbox| to be unbreakable. -\end{docTcbKey} - - -\begin{docTcbKey}{title after break}{=\meta{text}}{no default, initially empty} - The \refKey{/tcb/title} is used only for the \emph{first} part of a - \emph{break sequence}. Use |title after break| to create a heading line - with \meta{text} as content for all following parts. -\end{docTcbKey} - - -\begin{docTcbKey}{notitle after break}{}{no value, initially set} - Removes the title line or following parts in a \emph{break sequence} if set before. -\end{docTcbKey} - - -\begin{docTcbKey}{adjusted title after break}{=\meta{text}}{style, no default, initially unset} - Works like \refKey{/tcb/adjusted title} but applied to \refKey{/tcb/title after break}. -\end{docTcbKey} - - -\begin{docTcbKey}{lines before break}{=\meta{number}}{no default, initially |2|} - Assures that the given \meta{number} of lines of the upper box part or - the lower box part are placed before a break happens. -\end{docTcbKey} - - - -\begin{docTcbKey}{shrink break goal}{=\meta{length}}{no default, initially |0pt|} - This is an emergency parameter if the break algorithm produces unpleasant - breaks. It shrinks the goal height of the current box part by \meta{length} - which may result in smaller boxes. Never use negative values. -\end{docTcbKey} - - -\clearpage -\subsection{Option Keys for the Break Appearance} - -\begin{docTcbKey}{toprule at break}{=\meta{length}}{no default, initially \texttt{0.5mm}} - Sets the line width of the top rule to \meta{length} \emph{if} the box is \refKey{/tcb/breakable}. - In this case, it is applied to \emph{middle} and \emph{last} parts in a - break sequence. Note that \refKey{/tcb/toprule} overwrites this value - if used afterwards. -\end{docTcbKey} - - -\begin{docTcbKey}{bottomrule at break}{=\meta{length}}{no default, initially \texttt{0.5mm}} - Sets the line width of the bottom rule to \meta{length} \emph{if} the box is \refKey{/tcb/breakable}. - In this case, it is applied to \emph{first} and \emph{middle} parts in a - break sequence. Note that \refKey{/tcb/bottomrule} overwrites this value - if used afterwards. -\end{docTcbKey} - - - - -\begin{docTcbKey}{topsep at break}{=\meta{length}}{no default, initially \texttt{0mm}} - Additional vertical space of \meta{length} which is added at the top of - \emph{middle} and \emph{last} parts in a break sequence. In general, - it is not advisable to change this value if these parts start with a rule or a title. -\end{docTcbKey} - -\begin{docTcbKey}{bottomsep at break}{=\meta{length}}{no default, initially \texttt{0mm}} - Additional vertical space of \meta{length} which is added at the bottom of - \emph{first} and \emph{middle} parts in a break sequence. - In general, it is not advisable to change this value if these parts end with a rule. -\end{docTcbKey} - -\begin{docTcbKey}{pad before break}{=\meta{length}}{style, no default, initially \texttt{3.5mm}} - Sets the total amount of vertical space after the text content and before the - break point to \meta{length}. This style sets \refKey{/tcb/toprule at break} to |0pt| - and changes \refKey{/tcb/topsep at break} as required. - In general, it is not advisable to change this value if the - \emph{middle} and \emph{last} parts in a break sequence start with a rule or a title. -\end{docTcbKey} - -\begin{docTcbKey}{pad after break}{=\meta{length}}{style, no default, initially \texttt{3.5mm}} - Sets the total amount of vertical space after the break point and before the - text content to \meta{length}. This style sets \refKey{/tcb/bottomrule at break} to |0pt| - and changes \refKey{/tcb/bottomsep at break} as required. - In general, it is not advisable to change this value if the - \emph{first} and \emph{middle} parts in a break sequence end with a rule. -\end{docTcbKey} - -\begin{docTcbKey}{pad at break}{=\meta{length}}{style, no default, initially \texttt{3.5mm}} - Abbreviation for setting \meta{length} to \refKey{/tcb/pad before break} - and \refKey{/tcb/pad after break}. -\end{docTcbKey} - - -\begin{dispListing} -% \usepackage{lipsum} % preamble -\tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries} - -\begin{tcolorbox}[enhanced,breakable,pad at break=0mm, - title={For this box, the pad space at the break point is set to 0mm}] - \lipsum[1-2] -\end{tcolorbox} -\end{dispListing} -{\tcbusetemp} - - - -\begin{docTcbKey}{enlarge top at break by}{=\meta{length}}{no default, initially \texttt{0mm}} - Enlarges the bounding box distance to the top of the box by \meta{length} - \emph{if} the box is \refKey{/tcb/breakable}. - In this case, it is applied to \emph{middle} and \emph{last} parts in a - break sequence. - \refKey{/tcb/enlarge top by} overwrites this key. -\end{docTcbKey} - - -\begin{docTcbKey}{enlarge bottom at break by}{=\meta{length}}{no default, initially \texttt{0mm}} - Enlarges the bounding box distance to the bottom of the box by \meta{length} - \emph{if} the box is \refKey{/tcb/breakable}. - In this case, it is applied to \emph{first} and \emph{middle} parts in a - break sequence. \refKey{/tcb/enlarge bottom by} overwrites this key. -\end{docTcbKey} - - -\clearpage -\subsection{Break Sequence for the Skins}\label{subsec:breaksequence} -The following diagrams document the \emph{break sequence} for different -skins. Depending on the main skin of a |tcolorbox|, the actual skins of -the \emph{break sequence} parts are displayed. - -\def\tcbbreakskininto#1#2#3#4#5{% -\begin{center}\begin{tikzpicture} -\tcbset{width=5cm,colframe=Navy,colback=AliceBlue,fonttitle=\bfseries, - watermark color=AliceBlue!85!Navy,#5 +\lstdefinestyle{mydocumentation}{style=tcbdocumentation, + classoffset=0, + texcsstyle=\color{blue}, + % LaTeX and other packages + moretexcs={arrayrulecolor,draw,includegraphics,ifthenelse,isodd,lipsum,path,pgfkeysalso}, + classoffset=1, + % tcolorbox macros + moretexcs={% core + endtcolorbox,endtcbverbatimwrite, + tcblower,tcbox,tcbset,tcbuselibrary,tcolorbox,tcbverbatimwrite, + % listings + endtcblisting, + tcblisting,tcbinputlisting,tcbuselistingtext,tcbuselistinglisting,tcbusetemplisting, + % theorems + tcbmaketheorem,tcboxmath,tcbhighmath, + % documentation + brackets, + colDef,colOpt,cs, + docAuxCommand,docColor, + meta,marg, + oarg, + refCom,refEnv,refKey, + tcbmakedocSubKey, + % skins + tcbline, + }, + texcsstyle=\color{Definition}\bfseries, + classoffset=2, + keywordstyle=\color{Option}\bfseries, + % tcolorbox options + morekeywords={% core + adjusted,adjust,after,arc,auto,autoparskip, + before,bottom,boxsep,boxrule,bottomtitle,bottomrule,broken, + collower,coltext,coltitle,colback,colframe,colupper,center, + equal,enlarge,enlargement,extrude, + fontupper,fontlower,fonttitle,first,floatplacement,float, + group, + height, + lowerbox,left,leftrule,lefttitle,leftupper,leftlower,lower,last, + middle,minimum, + notitle,natural,noparskip,nobeforeafter, + parskip,parbox, + outer,oversize,overlay, + right,rightrule,righttitle,rightupper,rightlower, + savelowerto,savedelimiter,space,split,shrink, + title,top,toptitle,toprule,titlerule,tabularx,tikz,toggle,tight,tempfile,text, + upper,unbroken, + valign, + width, + % listings + comment, + file, + inputencoding, + listing, + options, + style, + utf, + % theorems + ams,align, + equation, + gather, + highlight, + math, + nodisplayskip, + theorem, + % documentation + actual, + color,colors, + docexample,documentation,definition,default, + example,english,environment,environments, + german, + hyperlink, + key, + index, + level,language, + pageshort, + option, + quote, + settings, + % skins + beamer,bicolor, + colbacktitle,code,colbacklower, + draft, + enhanced,engine, + frame,freelance, + graphical,geometry,graphics, + interior, + opacity, + nodes, + skin,segmentation,stretch,standard, + titled, + watermark,widget, + zoom, + % breakable + breakable,break, + goal, + pad, + unbreakable, + % hooks + app,pre, + }, + classoffset=0% restore default } -\node[above] (unbroken) at (0,0) {\begin{tcolorbox}[title=Unbroken Box,skin=#1,watermark text=unbroken,height=3.8cm] -\texttt{skin=#1} -\end{tcolorbox}}; -\node[above] (first) at (8,2.4) {\begin{tcolorbox}[title=Broken Boxes,skin=#2,watermark text=first,height=1.4cm] -\texttt{skin=#2} -\end{tcolorbox}}; -\node[above] (middle) at (8,1.2) {\begin{tcolorbox}[skin=#3,watermark text=middle,height=1cm] -\texttt{skin=#3} -\end{tcolorbox}}; -\node[above] (last) at (8,0) {\begin{tcolorbox}[skin=#4,watermark text=last,height=1cm] -\texttt{skin=#4} -\end{tcolorbox}}; -\path[draw=FireBrick,line width=2pt,->] (unbroken) edge (first.west) edge (middle.west) edge (last.west); -\end{tikzpicture}\end{center}} - -\tcbbreakskininto{standard}{standard}{standard}{standard}{watermark text/.style={}} -\tcbbreakskininto{enhanced}{enhancedfirst}{enhancedmiddle}{enhancedlast}{} -\tcbbreakskininto{enhancedfirst}{enhancedfirst}{enhancedmiddle}{enhancedmiddle}{} -\tcbbreakskininto{enhancedmiddle}{enhancedmiddle}{enhancedmiddle}{enhancedmiddle}{} -\tcbbreakskininto{enhancedlast}{enhancedmiddle}{enhancedmiddle}{enhancedlast}{} -\tcbbreakskininto{freelance}{freelance}{freelance}{freelance}{} -\tcbbreakskininto{bicolor}{bicolorfirst}{bicolormiddle}{bicolorlast}{bicolor} -\tcbbreakskininto{bicolorfirst}{bicolorfirst}{bicolormiddle}{bicolormiddle}{bicolor} -\tcbbreakskininto{bicolormiddle}{bicolormiddle}{bicolormiddle}{bicolormiddle}{bicolor} -\tcbbreakskininto{bicolorlast}{bicolormiddle}{bicolormiddle}{bicolorlast}{bicolor} -\tcbbreakskininto{beamer}{beamerfirst}{beamermiddle}{beamerlast}{beamer} -\tcbbreakskininto{beamerfirst}{beamerfirst}{beamermiddle}{beamermiddle}{beamer} -\tcbbreakskininto{beamermiddle}{beamermiddle}{beamermiddle}{beamermiddle}{beamer} -\tcbbreakskininto{beamerlast}{beamermiddle}{beamermiddle}{beamerlast}{beamer} -\clearpage -\tcbbreakskininto{widget}{widgetfirst}{widgetmiddle}{widgetlast}{widget} -\tcbbreakskininto{widgetfirst}{widgetfirst}{widgetmiddle}{widgetmiddle}{widget} -\tcbbreakskininto{widgetmiddle}{widgetmiddle}{widgetmiddle}{widgetmiddle}{widget} -\tcbbreakskininto{widgetlast}{widgetmiddle}{widgetmiddle}{widgetlast}{widget} -\tcbbreakskininto{draft}{draft}{draft}{draft}{draft} +\tcbset{documentation listing style=mydocumentation} -\clearpage -\subsection{Break by Hand (Faked Break)} -Since the appearance of broken boxes is done by skins, it is quite easy -to 'fake a break'. For this, you actually don't need the 'breakable' library at -all. - -\begin{dispExample} -\tcbset{enhanced,equal height group=fakedbreak, - colback=LightGreen,colframe=DarkGreen,colbacklower=LimeGreen!75!LightGreen, - width=(\linewidth-6mm)/3,nobeforeafter, - left=1mm,right=1mm,top=1mm,bottom=1mm,middle=1mm} -% -\begin{tcolorbox}[title=My broken box,skin=enhancedfirst] -This is a box which breaks from one column to another -\end{tcolorbox}\hfill -\begin{tcolorbox}[skin=enhancedmiddle] -column. I am sorry to say that this is a trick. -Nevertheless, you may use this trick for your -\end{tcolorbox}\hfill -\begin{tcolorbox}[skin=enhancedlast] -own purposes. -\end{tcolorbox} -\end{dispExample} - - - - -% 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/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/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/sturm}, - year = 2010, - language = {german} -} - -@book{sturm:2012k, - author = {Thomas F. Sturm}, - title = {\LaTeX\ -- Einführung in das Textsatzsystem}, - publisher = {Regionales Rechenzentrum für Niedersachsen (RRZN)}, - address = {Hannover}, - edition = 9, - series = {RRZN-Handb\"ucher}, - url = {http://www.rrzn.uni-hannover.de/buch.html?&titel=latex}, - date = {2012-05}, - 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} -} - -@manual{breitenlohner:1998a, - author = {Peter Breitenlohner}, - title = {The $\varepsilon$-\TeX\ manual}, - version = {2}, - url = {http://ftp.gwdg.de/pub/ctan/systems/e-tex/v2/doc/etex_man.pdf}, - date = {1998-02}, -} - -@manual{oberdiek:2011a, - author = {Heiko Oberdiek}, - title = {The listingsutf8 package}, - url = {http://mirror.ctan.org/macros/latex/contrib/oberdiek/listingsutf8.pdf}, - date = {2011-11-10}, -} - -\end{tcbverbatimwrite} - -\clearpage -\printbibliography[heading=bibintoc] - -\printindex +%\includeonly{tcolorbox.doc.hooks} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{document} +\include{tcolorbox.doc.abstract} +\include{tcolorbox.doc.intro} +\include{tcolorbox.doc.coremacros} +\include{tcolorbox.doc.coreoptions} +\include{tcolorbox.doc.verbatim} +\include{tcolorbox.doc.listings} +\include{tcolorbox.doc.theorems} +\include{tcolorbox.doc.documentation} +\include{tcolorbox.doc.skins} +\include{tcolorbox.doc.breakable} +\include{tcolorbox.doc.hooks} +\include{tcolorbox.doc.references} +\include{tcolorbox.doc.index} \end{document} diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex index 0a84e4088b4..839e5139259 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbbreakable.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcbbreakable.code.tex: Code for breakable colorboxes %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex index ddcafbbea23..2402acaffc9 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbdocumentation.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcbdocumentation.code.tex: Code for LaTeX documentations %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex new file mode 100644 index 00000000000..d82a1cb7df7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbhooks.code.tex @@ -0,0 +1,102 @@ +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) +%% tcbhooks.code.tex: Code for adding hooks +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2006-2013 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 +%% +\makeatletter +\def\tcblibrary@hooks@loaded{} + +% slim version of etoolbox'es more general macro +\newcommand{\tcb@appto}[2]{% + \ifx#1\relax% + \edef#1{\unexpanded{#2}}% + \else% + \edef#1{\expandonce#1\unexpanded{#2}}% + \fi} + +% slim version of etoolbox'es more general macro +\newcommand{\tcb@preto}[2]{% + \ifx#1\relax% + \edef#1{\unexpanded{#2}}% + \else% + \edef#1{\unexpanded{#2}\expandonce#1}% + \fi} + +\tcbset{% + before upper app/.code={\tcb@appto\kvtcb@before@upper{#1}},% + before upper pre/.code={\tcb@preto\kvtcb@before@upper{#1}},% + after upper app/.code={\tcb@appto\kvtcb@after@upper{#1}},% + after upper pre/.code={\tcb@preto\kvtcb@after@upper{#1}},% + before lower app/.code={\tcb@appto\kvtcb@before@lower{#1}},% + before lower pre/.code={\tcb@preto\kvtcb@before@lower{#1}},% + after lower app/.code={\tcb@appto\kvtcb@after@lower{#1}},% + after lower pre/.code={\tcb@preto\kvtcb@after@lower{#1}},% + before title app/.code={\tcb@appto\kvtcb@before@title{#1}},% + before title pre/.code={\tcb@preto\kvtcb@before@title{#1}},% + after title app/.code={\tcb@appto\kvtcb@after@title{#1}},% + after title pre/.code={\tcb@preto\kvtcb@after@title{#1}},% + % + % usable inside the document or in the preamble after setting before / after + before app/.code={\tcb@appto\kvtcb@beforebox{#1}},% + before pre/.code={\tcb@preto\kvtcb@beforebox{#1}},% + after app/.code={\tcb@appto\kvtcb@afterbox{#1}},% + after pre/.code={\tcb@preto\kvtcb@afterbox{#1}},% + % + overlay unbroken app/.code={\tcb@appto\tcb@overlay@unbroken{#1}},% + overlay unbroken pre/.code={\tcb@preto\tcb@overlay@unbroken{#1}},% + overlay first app/.code={\tcb@appto\tcb@overlay@first{#1}},% + overlay first pre/.code={\tcb@preto\tcb@overlay@first{#1}},% + overlay middle app/.code={\tcb@appto\tcb@overlay@middle{#1}},% + overlay middle pre/.code={\tcb@preto\tcb@overlay@middle{#1}},% + overlay last app/.code={\tcb@appto\tcb@overlay@last{#1}},% + overlay last pre/.code={\tcb@preto\tcb@overlay@last{#1}},% + % + overlay app/.style={overlay unbroken app={#1},overlay first app={#1},overlay middle app={#1},overlay last app={#1}},% + overlay pre/.style={overlay unbroken pre={#1},overlay first pre={#1},overlay middle pre={#1},overlay last pre={#1}},% + overlay broken app/.style={overlay first app={#1},overlay middle app={#1},overlay last app={#1}},% + overlay broken pre/.style={overlay first pre={#1},overlay middle pre={#1},overlay last pre={#1}},% + overlay unbroken and first app/.style={overlay unbroken app={#1},overlay first app={#1}},% + overlay unbroken and first pre/.style={overlay unbroken pre={#1},overlay first pre={#1}},% + overlay middle and last app/.style={overlay middle app={#1},overlay last app={#1}},% + overlay middle and last pre/.style={overlay middle pre={#1},overlay last pre={#1}},% + % + % skins: + frame code app/.code={\tcb@appto\tcb@frame@code{#1}},% + frame code pre/.code={\tcb@preto\tcb@frame@code{#1}},% + interior titled code app/.code={\tcb@appto\tcb@interiortitled@code{#1}},% + interior titled code pre/.code={\tcb@preto\tcb@interiortitled@code{#1}},% + interior code app/.code={\tcb@appto\tcb@interior@code{#1}},% + interior code pre/.code={\tcb@preto\tcb@interior@code{#1}},% + segmentation code app/.code={\tcb@appto\tcb@segmentation@code{#1}},% + segmentation code pre/.code={\tcb@preto\tcb@segmentation@code{#1}},% + title code app/.code={\tcb@appto\tcb@segmentation@code{#1}},% + title code pre/.code={\tcb@preto\tcb@segmentation@code{#1}},% + % + watermark tikz app/.style={overlay app={\tcb@drawspec@watermark@tikz{#1}}}, + watermark tikz pre/.style={overlay pre={\tcb@drawspec@watermark@tikz{#1}}}, + watermark tikz app on/.style args={#1 is #2}{overlay #1 app={\tcb@drawspec@watermark@tikz{#2}}},% + watermark tikz pre on/.style args={#1 is #2}{overlay #1 pre={\tcb@drawspec@watermark@tikz{#2}}},% + watermark graphics app/.style={overlay app={\tcb@drawspec@watermark@graphics{#1}}}, + watermark graphics pre/.style={overlay pre={\tcb@drawspec@watermark@graphics{#1}}}, + watermark graphics app on/.style args={#1 is #2}{overlay #1 app={\tcb@drawspec@watermark@graphics{#2}}}, + watermark graphics pre on/.style args={#1 is #2}{overlay #1 pre={\tcb@drawspec@watermark@graphics{#2}}}, + watermark text app/.style={overlay app={\tcb@drawspec@watermark@text{#1}}}, + watermark text pre/.style={overlay pre={\tcb@drawspec@watermark@text{#1}}}, + watermark text app on/.style args={#1 is #2}{overlay #1 app={\tcb@drawspec@watermark@text{#2}}}, + watermark text pre on/.style args={#1 is #2}{overlay #1 pre={\tcb@drawspec@watermark@text{#2}}}, +} + diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex index f6c9b92c747..678b9577190 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcblistings.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcblistings.code.tex: Code for colorboxes with listings %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex index bcff9d3378b..905ad4b8e38 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcblistingsutf8.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcblistingsutf8.code.tex: Code for colorboxes with listings in UTF-8 %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex index e45efa1954f..512da07b794 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbskins.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcbskins.code.tex: Code for colorboxes with different skins %% %% ------------------------------------------------------------------------------------------- diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex b/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex index ed55cf8f570..7f0fe32e54f 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcbtheorems.code.tex @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcbtheorems.code.tex: Code for theorems in colorboxes %% %% ------------------------------------------------------------------------------------------- @@ -20,10 +20,40 @@ \makeatletter \def\tcblibrary@theorems@loaded{} +\RequirePackage{amsmath} + +\def\tcb@hack@amsmath{\tcb@hack@currenvir\vskip-\abovedisplayskip} + \tcbset{ theorem/.code args={#1#2#3#4}{% - \refstepcounter{#2}\label{#4}% - \pgfkeysalso{title={\setbox\z@=\hbox{#1~\csname the#2\endcsname:\ }\hangindent\wd\z@\hangafter=1 \mbox{#1~\csname the#2\endcsname:\ }#3}}}% + \refstepcounter{#2}\label{#4}% + \pgfkeysalso{title={\setbox\z@=\hbox{#1~\csname the#2\endcsname:\ }\hangindent\wd\z@\hangafter=1 \mbox{#1~\csname the#2\endcsname:\ }#3}}},% + math upper/.style={before upper=$\displaystyle,after upper=$},% + math lower/.style={before lower=$\displaystyle,after lower=$},% + math/.style={math upper,math lower},% + ams equation upper/.style={before upper=\tcb@hack@currenvir\equation,after upper=\endequation},% + ams equation lower/.style={before lower=\tcb@hack@currenvir\equation,after lower=\endequation},% + ams equation/.style={ams equation upper,ams equation lower},% + ams equation* upper/.style={before upper=\tcb@hack@currenvir\csname equation*\endcsname,after upper=\endequation},% + ams equation* lower/.style={before lower=\tcb@hack@currenvir\csname equation*\endcsname,after lower=\endequation},% + ams equation*/.style={ams equation* upper,ams equation* lower},% + ams align upper/.style={before upper=\tcb@hack@amsmath\align,after upper=\endalign},% + ams align lower/.style={before lower=\tcb@hack@amsmath\align,after lower=\endalign},% + ams align/.style={ams align upper,ams align lower},% + ams align* upper/.style={before upper=\tcb@hack@amsmath\csname align*\endcsname,after upper=\endalign},% + ams align* lower/.style={before lower=\tcb@hack@amsmath\csname align*\endcsname,after lower=\endalign},% + ams align*/.style={ams align* upper,ams align* lower},% + ams gather upper/.style={before upper=\tcb@hack@amsmath\gather,after upper=\endgather},% + ams gather lower/.style={before lower=\tcb@hack@amsmath\gather,after lower=\endgather},% + ams gather/.style={ams gather upper,ams gather lower},% + ams gather* upper/.style={before upper=\tcb@hack@amsmath\csname gather*\endcsname,after upper=\endgather},% + ams gather* lower/.style={before lower=\tcb@hack@amsmath\csname gather*\endcsname,after lower=\endgather},% + ams gather*/.style={ams gather* upper,ams gather* lower},% + ams nodisplayskip upper/.style={before upper=\vskip-\abovedisplayskip},% + ams nodisplayskip lower/.style={before upper=\vskip-\abovedisplayskip},% + ams nodisplayskip/.style={ams nodisplayskip upper,ams nodisplayskip lower},% + highlight math style/.style={highlight math/.style={#1}},% + highlight math style={colframe=red,colback=yellow!25!white},% } \newcommand{\tcbmaketheorem}[5]{% @@ -33,3 +63,8 @@ ##1]}% {\endtcolorbox}% } + +\newcommand{\tcboxmath}[1][]{\tcbox[nobeforeafter,math upper,tcbox raise base,#1]} + +\newcommand{\tcbhighmath}[1][]{\tcboxmath[highlight math,#1]} + diff --git a/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty b/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty index 8fb0ed7dbef..e8575f07f7d 100644 --- a/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty +++ b/Master/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty @@ -1,4 +1,4 @@ -%% The LaTeX package tcolorbox - version 2.02 (2013/03/13) +%% The LaTeX package tcolorbox - version 2.10 (2013/04/09) %% tcolorbox.sty: Text color boxes %% %% ------------------------------------------------------------------------------------------- @@ -18,7 +18,7 @@ %% This work consists of all files listed in README %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tcolorbox}[2013/03/13 version 2.02 text color boxes] +\ProvidesPackage{tcolorbox}[2013/04/09 version 2.10 text color boxes] \RequirePackage{pgf}[2008/01/15] \RequirePackage{verbatim}[2003/08/22] @@ -64,6 +64,8 @@ \tcbset{autoparskip}% } +\def\tcb@hack@currenvir{\edef\tcb@temp{\noexpand\def\noexpand\@currenvir{\kvtcb@savedelimiter}}\tcb@temp} + \tcbset{ title/.store in=\kvtcb@title, notitle/.style={title=}, @@ -194,6 +196,36 @@ \let\tcb@overlay@last=\tcb@overlay@temp},% no overlay/.style={overlay=},% standard/.style={skin=standard},% + before title/.store in=\kvtcb@before@title,% + after title/.store in=\kvtcb@after@title,% + before upper/.store in=\kvtcb@before@upper,% + after upper/.store in=\kvtcb@after@upper,% + before lower/.store in=\kvtcb@before@lower,% + after lower/.store in=\kvtcb@after@lower,% + center title/.style={before title=\begin{center},after title=\end{center}},% + center upper/.style={before upper=\begin{center},after upper=\end{center}},% + center lower/.style={before lower=\begin{center},after lower=\end{center}},% + tabularx*/.style 2 args={% + boxsep=0pt,top=0pt,bottom=0pt,leftupper=0pt,rightupper=0pt, + toptitle=1mm,bottomtitle=1mm,boxrule=0.5mm, + before upper={\arrayrulecolor{\kvtcb@colframe}\def\arraystretch{1.1}#1% + \tcb@hack@currenvir\tabularx{\linewidth}{#2}}, + after upper=\endtabularx}, + tabularx/.style={tabularx*={}{#1}}, + tikz upper/.style={before upper=\begin{center}\begin{tikzpicture}[#1],after upper=\end{tikzpicture}\end{center}},% + tikz lower/.style={before lower=\begin{center}\begin{tikzpicture}[#1],after lower=\end{tikzpicture}\end{center}},% + oversize/.style={% + width=\the\dimexpr\dimexpr\linewidth\relax+\kvtcb@left@rule+\kvtcb@leftupper+\kvtcb@boxsep*2+\kvtcb@rightupper+\kvtcb@right@rule\relax,% + enlarge left by=\the\dimexpr-\kvtcb@left@rule-\kvtcb@leftupper-\kvtcb@boxsep\relax,% + enlarge right by=\the\dimexpr-\kvtcb@boxsep-\kvtcb@rightupper-\kvtcb@right@rule\relax},% + tcbox raise/.store in=\kvtcb@box@raise,% + tcbox raise base/.style={tcbox raise=\the\dimexpr-\tcb@temp@dp-\kvtcb@bbbottom@stand\relax},% + shrink tight/.style={boxsep=0mm,top=-\kvtcb@top@rule@stand,bottom=-\kvtcb@bottom@rule@stand,left=-\kvtcb@left@rule,right=-\kvtcb@right@rule},% + extrude left by/.code={\tcbdimto\kvtcb@leftupper{\kvtcb@leftupper+#1}\tcbdimto\kvtcb@bbleft{\kvtcb@bbleft-#1}},% + extrude right by/.code={\tcbdimto\kvtcb@rightupper{\kvtcb@rightupper+#1}\tcbdimto\kvtcb@bbright{\kvtcb@bbright-#1}},% + extrude top by/.code={\tcbdimto\kvtcb@top{\kvtcb@top+#1}\tcbdimto\kvtcb@bbtop@stand{\kvtcb@bbtop@stand-#1}},% + extrude bottom by/.code={\tcbdimto\kvtcb@bottom{\kvtcb@bottom+#1}\tcbdimto\kvtcb@bbbottom@stand{\kvtcb@bbbottom@stand-#1}},% + extrude by/.style={extrude left by=#1,extrude right by=#1,extrude top by=#1,extrude bottom by=#1},% } \tcbset{notitle,width=\linewidth,boxsep=1mm,boxrule=0.5mm,adjust text={\"Apgjy}, @@ -204,6 +236,8 @@ enlarge top by=0mm,enlarge bottom by=0mm,enlarge left by=0mm,enlarge right by=0mm, toggle enlargement=none,toptitle=0mm,bottomtitle=0mm, standard,parbox,overlay=,auto outer arc, + before title=,after title=,before upper=,after upper=,before lower=,after lower=, + tcbox raise=0pt, }% \let\tcb@parboxrestore=\@parboxrestore @@ -233,10 +267,10 @@ \let\endtcb@savebox=\endtcb@lrbox \def\tcb@saveupperbox{% -\begin{tcb@savebox}{\tcb@upperbox}{\tcb@w@upper}\color{\kvtcb@colupper}\kvtcb@fontupper\ignorespaces} +\begin{tcb@savebox}{\tcb@upperbox}{\tcb@w@upper}\color{\kvtcb@colupper}\kvtcb@fontupper\kvtcb@before@upper\ignorespaces} \def\tcb@savelowerbox{% -\begin{tcb@savebox}{\tcb@lowerbox}{\tcb@w@lower}\color{\kvtcb@collower}\kvtcb@fontlower\ignorespaces} +\begin{tcb@savebox}{\tcb@lowerbox}{\tcb@w@lower}\color{\kvtcb@collower}\kvtcb@fontlower\kvtcb@before@lower\ignorespaces} % counter for float @@ -268,13 +302,16 @@ \ifx\kvtcb@title\@empty\tcb@hasTitlefalse\else% \tcb@hasTitletrue% \tcbdimto\tcb@w@title{\tcb@temp-\kvtcb@lefttitle-\kvtcb@righttitle}% - \begin{tcb@savebox}{\tcb@titlebox}{\tcb@w@title}\color{\kvtcb@coltitle}\kvtcb@fonttitle\kvtcb@title\end{tcb@savebox}% + \begin{tcb@savebox}{\tcb@titlebox}{\tcb@w@title}\color{\kvtcb@coltitle}\kvtcb@fonttitle\kvtcb@before@title\kvtcb@title\kvtcb@after@title\end{tcb@savebox}% \fi% + \let\tcb@after@box=\kvtcb@after@upper% % switch for lower box \def\tcblower{% + \unskip\tcb@after@box% \end{tcb@savebox}% \tcbdimto\tcb@w@lower{\tcb@temp-\kvtcb@leftlower-\kvtcb@rightlower}% \tcb@hasLowertrue% + \let\tcb@after@box=\kvtcb@after@lower% \ifx\kvtcb@savelowerto\@empty% \let\tcb@startbox\tcb@savelowerbox% \let\endtcolorbox\tcb@endboxanddraw% @@ -293,6 +330,7 @@ \let\tcolorbox\tcb@colorbox \def\tcb@endboxanddraw{% + \unskip\tcb@after@box% \end{tcb@savebox}% \tcb@draw@color@box% } @@ -378,10 +416,10 @@ \begin{pgfscope}% \pgfsetcornersarced{\pgfpoint{0mm}{0mm}}% \pgfmoveto{\pgfpoint{\kvtcb@left@rule}{\kvtcb@bottom@rule}}% - \pgflineto{\pgfpoint{\kvtcb@left@rule}{\kvtcb@bottom@rule+\tcb@innerheight}}% - \pgflineto{\pgfpoint{\kvtcb@width-\kvtcb@right@rule}{\kvtcb@bottom@rule+\tcb@innerheight}}% + \pgflineto{\pgfpoint{\kvtcb@left@rule}{\the\dimexpr\kvtcb@bottom@rule+\tcb@innerheight\relax}}% + \pgflineto{\pgfpoint{\the\dimexpr\kvtcb@width-\kvtcb@right@rule\relax}{\the\dimexpr\kvtcb@bottom@rule+\tcb@innerheight\relax}}% \pgfsetcornersarced{\pgfpoint{\kvtcb@arc}{\kvtcb@arc}}% - \pgflineto{\pgfpoint{\kvtcb@width-\kvtcb@right@rule}{\kvtcb@bottom@rule}}% + \pgflineto{\pgfpoint{\the\dimexpr\kvtcb@width-\kvtcb@right@rule\relax}{\kvtcb@bottom@rule}}% \pgflineto{\pgfpoint{\kvtcb@left@rule}{\kvtcb@bottom@rule}}% \pgfpathclose% \pgfsetfillcolor{\kvtcb@colback}% @@ -395,7 +433,7 @@ \pgfsetcornersarced{\pgfpoint{\kvtcb@arc}{\kvtcb@arc}}% \pgfsetfillcolor{\kvtcb@colback}% \pgfpathrectangle{\pgfpoint{\kvtcb@left@rule}{\kvtcb@bottom@rule}}% - {\pgfpoint{\kvtcb@width-\kvtcb@left@rule-\kvtcb@right@rule}{\tcb@innerheight}}% + {\pgfpoint{\the\dimexpr\kvtcb@width-\kvtcb@left@rule-\kvtcb@right@rule\relax}{\tcb@innerheight}}% \pgfusepath{fill}% \end{pgfscope}% } @@ -407,7 +445,7 @@ \pgfsetdash{{1mm}{1mm}}{0.5mm}% \tcbdimto\tcb@seg@pos{\kvtcb@bottom@rule+\kvtcb@boxsep*2+\tcb@break@bottomsep+\kvtcb@middle+\kvtcb@bottom+\tcb@height@lower}% \pgfpathmoveto{\pgfpoint{\kvtcb@left@rule}{\tcb@seg@pos}}% - \pgfpathlineto{\pgfpoint{\kvtcb@width-\kvtcb@right@rule}{\tcb@seg@pos}}% + \pgfpathlineto{\pgfpoint{\the\dimexpr\kvtcb@width-\kvtcb@right@rule\relax}{\tcb@seg@pos}}% \pgfusepath{stroke}% \end{pgfscope}% } @@ -417,13 +455,13 @@ } \def\tcb@setbb@toggle@none{% - \pgfpathrectanglecorners{\pgfpoint{-\kvtcb@bbleft}{-\kvtcb@bbbottom}}% - {\pgfpoint{\kvtcb@width+\kvtcb@bbright}{\tcb@height+\kvtcb@bbtop}}% + \pgfpathrectanglecorners{\pgfpoint{\the\dimexpr0pt-\kvtcb@bbleft\relax}{\the\dimexpr0pt-\kvtcb@bbbottom\relax}}% + {\pgfpoint{\the\dimexpr\kvtcb@width+\kvtcb@bbright\relax}{\the\dimexpr\tcb@height+\kvtcb@bbtop\relax}}% } \def\tcb@setbb@toggle@forced{% - \pgfpathrectanglecorners{\pgfpoint{-\kvtcb@bbright}{-\kvtcb@bbbottom}}% - {\pgfpoint{\kvtcb@width+\kvtcb@bbleft}{\tcb@height+\kvtcb@bbtop}}% + \pgfpathrectanglecorners{\pgfpoint{\the\dimexpr0pt-\kvtcb@bbright\relax}{\the\dimexpr0pt-\kvtcb@bbbottom\relax}}% + {\pgfpoint{\the\dimexpr\kvtcb@width+\kvtcb@bbleft\relax}{\the\dimexpr\tcb@height+\kvtcb@bbtop\relax}}% } \def\tcb@setbb@toggle@evenpage{% @@ -538,14 +576,22 @@ \newcommand{\tcbox}[2][]{% - \setbox0=\hbox{#2}% - \tcbdimto{\tcb@temp@inner}{\wd0}% - \begin{tcolorbox}[#1,width=\the\dimexpr\tcb@temp@inner+\kvtcb@left@rule+\kvtcb@leftupper+\kvtcb@boxsep*2+\kvtcb@rightupper+\kvtcb@right@rule\relax]% + \begingroup% + \tcbset{#1,unbreakable}% + \setbox0=\hbox{\begingroup\color{\kvtcb@colupper}\kvtcb@fontupper\kvtcb@before@upper\ignorespaces#2\kvtcb@after@upper\endgroup}% + \tcbdimto{\tcb@temp@wd}{\wd0}% + \tcbdimto{\tcb@temp@dp}{\dp0+\kvtcb@bottom+\kvtcb@boxsep+\kvtcb@bottom@rule@stand}% + \let\kvtcb@fontupper=\relax% + \let\kvtcb@before@upper\relax% + \let\kvtcb@after@upper\relax% + \raisebox{\kvtcb@box@raise}{\begin{tcolorbox}[width=\the\dimexpr\tcb@temp@wd+\kvtcb@left@rule+\kvtcb@leftupper+\kvtcb@boxsep*2+\kvtcb@rightupper+\kvtcb@right@rule\relax]% \unhbox0% - \end{tcolorbox}% + \end{tcolorbox}}% + \endgroup% } + % verbatim output as in 'verbatim' \newwrite\tcb@out @@ -610,6 +656,7 @@ \tcb@add@library{documentation}{tcbdocumentation.code.tex} \tcb@add@library{skins}{tcbskins.code.tex} \tcb@add@library{breakable}{tcbbreakable.code.tex} +\tcb@add@library{hooks}{tcbhooks.code.tex} \ProcessOptions* \edef\tcb@temp{\noexpand\tcbuselibrary{\tcb@optionlist}} diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 9f456d64611..82b02901e27 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -2495,7 +2495,6 @@ $standardclean = '\.head|\.tmp|\.dvi|\.log|\.out|\.aux|\.toc|\.lof|\.lot' 'stubs' => 'stubs.pdf', # no source 'susy' => 'susy.pdf', # no source 'swimgraf' => 'swimgraf.pdf', # no source - 'tcolorbox' => 'tcolorbox-german.pdf', # no source 'toptesi' => 'logo.*', # legalities unknown 'tree-dvips' => 'avm.*', # author no response 'xskak' => 'xskak.pdf', # no source |