| 1 |
\documentclass[a4paper,11pt]{article} |
| 2 |
\usepackage[T1]{fontenc} |
| 3 |
\usepackage[utf8]{inputenc} |
| 4 |
\usepackage[english]{babel} |
| 5 |
\usepackage{graphicx} |
| 6 |
\usepackage{microtype} |
| 7 |
\usepackage[osf]{mathpazo} |
| 8 |
\usepackage[x11names]{xcolor} |
| 9 |
\usepackage[font=footnotesize,labelfont={bf}]{caption} |
| 10 |
\usepackage{subfig} |
| 11 |
\usepackage{listings} |
| 12 |
\lstset{language=[LaTeX]TeX,% |
| 13 |
basicstyle=\footnotesize\ttfamily, |
| 14 |
keywordstyle=\footnotesize\ttfamily\color{DodgerBlue1}, |
| 15 |
commentstyle=\footnotesize\ttfamily\color{DarkOrchid1}, |
| 16 |
showstringspaces=false, |
| 17 |
morecomment=[s][\footnotesize\ttfamily\color{brown!87!black}]\[ \], |
| 18 |
morecomment=[s][\footnotesize\ttfamily\color{brown!87!black}]< >, |
| 19 |
texcsstyle=*\color{DodgerBlue1}, |
| 20 |
morekeywords={invblock,opaqueblock,setalignment,dynalert,usetheme,alert,setinvopacity, |
| 21 |
setblockcolor,setbordercolor,setinnercolor,setoutercolor,settopcolor,setbottomcolor, |
| 22 |
setleftcolor,setrightcolor,fancyblock,vshadeblock,oshadeblock,DeclareOption,setbeamercolor}, |
| 23 |
framerule=2pt, |
| 24 |
rulecolor=\color{DodgerBlue1}, |
| 25 |
rulesep=4pt, |
| 26 |
framesep=5pt |
| 27 |
} |
| 28 |
%\lstdefinestyle{myslash}{% |
| 29 |
% literate={\textbackslash}{{\textcolor{DodgerBlue1}{\textbackslash}}}{1}% |
| 30 |
%} |
| 31 |
\usepackage[pdfpagelabels,plainpages=false,colorlinks=true,hyperindex=true, |
| 32 |
urlcolor=OrangeRed1,linkcolor=DodgerBlue1]{hyperref} |
| 33 |
|
| 34 |
\newcommand*{\mcmd}[1]{\texttt{\{}\normalfont\texttt{#1}\texttt{\}}} |
| 35 |
\newcommand*{\mbcmd}[1]{\texttt{[}\normalfont\texttt{#1}\texttt{]}} |
| 36 |
\newcommand*{\meta}[1]{{\normalfont\ensuremath{\langle}\textit{#1}\ensuremath{\rangle}}} |
| 37 |
\newcommand*{\marg}[1]{\texttt{\{\meta{#1}\}}} |
| 38 |
\newcommand*{\sarg}[1]{\texttt{<\meta{#1}>}} |
| 39 |
\newcommand*{\mbarg}[1]{\texttt{[\meta{#1}]}} |
| 40 |
\newcommand*{\cs}[1]{\texttt{\char92#1}} |
| 41 |
|
| 42 |
\renewcommand\labelitemi{\color{DodgerBlue1!60}$\bullet$} |
| 43 |
\renewcommand\labelitemii{\color{DodgerBlue1!60}$\circ$} |
| 44 |
|
| 45 |
\newcommand{\name}{\textsf{dynblocks}} |
| 46 |
\newcommand{\version}{0.2b} |
| 47 |
\newcommand{\versiondate}{187/09/2014} |
| 48 |
|
| 49 |
\author{Claudio Fiandrino \\ \footnotesize{\href{mailto:[email protected]}{[email protected]}}} |
| 50 |
\title{The \name{} package \footnote{This package has version number \textit{v}\version{} of \versiondate{}; it is released under and subject to the \href{http://www.latex-project.org/lppl/}{\LaTeX\ Project Public License (LPPL)}.}} |
| 51 |
|
| 52 |
\begin{document} |
| 53 |
\maketitle |
| 54 |
\begin{abstract} |
| 55 |
The \name{} package allows to fully customize blocks aspect and dimension inside a presentation. |
| 56 |
|
| 57 |
The package originated from \href{http://tex.stackexchange.com/questions/53784/overlay-images-and-block-in-beamer}{this question} in \href{http://tex.stackexchange.com/}{TeX.SE}. The core functionalities of the package are based on \href{http://tex.stackexchange.com/questions/53784/overlay-images-and-block-in-beamer/53797#53797}{this answer}. |
| 58 |
\end{abstract} |
| 59 |
|
| 60 |
\tableofcontents |
| 61 |
|
| 62 |
\section{Introduction} |
| 63 |
The purpose of the package is to provide an instrument to customize several aspects of blocks (here called \emph{dynblocks}): |
| 64 |
\begin{itemize} |
| 65 |
\item the width; |
| 66 |
\item the color |
| 67 |
\begin{itemize} |
| 68 |
\item of the background; |
| 69 |
\item of the border; |
| 70 |
\end{itemize} |
| 71 |
\item the text: |
| 72 |
\begin{itemize} |
| 73 |
\item alignment; |
| 74 |
\item opacity |
| 75 |
\end{itemize} |
| 76 |
\end{itemize} |
| 77 |
Notice that \emph{dynblocks} defined by \name{} differ from usual beamer's blocks because no title is given. |
| 78 |
|
| 79 |
The package has the following requirements: |
| 80 |
\begin{itemize} |
| 81 |
\item \textsf{TikZ}; |
| 82 |
\item \textsf{etoolbox}; |
| 83 |
\item \textsf{xparse}. |
| 84 |
\end{itemize} |
| 85 |
|
| 86 |
I would like to thank Enrico Gregorio for having pointed out an issue after the release of Ti\textit{k}Z 3.0.0 and \textsf{xparse} version 2014/08/25. |
| 87 |
|
| 88 |
\section{Usage} |
| 89 |
To load the package use as usual: \cs{usepackage}\mbarg{options}\mcmd{dynblocks}. |
| 90 |
|
| 91 |
The different options that can be adopted will be analysed in detail in section \ref{sec:options}. |
| 92 |
|
| 93 |
\subsection{Basic usage} |
| 94 |
Using the package in basic mode allows to define a block with: |
| 95 |
\begin{itemize} |
| 96 |
\item \emph{justified} alignment; |
| 97 |
\item width equal to \cs{textwidth}; |
| 98 |
\item border color \cs{blue} and fill color \cs{blue!10}. |
| 99 |
\end{itemize} |
| 100 |
thanks to the command \cs{opaqueblock}\sarg{overlay spec}\mbarg{width}\marg{text}. Notice that \sarg{overlay spec} could be: |
| 101 |
\begin{itemize} |
| 102 |
\item a single number: \texttt{<1>}; |
| 103 |
\item multiple numbers separated by commas and delimited by braces: \texttt{<\{1,2,3\}>}; |
| 104 |
\item a single number followed by a dash: \texttt{<1->}. |
| 105 |
\end{itemize} |
| 106 |
Moreover, it is also possible to make it \emph{invisible}, that is to force colors to become \texttt{gray} by means of \cs{invblock}\sarg{overlay spec}. For example, the following code, generates the two frames shown in figures \ref{fig:basic1} and \ref{fig:basic2}. |
| 107 |
\medskip |
| 108 |
\begin{lstlisting}[frame=lines] |
| 109 |
\documentclass{beamer} |
| 110 |
\usepackage{dynblocks} |
| 111 |
|
| 112 |
\usetheme{Luebeck} |
| 113 |
|
| 114 |
\begin{document} |
| 115 |
\begin{frame}{The frame title} |
| 116 |
\begin{columns}[T] |
| 117 |
\begin{column}{0.4\textwidth} |
| 118 |
\begin{dynblock} |
| 119 |
\opaqueblock<1>[0.8\textwidth]{hello this is a dynamic block |
| 120 |
with an itemize environment: |
| 121 |
\begin{itemize} |
| 122 |
\item hello |
| 123 |
\item hello again |
| 124 |
\end{itemize} |
| 125 |
} |
| 126 |
\invblock<2-> |
| 127 |
\end{dynblock} |
| 128 |
\end{column} |
| 129 |
\begin{column}{0.4\textwidth} |
| 130 |
\begin{dynblock} |
| 131 |
\opaqueblock<2>{hello this is another dynamic block} |
| 132 |
\end{dynblock} |
| 133 |
\end{column} |
| 134 |
\end{columns} |
| 135 |
\end{frame} |
| 136 |
|
| 137 |
\end{document} |
| 138 |
\end{lstlisting} |
| 139 |
|
| 140 |
\begin{figure}[ht] |
| 141 |
\centering |
| 142 |
\subfloat[First frame]{ |
| 143 |
\includegraphics[scale=0.45]{./images/basic_1} |
| 144 |
\label{fig:basic1}% |
| 145 |
} |
| 146 |
\hspace*{0.25cm} |
| 147 |
\subfloat[Second frame]{ |
| 148 |
\includegraphics[scale=0.45]{./images/basic_2} |
| 149 |
\label{fig:basic2}% |
| 150 |
} |
| 151 |
\caption{The basic example} |
| 152 |
\end{figure} |
| 153 |
|
| 154 |
In this example, it is possible to notice that the second \cs{opaqueblock} has no specified \texttt{width}; the default value is \cs{textwidth}, but if the block is placed inside a \emph{column} environment it automatically inherits the \texttt{width} given there. To set different values of \texttt{width}, it is necessary to specify the optional argument as did for the first \cs{opaqueblock} of the example. |
| 155 |
|
| 156 |
The presence of an \cs{invblock} makes the first \cs{opaqueblock} invisible; this command needs to be placed immediately after an \cs{opaqueblock} because of two facts: |
| 157 |
\begin{itemize} |
| 158 |
\item it automatically inherits the \texttt{width} from the \cs{opaqueblock}; |
| 159 |
\item it automatically shows the text of the previous \cs{opaqueblock}. |
| 160 |
\end{itemize} |
| 161 |
|
| 162 |
Finally, both \cs{opaqueblock} and \cs{invblock} need to be placed inside a \texttt{dynblock} environment. |
| 163 |
|
| 164 |
\subsection{Change text alignment} |
| 165 |
Thanks to the command \cs{setalignment}\marg{text spec} the text alignment changes according to the \meta{text spec} (for all possibilities please refer to the pgfmanual section 17.4.3 - version December 20, 2013). |
| 166 |
|
| 167 |
Suppose, for instance, to modify the previous example in order to display the second block with center aligned text. The only change to do is: |
| 168 |
\medskip |
| 169 |
\begin{lstlisting}[frame=lines] |
| 170 |
\begin{dynblock} |
| 171 |
\setalignment{center} |
| 172 |
\opaqueblock<2>{hello this is another dynamic block} |
| 173 |
\end{dynblock} |
| 174 |
\end{lstlisting} |
| 175 |
|
| 176 |
and this will lead to figure \ref{fig:align}. |
| 177 |
|
| 178 |
\begin{figure}[ht] |
| 179 |
\centering |
| 180 |
\includegraphics[scale=0.7]{./images/align} |
| 181 |
\caption{Second frame with text center aligned for the second block}% |
| 182 |
\label{fig:align}% |
| 183 |
\end{figure} |
| 184 |
|
| 185 |
Notice that the alignments can be local or global: if there is a definition in the preamble (global), all the \emph{dynblocks} will be set according to this definition. When the definition is set inside a group (a \emph{columns} environment or even simpler, the \emph{dynblock} environment), it affects only locally the \emph{dynblocks}. It is even possible set a global definition and then make local changes. |
| 186 |
|
| 187 |
\subsection{Text opacity and word alert} |
| 188 |
By default: |
| 189 |
\begin{itemize} |
| 190 |
\item \cs{opaqueblock}s have an opacity set to $0.9$; |
| 191 |
\item \cs{invblock}s have an opacity set to $0.4$. |
| 192 |
\end{itemize} |
| 193 |
To change these values two commands have been introduced: |
| 194 |
\begin{itemize} |
| 195 |
\item \cs{setvisopacity}\marg{opacity spec}; |
| 196 |
\item \cs{setinvopacity}\marg{opacity spec}; |
| 197 |
\end{itemize} |
| 198 |
where \meta{opacity spec} is a value in the interval $[0 \, , \, 1]$. Also these commands can be set locally or in a global fashion in the preamble. |
| 199 |
|
| 200 |
Due to the opacity, the usual \cs{alert} command is not more useful with \cs{invblock}s. The package provides a method to alert a word even in this case. The command to be used is \cs{dynalert}\sarg{overlay spec}\marg{text}. Note that with the proper usage of \meta{overlay spec}, \cs{dynalert} must not fall inside a \cs{opaqueblock}. This is a limitation because the purpose for which it has been developed is different. |
| 201 |
|
| 202 |
Assume, for example, to modify the reference example such that the opacity of \cs{invblock} will be set to $0.1$; furthermore, for the first block, the word ``\emph{itemize}'' will be alerted with \cs{alert}, while ``\emph{dynamic block}'' with \cs{dynalert} and for the second block (that does not have the correspondent \cs{invblock}) it is shown what happens with a wrong usage of \cs{dynalert}. The code is: |
| 203 |
\medskip |
| 204 |
\begin{lstlisting}[frame=lines] |
| 205 |
\documentclass{beamer} |
| 206 |
\usepackage{dynblocks} |
| 207 |
|
| 208 |
\usetheme{Luebeck} |
| 209 |
\setinvopacity{0.1} |
| 210 |
|
| 211 |
\begin{document} |
| 212 |
\begin{frame}{The frame title} |
| 213 |
\begin{columns}[T] |
| 214 |
\begin{column}{0.4\textwidth} |
| 215 |
\begin{dynblock} |
| 216 |
\opaqueblock<1>[0.8\textwidth]{hello this is a |
| 217 |
\dynalert<2>{dynamic block} with an \alert<1,2>{itemize} |
| 218 |
environment: |
| 219 |
\begin{itemize} |
| 220 |
\item hello |
| 221 |
\item hello again |
| 222 |
\end{itemize} |
| 223 |
} |
| 224 |
\invblock<2-> |
| 225 |
\end{dynblock} |
| 226 |
\end{column} |
| 227 |
\begin{column}{0.4\textwidth} |
| 228 |
\begin{dynblock} |
| 229 |
\opaqueblock<2>{hello this is another |
| 230 |
\dynalert<2>{dynamic} block} |
| 231 |
\end{dynblock} |
| 232 |
\end{column} |
| 233 |
\end{columns} |
| 234 |
\end{frame} |
| 235 |
|
| 236 |
\end{document} |
| 237 |
\end{lstlisting} |
| 238 |
|
| 239 |
\begin{figure}[ht] |
| 240 |
\centering |
| 241 |
\subfloat[First frame]{ |
| 242 |
\includegraphics[scale=0.45]{./images/alert_1} |
| 243 |
\label{fig:alert1}% |
| 244 |
} |
| 245 |
\hspace*{0.1cm} |
| 246 |
\subfloat[Second frame]{ |
| 247 |
\includegraphics[scale=0.45]{./images/alert_2} |
| 248 |
\label{fig:alert2}% |
| 249 |
} |
| 250 |
\caption{Example with different opacity and alerts} |
| 251 |
\end{figure} |
| 252 |
|
| 253 |
As it is possible to see from figures \ref{fig:alert1} and \ref{fig:alert2}, the usual \cs{alert}, when used inside an \cs{invblock}, is set with the opacity of the block while the proper \cs{dynalert} no. Anyway, a wrong usage of \cs{dynalert} lead to the output shown in figure \ref{fig:alert2}: the subsequent text of the alerted word is set with the opacity of an \cs{invblock}. |
| 254 |
|
| 255 |
The suggested use, in conclusion, is: |
| 256 |
\begin{itemize} |
| 257 |
\item \cs{alert} with \meta{overlay spec} equal specified in the related \cs{opaqueblock}; |
| 258 |
\item \cs{dynalert} to highlight words inside an \cs{invblock}; |
| 259 |
\item never do something like: \cs{dynalert}\texttt{<1,2>}\mcmd{word} if the \cs{opaqueblock} is shown in \meta{overlay spec}$=1$ and the \cs{invblock} in \meta{overlay spec}$=2$. |
| 260 |
\end{itemize} |
| 261 |
|
| 262 |
To change colors: |
| 263 |
\begin{itemize} |
| 264 |
\item for \cs{alert} the usual Beamer command works:\\ \cs{setbeamercolor}\mcmd{alerted text}\marg{color spec}; |
| 265 |
\item for \cs{dynalert} a different command has been introduced to differentiate them from standard Beamer's alerts: \cs{setwordscolor}\marg{color}; the default value is set to \textit{blue}. |
| 266 |
\end{itemize} |
| 267 |
|
| 268 |
\section{Options and advanced examples}\label{sec:options} |
| 269 |
In this section the package's options are introduced with examples. They allow to customize more deeply the aspect of \emph{dynblocks}: |
| 270 |
\begin{itemize} |
| 271 |
\item adding the shadow and the rounded corners (subsection \ref{subse:shrc}); |
| 272 |
\item customizing the fill color (subsection \ref{subse:cfill}); |
| 273 |
\item adapting the fill color to the current Beamer theme used (subsection \ref{subse:cadapt}). |
| 274 |
\end{itemize} |
| 275 |
|
| 276 |
\subsection{The shadow and the rounded corners}\label{subse:shrc} |
| 277 |
To load: |
| 278 |
\begin{itemize} |
| 279 |
\item the shadow option use: \cs{usepackage}\mbcmd{shadow}\mcmd{dynblocks}; it is possible to set the \emph{shadow opacity} by means of the following command: \cs{setshadowopacity}\marg{opacity spec} (default value $0.4$); |
| 280 |
\item the option to have rounded corners for \emph{dynblocks} use: \\ \cs{usepackage}\mbcmd{roundedcorners}\mcmd{dynblocks}. |
| 281 |
\end{itemize} |
| 282 |
|
| 283 |
For example: |
| 284 |
\begin{lstlisting}[frame=lines] |
| 285 |
\documentclass{beamer} |
| 286 |
\usepackage[shadow,roundedcorners]{dynblocks} |
| 287 |
|
| 288 |
\usetheme{Luebeck} |
| 289 |
|
| 290 |
\begin{document} |
| 291 |
\begin{frame}{The frame title} |
| 292 |
\begin{columns}[T] |
| 293 |
\begin{column}{0.4\textwidth} |
| 294 |
\begin{dynblock} |
| 295 |
\opaqueblock<1>[0.8\textwidth]{hello this is a |
| 296 |
\dynalert<2>{dynamic block} with an |
| 297 |
\alert<1,2>{itemize} environment: |
| 298 |
\begin{itemize} |
| 299 |
\item hello |
| 300 |
\item hello again |
| 301 |
\end{itemize} |
| 302 |
} |
| 303 |
\invblock<2-> |
| 304 |
\end{dynblock} |
| 305 |
\end{column} |
| 306 |
\begin{column}{0.4\textwidth} |
| 307 |
\begin{dynblock} |
| 308 |
\setalignment{center} |
| 309 |
\opaqueblock<2>{hello this is another dynamic block} |
| 310 |
\end{dynblock} |
| 311 |
\end{column} |
| 312 |
\end{columns} |
| 313 |
\end{frame} |
| 314 |
|
| 315 |
\end{document} |
| 316 |
\end{lstlisting} |
| 317 |
allows to get the frames shown in figures \ref{fig:shdrndc1} and \ref{fig:shdrndc2}. |
| 318 |
|
| 319 |
\begin{figure}[ht] |
| 320 |
\centering |
| 321 |
\subfloat[First frame]{ |
| 322 |
\includegraphics[scale=0.45]{./images/shdrndc_1} |
| 323 |
\label{fig:shdrndc1}% |
| 324 |
} |
| 325 |
\hspace*{0.1cm} |
| 326 |
\subfloat[Second frame]{ |
| 327 |
\includegraphics[scale=0.45]{./images/shdrndc_2} |
| 328 |
\label{fig:shdrndc2}% |
| 329 |
} |
| 330 |
\caption{Example with \texttt{shadow} and \texttt{roundedcorners} options} |
| 331 |
\end{figure} |
| 332 |
|
| 333 |
\subsection{Customized fill colors}\label{subse:cfill} |
| 334 |
By activating this option it is possible to fully customize the \emph{dynblocks} colors because several command become available: |
| 335 |
\begin{itemize} |
| 336 |
\item \cs{setblockcolor}\marg{color spec} and \cs{setbordercolor}\marg{color spec} for the \cs{opaqueblock}s (default values are \textit{blue!10} and \textit{blue} respectively); |
| 337 |
\item \cs{setinnercolor}\marg{color spec} and \cs{setoutercolor}\marg{color spec} for the \cs{fancyblock}s (default values are \textit{white} and \textit{blue!10} respectively); |
| 338 |
\item \cs{settopcolor}\marg{color spec} and \cs{setbottomcolor}\marg{color spec} for the \cs{vshadeblock}s (default values are \textit{white} and \textit{blue!10} respectively); |
| 339 |
\item \cs{setleftcolor}\marg{color spec} and \cs{setrightcolor}\marg{color spec} for the \cs{oshadeblock}s (default values are \textit{white} and \textit{blue!10} respectively). |
| 340 |
\end{itemize} |
| 341 |
Similarly to the \texttt{shadow} and the \texttt{roundedcorners} options, to load the \texttt{customcolors} option use \cs{usepackage}\mbcmd{customcolors}\mcmd{dynblocks}. |
| 342 |
|
| 343 |
In the following example, all \emph{dynblocks} types are used and it is possible to see how local and global setting work. |
| 344 |
|
| 345 |
\begin{lstlisting}[frame=lines] |
| 346 |
\documentclass{beamer} |
| 347 |
\usepackage[shadow, roundedcorners,customcolors]{dynblocks} |
| 348 |
% some global settings |
| 349 |
\setblockcolor{red!10} |
| 350 |
\setbordercolor{red} |
| 351 |
\setbottomcolor{orange!40} |
| 352 |
\setrightcolor{orange!40} |
| 353 |
|
| 354 |
\usetheme{Luebeck} |
| 355 |
|
| 356 |
\begin{document} |
| 357 |
\begin{frame}{The frame title} |
| 358 |
\begin{columns}[T] |
| 359 |
\begin{column}{0.4\textwidth} |
| 360 |
\begin{dynblock} |
| 361 |
\opaqueblock<1>[0.8\textwidth]{hello this is a |
| 362 |
\dynalert<2>{dynamic block} with an |
| 363 |
\alert<1,2>{itemize} environment: |
| 364 |
\begin{itemize} |
| 365 |
\item hello |
| 366 |
\item hello again |
| 367 |
\end{itemize} |
| 368 |
} |
| 369 |
\invblock<2-> |
| 370 |
\end{dynblock} |
| 371 |
\end{column} |
| 372 |
\begin{column}{0.4\textwidth} |
| 373 |
\setalignment{center} |
| 374 |
\begin{dynblock} |
| 375 |
% default settings since no |
| 376 |
% \setinnercolor or \setoutercolor |
| 377 |
% are there |
| 378 |
\fancyblock<2>{hello this is another dynamic block} |
| 379 |
\invblock<3-> |
| 380 |
\end{dynblock} |
| 381 |
\\[2ex] |
| 382 |
\setbordercolor{orange} % local definition |
| 383 |
% that overwrites the global one |
| 384 |
\begin{dynblock} |
| 385 |
\vshadeblock<3>{replica: hello this a another dynamic block} |
| 386 |
\invblock<4-> |
| 387 |
\end{dynblock} |
| 388 |
\\[2ex] |
| 389 |
\begin{dynblock} |
| 390 |
\oshadeblock<4>{replica 2: hello this a another dynamic block} |
| 391 |
\end{dynblock} |
| 392 |
\end{column} |
| 393 |
\end{columns} |
| 394 |
\end{frame} |
| 395 |
|
| 396 |
\end{document} |
| 397 |
\end{lstlisting} |
| 398 |
|
| 399 |
The four frames obtained by this example are shown in figures \ref{fig:custcol1}, \ref{fig:custcol2}, \ref{fig:custcol3} and \ref{fig:custcol4}; more in detail: |
| 400 |
\begin{itemize} |
| 401 |
\item an example of \cs{opaqueblock} customization through \cs{setblockcolor} and \cs{setbordercolor} could be seen in figure \ref{fig:custcol1}; |
| 402 |
\item an example of \cs{fancyblock} with default settings could be seen in figure \ref{fig:custcol2} (notice that it inherits the \texttt{bordercolor} from the global setting); |
| 403 |
\item an example of \cs{vshadeblock} with customization of \cs{setbottomcolor} and locally \cs{setbordercolor} (\cs{settopcolor} at default value) could be seen in figure \ref{fig:custcol3}; |
| 404 |
\item finally, an example of \cs{oshadeblock} with \cs{setrightcolor} and local \cs{setbordercolor} customization (\cs{settopcolor} at default value) could be seen in figure \ref{fig:custcol4}. |
| 405 |
\end{itemize} |
| 406 |
|
| 407 |
\begin{figure}[ht] |
| 408 |
\centering |
| 409 |
\subfloat[First frame]{ |
| 410 |
\includegraphics[scale=0.45]{./images/custcol_1} |
| 411 |
\label{fig:custcol1}% |
| 412 |
} |
| 413 |
\hspace*{0.25cm} |
| 414 |
\subfloat[Second frame]{ |
| 415 |
\includegraphics[scale=0.45]{./images/custcol_2} |
| 416 |
\label{fig:custcol2}% |
| 417 |
} |
| 418 |
\\ |
| 419 |
\subfloat[Third frame]{ |
| 420 |
\includegraphics[scale=0.45]{./images/custcol_3} |
| 421 |
\label{fig:custcol3}% |
| 422 |
} |
| 423 |
\hspace*{0.25cm} |
| 424 |
\subfloat[Fourth frame]{ |
| 425 |
\includegraphics[scale=0.45]{./images/custcol_4} |
| 426 |
\label{fig:custcol4}% |
| 427 |
} |
| 428 |
\caption{Example with \texttt{customcolor} option and all \emph{dynblocks} types} |
| 429 |
\end{figure} |
| 430 |
|
| 431 |
\subsection{Color adaptation to the Beamer theme}\label{subse:cadapt} |
| 432 |
The purpose of this option is to use the Beamer's color of the theme currently adopted; as it will be possible to see, the \texttt{getthemecolors} option should be used with particular care. To load the option there is the usual \cs{usepackage}\mbcmd{getthemecolors}\mcmd{dynblocks}. |
| 433 |
|
| 434 |
This option is defined inside the package as: |
| 435 |
\begin{lstlisting}[frame=lines] |
| 436 |
\DeclareOption{getthemecolors}{ |
| 437 |
% redefinition opaqueblock |
| 438 |
\renewcommand{\thecol}{structure.fg!10} |
| 439 |
\renewcommand{\thebordercol}{structure.fg} |
| 440 |
% redefinition fancyblock |
| 441 |
\def\@setinnercolor{white} |
| 442 |
\def\@setoutercolor{structure.fg!10} |
| 443 |
% redefinition vshadeblock |
| 444 |
\def\@settopcolor{white} |
| 445 |
\def\@setbottomcolor{structure.fg!10} |
| 446 |
% redefinition oshadeblock |
| 447 |
\def\@setleftcolor{white} |
| 448 |
\def\@setrightcolor{structure.fg!10} |
| 449 |
} |
| 450 |
\end{lstlisting} |
| 451 |
thus it works properly if the current \texttt{beamercolortheme} set the \emph{structure} definition. |
| 452 |
|
| 453 |
For example: |
| 454 |
\begin{lstlisting}[frame=lines] |
| 455 |
\documentclass{beamer} |
| 456 |
\usepackage[shadow, roundedcorners,getthemecolors, |
| 457 |
customcolors]{dynblocks} |
| 458 |
|
| 459 |
\usetheme{CambridgeUS} |
| 460 |
|
| 461 |
\begin{document} |
| 462 |
\begin{frame}{The frame title} |
| 463 |
\begin{columns}[T] |
| 464 |
\begin{column}{0.4\textwidth} |
| 465 |
\begin{dynblock} |
| 466 |
\opaqueblock<1>[0.8\textwidth]{hello this is a |
| 467 |
\dynalert<2>{dynamic block} with an |
| 468 |
\alert<1,2>{itemize} environment: |
| 469 |
\begin{itemize} |
| 470 |
\item hello |
| 471 |
\item hello again |
| 472 |
\end{itemize} |
| 473 |
} |
| 474 |
\invblock<2-> |
| 475 |
\end{dynblock} |
| 476 |
\end{column} |
| 477 |
\begin{column}{0.4\textwidth} |
| 478 |
\setalignment{center} |
| 479 |
\begin{dynblock} |
| 480 |
\opaqueblock<2>{hello this is another dynamic block} |
| 481 |
\end{dynblock} |
| 482 |
\end{column} |
| 483 |
\end{columns} |
| 484 |
\end{frame} |
| 485 |
|
| 486 |
\end{document} |
| 487 |
\end{lstlisting} |
| 488 |
will lead to figures \ref{fig:cmbx1} and \ref{fig:cmbx2}. |
| 489 |
\begin{figure}[ht] |
| 490 |
\centering |
| 491 |
\subfloat[First frame]{ |
| 492 |
\includegraphics[scale=0.45]{./images/cmbx_1} |
| 493 |
\label{fig:cmbx1}% |
| 494 |
} |
| 495 |
\hspace*{0.1cm} |
| 496 |
\subfloat[Second frame]{ |
| 497 |
\includegraphics[scale=0.45]{./images/cmbx_2} |
| 498 |
\label{fig:cmbx2}% |
| 499 |
} |
| 500 |
\caption{Example with a theme that does not define structure color} |
| 501 |
\end{figure} |
| 502 |
|
| 503 |
The result can be improved in the following way: |
| 504 |
\begin{lstlisting}[frame=lines] |
| 505 |
\documentclass{beamer} |
| 506 |
\usepackage[shadow, roundedcorners,getthemecolors, |
| 507 |
customcolors]{dynblocks} |
| 508 |
|
| 509 |
\usetheme{CambridgeUS} |
| 510 |
% definition of structure |
| 511 |
\setbeamercolor*{structure}{parent=palette primary} |
| 512 |
|
| 513 |
\begin{document} |
| 514 |
\begin{frame}{The frame title} |
| 515 |
\begin{columns}[T] |
| 516 |
\begin{column}{0.4\textwidth} |
| 517 |
\begin{dynblock} |
| 518 |
\opaqueblock<1>[0.8\textwidth]{hello this is a |
| 519 |
\dynalert<2>{dynamic block} with an |
| 520 |
\alert<1,2>{itemize} environment: |
| 521 |
\begin{itemize} |
| 522 |
\item hello |
| 523 |
\item hello again |
| 524 |
\end{itemize} |
| 525 |
} |
| 526 |
\invblock<2-> |
| 527 |
\end{dynblock} |
| 528 |
\end{column} |
| 529 |
\begin{column}{0.4\textwidth} |
| 530 |
\setalignment{center} |
| 531 |
\begin{dynblock} |
| 532 |
\opaqueblock<2>{hello this is another dynamic block} |
| 533 |
\end{dynblock} |
| 534 |
\end{column} |
| 535 |
\end{columns} |
| 536 |
\end{frame} |
| 537 |
|
| 538 |
\end{document} |
| 539 |
\end{lstlisting} |
| 540 |
obtaining as result the frames shown in figures \ref{fig:cmby1} and \ref{fig:cmby2}. |
| 541 |
|
| 542 |
\begin{figure}[ht] |
| 543 |
\centering |
| 544 |
\subfloat[First frame]{ |
| 545 |
\includegraphics[scale=0.45]{./images/cmby_1} |
| 546 |
\label{fig:cmby1}% |
| 547 |
} |
| 548 |
\hspace*{0.1cm} |
| 549 |
\subfloat[Second frame]{ |
| 550 |
\includegraphics[scale=0.45]{./images/cmby_2} |
| 551 |
\label{fig:cmby2}% |
| 552 |
} |
| 553 |
\caption{Example of a theme with a posteriori structure color definition} |
| 554 |
\end{figure} |
| 555 |
|
| 556 |
|
| 557 |
Here is another example: |
| 558 |
\begin{lstlisting}[frame=lines] |
| 559 |
\documentclass{beamer} |
| 560 |
\usepackage[getthemecolors]{dynblocks} |
| 561 |
|
| 562 |
\usetheme{EastLansing} |
| 563 |
\setbeamercolor*{structure}{parent=palette primary} |
| 564 |
|
| 565 |
\begin{document} |
| 566 |
\begin{frame}{The frame title} |
| 567 |
\begin{dynblock} |
| 568 |
\opaqueblock<1>{hello this is a |
| 569 |
dynamic block with an |
| 570 |
itemize environment: |
| 571 |
\begin{itemize} |
| 572 |
\item hello |
| 573 |
\item hello again |
| 574 |
\end{itemize} |
| 575 |
} |
| 576 |
\end{dynblock} |
| 577 |
\end{frame} |
| 578 |
|
| 579 |
\end{document} |
| 580 |
\end{lstlisting} |
| 581 |
with the final output shown in figure \ref{fig:estl}. |
| 582 |
|
| 583 |
\begin{figure}[ht] |
| 584 |
\centering |
| 585 |
\includegraphics[scale=0.7]{./images/estl} |
| 586 |
\caption{Second example of a theme with a posteriori structure color definition}% |
| 587 |
\label{fig:estl}% |
| 588 |
\end{figure} |
| 589 |
|
| 590 |
The decision of adopting \emph{structure} as reference is due to the fact that this parameter is one of the most relevant while customizing a Beamer theme. In the following example, it is shown a color customization of the Szeged theme and a particular effect that can be realized thanks to multiple \emph{dynblocks} inside the same \texttt{dynblock} environment: |
| 591 |
\begin{lstlisting}[frame=lines] |
| 592 |
\documentclass{beamer} |
| 593 |
\usepackage[getthemecolors,roundedcorners,shadow]{dynblocks} |
| 594 |
|
| 595 |
\usetheme{Szeged} |
| 596 |
\setbeamercolor{structure}{bg=red!20,fg=red} |
| 597 |
|
| 598 |
\begin{document} |
| 599 |
|
| 600 |
|
| 601 |
\begin{frame}{A title} |
| 602 |
\begin{center} |
| 603 |
\begin{dynblock} |
| 604 |
\opaqueblock<1>[0.6\textwidth]{hello this is a dynamic block |
| 605 |
with an itemize environment: |
| 606 |
\begin{itemize} |
| 607 |
\item hello |
| 608 |
\item hello again |
| 609 |
\end{itemize} |
| 610 |
} |
| 611 |
\invblock<2-> |
| 612 |
\setalignment{center} |
| 613 |
\opaqueblock<2>{hello this is another dynamic block} |
| 614 |
\end{dynblock} |
| 615 |
\end{center} |
| 616 |
\end{frame} |
| 617 |
|
| 618 |
\end{document} |
| 619 |
\end{lstlisting} |
| 620 |
The two frames obtained as outcome are shown in figures \ref{fig:szeg1} and \ref{fig:szeg2}. |
| 621 |
\begin{figure} |
| 622 |
\centering |
| 623 |
\subfloat[First frame]{ |
| 624 |
\includegraphics[scale=0.45]{./images/szeg_1} |
| 625 |
\label{fig:szeg1}% |
| 626 |
} |
| 627 |
\hspace*{0.1cm} |
| 628 |
\subfloat[Second frame]{ |
| 629 |
\includegraphics[scale=0.45]{./images/szeg_2} |
| 630 |
\label{fig:szeg2}% |
| 631 |
} |
| 632 |
\caption{Example of a customized theme} |
| 633 |
\end{figure} |
| 634 |
|
| 635 |
Note that the \texttt{getthemecolors} option has some drawbacks when it is used with particular Beamer color themes like: |
| 636 |
\begin{itemize} |
| 637 |
\item albatross; |
| 638 |
\item beetle. |
| 639 |
\end{itemize} |
| 640 |
|
| 641 |
|
| 642 |
\end{document} |
| 643 |
|