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.tex253
1 files changed, 236 insertions, 17 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 cf5c9669d37..9a7b682057d 100644
--- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex
+++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex
@@ -344,6 +344,12 @@ This is a \textbf{tcolorbox}.
\end{dispExample}
\end{docTcbKey}
+\bigskip
+\begin{marker}
+ More options for drawing a \refKey{/tcb/borderline} are provided by using skins documented in
+ Section \ref{sec:skins} from page \pageref{sec:skins}.
+\end{marker}
+
\clearpage
\begin{docTcbKey}{arc}{=\meta{length}}{no default, initially \texttt{1mm}}
@@ -904,10 +910,10 @@ This is the lower part.
\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}|.
+ This style sets \refKey{/tcb/before title} to |\centering|.
\begin{dispExample}
\tcbset{center title,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries}
@@ -919,8 +925,7 @@ This is a \textbf{tcolorbox}.
\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}|.
+ This style sets \refKey{/tcb/before upper} to |\centering|.
\begin{dispExample}
\tcbset{center upper,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries}
@@ -932,8 +937,7 @@ This is a \textbf{tcolorbox}.
\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}|.
+ This style sets \refKey{/tcb/before lower} to |\centering|.
\begin{dispExample}
\tcbset{center lower,colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries}
@@ -947,6 +951,101 @@ This is the lower part.
\clearpage
+\begin{docTcbKey}{flushleft title}{}{style, no value, initially unset}
+ This style sets \refKey{/tcb/before title} to |\raggedright|.
+\begin{dispExample*}{sbs,lefthand ratio=0.6}
+\tcbset{flushleft title,colback=red!5!white,
+ colframe=red!75!black,fonttitle=\bfseries}
+
+\begin{tcolorbox}[title=My title which is
+ quite long but always flushed left]
+This is a \textbf{tcolorbox}.
+\end{tcolorbox}
+\end{dispExample*}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}{flushleft upper}{}{style, no value, initially unset}
+ This style sets \refKey{/tcb/before upper} to |\raggedright|.
+\begin{dispExample*}{sbs,lefthand ratio=0.6}
+\tcbset{flushleft upper,colback=red!5!white,
+ colframe=red!75!black,fonttitle=\bfseries}
+
+\begin{tcolorbox}[title=My title]
+This is a \textbf{tcolorbox}. Here, the
+content is flushed left.
+You see the effect on the right hand side.
+\end{tcolorbox}
+\end{dispExample*}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}{flushleft lower}{}{style, no value, initially unset}
+ This style sets \refKey{/tcb/before lower} to |\raggedright|.
+\begin{dispExample*}{sbs,lefthand ratio=0.6}
+\tcbset{flushleft lower,colback=red!5!white,
+ colframe=red!75!black,fonttitle=\bfseries}
+
+\begin{tcolorbox}[title=My title]
+This is a \textbf{tcolorbox}. The upper part
+is not flushed left or right. This could be
+unpleasant for small boxes.
+\tcblower
+This is the lower part. Here, the
+content is flushed left.
+You see the effect on the right hand side.
+\end{tcolorbox}
+\end{dispExample*}
+\end{docTcbKey}
+
+
+\clearpage
+\begin{docTcbKey}{flushright title}{}{style, no value, initially unset}
+ This style sets \refKey{/tcb/before title} to |\raggedleft|.
+\begin{dispExample*}{sbs,lefthand ratio=0.6}
+\tcbset{flushright 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}{flushright upper}{}{style, no value, initially unset}
+ This style sets \refKey{/tcb/before upper} to |\raggedleft|.
+\begin{dispExample*}{sbs,lefthand ratio=0.6}
+\tcbset{flushright 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}{flushright lower}{}{style, no value, initially unset}
+ This style sets \refKey{/tcb/before lower} to |\raggedleft|.
+\begin{dispExample*}{sbs,lefthand ratio=0.6}
+\tcbset{flushright 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 upper} and \refKey{/tcb/after upper}
and several geometry keys to support a |tabularx| with the
@@ -1081,6 +1180,7 @@ This is a \textbf{tcolorbox}.
\end{tcolorbox}
\end{dispExample}
+\enlargethispage*{5mm}
\begin{dispExample}
% \usetikzlibrary{patterns} % preamble
% \tcbuselibrary{skins} % preamble
@@ -1101,6 +1201,7 @@ This is the lower part.
\end{dispExample}
\end{docTcbKey}
+\clearpage
\begin{docTcbKey}{no overlay}{}{style, no default, initially set}
Removes the overlay if set before.
\end{docTcbKey}
@@ -1202,14 +1303,32 @@ are drawn by the codes given with
\end{myexample}
\begin{myexample}
-\lipsum[2-14]
+\lipsum[2-11]
\end{myexample}
-\lipsum[15]% following text
+\lipsum[12]% following text
\end{dispListing*}
{\tcbusetemp}
+\begin{dispExample}
+% \tcbuselibrary{skins}
+\newtcolorbox{FancyTitle}[2][]{%
+ enhanced,colback=blue!10!white,colframe=orange,top=4mm,
+ enlarge top by=\baselineskip/2+1mm,
+ enlarge top at break by=0mm,pad at break=2mm,
+ fontupper=\normalsize,
+ overlay unbroken and first={%
+ \node[rectangle,rounded corners,draw=black,fill=blue!20!white,
+ inner sep=1mm,anchor=west,font=\small]
+ at ([xshift=4.5mm]frame.north west) {\strut\textbf{#2}};},
+ #1}%
+
+\begin{FancyTitle}{My fancy title}
+ \lipsum[1]
+\end{FancyTitle}
+\end{dispExample}
+
\clearpage
\subsection{Floating Objects}
\begin{docTcbKey}{floatplacement}{=\meta{values}}{no default, initially \texttt{htb}}
@@ -1449,6 +1568,11 @@ This behavior is controlled by the keys |before| and |after|.
\end{docTcbKey}
+\begin{docTcbKey}{baseline}{=\meta{length}}{no default, initially |0pt|}
+ Used to set the |\pgfsetbaseline| value of the resulting |tcolorbox|.
+\end{docTcbKey}
+
+
\clearpage
\subsection{Bounding Box}
Normally, every |tcolorbox| has a bounding box which fits exactly to the
@@ -1529,10 +1653,13 @@ This is a \textbf{tcolorbox}.
\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.
+ right enlargement are switched. It is recommended to use this setting in
+ conjunction with \refKey{/tcb/check odd page}.
+ %Note that the page number detection may
+ %fail in certain cases. For these cases, use the |forced| value.
\end{itemize}
\begin{dispExample}
+% \usepackage{changepage} for 'check odd page'
\tcbset{colframe=blue!75!black,colback=white,
enlarge left by=-20mm,enlarge right by=5mm,width=\linewidth+15mm}
@@ -1542,7 +1669,7 @@ This is a \textbf{tcolorbox}.
\begin{tcolorbox}[toggle enlargement=forced]
This is a \textbf{tcolorbox}.
\end{tcolorbox}
-\begin{tcolorbox}[toggle enlargement=evenpage]
+\begin{tcolorbox}[toggle enlargement=evenpage,check odd page]
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).
@@ -1580,7 +1707,7 @@ lower part.
extrusion keys.
\begin{dispExample}
\tcbset{colframe=blue!75!black,colback=white,arc=0mm,boxrule=0.4pt,
- tcbox raise base,shrink tight}
+ nobeforeafter,tcbox raise base,shrink tight}
\begin{tcolorbox}
This is a \textbf{tcolorbox}.
@@ -1597,7 +1724,7 @@ Lorem \tcbox{ipsum} dolor sit amet, consectetuer adipiscing elit.
\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}
+ nobeforeafter,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.
@@ -1613,7 +1740,7 @@ Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
\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}
+ nobeforeafter,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.
@@ -1630,7 +1757,7 @@ Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
\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}
+ nobeforeafter,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.
@@ -1646,7 +1773,7 @@ Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
\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}
+ nobeforeafter,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.
@@ -1662,7 +1789,7 @@ Nam arcu libero, nonummy eget, consectetuer id, vulputate a, magna.
\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}
+ nobeforeafter,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
@@ -1674,6 +1801,66 @@ et malesuada fames ac turpis egestas. \tcbox{Mauris ut leo.}
\end{docTcbKey}
+\clearpage
+\subsection{Capture Mode}\label{subsec:capture}
+
+\begin{docTcbKey}{capture}{=\meta{mode}}{no default, initially |minipage|}
+ The capture \meta{mode} defines how the box content is processed.
+
+Feasible values for \meta{mode} are:
+\begin{itemize}
+\item |minipage|:\\
+ This is the default \meta{mode} for \refEnv{tcolorbox}.
+ The content may have an upper and a lower part. Optionally, the box
+ can be \refKey{/tcb/breakable}. The box content is put into a
+ minipage or into something similar to a minipage.
+\item |hbox|:\\
+ This is the default \meta{mode} for \refCom{tcbox}. The content cannot have
+ a lower part and cannot be broken. The colored box is sized according
+ to the dimensions of the content.
+ A shortcut to set this mode is \refKey{/tcb/hbox}.
+\item |fitbox|: (needs the 'fitting' library)\\
+ This is the default \meta{mode} for \refCom{tcboxfit}. The content cannot have
+ a lower part and cannot be broken.
+ The content is sized according to the dimensions of the colored box.
+ A shortcut to set this mode is \refKey{/tcb/fit}.
+\end{itemize}
+
+\begin{dispExample}
+\tcbset{colframe=blue!75!black,colback=white}
+
+\begin{tcolorbox}[capture=minipage]
+This is a tcolorbox.
+\end{tcolorbox}
+
+\begin{tcolorbox}[capture=hbox]
+This is a tcolorbox.
+\end{tcolorbox}
+
+\begin{tcolorbox}[capture=fitbox,height=9mm]% needs the 'fitting' library
+This is a tcolorbox.
+\end{tcolorbox}
+\end{dispExample}
+\end{docTcbKey}
+
+
+
+\begin{docTcbKey}{hbox}{}{style, no default}
+ Shortcut for |capture=hbox|.
+\begin{dispExample}
+\tcbset{colframe=blue!75!black,colback=white}
+
+\begin{tcolorbox}[hbox]
+This is a tcolorbox.
+\end{tcolorbox}
+\end{dispExample}
+\end{docTcbKey}
+
+
+\begin{docTcbKey}{minipage}{}{style, no default}
+ Shortcut for |capture=minipage|.
+\end{docTcbKey}
+
\clearpage
\subsection{Text Characteristics}
@@ -1740,3 +1927,35 @@ 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
+\subsection{Miscellaneous}
+
+\begin{docTcbKey}{check odd page}{\colOpt{=\meta{boolean value}}}{default |true|, initially |false|}
+If set to |true|, the even/odd page testing from the package |changepage|
+is applied. The \refKey{/tcb/toggle enlargement} check will use the
+|\ifoddpage| macro from this package.
+Note that you have to include the package |changepage| by hand\footnote{If |changepage| is
+not included, a compilation error will arise.}:
+
+\begin{dispListing}
+\usepackage{changepage}
+\strictpagecheck
+\end{dispListing}
+
+\medskip
+The macro |\ifoddpage| can be used inside overlay or watermark code to test if the
+box is on an odd page. This will work also for boxes in a break sequence.
+Note that you cannot use the test inside the normal
+box content.
+
+\begin{dispExample}
+% \usepackage{changepage}
+\tcbset{colframe=blue!75!black,colback=white}
+
+\begin{tcolorbox}[enhanced,
+ watermark text={\ifoddpage Odd\else Even\fi\ page!}]
+\lipsum[1]
+\end{tcolorbox}
+\end{dispExample}
+\end{docTcbKey}
+