summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex')
-rw-r--r--Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex93
1 files changed, 92 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex
index 88b534dda7b..867e9890745 100644
--- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex
+++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex
@@ -123,6 +123,26 @@ Now, the saved part is used:
\input{\jobname_bspsave2.tex}
\end{tcolorbox}
\end{dispExample}
+
+The |savedelimiter| is used implicitely with \refCom{newtcolorbox} which
+allows a more convenient usage:
+\begin{dispExample}
+\newtcolorbox{mybox}[1]{%
+ savelowerto=\jobname_bspsave2.tex,lowerbox=ignored,
+ colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,
+ title=#1}%
+
+\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}
@@ -928,7 +948,7 @@ This is the lower part.
\clearpage
\begin{docTcbKey}{tabularx}{=\meta{preamble}}{style}
- This style sets \refKey{/tcb/before lower} and \refKey{/tcb/after lower}
+ This style sets \refKey{/tcb/before upper} and \refKey{/tcb/after upper}
and several geometry keys to support a |tabularx| with the
given \meta{preamble}.
The package |tabularx| \cite {carlisle:1999a} has to be loaded separately.
@@ -1007,6 +1027,22 @@ One & Two & Three \\\hline\hline
\clearpage
+\begin{docTcbKey}{code}{=\meta{code}}{no default, initially unset}
+ The given \meta{code} is executed immediately. This option is useful
+ to place some arbitrary code into an option list.
+\begin{dispExample}
+\tcbset{colback=red!5!white,colframe=red!75!black,
+ code={Useless at this spot but functional.},
+ fonttitle=\bfseries}
+
+\begin{tcolorbox}[code={\newcommand{\mycommand}{\textit{working}}},
+ title=My \mycommand\ title]
+This is a \textbf{tcolorbox}.
+\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
@@ -1116,6 +1152,61 @@ This is the lower part.
+\begin{dispListing*}{breakable,before upper={This example demonstrates
+the application of break sequence specific overlay options.
+Here, we define an environment |myexample| based
+on |tcolorbox| where the visible drawing is done totally by overlay keys.\par
+Here, the first application of |myexample| produces an unbroken |tcolorbox|.
+The frame is drawn by the code given with \refKey{/tcb/overlay unbroken}.\par
+The second application of |myexample| is broken into several parts which
+are drawn by the codes given with
+\refKey{/tcb/overlay first}, \refKey{/tcb/overlay middle}, and
+\refKey{/tcb/overlay last}.
+\par\bigskip
+}}
+% Preamble:
+%\usepackage{tikz,lipsum,calc}
+%\tcbuselibrary{skins,breakable}
+%\newcounter{example}
+%\newlength{\examlen}
+\colorlet{colexam}{red!75!black}
+
+\newtcolorbox{myexample}{%
+ code={\refstepcounter{example}%
+ \settowidth{\examlen}{\Large\bfseries Example \arabic{example}}},%
+ title=Example \arabic{example},
+ coltitle=colexam,fonttitle=\Large\bfseries,
+ enhanced,breakable,before=\par\medskip,parbox=false,
+ frame hidden,interior hidden,segmentation hidden,
+ boxsep=0pt,left=0pt,right=3mm,toptitle=2mm,pad at break=0mm,
+ overlay unbroken={\draw[colexam,line width=1pt] (frame.north west)
+ --([xshift=-0.5pt]frame.north east)--([xshift=-0.5pt]frame.south east)
+ --(frame.south west);
+ \draw[colexam,line width=2pt] ([yshift=0.5pt]frame.north west)
+ -- +(\examlen,0pt);},
+ overlay first={\draw[colexam,line width=1pt] (frame.north west)
+ --([xshift=-0.5pt]frame.north east)--([xshift=-0.5pt]frame.south east);
+ \draw[red!75!black,line width=2pt] ([yshift=0.5pt]frame.north west)
+ -- +(\examlen,0pt);},
+ overlay middle={\draw[colexam,line width=1pt] ([xshift=-0.5pt]frame.north east)
+ --([xshift=-0.5pt]frame.south east); },
+ overlay last={\draw[colexam,line width=1pt] ([xshift=-0.5pt]frame.north east)
+ --([xshift=-0.5pt]frame.south east)--(frame.south west);}%
+}
+
+\begin{myexample}
+\lipsum[1]
+\end{myexample}
+
+\begin{myexample}
+\lipsum[2-14]
+\end{myexample}
+
+\lipsum[15]% following text
+\end{dispListing*}
+{\tcbusetemp}
+
+
\clearpage
\subsection{Floating Objects}
\begin{docTcbKey}{floatplacement}{=\meta{values}}{no default, initially \texttt{htb}}