| 1 |
%% |
| 2 |
%% This is file `bgndexample.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% texpower-doc.dtx (with options: `bgndexample,bgndexample-src,end') |
| 8 |
%% |
| 9 |
%% -------------------------------------------------------------- |
| 10 |
%% TeXPower bundle - dynamic online presentations with LaTeX |
| 11 |
%% Copyright (C) 1999-2004 Stephan Lehmke |
| 12 |
%% Copyright (C) 2003-2005 Hans Fredrik Nordhaug |
| 13 |
%% |
| 14 |
%% This program is free software; you can redistribute it and/or |
| 15 |
%% modify it under the terms of the GNU General Public License |
| 16 |
%% as published by the Free Software Foundation; either version 2 |
| 17 |
%% of the License, or (at your option) any later version. |
| 18 |
%% |
| 19 |
%% This program is distributed in the hope that it will be useful, |
| 20 |
%% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
%% GNU General Public License for more details. |
| 23 |
%% -------------------------------------------------------------- |
| 24 |
%% |
| 25 |
%% The list of all files belonging to the TeXPower bundle is |
| 26 |
%% given in the file `00readme.txt'. |
| 27 |
%% |
| 28 |
\ProvidesFile{bgndexample.tex}% |
| 29 |
[2005/04/07 TeXPower example file] |
| 30 |
%----------------------------------------------------------------------------------------------------------------- |
| 31 |
% |
| 32 |
% Background style example for the package texpower.sty. |
| 33 |
% |
| 34 |
%----------------------------------------------------------------------------------------------------------------- |
| 35 |
% Use slifonts and a dark background. |
| 36 |
|
| 37 |
\PassOptionsToPackage{darkbackground,colorhighlight,verbose}{texpower} |
| 38 |
|
| 39 |
\RequirePackage{tpslifonts} |
| 40 |
|
| 41 |
% Input the generic preamble. |
| 42 |
|
| 43 |
\input{__TPpreamble} |
| 44 |
\hypersetup{pdftitle={texpower background style example}} |
| 45 |
|
| 46 |
\newcommand{\skipTo}[1]{\hyperlink{#1}{\present{\textsf{\textbf{Skip animation}}}}} |
| 47 |
|
| 48 |
\makeatletter |
| 49 |
\newcommand{\histogram}[1] |
| 50 |
{{% |
| 51 |
\renewcommand{\vstripe@TP}[4] |
| 52 |
{\rule{##2-2pt}{(##3)*\real{##1}}\hspace*{2pt}##4}% |
| 53 |
#1% |
| 54 |
}} |
| 55 |
\makeatother |
| 56 |
|
| 57 |
\newcommand{\totalbarwidth}{2cm} |
| 58 |
|
| 59 |
\newcommand{\mkbar}[2][100] |
| 60 |
{% |
| 61 |
\ifthenelse{#1<#2}{\def\percentval{#1}}{\def\percentval{#2}}% |
| 62 |
\mkfactor{\intensity}{\percentval/100}% |
| 63 |
\colorbetween[\intensity]{ecolor}{green}{red}% |
| 64 |
\hgradrule[\percentval]{red}{ecolor}{\totalbarwidth*\real{\intensity}}{1ex} |
| 65 |
\textbf{\boldmath$\mathsf{\ifthenelse{\percentval<10}{\phantom{0}}{}\percentval\%}$}% |
| 66 |
} |
| 67 |
|
| 68 |
\renewcommand{\bgndstripes}{100} |
| 69 |
|
| 70 |
\setlength{\fboxrule}{1pt} |
| 71 |
|
| 72 |
%----------------------------------------------------------------------------------------------------------------- |
| 73 |
% Finally, everything is set up. Here we go... |
| 74 |
% |
| 75 |
\begin{document} |
| 76 |
\begin{slide} |
| 77 |
|
| 78 |
\centerslidestrue |
| 79 |
\title{The \TeX Power bundle\\[2ex]{\normalfont Structured |
| 80 |
rules, box and page backgrounds}} |
| 81 |
\author{Stephan Lehmke\\\url{mailto:[email protected]}} |
| 82 |
\maketitle |
| 83 |
|
| 84 |
\begin{small} |
| 85 |
This example demonstrates \TeX Power's support for structured rules, |
| 86 |
box and page backgrounds. The usage and parameterization of the |
| 87 |
corresponding commands is documented in the manual. Here, we only |
| 88 |
demonstrate the effects achievable with the parameters. |
| 89 |
\end{small} |
| 90 |
|
| 91 |
\pageDuration{0.01} |
| 92 |
|
| 93 |
\parstepwise*% |
| 94 |
{% |
| 95 |
\multistep |
| 96 |
{50} |
| 97 |
{% |
| 98 |
\mkfactor{\intensity}{(\value{substep}-1)/49}% |
| 99 |
\colorbetween[\intensity]{stcolor}{pagecolor}{white}% |
| 100 |
\backgroundstyle[startcolor=stcolor,endcolor=white]{vgradient}% |
| 101 |
}% |
| 102 |
\multistep |
| 103 |
{3} |
| 104 |
{% |
| 105 |
\afterstep{\pageDuration{1}}% |
| 106 |
\backgroundstyle[startcolor=pagecolor,endcolor=white,firstgradprogression=\value{substep}]{vgradient}% |
| 107 |
}% |
| 108 |
\multistep |
| 109 |
{10} |
| 110 |
{% |
| 111 |
\afterstep{\pageDuration{0.01}}% |
| 112 |
\mkfactor{\intensity}{(\value{substep}-1)/40}% |
| 113 |
\colorbetween[\intensity]{ecolor}{pagecolor}{white}% |
| 114 |
\backgroundstyle[startcolor=pagecolor,endcolor=ecolor,firstgradprogression=3]{vgradient}% |
| 115 |
}% |
| 116 |
\skipTo{eotitle} |
| 117 |
} |
| 118 |
|
| 119 |
\hypertarget{eotitle}{} |
| 120 |
|
| 121 |
\stopAdvancing |
| 122 |
|
| 123 |
\newslide |
| 124 |
|
| 125 |
\renewcommand{\rulestripes}{100} |
| 126 |
|
| 127 |
\newcounter{mstep} |
| 128 |
|
| 129 |
\section{Color Gradients} |
| 130 |
\liststepwise[\let\hidestepcontents=\hidesmartignore] |
| 131 |
{% |
| 132 |
\concept{Horizontal} \step{or \concept{vertical}; \concept{single}} \step{or \concept{double}.} |
| 133 |
|
| 134 |
\step |
| 135 |
{% |
| 136 |
Parameters: |
| 137 |
\begin{itemize} |
| 138 |
\item Gradient \concept{start} {\bstep[\value{step}=13]{(and |
| 139 |
\concept{middle})}} and \concept{end} color. |
| 140 |
|
| 141 |
\step[\value{step}=23]{\item Number of \concept{stripes}.} |
| 142 |
|
| 143 |
\step[\value{step}=33]{\item \concept{Midpoint} of a double |
| 144 |
gradient.} |
| 145 |
|
| 146 |
\step[\value{step}=43]{\item Gradient \concept{Progression}} |
| 147 |
\step[\value{step}=56]{\par(independent for double gradients).} |
| 148 |
\end{itemize} |
| 149 |
} |
| 150 |
\vfill |
| 151 |
\steponce[\value{step}=0]{\hgradrule{red}{green}{\linewidth}{5ex}}% |
| 152 |
\steponce[\value{step}=1]{\vgradrule{red}{green}{\linewidth}{5ex}}% |
| 153 |
\steponce[\value{step}=2]{\dblvgradrule{red}{yellow}{green}{\linewidth}{5ex}}% |
| 154 |
\steponce[\value{step}>2\and\value{step}<13] |
| 155 |
{% |
| 156 |
\skipTo{eostartend}\\ |
| 157 |
\multistep(\setcounter{mstep}{\value{substep}+2}\ifthenelse{\value{step}=\value{mstep}}){10} |
| 158 |
{% |
| 159 |
\mkfactor{\intensity}{(\value{substep}-1)/9}% |
| 160 |
\colorbetween[\intensity]{scolor}{blue}{red}% |
| 161 |
\colorbetween[\intensity]{ecolor}{yellow}{green}% |
| 162 |
\hgradrule{scolor}{ecolor}{\linewidth}{5ex}% |
| 163 |
\ifthenelse{\value{substep}=10} |
| 164 |
{\hypertarget{eostartend}{}\afterstep{\stopAdvancing}} |
| 165 |
{\afterstep{\pageDuration{0.01}}}% |
| 166 |
}% |
| 167 |
}% |
| 168 |
\steponce[\value{step}>12\and\value{step}<23] |
| 169 |
{% |
| 170 |
\skipTo{eomidcolor}\\ |
| 171 |
\multistep(\setcounter{mstep}{\value{substep}+12}\ifthenelse{\value{step}=\value{mstep}}){10} |
| 172 |
{% |
| 173 |
\colorbetween{scolor}{blue}{yellow}% |
| 174 |
\mkfactor{\intensity}{(\value{substep}-1)/9}% |
| 175 |
\colorbetween[\intensity]{ecolor}{red}{scolor}% |
| 176 |
\dblhgradrule{blue}{ecolor}{yellow}{\linewidth}{5ex}% |
| 177 |
\ifthenelse{\value{substep}=10} |
| 178 |
{\hypertarget{eomidcolor}{}\afterstep{\stopAdvancing}} |
| 179 |
{\afterstep{\pageDuration{0.01}}}% |
| 180 |
}% |
| 181 |
}% |
| 182 |
\steponce[\value{step}>22\and\value{step}<33] |
| 183 |
{% |
| 184 |
\skipTo{eostripes}\\ |
| 185 |
\multistep(\setcounter{mstep}{\value{substep}+22}\ifthenelse{\value{step}=\value{mstep}}){10} |
| 186 |
{% |
| 187 |
\histogram{\dblhgradrule[][10*\value{substep}]{red}{yellow}{green}{\linewidth}{2.5ex}}\\% |
| 188 |
\dblhgradrule[][10*\value{substep}]{red}{yellow}{green}{\linewidth}{2.5ex}% |
| 189 |
\ifthenelse{\value{substep}=10} |
| 190 |
{\hypertarget{eostripes}{}\afterstep{\stopAdvancing}} |
| 191 |
{\afterstep{\pageDuration{0.5}}}% |
| 192 |
}% |
| 193 |
}% |
| 194 |
\steponce[\value{step}>32\and\value{step}<43] |
| 195 |
{% |
| 196 |
\skipTo{eomidpoint}\\ |
| 197 |
\multistep(\setcounter{mstep}{\value{substep}+32}\ifthenelse{\value{step}=\value{mstep}}){10} |
| 198 |
{% |
| 199 |
\mkfactor{\midpoint}{(\value{substep}-1)/9}% |
| 200 |
\histogram{\dblhgradrule[\midpoint]{blue}{red}{yellow}{\linewidth}{2.5ex}}\\% |
| 201 |
\dblhgradrule[\midpoint]{red}{yellow}{green}{\linewidth}{2.5ex}% |
| 202 |
\ifthenelse{\value{substep}=10} |
| 203 |
{\hypertarget{eomidpoint}{}\afterstep{\stopAdvancing}} |
| 204 |
{\afterstep{\pageDuration{0.5}}}% |
| 205 |
}% |
| 206 |
}% |
| 207 |
\steponce[\value{step}>42\and\value{step}<56] |
| 208 |
{% |
| 209 |
\skipTo{eofirstprog}\\ |
| 210 |
\multistep(\setcounter{mstep}{\value{substep}+42}\ifthenelse{\value{step}=\value{mstep}}){13} |
| 211 |
{% |
| 212 |
\renewcommand{\rulefirstgradprogression}{\value{substep}-7}% |
| 213 |
\histogram{\hgradrule{red}{green}{\linewidth}{2.5ex}}\\% |
| 214 |
\hgradrule{red}{green}{\linewidth}{2.5ex}% |
| 215 |
\ifthenelse{\value{substep}=13} |
| 216 |
{\hypertarget{eofirstprog}{}\afterstep{\stopAdvancing}} |
| 217 |
{\afterstep{\pageDuration{0.5}}}% |
| 218 |
}% |
| 219 |
}% |
| 220 |
\steponce[\value{step}>55\and\value{step}<69] |
| 221 |
{% |
| 222 |
\skipTo{eosecondprog}\\ |
| 223 |
\multistep(\setcounter{mstep}{\value{substep}+55}\ifthenelse{\value{step}=\value{mstep}}){13} |
| 224 |
{% |
| 225 |
\renewcommand{\rulefirstgradprogression}{\value{substep}-7}% |
| 226 |
\renewcommand{\rulesecondgradprogression}{7-\value{substep}}% |
| 227 |
\histogram{\dblhgradrule{red}{green}{red}{\linewidth}{2.5ex}}\\% |
| 228 |
\dblhgradrule{red}{green}{red}{\linewidth}{2.5ex}% |
| 229 |
\ifthenelse{\value{substep}=13} |
| 230 |
{\hypertarget{eosecondprog}{}\afterstep{\stopAdvancing}} |
| 231 |
{\afterstep{\pageDuration{0.5}}}% |
| 232 |
}% |
| 233 |
}% |
| 234 |
} |
| 235 |
|
| 236 |
\newslide |
| 237 |
|
| 238 |
Applications of gradients: |
| 239 |
\centerslidesfalse |
| 240 |
\liststepwise* |
| 241 |
{% |
| 242 |
\begin{itemize} |
| 243 |
\item |
| 244 |
\begin{tabular}[t]{@{}l@{}} |
| 245 |
As rules:\\ |
| 246 |
\skipTo{eoruledemo} |
| 247 |
\end{tabular} |
| 248 |
\multistep{72} |
| 249 |
{% |
| 250 |
\present |
| 251 |
{% |
| 252 |
\small\renewcommand{\arraystretch}{.9}% |
| 253 |
\begin{tabular}{rp{\totalbarwidth+2em}} |
| 254 |
\multicolumn{2}{c}{\textbf{Compression rates}}\\[2ex] |
| 255 |
\code{compress} & \mkbar[\thesubstep]{51}\\ |
| 256 |
\code{gzip -1} & \mkbar[\thesubstep]{62}\\ |
| 257 |
\code{gzip -9} & \mkbar[\thesubstep]{66}\\ |
| 258 |
\code{bzip2 -1} & \mkbar[\thesubstep]{65}\\ |
| 259 |
\code{bzip2 -9} & \mkbar[\thesubstep]{73} |
| 260 |
\end{tabular}% |
| 261 |
}% |
| 262 |
\afterstep{\pageDuration{0.01}}% |
| 263 |
}% |
| 264 |
\step |
| 265 |
{% |
| 266 |
\present |
| 267 |
{% |
| 268 |
\small\renewcommand{\arraystretch}{.9}% |
| 269 |
\begin{tabular}{rp{\totalbarwidth+2em}} |
| 270 |
\multicolumn{2}{c}{\textbf{Compression rates}}\\[2ex] |
| 271 |
\code{compress} & \mkbar{51}\\ |
| 272 |
\code{gzip -1} & \mkbar{62}\\ |
| 273 |
\code{gzip -9} & \mkbar{66}\\ |
| 274 |
\code{bzip2 -1} & \mkbar{65}\\ |
| 275 |
\code{bzip2 -9} & \mkbar{73} |
| 276 |
\end{tabular}% |
| 277 |
}% |
| 278 |
\ifthenelse{\boolean{firstactivation}}{\AtShipout{\hypertarget{eoruledemo}{}}\afterstep{\stopAdvancing}}{}% |
| 279 |
}% |
| 280 |
|
| 281 |
\step |
| 282 |
{% |
| 283 |
\item |
| 284 |
\begin{tabular}[t]{@{}l@{}} |
| 285 |
As box backgrounds:\\ |
| 286 |
\skipTo{eoboxdemo} |
| 287 |
\end{tabular} |
| 288 |
\afterstep{\pageDuration{0.01}}% |
| 289 |
\multistep{10} |
| 290 |
{% |
| 291 |
\mkfactor{\intensity}{(\value{substep}-1)/9}% |
| 292 |
\colorbetween[\intensity]{ecolor}{green}{blue}% |
| 293 |
\colorbetween[\intensity]{scolor}{yellow}{green}% |
| 294 |
\colorbetween{mcolor}{scolor}{ecolor}% |
| 295 |
\complementcolor{tcolor}{mcolor}% |
| 296 |
\raisebox{-.5\height}{\hgradbox{scolor}{ecolor}{\Huge\textsf{\textbf{\mbox{{\textcolor{tcolor}{Groovy!}}}}}}}% |
| 297 |
}% |
| 298 |
\multistep{10} |
| 299 |
{% |
| 300 |
\mkfactor{\intensity}{(\value{substep}-1)/9}% |
| 301 |
\colorbetween[\intensity]{ecolor}{yellow}{green}% |
| 302 |
\colorbetween[\intensity]{scolor}{red}{yellow}% |
| 303 |
\colorbetween{mcolor}{scolor}{ecolor}% |
| 304 |
\complementcolor{tcolor}{mcolor}% |
| 305 |
\raisebox{-.5\height}{\hgradbox{scolor}{ecolor}{\Huge\textsf{\textbf{\textcolor{tcolor}{Groovy!}}}}}% |
| 306 |
}% |
| 307 |
\multistep{10} |
| 308 |
{% |
| 309 |
\mkfactor{\intensity}{(\value{substep}-1)/9}% |
| 310 |
\colorbetween[\intensity]{ecolor}{red}{yellow}% |
| 311 |
\colorbetween[\intensity]{scolor}{blue}{red}% |
| 312 |
\colorbetween{mcolor}{scolor}{ecolor}% |
| 313 |
\complementcolor{tcolor}{mcolor}% |
| 314 |
\raisebox{-.5\height}{\hgradbox{scolor}{ecolor}{\Huge\textsf{\textbf{\textcolor{tcolor}{Groovy!}}}}}% |
| 315 |
}% |
| 316 |
\multistep{10} |
| 317 |
{% |
| 318 |
\mkfactor{\intensity}{(\value{substep}-1)/9}% |
| 319 |
\colorbetween[\intensity]{ecolor}{blue}{red}% |
| 320 |
\colorbetween[\intensity]{scolor}{green}{blue}% |
| 321 |
\colorbetween{mcolor}{scolor}{ecolor}% |
| 322 |
\complementcolor{tcolor}{mcolor}% |
| 323 |
\raisebox{-.5\height}{\hgradbox{scolor}{ecolor}{\Huge\textsf{\textbf{\textcolor{tcolor}{Groovy!}}}}}% |
| 324 |
}% |
| 325 |
\step |
| 326 |
{% |
| 327 |
\colorbetween{mcolor}{green}{blue}% |
| 328 |
\complementcolor{tcolor}{mcolor}% |
| 329 |
\raisebox{-.5\height}{\hgradbox{green}{blue}{\Huge\textsf{\textbf{\textcolor{tcolor}{Groovy!}}}}}% |
| 330 |
\ifthenelse{\boolean{firstactivation}}{\AtShipout{\hypertarget{eoboxdemo}{}}\afterstep{\stopAdvancing}}{}% |
| 331 |
}% |
| 332 |
} |
| 333 |
|
| 334 |
\step |
| 335 |
{% |
| 336 |
\item As page backgrounds. \skipTo{eobgnddemo} |
| 337 |
\colorbetween[.22]{ecolor}{pagecolor}{white}% |
| 338 |
\afterstep{\pageDuration{0.01}}% |
| 339 |
\multistep{20} |
| 340 |
{% |
| 341 |
\backgroundstyle |
| 342 |
[% |
| 343 |
startcolor=pagecolor,endcolor=ecolor,firstgradprogression=3, |
| 344 |
rightpanelwidth=\TPpagewidth*\real{.025}*\value{substep},rightpanelcolor=pagecolor, |
| 345 |
leftpanelwidth=\TPpagewidth*\real{.025}*\value{substep},leftpanelcolor=pagecolor, |
| 346 |
toppanelheight=\TPpageheight*\real{.025}*\value{substep},toppanelcolor=pagecolor, |
| 347 |
bottompanelheight=\TPpageheight*\real{.025}*\value{substep},bottompanelcolor=pagecolor% |
| 348 |
]{vgradient}% |
| 349 |
}% |
| 350 |
\multistep{20} |
| 351 |
{% |
| 352 |
\backgroundstyle |
| 353 |
[% |
| 354 |
startcolordef={rgb}{0.4,0,0},endcolordef={rgb}{0,0.4,0},firstgradprogression=3, |
| 355 |
rightpanelwidth=\TPpagewidth*\real{.025}*(20-\value{substep}),rightpanelcolor=pagecolor, |
| 356 |
leftpanelwidth=\TPpagewidth*\real{.025}*(20-\value{substep}),leftpanelcolor=pagecolor, |
| 357 |
toppanelheight=\TPpageheight*\real{.025}*(20-\value{substep}),toppanelcolor=pagecolor, |
| 358 |
bottompanelheight=\TPpageheight*\real{.025}*(20-\value{substep}),bottompanelcolor=pagecolor% |
| 359 |
]{vgradient}% |
| 360 |
}% |
| 361 |
} |
| 362 |
\end{itemize} |
| 363 |
} |
| 364 |
\hypertarget{eobgnddemo}{} |
| 365 |
\end{slide} |
| 366 |
|
| 367 |
|
| 368 |
|
| 369 |
\begin{slide}[\slidewidth-40mm,\slideheight-40mm] |
| 370 |
\renewcommand{\sliderightmargin}{45mm}% |
| 371 |
\renewcommand{\slidetopmargin}{25mm}% |
| 372 |
\renewcommand{\slidebottommargin}{25mm}% |
| 373 |
\colorbetween[.22]{ecolor}{pagecolor}{white}% |
| 374 |
\backgroundstyle[startcolor=pagecolor,endcolor=ecolor,firstgradprogression=3]{vgradient}% |
| 375 |
|
| 376 |
\liststepwise |
| 377 |
{% |
| 378 |
Special parameters for page backgrounds: |
| 379 |
\begin{itemize} |
| 380 |
\item Leave space for panels, headers and footers.\\ |
| 381 |
\skipTo{eopaneldemo} |
| 382 |
\afterstep{\pageDuration{0.01}}% |
| 383 |
\multistep{20} |
| 384 |
{% |
| 385 |
\backgroundstyle |
| 386 |
[% |
| 387 |
startcolor=pagecolor,endcolor=ecolor,firstgradprogression=3, |
| 388 |
toppanelheight=.1\semcm*\value{substep},toppanelcolor=black, |
| 389 |
bottompanelheight=.1\semcm*\value{substep}% |
| 390 |
]{vgradient}% |
| 391 |
}% |
| 392 |
\multistep{20} |
| 393 |
{% |
| 394 |
\backgroundstyle |
| 395 |
[% |
| 396 |
startcolor=pagecolor,endcolor=ecolor,firstgradprogression=3, |
| 397 |
rightpanelwidth=.2\semcm*\value{substep},rightpanelcolordef={rgb}{0,0.4,0.6}, |
| 398 |
toppanelheight=2\semcm,toppanelcolor=black, |
| 399 |
bottompanelheight=2\semcm% |
| 400 |
]{vgradient}% |
| 401 |
}% |
| 402 |
\end{itemize} |
| 403 |
} |
| 404 |
|
| 405 |
\hypertarget{eopaneldemo}{} |
| 406 |
\end{slide} |
| 407 |
\end{document} |
| 408 |
\endinput |
| 409 |
%% |
| 410 |
%% End of file `bgndexample.tex'. |