diff options
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.tex | 110 |
1 files changed, 99 insertions, 11 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 7008cbdab9b..cac968f3641 100644 --- a/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex +++ b/Master/texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.coreoptions.tex @@ -5,7 +5,7 @@ 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 +the syntax for |pgf| keys, see \cite{tantau:2013a,sturm:2012k} or the examples starting from page \pageref{sec:latextutorial}. @@ -51,6 +51,58 @@ Now, we try again with adjusted titles:\\ never exceed '\"Apgjy' in depth and height you don't need to care about this option. \end{docTcbKey} +\clearpage + +\begin{docTcbKey}{detach title}{}{no value} +Detaches the title from its normal position. The text of the title is +stored into \docAuxCommand{tcbtitletext} and the formatted title is +available by \docAuxCommand{tcbtitle}. +The main application is to move the title from its usual place to another one. +\begin{dispExample} +\newtcolorbox{mybox}[2][]{colbacktitle=red!10!white, + colback=blue!10!white,coltitle=red!70!black, + title={#2},fonttitle=\bfseries,#1} + +\begin{mybox}{My title} + This is a \textbf{tcolorbox}. +\end{mybox} +\begin{mybox}[detach title,before upper={\tcbtitle\quad}]{My title} + This is a \textbf{tcolorbox}. +\end{mybox} +\begin{mybox}[detach title,after upper={\par\hfill\tcbtitle}]{My title} + This is a \textbf{tcolorbox}. +\end{mybox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{attach title}{}{no value} +Attaches the title to its normal position. This option is used to reverse +\refKey{/tcb/detach title}. +\end{docTcbKey} + + +\begin{docTcbKey}{attach title to upper}{\colOpt{=\meta{text}}}{style, default empty, initially unset} +Attaches the title to the begin of the upper part of the box content. +The optional \meta{text} is set between the formatted title and the box content. +\begin{dispExample} +\newtcolorbox{mybox}[2][]{colbacktitle=red!10!white, + colback=blue!10!white,coltitle=red!70!black, + title={#2},fonttitle=\bfseries,#1} + +\begin{mybox}[attach title to upper={\ ---\ }]{My title} + This is a \textbf{tcolorbox}. +\end{mybox} +\begin{mybox}[attach title to upper,after title={:\ }]{My title} + This is a \textbf{tcolorbox}. +\end{mybox} +\end{dispExample} +\end{docTcbKey} + + +\bigskip +\begin{marker} +More title options are documented in \Vref{subsec:contentadditions}. +\end{marker} \clearpage @@ -1359,7 +1411,7 @@ One & Two & Three \\\hline\hline \clearpage \begin{docTcbKey}{tikz upper}{\colOpt{=\meta{options}}}{style} This style adds a centered |tikzpicture| environment to the start and end - of the upper part. + of the upper part. The \meta{options} may be given as TikZ picture options. \begin{dispExample} % \usepackage{tikz} @@ -1375,7 +1427,7 @@ One & Two & Three \\\hline\hline \begin{docTcbKey}{tikz lower}{\colOpt{=\meta{options}}}{style} This style adds a centered |tikzpicture| environment to the start and end - of the lower part. + of the lower part. The \meta{options} may be given as TikZ picture options. \begin{dispExample} % \usepackage{tikz} % \usetikzlibrary{skins,listings} @@ -1396,6 +1448,41 @@ One & Two & Three \\\hline\hline \clearpage +\begin{docTcbKey}{tikznode upper}{\colOpt{=\meta{options}}}{style} + This style places the upper part content into a centered + TikZ node. The \meta{options} may be given as TikZ node options. + This style is especially useful for boxes with multiline texts which are + fitted to the text width. +\begin{dispExample} +% \usepackage{tikz} +\newtcbox{\headline}[1][]{enhanced,before=\begin{center},after=\end{center}, + fontupper=\Large\bfseries,colframe=red!50!black,colback=red!10!white, + drop fuzzy shadow=yellow,tikznode upper,#1} + +\headline{Important\\Headline} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{tikznode lower}{\colOpt{=\meta{options}}}{style} + This style places the lower part content into a centered + TikZ node. The \meta{options} may be given as TikZ node options. +\begin{dispExample} +% \usepackage{tikz} +\begin{tcolorbox}[bicolor,colback=LightBlue!50!white,colbacklower=white, + colframe=black,tikznode lower={inner sep=2pt,draw=red,fill=yellow}] +Upper part. +\tcblower +Lower part. +\end{tcolorbox} +\end{dispExample} +\end{docTcbKey} + +\begin{docTcbKey}{tikznode}{\colOpt{=\meta{options}}}{style} + Shortcut for setting \refKey{/tcb/tikznode upper} and \refKey{/tcb/tikznode lower} + the same time. +\end{docTcbKey} + +%\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. @@ -1670,7 +1757,7 @@ This is the lower (\textit{right-handed}) part. \begin{docTcbKey}{sidebyside align}{=\meta{alignment value}}{no default, initially |center|} Sets the vertical alignment for the left-handed and right-handed part. - Feasible values are |center|, |top|, and |bottom|. + Feasible values are \docValue{center}, \docValue{top}, and \docValue{bottom}. \begin{dispExample} \tcbset{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,nobeforeafter, left=2mm,right=2mm,sidebyside,sidebyside gap=6mm,width=(\linewidth-2mm)/3} @@ -1975,9 +2062,9 @@ This is a \textbf{tcolorbox}. 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 + \item\docValue{none}: no switching. + \item\docValue{forced}: the values of the left and right enlargement are switched. + \item\docValue{evenpage}: if the page is an even page, the values of the left and right enlargement are switched. It is recommended that one use this setting in conjunction with \refKey{/tcb/check odd page}. %Note that the page number detection may @@ -2182,6 +2269,7 @@ It may be changed by redefining this style. \tcbset{every box/.style={enhanced}} \end{dispListing} +\medskip \begin{marker} The alternative for setting something for every box (on every layer) is\\ \refCom{tcbsetforeverylayer}: @@ -2227,7 +2315,7 @@ not forbidden. \begin{tcboutputlisting} % \usepackage{lipsum} % \tcbuselibrary{skins,breakable} -\tcbset{enhanced,breakable,colframe=red!75!black,fonttitle=\bfseries, +\tcbset{enhanced jigsaw,breakable,colframe=red!75!black,fonttitle=\bfseries, colback=red!5!white, every box/.style={enhanced,watermark text=\thetcblayer, before=\par\smallskip,after=\par\smallskip}, @@ -2270,17 +2358,17 @@ Some text\footnote{Footnote from some text}. Feasible values for \meta{mode} are: \begin{itemize} -\item |minipage|:\\ +\item\docValue{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|:\\ +\item\docValue{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 \mylib{fitting} library)\\ +\item\docValue{fitbox}: (needs the \mylib{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. |