Debian Codegraph @

texmf-dist/doc/latex/tcolorbox/tcolorbox.doc.beamer.tex

raw
1 % !TeX root = tcolorbox.tex
2 % include file of tcolorbox.tex (manual of the LaTeX package tcolorbox)
3 \clearpage
4 \section{Beamer Support}\label{sec:beamer}%
5 \tcbset{external/prefix=external/beamer_}%
6 The \mylib{skins} library adds some supporting options for the \refPkg{beamer}
7 package \cite{tantau:beamer}.
8 For the following options, the \mylib{skins} library has to be loaded
9 by a package option or inside the preamble by:
10 \begin{dispListing}
11 \tcbuselibrary{skins}
12 \end{dispListing}
13
14 See \zvref{sec:skins} for the documentation of all other options of the \mylib{skins} library.
15
16 \begin{docTcbKey}[][doc new and updated={2015-01-09}{2019-03-01}]{only}{=\pbarg{overlay specification}\marg{options}}{style, no default, initially unset}
17 Sets the given |tcolorbox| \meta{options} in dependency of
18 a |beamer| \meta{overlay specification}.
19 Note that this needs the |beamer| class \cite{tantau:beamer}.
20 The \meta{options} will only be used on the specified |beamer| frames.
21
22
23 \begin{fulldocumentlisting}{}
24 \documentclass{beamer}
25 \usepackage[many]{tcolorbox}
26 \begin{document}
27
28 \begin{frame}
29 \begin{tcolorbox}[title=My title,fonttitle=\bfseries,
30 enhanced,colframe=red!50!black,colback=red!10,colbacktitle=red,
31 sidebyside,righthand width=3cm,
32 lowerbox=invisible,lower separated=false,
33 drop lifted shadow,
34 only=<1>{colbacktitle=yellow,coltitle=red!50!black,colframe=red},
35 only=<3>{colback=yellow!50,watermark text={Attention!}},
36 only=<3->{lowerbox=visible} ]
37 This is a test.
38 \begin{itemize}[<+->]
39 \item One
40 \item Two
41 \item \alert<3>{Three}
42 \item Four
43 \end{itemize}
44 \tcblower
45 \begin{equation*}
46 \int\limits_{1}^{x} \frac{1}{t}~dt = \ln(x).
47 \end{equation*}
48 \end{tcolorbox}
49 \end{frame}
50 \end{document}
51 \end{fulldocumentlisting}
52
53
54 \begin{fulldocumentlisting}{}
55 \documentclass{beamer}
56 \usepackage[most]{tcolorbox}
57 \begin{document}
58
59 \begin{frame}[fragile]
60 \begin{tcblisting}{beamer,colback=blue!5,colframe=blue!20!gray,coltitle=yellow,
61 title=Example,
62 only=<1>{lowerbox=invisible},only=<2>{}
63 }
64 This is an \textbf{example listing}
65 \end{tcblisting}
66 \end{frame}
67 \end{document}
68 \end{fulldocumentlisting}
69
70 \begin{marker}
71 The option \refKey{/tcb/only} belonged to the core package before version 4.20.
72 \end{marker}
73 \end{docTcbKey}
74
75 \clearpage
76
77 \begin{docTcbKey}[][doc new={2025-05-28}]{alt}{=\pbarg{overlay specification}\marg{default}\marg{alternative}}{style, no default, initially unset}
78 Alternates between different |tcolorbox| options in dependency of a |beamer| \meta{overlay specification}.
79 The \meta{default} options are used on the specified slides, otherwise the \meta{alternative} options.
80 Note that this needs the |beamer| class \cite{tantau:beamer}.
81 \end{docTcbKey}
82
83 \begin{docTcbKey}[][doc new={2025-07-07}]{set alt}{=\marg{default}\marg{alternative}}{no default, initially \brackets{}\brackets{}}
84 Stores the arguments later to be used with \refKey{/tcb/use alt}.
85 \end{docTcbKey}
86
87 \begin{docTcbKey}[][doc new={2025-07-07}]{use alt}{=\pbarg{overlay specification}}{style, no default, initially unset}
88 Like \refKey{/tcb/alt}, but uses the arguments stored with \refKey{/tcb/set alt}.
89 \end{docTcbKey}
90
91 \begin{docTcbKey}[][doc new={2025-05-28}]{temporal}{=\pbarg{overlay specification}\marg{before slide}\marg{default}\marg{after slide}}{style,\linebreak no default, initially unset}
92 Temporarily changes between different |tcolorbox| options in dependency of a |beamer| \meta{overlay specification}.
93 The \meta{default} options are used on the specified slides,
94 the \meta{before slide} options are used before them, and
95 the \meta{after slide} options after them.
96 Note that this needs the |beamer| class \cite{tantau:beamer}.
97 \end{docTcbKey}
98
99 \begin{docTcbKey}[][doc new={2025-07-07}]{set temporal}{=\marg{before slide}\marg{default}\marg{after slide}}{no default, initially \brackets{}\brackets{}\brackets{}}
100 Stores the arguments later to be used with \refKey{/tcb/use temporal}.
101 \end{docTcbKey}
102
103 \begin{docTcbKey}[][doc new={2025-07-07}]{use temporal}{=\pbarg{overlay specification}}{style, no default, initially unset}
104 Like \refKey{/tcb/temporal}, but uses the arguments stored with \refKey{/tcb/set temporal}.
105 \end{docTcbKey}
106
107
108 \begin{docTcbKey}[][doc new={2019-03-01}]{hide}{=\pbarg{overlay specification}}{style, no default, initially unset}
109 Sets the \refKey{/tcb/beamer hidden} style in dependency of
110 a |beamer| \meta{overlay specification}.
111 \refKey{/tcb/beamer hidden} can be redefined for customization.
112 \end{docTcbKey}
113
114 \begin{docTcbKey}[][doc new={2019-03-01}]{beamer hidden}{}{style, no options, initially |nirvana|}
115 This style is not intended to be used directly, but in concealed way by applying
116 \refKey{/tcb/hide}. The style can be redefined.
117 \begin{dispListing}
118 \tcbset{
119 beamer hidden/.style={invisible,interior hidden,colframe=blue!20!gray!15},
120 }
121 \end{dispListing}
122 \end{docTcbKey}
123
124 \begin{docTcbKey}[][doc new={2019-03-01}]{alert}{=\pbarg{overlay specification}}{style, no default, initially unset}
125 Sets the \refKey{/tcb/beamer alerted} style in dependency of
126 a |beamer| \meta{overlay specification}.
127 \refKey{/tcb/beamer alerted} can be redefined for customization.
128 \end{docTcbKey}
129
130
131 \begin{docTcbKey}[][doc new={2019-03-01}]{beamer alerted}{}{style, no options, initially |fuzzy halo|}
132 This style is not intended to be used directly, but in concealed way by applying
133 \refKey{/tcb/alert}. The style can be redefined.
134 \begin{dispListing}
135 \tcbset{
136 beamer alerted/.style={colframe=red!50!gray},
137 }
138 \end{dispListing}
139 \end{docTcbKey}
140
141
142 \clearpage
143
144 The following examples use \refEnv{tcbitemize} from \mylib{raster} for
145 convenient use of a list of boxes which are uncovered one by one.
146
147
148 \begin{fulldocumentlisting}{run pdflatex}
149 \documentclass{beamer}
150 \usepackage[most]{tcolorbox}
151 \begin{document}
152
153 \begin{frame}
154 \begin{tcbitemize}[raster equal height=rows,
155 enhanced,colback=blue!5,colframe=blue!20!gray,coltitle=yellow,
156 ]
157 \tcbitem[title=One,alert=<1>]
158 First Statement
159 \tcbitem[title=Two,hide=<-1>,alert=<2>]
160 Second Statement
161 \tcbitem[title=Three,hide=<-2>,alert=<3>]
162 Test
163 \tcbitem[title=Four,hide=<-3>,alert=<4>]
164 \begin{equation*}
165 \int\limits_{1}^{x} \frac{1}{t}~dt = \ln(x).
166 \end{equation*}
167 \tcbitem[title=Five,hide=<-4>,alert=<5>]
168 \includegraphics[width=1cm]{goldshade.png}
169 \tcbitem[title=Six,hide=<-5>,alert=<6>]
170 Test
171 \end{tcbitemize}
172 \end{frame}
173 \end{document}
174 \end{fulldocumentlisting}
175
176
177
178 \begin{fulldocumentlisting}{run pdflatex}
179 \documentclass{beamer}
180 \usepackage[most]{tcolorbox}
181 \begin{document}
182
183 \begin{frame}
184 \begin{tcbitemize}[raster equal height=rows,enhanced,
185 set temporal={invisible,interior hidden,colframe=blue!20!gray!15}
186 {colback=red!5,colframe=red!50!gray,coltitle=yellow}
187 {colback=blue!5,colframe=blue!20!gray,coltitle=yellow},
188 ]
189 \tcbitem[title=One,use temporal=<1>]
190 First Statement
191 \tcbitem[title=Two,use temporal=<2>]
192 Second Statement
193 \tcbitem[title=Three,use temporal=<3>]
194 Test
195 \tcbitem[title=Four,use temporal=<4>]
196 \begin{equation*}
197 \int\limits_{1}^{x} \frac{1}{t}~dt = \ln(x).
198 \end{equation*}
199 \tcbitem[title=Five,use temporal=<5>]
200 \includegraphics[width=1cm]{goldshade.png}
201 \tcbitem[title=Six,use temporal=<6>]
202 Test
203 \end{tcbitemize}
204 \end{frame}
205 \end{document}
206 \end{fulldocumentlisting}
207
208
209
210 \begin{fulldocumentlisting}{run pdflatex}
211 \documentclass{beamer}
212 \usepackage[most]{tcolorbox}
213 \begin{document}
214
215 \begin{frame}
216 \begin{tcbitemize}[raster equal height=rows,beamer,
217 colback=blue!5,colframe=blue!20!gray,coltitle=yellow,
218 set temporal={colback=white,colframe=gray!50,
219 opacityupper=0.2,opacitytitle=0.2}
220 {colframe=red!50!gray,fuzzy halo}
221 {},
222 ]
223 \tcbitem[title=One,use temporal=<1>]
224 First Statement
225 \tcbitem[title=Two,use temporal=<2>]
226 Second Statement
227 \tcbitem[title=Three,use temporal=<3>]
228 Test
229 \tcbitem[title=Four,use temporal=<4>]
230 \begin{equation*}
231 \int\limits_{1}^{x} \frac{1}{t}~dt = \ln(x).
232 \end{equation*}
233 \tcbitem[title=Five,use temporal=<5>]
234 \includegraphics[width=1cm]{goldshade.png}
235 \tcbitem[title=Six,use temporal=<6>]
236 Test
237 \end{tcbitemize}
238 \end{frame}
239 \end{document}
240 \end{fulldocumentlisting}
241
242
243 \begin{fulldocumentlisting}{run pdflatex}
244 \documentclass{beamer}
245 \usepackage[most]{tcolorbox}
246
247 \NewTColorBox{mybox}{ d<> }{enhanced,
248 temporal=<#1>{empty,invisible}
249 {colback=red!5,colframe=red!20!gray}
250 {colframe=blue!20!gray,colback=blue!5},
251 }
252 \begin{document}
253
254 \begin{frame}
255 \begin{mybox}<1>
256 First Statement
257 \end{mybox}
258 \begin{mybox}<2>
259 Second Statement
260 \end{mybox}
261 \begin{mybox}<3>
262 Third Statement
263 \end{mybox}
264 \begin{mybox}<4>
265 Final Statement
266 \end{mybox}
267 \end{frame}
268 \end{document}
269 \end{fulldocumentlisting}