| 1 |
%% |
| 2 |
%% This is file `bidipresentation.cls', |
| 3 |
%% |
| 4 |
%% __________________________________________________ |
| 5 |
%% Copyright © 2009–2014 Vafa Khalighi <[email protected]> |
| 6 |
%% |
| 7 |
%% A great portion of the code is brorrowd from texpower bundle: |
| 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 |
%% |
| 15 |
%% with modifications to get things working properly in both right to |
| 16 |
%% left and left to right modes. |
| 17 |
%% |
| 18 |
%% It may be distributed and/or modified under the LaTeX Project Public License, |
| 19 |
%% version 1.3c or higher (your choice). The latest version of |
| 20 |
%% this license is at: http://www.latex-project.org/lppl.txt |
| 21 |
%% |
| 22 |
%% This work is “author-maintained” (as per LPPL maintenance status) |
| 23 |
%% by Vafa Khalighi. |
| 24 |
%% |
| 25 |
\NeedsTeXFormat{LaTeX2e} |
| 26 |
\ProvidesClass{bidipresentation}[2014/09/26 v0.3 Experimental bidi presentation] |
| 27 |
\RequirePackage{scrlfile} |
| 28 |
\RequirePackage{fancyhdr} |
| 29 |
\RequirePackage{ifthen} |
| 30 |
\RequirePackage{calc} |
| 31 |
\RequirePackage{keyval} |
| 32 |
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} |
| 33 |
\newboolean{verbose@bidipres} |
| 34 |
\DeclareOption{verbose}{\setboolean{verbose@bidipres}{true}} |
| 35 |
\provideboolean{display} |
| 36 |
\DeclareOption{display}{\setboolean{display}{true}} |
| 37 |
\DeclareOption{printout}{\setboolean{display}{false}} |
| 38 |
\newboolean{fixcolorstack@bidipres} |
| 39 |
\DeclareOption{fixcolorstack}{\setboolean{fixcolorstack@bidipres}{true}} |
| 40 |
\newboolean{strongfiltering@bidipres} |
| 41 |
\DeclareOption{strongfiltering}{\setboolean{strongfiltering@bidipres}{true}} |
| 42 |
\newcommand{\strongfilteringon}{\setboolean{strongfiltering@bidipres}{true}} |
| 43 |
\newcommand{\strongfilteringoff}{\setboolean{strongfiltering@bidipres}{false}} |
| 44 |
\newboolean{nineminutes@bidipres} |
| 45 |
\DeclareOption{nineminutes}{\setboolean{nineminutes@bidipres}{true}} |
| 46 |
\newboolean{bidiprescolor} |
| 47 |
\newboolean{coloremph@bidipres} |
| 48 |
\DeclareOption{coloremph} |
| 49 |
{\setboolean{bidiprescolor}{true}\setboolean{coloremph@bidipres}{true}} |
| 50 |
\newboolean{colormath@bidipres} |
| 51 |
\DeclareOption{colormath} |
| 52 |
{\setboolean{bidiprescolor}{true}\setboolean{colormath@bidipres}{true}} |
| 53 |
\newboolean{colorhighlight@bidipres} |
| 54 |
\DeclareOption{colorhighlight} |
| 55 |
{\setboolean{bidiprescolor}{true}\setboolean{colorhighlight@bidipres}{true}} |
| 56 |
\newboolean{whitebackground@bidipres} |
| 57 |
\setboolean{whitebackground@bidipres}{true}% This is the default. |
| 58 |
\DeclareOption{whitebackground} |
| 59 |
{\setboolean{bidiprescolor}{true}\setboolean{whitebackground@bidipres}{true}} |
| 60 |
\newboolean{lightbackground@bidipres} |
| 61 |
\DeclareOption{lightbackground} |
| 62 |
{\setboolean{bidiprescolor}{true}\setboolean{lightbackground@bidipres}{true}} |
| 63 |
\newboolean{blackbackground@bidipres} |
| 64 |
\DeclareOption{blackbackground} |
| 65 |
{\setboolean{bidiprescolor}{true}\setboolean{blackbackground@bidipres}{true}} |
| 66 |
\newboolean{darkbackground@bidipres} |
| 67 |
\DeclareOption{darkbackground} |
| 68 |
{\setboolean{bidiprescolor}{true}\setboolean{darkbackground@bidipres}{true}} |
| 69 |
\ExecuteOptions{display} |
| 70 |
\ProcessOptions\relax |
| 71 |
\LoadClass{article} |
| 72 |
|
| 73 |
\RequirePackage[foot=10.2pt,head=0pt,paperwidth=128mm,paperheight=96mm,left=5mm,top=5mm,right=7mm,bottom=8mm]{geometry} |
| 74 |
|
| 75 |
\renewcommand{\headrulewidth}{0mm} |
| 76 |
|
| 77 |
\renewcommand{\maketitle}% |
| 78 |
{\ClassError{bidipresentation}{Caution: ``maketitle'' command not supported}% |
| 79 |
{Please use ``titlepage'' environment instead}% |
| 80 |
} |
| 81 |
|
| 82 |
\RequirePackage{hyperref} |
| 83 |
|
| 84 |
\fancypagestyle{pres}{% |
| 85 |
\lhead{}% |
| 86 |
\chead{}% |
| 87 |
\rhead{}% |
| 88 |
\ifthenelse{\boolean{bidiprescolor}}{% |
| 89 |
\lfoot{\xecolor{textcolor}\footnotesize \thepage}}{% |
| 90 |
\lfoot{\footnotesize \thepage}} |
| 91 |
\cfoot{}% |
| 92 |
\rfoot{}% |
| 93 |
} |
| 94 |
|
| 95 |
\pagestyle{pres} |
| 96 |
|
| 97 |
\newcommand{\distance}[1]{\vspace*{\stretch{#1}}} |
| 98 |
\newcommand{\abstand}[1]{\vspace*{\stretch{#1}}} |
| 99 |
|
| 100 |
\setlength{\parskip}{0.6ex} |
| 101 |
\setlength{\parindent}{0mm} |
| 102 |
|
| 103 |
\newenvironment{plainslide}[1][]% |
| 104 |
{{\raggedleft \large\bfseries #1\par}\par\vspace*{\stretch{1}}}% |
| 105 |
{\par\vspace*{\stretch{1}}\newpage} |
| 106 |
|
| 107 |
\newenvironment{rawslide}{}{\newpage}% |
| 108 |
|
| 109 |
\def\itemize{% |
| 110 |
\ifnum \@itemdepth >\thr@@\@toodeep\else |
| 111 |
\advance\@itemdepth\@ne |
| 112 |
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% |
| 113 |
\expandafter |
| 114 |
\list |
| 115 |
\csname\@itemitem\endcsname |
| 116 |
{\def\makelabel##1{\hss\llap{##1}}}% |
| 117 |
\fi |
| 118 |
\setlength{\itemsep}{0ex}% |
| 119 |
\setlength{\parskip}{0.1ex}% |
| 120 |
\setlength{\parsep}{0ex}% |
| 121 |
}% |
| 122 |
\let\enditemize =\endlist |
| 123 |
|
| 124 |
\def\enumerate{% |
| 125 |
\ifnum \@enumdepth >\thr@@\@toodeep\else |
| 126 |
\advance\@enumdepth\@ne |
| 127 |
\edef\@enumctr{enum\romannumeral\the\@enumdepth}% |
| 128 |
\expandafter |
| 129 |
\list |
| 130 |
\csname label\@enumctr\endcsname |
| 131 |
{\usecounter\@enumctr\def\makelabel##1{\hss\llap{##1}}}% |
| 132 |
\fi |
| 133 |
\setlength{\itemsep}{0ex}% |
| 134 |
\setlength{\parskip}{0.1ex}% |
| 135 |
\setlength{\parsep}{0ex}% |
| 136 |
}% |
| 137 |
\let\endenumerate =\endlist |
| 138 |
|
| 139 |
\renewenvironment{description} |
| 140 |
{\list{}{\labelwidth\z@ \itemindent-\leftmargin |
| 141 |
\let\makelabel\descriptionlabel} |
| 142 |
\setlength{\itemsep}{0ex}% |
| 143 |
\setlength{\parskip}{0.1ex}% |
| 144 |
\setlength{\parsep}{0ex}} |
| 145 |
{\endlist} |
| 146 |
|
| 147 |
\ifthenelse{\boolean{display}} |
| 148 |
{\ClassInfo{bidipresentation}{Producing display version. Dynamic features activated.}} |
| 149 |
{\ClassInfo{bidipresentation}{Producing printout version. Dynamic features inactive.}} |
| 150 |
\ifthenelse{\boolean{verbose@bidipres}}{\setcounter{errorcontextlines}{10000}}{} |
| 151 |
|
| 152 |
\newcounter{tmpcnta@bidipres} |
| 153 |
\newcounter{tmpcntb@bidipres} |
| 154 |
|
| 155 |
\newlength{\tempdima@bidipres} |
| 156 |
\newlength{\tempdimb@bidipres} |
| 157 |
|
| 158 |
\newbox\tempbox@bidipres |
| 159 |
|
| 160 |
\newboolean{carryon@bidipres} |
| 161 |
\newcommand{\bidiprespagewidth}{\strip@pt\paperwidth truept} |
| 162 |
\newcommand{\bidiprespageheight}{\strip@pt\paperheight truept} |
| 163 |
\newcommand{\mkfactor}[2]% |
| 164 |
{\setlength{\tempdima@bidipres}{1pt*#2}\edef#1{\strip@pt\tempdima@bidipres}} |
| 165 |
\newcommand{\mklength@bidipres}[2] |
| 166 |
{\setlength{\tempdima@bidipres}{#2}\edef#1{\the\tempdima@bidipres}} |
| 167 |
|
| 168 |
\newcommand{\mklength}{} |
| 169 |
\let\mklength\mklength@bidipres |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
\ifthenelse{\boolean{bidiprescolor}}{% |
| 175 |
\RequirePackage{color}% |
| 176 |
\RequirePackage{xecolor}% |
| 177 |
}{}% |
| 178 |
\ifthenelse{\boolean{bidiprescolor}}{% Yes. |
| 179 |
\let\setcolor@bidipres=\color% |
| 180 |
\let\o@definecolor@bidipres=\definecolor% |
| 181 |
\def\definecolor#1#2#3% |
| 182 |
{% |
| 183 |
\o@definecolor@bidipres{#1}{#2}{#3}% |
| 184 |
\expandafter\edef\csname colordef@bidipres@#1\endcsname% |
| 185 |
{\csname processcolor@bidipres@#2\endcsname{#3}}% |
| 186 |
}% |
| 187 |
\@ifundefined{c@lor@namefile}{}{\input{\c@lor@namefile}} |
| 188 |
|
| 189 |
\ifx\color@gray\@undefined |
| 190 |
\ifx\color@rgb\@undefined |
| 191 |
\else |
| 192 |
\definecolor{black}{rgb}{0,0,0} |
| 193 |
\definecolor{white}{rgb}{1,1,1} |
| 194 |
\fi |
| 195 |
\else |
| 196 |
\definecolor{black}{gray}{0} |
| 197 |
\definecolor{white}{gray}{1} |
| 198 |
\fi |
| 199 |
\ifx\color@rgb\@undefined\else |
| 200 |
\definecolor{red}{rgb}{1,0,0} |
| 201 |
\definecolor{green}{rgb}{0,1,0} |
| 202 |
\definecolor{blue}{rgb}{0,0,1} |
| 203 |
\fi |
| 204 |
\ifx\color@cmyk\@undefined\else |
| 205 |
\definecolor{cyan}{cmyk}{1,0,0,0} |
| 206 |
\definecolor{magenta}{cmyk}{0,1,0,0} |
| 207 |
\definecolor{yellow}{cmyk}{0,0,1,0} |
| 208 |
\fi |
| 209 |
\newcommand{\interpolate@bidipres}[3]% |
| 210 |
{% |
| 211 |
\setlength{\tempdima@bidipres}{1pt-#1pt}% Calculate the second factor for the weighted average. |
| 212 |
\edef\secondfactor@bidipres{\strip@pt\tempdima@bidipres}% |
| 213 |
\setlength{\tempdima@bidipres}{#2pt*\real{#1}+#3pt*\real{\secondfactor@bidipres}}% Calculate the weighted average. |
| 214 |
\ifthenelse{\lengthtest{\tempdima@bidipres<0pt}}% Bound the result to the interval [0,1] (just in case the first |
| 215 |
{\setlength{\tempdima@bidipres}{0pt}}% factor was not from [0,1]). |
| 216 |
{\ifthenelse{\lengthtest{\tempdima@bidipres>1pt}}{\setlength{\tempdima@bidipres}{1pt}}{}}% |
| 217 |
\edef\result@bidipres{\strip@pt\tempdima@bidipres}% |
| 218 |
} |
| 219 |
\def\interpolate@three@bidipres#1,#2,#3;#4,#5,#6;#7% |
| 220 |
{% |
| 221 |
\interpolate@bidipres{#7}{#1}{#4}% First intermediary value. |
| 222 |
\edef\newcolordef@bidipres{\result@bidipres,}% Store first value. |
| 223 |
\interpolate@bidipres{#7}{#2}{#5}% Second intermediary value. |
| 224 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres,}% Store second value. |
| 225 |
\interpolate@bidipres{#7}{#3}{#6}% Third intermediary value. |
| 226 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres}% Store third value. |
| 227 |
} |
| 228 |
\def\interpolate@four@bidipres#1,#2,#3,#4;#5,#6,#7,#8;#9% |
| 229 |
{% |
| 230 |
\interpolate@bidipres{#9}{#1}{#5}% First intermediary value. |
| 231 |
\edef\newcolordef@bidipres{\result@bidipres,}% Store first value. |
| 232 |
\interpolate@bidipres{#9}{#2}{#6}% Second intermediary value. |
| 233 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres,}% Store second value. |
| 234 |
\interpolate@bidipres{#9}{#3}{#7}% Third intermediary value. |
| 235 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres,}% Store third value. |
| 236 |
\interpolate@bidipres{#9}{#4}{#8}% Fourth intermediary value. |
| 237 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres}% Store fourth value. |
| 238 |
} |
| 239 |
\def\convert@cmykvalue@rgbvalue@bidipres#1#2% |
| 240 |
{% |
| 241 |
\setlength{\tempdima@bidipres}{1pt-#1pt-#2pt}% |
| 242 |
\ifthenelse{\lengthtest{\tempdima@bidipres<0pt}}{\setlength{\tempdima@bidipres}{0pt}}{}% |
| 243 |
\edef\result@bidipres{\strip@pt\tempdima@bidipres}% |
| 244 |
}% |
| 245 |
\def\convert@cmyk@rgb@bidipres#1,#2,#3,#4;% |
| 246 |
{% |
| 247 |
\convert@cmykvalue@rgbvalue@bidipres{#1}{#4}% |
| 248 |
\edef\newcolordef@bidipres{\result@bidipres,}% Store first value. |
| 249 |
\convert@cmykvalue@rgbvalue@bidipres{#2}{#4}% |
| 250 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres,}% Store second value. |
| 251 |
\convert@cmykvalue@rgbvalue@bidipres{#3}{#4}% |
| 252 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres}% Store third value. |
| 253 |
} |
| 254 |
\def\convert@RGBvalue@rgbvalue@bidipres#1% |
| 255 |
{% |
| 256 |
\setlength{\tempdima@bidipres}{#1pt/255}% |
| 257 |
\edef\result@bidipres{\strip@pt\tempdima@bidipres}% |
| 258 |
}% |
| 259 |
\def\convert@RGB@rgb@bidipres#1,#2,#3;% |
| 260 |
{% |
| 261 |
\convert@RGBvalue@rgbvalue@bidipres{#1}% |
| 262 |
\edef\newcolordef@bidipres{\result@bidipres,}% Store first value. |
| 263 |
\convert@RGBvalue@rgbvalue@bidipres{#2}% |
| 264 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres,}% Store second value. |
| 265 |
\convert@RGBvalue@rgbvalue@bidipres{#3}% |
| 266 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres}% Store third value. |
| 267 |
} |
| 268 |
\newcommand{\colorbetween}[4][.5]% |
| 269 |
{% |
| 270 |
\begingroup% Make the definition of \processcolor... local. |
| 271 |
\newcommand{\processcolor@bidipres@rgb}[3]% What if the first color is an rgb color? |
| 272 |
{% |
| 273 |
\ifx##2\processcolor@bidipres@rgb% Are both colors rgb colors? |
| 274 |
\interpolate@three@bidipres##1;##3;{#1}% Calculate interpolated values. |
| 275 |
\else |
| 276 |
\ifx##2\processcolor@bidipres@gray% Is the second color from the gray model? |
| 277 |
\interpolate@three@bidipres##1;##3,##3,##3;{#1}% Calculate interpolated values. |
| 278 |
\else |
| 279 |
\ifx##2\processcolor@bidipres@cmyk% Is the second color from the cmyk model? |
| 280 |
\convert@cmyk@rgb@bidipres##3;% Convert to rgb. |
| 281 |
\edef\newcolordef@bidipres{\noexpand\interpolate@three@bidipres##1;\newcolordef@bidipres;{#1}}% |
| 282 |
\newcolordef@bidipres |
| 283 |
\else |
| 284 |
\ifx##2\processcolor@bidipres@RGB% Is the second color from the RGB model? |
| 285 |
\convert@RGB@rgb@bidipres##3;% Convert to rgb. |
| 286 |
\edef\newcolordef@bidipres{\noexpand\interpolate@three@bidipres##1;\newcolordef@bidipres;{#1}}% |
| 287 |
\newcolordef@bidipres |
| 288 |
\else |
| 289 |
\ifx##2\processcolor@bidipres@hsb% Is the second color from the hsb model? |
| 290 |
\ClassError{bidipresentation}{Don't know how to convert an hsb color!} |
| 291 |
\fi |
| 292 |
\fi |
| 293 |
\fi |
| 294 |
\fi |
| 295 |
\fi |
| 296 |
\edef\newcolordef@bidipres{{rgb}{\newcolordef@bidipres}}% Store the result |
| 297 |
}% |
| 298 |
\newcommand{\processcolor@bidipres@gray}[3]% What if the first color is a gray color? |
| 299 |
{% |
| 300 |
\ifx##2\processcolor@bidipres@gray% Are both colors gray colors? |
| 301 |
\interpolate@bidipres{#1}{##1}{##3}% Calculate interpolated value. |
| 302 |
\edef\newcolordef@bidipres{{gray}{\result@bidipres}}% Store the result |
| 303 |
\else |
| 304 |
\processcolor@bidipres@rgb{##1,##1,##1}{##2}{##3}% Otherwise, convert first color to rgb and continue. |
| 305 |
\fi |
| 306 |
}% |
| 307 |
\newcommand{\processcolor@bidipres@cmyk}[3]% What if the first color is a cmyk color? |
| 308 |
{% |
| 309 |
\ifx##2\processcolor@bidipres@cmyk% Are both colors cmyk colors? |
| 310 |
\interpolate@four@bidipres##1;##3;{#1}% Calculate interpolated values. |
| 311 |
\edef\newcolordef@bidipres{{cmyk}{\newcolordef@bidipres}}% Store the result |
| 312 |
\else |
| 313 |
\convert@cmyk@rgb@bidipres##1;% Otherwise, convert first color to rgb ... |
| 314 |
\expandafter\processcolor@bidipres@rgb\expandafter{\newcolordef@bidipres}{##2}{##3}% ... and continue. |
| 315 |
\fi |
| 316 |
}% |
| 317 |
\newcommand{\processcolor@bidipres@RGB}[3]% What if the first color is an RGB color? |
| 318 |
{% |
| 319 |
\convert@RGB@rgb@bidipres##1;% Convert to rgb ... |
| 320 |
\expandafter\processcolor@bidipres@rgb\expandafter{\newcolordef@bidipres}{##2}{##3}% ... and continue. |
| 321 |
}% |
| 322 |
\newcommand{\processcolor@bidipres@hsb}[3]% What if the first color is an hsb color? |
| 323 |
{% |
| 324 |
\ifx##2\processcolor@bidipres@hsb% Are both colors hsb colors? |
| 325 |
\interpolate@three@bidipres##1;##3;{#1}% Calculate interpolated values. |
| 326 |
\edef\newcolordef@bidipres{{hsb}{\newcolordef@bidipres}}% Store the result |
| 327 |
\else |
| 328 |
\ClassError{bidipresentation}{Don't know how to convert an hsb color!} |
| 329 |
\fi |
| 330 |
}% |
| 331 |
\expandafter\let\expandafter |
| 332 |
\firstcol@bidipres\csname colordef@bidipres@#3\endcsname % Retrieve definition of color <source1>... |
| 333 |
\expandafter\expandafter\expandafter\firstcol@bidipres% and apply (remember \processcolor... is part of the definition) |
| 334 |
\csname colordef@bidipres@#4\endcsname% to definition of color <source2>. |
| 335 |
\edef\end@bidipres% Define color <target> (outside the enclosing group). |
| 336 |
{\endgroup\noexpand\definecolor{#2}\newcolordef@bidipres}% |
| 337 |
\end@bidipres |
| 338 |
}% matches \newcommand{\colorbetween} |
| 339 |
\newcommand{\complement@bidipres}[1]% |
| 340 |
{% |
| 341 |
\setlength{\tempdima@bidipres}{1pt-#1pt}% |
| 342 |
\edef\result@bidipres{\strip@pt\tempdima@bidipres}% |
| 343 |
} |
| 344 |
\def\complement@three@bidipres#1,#2,#3;% |
| 345 |
{% |
| 346 |
\complement@bidipres{#1}% |
| 347 |
\edef\newcolordef@bidipres{\result@bidipres,}% Store first value. |
| 348 |
\complement@bidipres{#2}% |
| 349 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres,}% Store second value. |
| 350 |
\complement@bidipres{#3}% |
| 351 |
\edef\newcolordef@bidipres{\newcolordef@bidipres\result@bidipres}% Store third value. |
| 352 |
} |
| 353 |
\def\grabfourth@bidipres#1,#2,#3,#4;% |
| 354 |
{% |
| 355 |
\def\mem@bidipres{#4}% Store fourth element. |
| 356 |
\def\result@bidipres{#1,#2,#3;}% Store first three elements. |
| 357 |
} |
| 358 |
\newcommand{\complementcolor}[2]% |
| 359 |
{% |
| 360 |
\begingroup% Make the definition of \processcolor... local. |
| 361 |
\newcommand{\processcolor@bidipres@rgb}[1]% What if the color is an rgb color? |
| 362 |
{% |
| 363 |
\complement@three@bidipres##1;% Calculate complemented values. |
| 364 |
\edef\newcolordef@bidipres{{rgb}{\newcolordef@bidipres}}% Store the result |
| 365 |
}% |
| 366 |
\newcommand{\processcolor@bidipres@gray}[1]% What if the color is a gray color? |
| 367 |
{% |
| 368 |
\complement@bidipres{##1}% Calculate complemented value. |
| 369 |
\edef\newcolordef@bidipres{{gray}{\result@bidipres}}% Store the result |
| 370 |
}% |
| 371 |
\newcommand{\processcolor@bidipres@cmyk}[1]% What if the color is a cmyk color? |
| 372 |
{% |
| 373 |
\grabfourth@bidipres##1;% Remember fourth element. |
| 374 |
\expandafter\complement@three@bidipres\result@bidipres% Calculate complemented values of first three elements. |
| 375 |
\edef\newcolordef@bidipres{{cmyk}{\newcolordef@bidipres,\mem@bidipres}}% Store the result, putting back the fourth element. |
| 376 |
}% |
| 377 |
\newcommand{\processcolor@bidipres@RGB}[1]% What if the color is an RGB color? |
| 378 |
{% |
| 379 |
\convert@RGB@rgb@bidipres##1;% Convert to rgb ... |
| 380 |
\expandafter\processcolor@bidipres@rgb\expandafter{\newcolordef@bidipres}% ... and continue. |
| 381 |
}% |
| 382 |
\newcommand{\processcolor@bidipres@hsb}[1]% What if the color is an hsb color? |
| 383 |
{% |
| 384 |
\complement@three@bidipres##1;% Calculate complemented values. |
| 385 |
\edef\newcolordef@bidipres{{hsb}{\newcolordef@bidipres}}% Store the result |
| 386 |
}% |
| 387 |
\csname colordef@bidipres@#2\endcsname% Execute definition of color <source> (which contains \processcolor...) |
| 388 |
\edef\end@bidipres% Define color <target> (outside the enclosing group). |
| 389 |
{\endgroup\noexpand\definecolor{#1}\newcolordef@bidipres}% |
| 390 |
\end@bidipres |
| 391 |
}% matches \newcommand{\complementcolor} |
| 392 |
}% matches \ifthenelse{\boolean{bidiprescolor}}{% Yes. |
| 393 |
{% No. Do nothing. |
| 394 |
} |
| 395 |
\newcommand{\replacecolor} |
| 396 |
{% |
| 397 |
\let\replacecolor@hook@bidipres=\@gobble% This hook can be used for variant checking (see below). |
| 398 |
\replacecolor@bidipres% Pick up arguments. |
| 399 |
} |
| 400 |
|
| 401 |
\newcommand{\replacecolor@bidipres}[2][]% Pick up the first two arguments of \replacecolor. |
| 402 |
{% |
| 403 |
\ifthenelse{\equal{#1}{}}{\edef\tcolname@bidipres{#2}}{\edef\tcolname@bidipres{#2@#1}}% Construct `real' target color name. |
| 404 |
\@replacecolor@bidipres% Read second argument. |
| 405 |
}% |
| 406 |
\ifthenelse{\boolean{bidiprescolor}}% Only if bidipresentation's color management is active. |
| 407 |
{% Yes. |
| 408 |
\newcommand{\undefinecolor@bidipres}[1]% Make a color undefined. |
| 409 |
{\expandafter\let\csname\string\color @#1\endcsname=\@undefined}% |
| 410 |
|
| 411 |
\newcommand{\ifcolorexists@bidipres}[3]% Conditional for testing whether a color is defined. |
| 412 |
{\@ifundefined{\string\color @#1}{#3}{#2}}% Test whether a given color is defined. |
| 413 |
|
| 414 |
\newcommand{\@replacecolor@bidipres}[2][]% Second part of \replacecolor. |
| 415 |
{% |
| 416 |
\ifthenelse{\equal{#1}{}}{\edef\scolname@bidipres{#2}}{\edef\scolname@bidipres{#2@#1}}% Construct `real' source color name. |
| 417 |
\ifcolorexists@bidipres{\scolname@bidipres}% Does the source color exist at all? |
| 418 |
{% Yes. |
| 419 |
\replacecolor@hook@bidipres{\tcolname@bidipres}% Execute hook. |
| 420 |
\expandafter\let\csname\string\color @\tcolname@bidipres\expandafter\endcsname% Make value of target color |
| 421 |
\csname\string\color @\scolname@bidipres\endcsname% identical with source color. |
| 422 |
\expandafter\let\csname colordef@bidipres@\tcolname@bidipres\expandafter\endcsname% Make definition of target color |
| 423 |
\csname colordef@bidipres@\scolname@bidipres\endcsname% identical with source color. |
| 424 |
}% |
| 425 |
{% No. Do nothing. |
| 426 |
}% |
| 427 |
}% |
| 428 |
\newcommand{\colors@bidipres}{} |
| 429 |
\newcommand{\removecolor@bidipres}[1]% |
| 430 |
{% |
| 431 |
\def\processme@bidipres##1% This macro does the real work. |
| 432 |
{% |
| 433 |
\ifthenelse{\equal{#1}{##1}}% Is this the color to be removed? |
| 434 |
{% Yes. Do nothing, so it vanishes. |
| 435 |
} |
| 436 |
{% No. Re-insert. |
| 437 |
\expandafter\def\expandafter\colors@bidipres\expandafter{\colors@bidipres\processme@bidipres{##1}}% |
| 438 |
}% |
| 439 |
}% |
| 440 |
\expandafter\let\expandafter\colors@bidipres\expandafter\empty% Initialize \colors@bidipres. |
| 441 |
\colors@bidipres% Execute \processme@bidipres for every color on the list. |
| 442 |
} |
| 443 |
\newcommand{\addbidiprescolor}[1]% |
| 444 |
{% |
| 445 |
\removecolor@bidipres{#1}% Remove this color from the list (to avoid duplicates). |
| 446 |
\expandafter\def\expandafter\colors@bidipres\expandafter{\colors@bidipres\processme@bidipres{#1}}% ... and insert. |
| 447 |
\register@normalvariant@bidipres{#1}% Register the normal variant for this color. |
| 448 |
} |
| 449 |
\newcommand{\definebidiprescolor}[4][] |
| 450 |
{% |
| 451 |
\addbidiprescolor{#2}% Add color to the list. |
| 452 |
\ifthenelse{\equal{#1}{}}% Color from the current color set? |
| 453 |
{\definecolor{#2}{#3}{#4}}% Yep. Just define the color. |
| 454 |
{\definecolor{#2@#1}{#3}{#4}}% No. Add color set identifyer. |
| 455 |
} |
| 456 |
\newcommand{\replacecolors@bidipres}% |
| 457 |
{% |
| 458 |
\@ifstar% The starred version will put the color set into normal variant. |
| 459 |
{\let\replacecolor@hook@bidipres=\register@normalvariant@bidipres\@replacecolors@bidipres} |
| 460 |
{\let\replacecolor@hook@bidipres=\@gobble\@replacecolors@bidipres}% |
| 461 |
} |
| 462 |
|
| 463 |
\newcommand{\@replacecolors@bidipres}[4]% This part does the real work. |
| 464 |
{% |
| 465 |
\def\processme@bidipres##1{\replacecolor@bidipres[#1]{#2##1}[#3]{#4##1}}% |
| 466 |
\colors@bidipres |
| 467 |
} |
| 468 |
\newcommand{\usecolorset}[1]% |
| 469 |
{% |
| 470 |
\replacecolors@bidipres*{}{}{#1}{}% Replace normal variant (registering variants). |
| 471 |
\replacecolors@bidipres{}{d}{#1}{d}% Replace dimmed variant. |
| 472 |
\replacecolors@bidipres{}{e}{#1}{e}% Replace enhanced variant. |
| 473 |
\xecolor{textcolor}% Activate textcolor. |
| 474 |
\pagecolor{pagecolor}% Activate pagecolor. |
| 475 |
}% |
| 476 |
\newcommand{\dumpcolorset}[1]% |
| 477 |
{% |
| 478 |
\nonnormalwarnings@bidipres{Dumping color set #1}% Output a warning for every color not in the normal variant. |
| 479 |
\replacecolors@bidipres{#1}{}{}{}% Dump normal variant (hopefully). |
| 480 |
\replacecolors@bidipres{#1}{d}{}{d}% Dump dimmed variant. |
| 481 |
\replacecolors@bidipres{#1}{e}{}{e}% Dump enhanced variant. |
| 482 |
}% |
| 483 |
\newcommand{\registervariant@bidipres}[2]% Remember which variant a color is currently in. |
| 484 |
{\expandafter\def\csname cvar@#1@bidipres\endcsname{#2}} |
| 485 |
|
| 486 |
\newcommand{\register@normalvariant@bidipres}[1]% Register that a color is now in the normal variant. |
| 487 |
{\registervariant@bidipres{#1}{}} |
| 488 |
|
| 489 |
\newcommand{\currentvariant@bidipres}[1]% Return the current variant of a color. |
| 490 |
{\csname cvar@#1@bidipres\endcsname} |
| 491 |
|
| 492 |
\newcommand{\ifnormalvariant@bidipres}[3]% Conditional for checking whether a color is in the normal variant. |
| 493 |
{\ifthenelse{\equal{\currentvariant@bidipres{#1}}{}}{#2}{#3}} |
| 494 |
|
| 495 |
\newcommand{\nonnormalwarnings@bidipres}[1]% Checks the current variant for every standard color and gives a warning |
| 496 |
{% if it's not the normal one. |
| 497 |
\def\processme@bidipres##1% |
| 498 |
{% |
| 499 |
\ifnormalvariant@bidipres{##1}{} |
| 500 |
{% |
| 501 |
\ClassWarning{bidipresentation} |
| 502 |
{#1\MessageBreak when color ##1 is in \currentvariant@bidipres{##1} variant}% |
| 503 |
}% |
| 504 |
}% |
| 505 |
\colors@bidipres |
| 506 |
} |
| 507 |
\newcommand{\dimlevel}{.7} |
| 508 |
\newcommand{\dimcolor}[2][\dimlevel] |
| 509 |
{% |
| 510 |
\ifnormalvariant@bidipres{#2}% Color in the normal variant? |
| 511 |
{% Yes. |
| 512 |
\registervariant@bidipres{#2}{d}% Register dimmed variant. |
| 513 |
\ifcolorexists@bidipres{d#2}% Dedicated dimmed color found? |
| 514 |
{\replacecolor{#2}{d#2}}% Yes. use that one. |
| 515 |
{\colorbetween[#1]{#2}{pagecolor}{#2}}% No. Dim numerically using \colorbetween. |
| 516 |
}% |
| 517 |
{}% No. Do nothing. |
| 518 |
} |
| 519 |
\newcommand{\dimcolors}[1][\dimlevel] |
| 520 |
{% |
| 521 |
\def\processme@bidipres##1{\dimcolor[#1]{##1}}% |
| 522 |
\colors@bidipres |
| 523 |
}% |
| 524 |
\newcommand{\enhancelevel}{.5} |
| 525 |
\newcommand{\enhancecolor}[2][\enhancelevel] |
| 526 |
{% |
| 527 |
\ifnormalvariant@bidipres{#2}% Color in the normal variant? |
| 528 |
{% |
| 529 |
\registervariant@bidipres{#2}{e}% Register enhanced variant. |
| 530 |
\ifcolorexists@bidipres{e#2}% Dedicated enhanced color found? |
| 531 |
{\replacecolor{#2}{e#2}}% Yes. use that one. |
| 532 |
{\colorbetween[-#1]{#2}{pagecolor}{#2}}% No. Enhance numerically using \colorbetween. |
| 533 |
}% |
| 534 |
{}% |
| 535 |
}% |
| 536 |
\newcommand{\enhancecolors}[1][\enhancelevel] |
| 537 |
{% |
| 538 |
\def\processme@bidipres##1{\enhancecolor[#1]{##1}}% |
| 539 |
\colors@bidipres |
| 540 |
}% |
| 541 |
\newcommand{\replacecolorsbyone@bidipres}[2]% |
| 542 |
{% |
| 543 |
\def\processme@bidipres##1{\replacecolor{#1##1}{#2}}% |
| 544 |
\colors@bidipres |
| 545 |
} |
| 546 |
\newcommand{\vanishcolor}{pagecolor} |
| 547 |
\newcommand{\vanishcolors}[1][\vanishcolor]{\replacecolorsbyone@bidipres{}{#1}} |
| 548 |
\input{bidiprescolors.cfg} |
| 549 |
\newcommand{\whitebackground}% |
| 550 |
{% |
| 551 |
\usecolorset{whitebg}% |
| 552 |
} |
| 553 |
\ifthenelse{\boolean{whitebackground@bidipres}} |
| 554 |
{\AtEndOfClass{\whitebackground}} |
| 555 |
{} |
| 556 |
\newcommand{\lightbackground}% |
| 557 |
{% |
| 558 |
\usecolorset{lightbg}% |
| 559 |
} |
| 560 |
\ifthenelse{\boolean{lightbackground@bidipres}}{\AtEndOfClass{\lightbackground}}{} |
| 561 |
\newcommand{\darkbackground}% |
| 562 |
{% |
| 563 |
\usecolorset{darkbg}% |
| 564 |
} |
| 565 |
\ifthenelse{\boolean{darkbackground@bidipres}}{\AtEndOfClass{\darkbackground}}{} |
| 566 |
\newcommand{\blackbackground}% |
| 567 |
{% |
| 568 |
\usecolorset{blackbg}% |
| 569 |
} |
| 570 |
\ifthenelse{\boolean{blackbackground@bidipres}}{\AtEndOfClass{\blackbackground}}{} |
| 571 |
\ifthenelse{\boolean{bidiprescolor}} |
| 572 |
{% |
| 573 |
\renewcommand{\normalcolor}{\xecolor{textcolor}}% \normalcolor should produce textcolor. |
| 574 |
|
| 575 |
\let\o@textnormal@bidipres=\textnormal% \textnormal should also set text color. |
| 576 |
\def\textnormal#1{\o@textnormal@bidipres{\normalcolor#1}} |
| 577 |
\AtEndOfClass{\xecolor{textcolor}\let\default@color\current@color} |
| 578 |
\AtBeginDocument% |
| 579 |
{% |
| 580 |
\pagecolor{pagecolor}\xecolor{textcolor}% |
| 581 |
}% |
| 582 |
} |
| 583 |
{} |
| 584 |
\ifthenelse{\boolean{bidiprescolor}}{\AtBeginDocument{\pagecolor{pagecolor}\xecolor{textcolor}}}{} |
| 585 |
}% matches \ifthenelse{\boolean{bidiprescolor}}{% Yes. |
| 586 |
{% No; provide dummies. |
| 587 |
\let\setcolor@bidipres=\@gobble% |
| 588 |
\newcommand{\@replacecolor@bidipres}[2][]{}% |
| 589 |
\let\addbidiprescolor=\@gobble |
| 590 |
\newcommand{\definebidiprescolor}[4][]{}% |
| 591 |
\let\usecolorset=\@gobble |
| 592 |
\let\dumpcolorset=\@gobble |
| 593 |
\newcommand{\dimcolor}[2][]{} |
| 594 |
\newcommand{\dimcolors}[1][]{} |
| 595 |
\newcommand{\enhancecolor}[2][]{} |
| 596 |
\newcommand{\enhancecolors}[1][]{} |
| 597 |
\newcommand{\vanishcolors}[1][]{} |
| 598 |
} |
| 599 |
\ifthenelse{\boolean{coloremph@bidipres}}% Should \emph use color? |
| 600 |
{% Yes; |
| 601 |
\DeclareRobustCommand{\em}% Redefine \em. |
| 602 |
{% |
| 603 |
\@nomath\em \xecolor{emcolor}% Change color. |
| 604 |
\replacecolor{tmp@bidipres}{emcolor}% Exchange emcolor and altemcolor. |
| 605 |
\replacecolor{emcolor}{altemcolor}% |
| 606 |
\replacecolor{altemcolor}{tmp@bidipres}% |
| 607 |
}% |
| 608 |
}% |
| 609 |
{}% No; keep original definition. |
| 610 |
|
| 611 |
\ifthenelse{\boolean{colorhighlight@bidipres}}% Color highlighting enabled? |
| 612 |
{% Yes; code is displayed typewriter-style, bold and in a special color. |
| 613 |
\DeclareRobustCommand{\code}[1]{\textxecolor{codecolor}{\textbf{\texttt{#1}}}}% |
| 614 |
\DeclareRobustCommand{\codeswitch}{\xecolor{codecolor}\bfseries\ttfamily}% |
| 615 |
} |
| 616 |
{% No; code is displayed just in typewriter-style and bold. |
| 617 |
\DeclareRobustCommand{\code}[1]{\textbf{\texttt{#1}}}% |
| 618 |
\DeclareRobustCommand{\codeswitch}{\bfseries\ttfamily}% |
| 619 |
} |
| 620 |
\newcommand{\macroname}[1]{\code{\textbackslash#1}} |
| 621 |
\newcommand{\commandapp}[3][]{\code{\macroname{#2}\ifthenelse{\equal{#1}{}}{}{[#1]}\{#3\}}} |
| 622 |
\newcommand{\carg}[1]{\code{\origmath{\left<\code{#1}\right>}}} |
| 623 |
\ifthenelse{\boolean{colorhighlight@bidipres}}% Color highlighting enabled? |
| 624 |
{% Yes; |
| 625 |
\DeclareRobustCommand{\underl}{\textxecolor{underlcolor}}% Use color to highlight. |
| 626 |
} |
| 627 |
{% No; |
| 628 |
\DeclareRobustCommand{\underl}{\textbf}% Use bold face. |
| 629 |
} |
| 630 |
\ifthenelse{\boolean{colorhighlight@bidipres}}% Color highlighting enabled? |
| 631 |
{% Yes; |
| 632 |
\DeclareRobustCommand{\concept}{\textxecolor{conceptcolor}}% Use color to highlight. |
| 633 |
} |
| 634 |
{% No; |
| 635 |
\DeclareRobustCommand{\concept}{\textbf}% Use bold face. |
| 636 |
} |
| 637 |
\ifthenelse{\boolean{colorhighlight@bidipres}}% Color highlighting enabled? |
| 638 |
{% Yes; |
| 639 |
\DeclareRobustCommand{\inactive}{\textxecolor{inactivecolor}}% Use color to highlight. |
| 640 |
} |
| 641 |
{% No; |
| 642 |
\DeclareRobustCommand{\inactive}{\monochromeinactive}% Use monochrome default. |
| 643 |
} |
| 644 |
|
| 645 |
\providecommand{\monochromeinactive}{}% What should \inactive do if colors can't be used? We provide a hook for |
| 646 |
% user definitions. |
| 647 |
\ifthenelse{\boolean{colorhighlight@bidipres}}% Color highlighting enabled? |
| 648 |
{% Yes; use a colored box. |
| 649 |
\newcommand{\present}[2][]{\leavevmode\llap{\textbf{\footnotesize#1}\,}\fcolorbox{textcolor}{presentcolor}{#2}}% |
| 650 |
\newcommand{\mkpbox@bidipres}[1]{\fcolorbox{presentcolor}{presentcolor}{#1}}% Internal macro for use by \presentbox. |
| 651 |
} |
| 652 |
{% No; use an \fbox. |
| 653 |
\newcommand{\present}[2][]{\leavevmode\llap{\textbf{\footnotesize#1}\,}\fbox{#2}}% |
| 654 |
\newcommand{\mkpbox@bidipres}[1]{\fbox{#1}}% |
| 655 |
} |
| 656 |
\newsavebox{\pbox@bidipres}% Container for the minipage to be boxed. |
| 657 |
\newenvironment{presentbox}% |
| 658 |
{% |
| 659 |
\par\smallskip% First a small space to separate the area from preceding text. |
| 660 |
\begin{lrbox}{\pbox@bidipres}% Save the contents in a minipage inside \pbox@bidipres. |
| 661 |
\noindent |
| 662 |
\begin{minipage}{\linewidth-2\fboxsep-2\fboxrule}% Reduce the width of the minipage to leave space for the frame. |
| 663 |
\replacecolor{presentcolor}{pagecolor}% If \present is used inside the colored area... |
| 664 |
}% |
| 665 |
{% |
| 666 |
\end{minipage} |
| 667 |
\end{lrbox}% |
| 668 |
\noindent\mkpbox@bidipres{\usebox{\pbox@bidipres}}% This typesets the saved minipage inside the coloured area. |
| 669 |
\smallskip% A small space to separate the area from succeding text. |
| 670 |
\par |
| 671 |
} |
| 672 |
\newcommand{\rulestripes}{10} |
| 673 |
\newcommand{\stripeoverlap}{.15pt} |
| 674 |
\newcommand{\rulefirstgradprogression}{1} |
| 675 |
\newcommand{\rulesecondgradprogression}{1} |
| 676 |
\newcommand{\rulegradmidpoint}{.5} |
| 677 |
\newcounter{stripe@bidipres} |
| 678 |
|
| 679 |
\newcounter{stripes@bidipres} |
| 680 |
|
| 681 |
\newcommand{\firstgradprogression@bidipres}{1} |
| 682 |
|
| 683 |
\newcommand{\secondgradprogression@bidipres}{1} |
| 684 |
|
| 685 |
\newcounter{gradprogression@bidipres} |
| 686 |
|
| 687 |
\newcommand{\gradmidpoint@bidipres}{.5} |
| 688 |
\newcommand{\mkgradfirstfactor@bidipres}{\mkgradfactor@bidipres\firstgradprogression@bidipres} |
| 689 |
|
| 690 |
\newcommand{\mkgradsecondfactor@bidipres}{\mkgradfactor@bidipres\secondgradprogression@bidipres} |
| 691 |
|
| 692 |
\newcommand{\mkgradfactor@bidipres}[3]% Calculate a factor modified by a `progression' parameter. |
| 693 |
{% |
| 694 |
\mkfactor{#2}{#3}% Calculate the unmodified factor. |
| 695 |
\setcounter{gradprogression@bidipres}{#1}% Factor definition may contain a calc-expression. |
| 696 |
\ifthenelse{\value{gradprogression@bidipres}=1}{}% Progression value 1 is neutral. |
| 697 |
{% |
| 698 |
\ifthenelse{\value{gradprogression@bidipres}<0}% `Negative' progression? |
| 699 |
{% Yes. |
| 700 |
\@tempcnta-\value{gradprogression@bidipres}\relax% Complement progression wrt 0. |
| 701 |
\mkfactor{#2}{1-1pt*\real{#2}}% Complement factor definition wrt 1pt. |
| 702 |
} |
| 703 |
{\@tempcnta\value{gradprogression@bidipres}\relax}% No; Use progression as given. |
| 704 |
\whiledo{\the\@tempcnta>1}% Calculate (factor definition)^(progression). |
| 705 |
{\advance\@tempcnta by -1\relax\mkfactor{#2}{\real{#2}*\real{#2}}}% |
| 706 |
\ifthenelse{\value{gradprogression@bidipres}<0}% `Negative' progression? |
| 707 |
{% Yes. |
| 708 |
\mkfactor{#2}{1-1pt*\real{#2}}% Complement result wrt 1pt. |
| 709 |
} |
| 710 |
{}% |
| 711 |
}% |
| 712 |
} |
| 713 |
\newcommand{\vgradrule}[1][]% Pick up first optional argument: [<stripes>] |
| 714 |
{% |
| 715 |
\let\firstgradprogression@bidipres=\rulefirstgradprogression% Use progression parameter for rules. |
| 716 |
\ifthenelse{\equal{#1}{}}% First optional argument given? |
| 717 |
{\setcounter{stripes@bidipres}{\rulestripes}}% No; use default value. |
| 718 |
{\setcounter{stripes@bidipres}{#1}}% Yes. |
| 719 |
\vgradrule@bidipres% Pick up [<startmodel>]{<startcolor>}. |
| 720 |
} |
| 721 |
|
| 722 |
\newcommand{\vgradrule@bidipres}[2][]% Pick up next pair of arguments: [<startmodel>]{<startcolor>}. |
| 723 |
{% |
| 724 |
\ifthenelse{\equal{#1}{}}% <startmodel> given? |
| 725 |
{\replacecolor{startcolor@bidipres}{#2}}% No; <startcolor> is a color name. |
| 726 |
{\definecolor{startcolor@bidipres}{#1}{#2}}% Yes; {<startmodel>}{<startcolor>} is a color definition. |
| 727 |
\@vgradrule@bidipres% Pick up [<endmodel>]{<endcolor>}. |
| 728 |
} |
| 729 |
|
| 730 |
\newcommand{\@vgradrule@bidipres}[2][]% Pick up next pair of arguments: [<endmodel>]{<endcolor>}. |
| 731 |
{% |
| 732 |
\ifthenelse{\equal{#1}{}} |
| 733 |
{\replacecolor{endcolor@bidipres}{#2}} |
| 734 |
{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 735 |
\@@vgradrule@bidipres% Pick up rule arguments and proceed. |
| 736 |
} |
| 737 |
\newcommand{\hstripe@bidipres}[4]% |
| 738 |
{\hbox{{\setcolor@bidipres{stripecolor@bidipres}\rule{#2}{#3}}}#4} |
| 739 |
\newcommand{\@@vgradrule@bidipres}[3][0pt]% |
| 740 |
{% |
| 741 |
\ifthenelse{\value{stripes@bidipres}<2}% A `pathological case' which can happen in animations: If 0 or 1 stripes are |
| 742 |
% requested, a division by zero error would be produced by the gradient code. |
| 743 |
{\mbox{{\setcolor@bidipres{startcolor@bidipres}\rule[#1]{#2}{#3}}}}% In this case, just produce a colored rule. |
| 744 |
{% |
| 745 |
\raisebox{#1}% Evaluate the <raise> argument of the rule. |
| 746 |
{% |
| 747 |
\vbox% A vbox with \offinterlineskip allows to align the stripes vertically. |
| 748 |
{% |
| 749 |
\offinterlineskip |
| 750 |
\setcounter{stripe@bidipres}{0}% Initialize the number of the current stripe. |
| 751 |
\whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}} |
| 752 |
{% |
| 753 |
\mkgradfirstfactor@bidipres{\tmp@bidipres}% Make the weight for \colorbetween, based on the number of the current stripe |
| 754 |
{\value{stripe@bidipres}/(\value{stripes@bidipres}-1)}% and the first gradient progression. |
| 755 |
\colorbetween[\tmp@bidipres]{stripecolor@bidipres}{endcolor@bidipres}{startcolor@bidipres}% Calculate stripe color. |
| 756 |
\stepcounter{stripe@bidipres}% |
| 757 |
\ifthenelse{\value{stripe@bidipres}=\value{stripes@bidipres}}% Last stripe? |
| 758 |
{\hstripe@bidipres{\tmp@bidipres}{#2}{(#3)/\value{stripes@bidipres}}{}}% Yes; make stripe w/o overlap. |
| 759 |
{% No; add a kern to make stripes overlap. |
| 760 |
\hstripe@bidipres{\tmp@bidipres}{#2}{(#3)/\value{stripes@bidipres}+\stripeoverlap}{\kern-\stripeoverlap}% |
| 761 |
}% |
| 762 |
}% matches \whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}}{% |
| 763 |
}% matches \vbox{% |
| 764 |
}% matches \raisebox{#1}{% |
| 765 |
}% matches second argument of \ifthenelse{\value{stripes@bidipres}<2} |
| 766 |
}% matches \newcommand{\@@vgradrule@bidipres}[3][0pt]{% |
| 767 |
\newcommand{\dblvgradrule}[1][]% Pick up first optional argument: [<midpoint>] |
| 768 |
{% |
| 769 |
\let\firstgradprogression@bidipres=\rulefirstgradprogression% Use progression parameters for rules. |
| 770 |
\let\secondgradprogression@bidipres=\rulesecondgradprogression |
| 771 |
\ifthenelse{\equal{#1}{}}% First optional argument given? |
| 772 |
{\let\gradmidpoint@bidipres=\rulegradmidpoint}% No; use default value. |
| 773 |
{\def\gradmidpoint@bidipres{#1}}% Yes. |
| 774 |
\dblvgradrule@bidipres% Pick up second optional argument. |
| 775 |
} |
| 776 |
|
| 777 |
\newcommand{\dblvgradrule@bidipres}[1][]% Pick up second optional argument: [<stripes>] |
| 778 |
{% |
| 779 |
\ifthenelse{\equal{#1}{}} |
| 780 |
{\setcounter{stripes@bidipres}{\rulestripes}} |
| 781 |
{\setcounter{stripes@bidipres}{#1}}% |
| 782 |
\@dblvgradrule@bidipres |
| 783 |
} |
| 784 |
|
| 785 |
\newcommand{\@dblvgradrule@bidipres}[2][]% Pick up next pair of arguments: [<startmodel>]{<startcolor>}. |
| 786 |
{% |
| 787 |
\ifthenelse{\equal{#1}{}} |
| 788 |
{\replacecolor{startcolor@bidipres}{#2}} |
| 789 |
{\definecolor{startcolor@bidipres}{#1}{#2}}% |
| 790 |
\@@dblvgradrule@bidipres |
| 791 |
} |
| 792 |
|
| 793 |
\newcommand{\@@dblvgradrule@bidipres}[2][]% Pick up next pair of arguments: [<midmodel>]{<midcolor>}. |
| 794 |
{% |
| 795 |
\ifthenelse{\equal{#1}{}} |
| 796 |
{\replacecolor{midcolor@bidipres}{#2}} |
| 797 |
{\definecolor{midcolor@bidipres}{#1}{#2}}% |
| 798 |
\@@@dblvgradrule@bidipres |
| 799 |
} |
| 800 |
|
| 801 |
\newcommand{\@@@dblvgradrule@bidipres}[2][]% Pick up next pair of arguments: [<endmodel>]{<endcolor>}. |
| 802 |
{% |
| 803 |
\ifthenelse{\equal{#1}{}} |
| 804 |
{\replacecolor{endcolor@bidipres}{#2}} |
| 805 |
{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 806 |
\@@@@dblvgradrule@bidipres% Pick up rule arguments and proceed. |
| 807 |
} |
| 808 |
|
| 809 |
\newcommand{\@@@@dblvgradrule@bidipres}[3][0pt]% Main part of \dblvgradrule. |
| 810 |
{% |
| 811 |
\ifthenelse{\value{stripes@bidipres}<2}% The gradient code is not equipped for making less than 2 stripes. |
| 812 |
{\mbox{{\setcolor@bidipres{midcolor@bidipres}\rule[#1]{#2}{#3}}}}% In this case, just produce a rule colored with the middle color. |
| 813 |
{% |
| 814 |
\raisebox{#1}% Evaluate the <raise> argument of the rule. |
| 815 |
{% |
| 816 |
\vbox% A vbox with \offinterlineskip allows to align the stripes |
| 817 |
{% vertically. |
| 818 |
\offinterlineskip |
| 819 |
\setcounter{stripe@bidipres}{0}% Initialize the number of the current stripe. |
| 820 |
\setcounter{tmpcnta@bidipres}% Number of the `middle' stripe. |
| 821 |
{\value{stripes@bidipres}*\real{\gradmidpoint@bidipres}}% |
| 822 |
\whiledo{\value{stripe@bidipres}<\value{tmpcnta@bidipres}}% Produce the upper part of the gradient. |
| 823 |
{% |
| 824 |
\mkgradfirstfactor@bidipres{\tmp@bidipres}% Make the weight for \colorbetween, based on the number of the |
| 825 |
{\value{stripe@bidipres}/\value{tmpcnta@bidipres}}% current stripe and the first gradient progression. |
| 826 |
\colorbetween[\tmp@bidipres]{stripecolor@bidipres}{midcolor@bidipres}{startcolor@bidipres}% Calculate stripe color. |
| 827 |
\hstripe@bidipres{\tmp@bidipres}% Make stripe with overlap. |
| 828 |
{#2}{(#3)/\value{stripes@bidipres}+\stripeoverlap}{\kern-\stripeoverlap}% This is the upper part, remember? |
| 829 |
\stepcounter{stripe@bidipres}% |
| 830 |
}% |
| 831 |
\stepcounter{tmpcnta@bidipres}% |
| 832 |
\ifthenelse{\value{stripes@bidipres}=\value{tmpcnta@bidipres}}% Only one stripe left to produce? |
| 833 |
{\hstripe@bidipres{1}{#2}{(#3)/\value{stripes@bidipres}}{}}% Just produce one stripe colored with the end color. |
| 834 |
{% |
| 835 |
\whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}}% Produce the lower part of the gradient. |
| 836 |
{% |
| 837 |
\mkgradsecondfactor@bidipres{\tmp@bidipres}% Make the weight for \colorbetween. |
| 838 |
{(\value{stripe@bidipres}-\value{tmpcnta@bidipres}+1)/(\value{stripes@bidipres}-\value{tmpcnta@bidipres})}% |
| 839 |
\colorbetween[\tmp@bidipres]{stripecolor@bidipres}{endcolor@bidipres}{midcolor@bidipres}% Calculate stripe color. |
| 840 |
\stepcounter{stripe@bidipres}% |
| 841 |
\ifthenelse{\value{stripe@bidipres}=\value{stripes@bidipres}}% Last stripe? |
| 842 |
{\hstripe@bidipres{\tmp@bidipres}{#2}{(#3)/\value{stripes@bidipres}}{}}% Yes; make stripe w/o overlap. |
| 843 |
{% No; add kern to make stripes overlap. |
| 844 |
\hstripe@bidipres{\tmp@bidipres}{#2}{(#3)/\value{stripes@bidipres}+\stripeoverlap}{\kern-\stripeoverlap}% |
| 845 |
}% |
| 846 |
}% matches \whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}}% |
| 847 |
}% matches second argument of \ifthenelse{\value{stripes@bidipres}=\value{tmpcnta@bidipres}}% |
| 848 |
}% matches \vbox{% |
| 849 |
}% matches \raisebox{#1}{% |
| 850 |
}% matches second argument of \ifthenelse{\value{stripes@bidipres}<2}% |
| 851 |
}% matches \newcommand{\@@@@dblvgradrule@bidipres}[3][0pt]% |
| 852 |
\newcommand{\hgradrule}[1][]% Pick up first optional argument: [<stripes>]. |
| 853 |
{% |
| 854 |
\let\firstgradprogression@bidipres=\rulefirstgradprogression% Use progression parameter for rules. |
| 855 |
\ifthenelse{\equal{#1}{}}% First optional argument given? |
| 856 |
{\setcounter{stripes@bidipres}{\rulestripes}}% No; use default value. |
| 857 |
{\setcounter{stripes@bidipres}{#1}}% Yes. |
| 858 |
\hgradrule@bidipres% Pick up [<startmodel>]{<startcolor>}. |
| 859 |
} |
| 860 |
|
| 861 |
\newcommand{\hgradrule@bidipres}[2][]% Pick up next pair of arguments: [<startmodel>]{<startcolor>}. |
| 862 |
{% |
| 863 |
\ifthenelse{\equal{#1}{}} |
| 864 |
{\replacecolor{startcolor@bidipres}{#2}} |
| 865 |
{\definecolor{startcolor@bidipres}{#1}{#2}}% |
| 866 |
\@hgradrule@bidipres |
| 867 |
} |
| 868 |
|
| 869 |
\newcommand{\@hgradrule@bidipres}[2][] |
| 870 |
{% |
| 871 |
\ifthenelse{\equal{#1}{}} |
| 872 |
{\replacecolor{endcolor@bidipres}{#2}} |
| 873 |
{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 874 |
\@@hgradrule@bidipres% Pick up rule arguments and proceed. |
| 875 |
} |
| 876 |
|
| 877 |
\newcommand{\vstripe@bidipres}[4]% Helper command for making _one_ stripe. Can be overladed for making historams. |
| 878 |
{{\setcolor@bidipres{stripecolor@bidipres}\rule{#2}{#3}#4}} |
| 879 |
|
| 880 |
\newcommand{\@@hgradrule@bidipres}[3][0pt]% Main part of \hgradrule. |
| 881 |
{% |
| 882 |
\ifthenelse{\value{stripes@bidipres}<2}% A `pathological case' which can happen in animations: If 0 or 1 stripes are |
| 883 |
% requested, a division by zero error would be produced by the gradient code. |
| 884 |
{\mbox{{\setcolor@bidipres{startcolor@bidipres}\rule[#1]{#2}{#3}}}}% In this case, just produce a colored rule. |
| 885 |
{% |
| 886 |
\raisebox{#1}% Evaluate the <raise> argument of the rule. |
| 887 |
{% |
| 888 |
\setcounter{stripe@bidipres}{0}% Initialize the number of the current stripe. |
| 889 |
\whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}} |
| 890 |
{% |
| 891 |
\mkgradfirstfactor@bidipres{\tmp@bidipres}% Make the weight for \colorbetween, based on the number of the current stripe |
| 892 |
{\value{stripe@bidipres}/(\value{stripes@bidipres}-1)}% and the first gradient progression. |
| 893 |
\colorbetween[\tmp@bidipres]{stripecolor@bidipres}{endcolor@bidipres}{startcolor@bidipres}% Calculate stripe color. |
| 894 |
\stepcounter{stripe@bidipres}% |
| 895 |
\ifthenelse{\value{stripe@bidipres}=\value{stripes@bidipres}}% Last stripe? |
| 896 |
{\vstripe@bidipres{\tmp@bidipres}{(#2)/\value{stripes@bidipres}}{#3}{}}% Yes; make stripe w/o overlap. |
| 897 |
{% No; add a kern to make stripes overlap. |
| 898 |
\vstripe@bidipres{\tmp@bidipres}{(#2)/\value{stripes@bidipres}+\stripeoverlap}{#3}{\kern-\stripeoverlap}% |
| 899 |
}% |
| 900 |
}% matches \whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}}{% |
| 901 |
}% matches \raisebox{#1}{% |
| 902 |
}% matches second argument of \ifthenelse{\value{stripes@bidipres}<2}% |
| 903 |
}% matches \newcommand{\@@hgradrule@bidipres}[3][0pt]{% |
| 904 |
|
| 905 |
\newcommand{\dblhgradrule}[1][]% Pick up first optional argument: [<midpoint>]. |
| 906 |
{% |
| 907 |
\let\firstgradprogression@bidipres=\rulefirstgradprogression% Use progression parameters for rules. |
| 908 |
\let\secondgradprogression@bidipres=\rulesecondgradprogression |
| 909 |
\ifthenelse{\equal{#1}{}}{\let\gradmidpoint@bidipres=\rulegradmidpoint}{\def\gradmidpoint@bidipres{#1}}% |
| 910 |
\dblhgradrule@bidipres |
| 911 |
} |
| 912 |
|
| 913 |
\newcommand{\dblhgradrule@bidipres}[1][]% Pick up second optional argument: [<stripes>]. |
| 914 |
{% |
| 915 |
\ifthenelse{\equal{#1}{}}{\setcounter{stripes@bidipres}{\rulestripes}}{\setcounter{stripes@bidipres}{#1}}% |
| 916 |
\@dblhgradrule@bidipres |
| 917 |
} |
| 918 |
|
| 919 |
\newcommand{\@dblhgradrule@bidipres}[2][]% Pick up next pair of arguments: [<startmodel>]{<startcolor>}. |
| 920 |
{% |
| 921 |
\ifthenelse{\equal{#1}{}}{\replacecolor{startcolor@bidipres}{#2}}{\definecolor{startcolor@bidipres}{#1}{#2}}% |
| 922 |
\@@dblhgradrule@bidipres |
| 923 |
} |
| 924 |
|
| 925 |
\newcommand{\@@dblhgradrule@bidipres}[2][] |
| 926 |
{% |
| 927 |
\ifthenelse{\equal{#1}{}}{\replacecolor{midcolor@bidipres}{#2}}{\definecolor{midcolor@bidipres}{#1}{#2}}% |
| 928 |
\@@@dblhgradrule@bidipres |
| 929 |
} |
| 930 |
|
| 931 |
\newcommand{\@@@dblhgradrule@bidipres}[2][] |
| 932 |
{% |
| 933 |
\ifthenelse{\equal{#1}{}} |
| 934 |
{\replacecolor{endcolor@bidipres}{#2}} |
| 935 |
{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 936 |
\@@@@dblhgradrule@bidipres% Pick up rule arguments and proceed. |
| 937 |
} |
| 938 |
|
| 939 |
\newcommand{\@@@@dblhgradrule@bidipres}[3][0pt]% Main part of \dblhgradrule. |
| 940 |
{% |
| 941 |
\ifthenelse{\value{stripes@bidipres}<2}% The gradient code is not equipped for making less than 2 stripes. |
| 942 |
{\mbox{{\setcolor@bidipres{midcolor@bidipres}\rule[#1]{#2}{#3}}}}% In this case, just produce a rule colored with the middle color. |
| 943 |
{% |
| 944 |
\raisebox{#1}% Evaluate the <raise> argument of the rule. |
| 945 |
{% |
| 946 |
\setcounter{stripe@bidipres}{0}% Initialize the number of the current stripe. |
| 947 |
\setcounter{tmpcnta@bidipres}% Number of the `middle' stripe. |
| 948 |
{\value{stripes@bidipres}*\real{\gradmidpoint@bidipres}}% |
| 949 |
\whiledo{\value{stripe@bidipres}<\value{tmpcnta@bidipres}}% Produce the left part of the gradient. |
| 950 |
{% |
| 951 |
\mkgradfirstfactor@bidipres{\tmp@bidipres}% Make the weight for \colorbetween, based on the number of the |
| 952 |
{\value{stripe@bidipres}/\value{tmpcnta@bidipres}}% current stripe and the first gradient progression. |
| 953 |
\colorbetween[\tmp@bidipres]{stripecolor@bidipres}{midcolor@bidipres}{startcolor@bidipres}% Calculate stripe color. |
| 954 |
\vstripe@bidipres{\tmp@bidipres}% Make stripe with overlap. |
| 955 |
{(#2)/\value{stripes@bidipres}+\stripeoverlap}{#3}{\kern-\stripeoverlap}% This is the left part, remember? |
| 956 |
\stepcounter{stripe@bidipres}% |
| 957 |
}% |
| 958 |
\stepcounter{tmpcnta@bidipres}% |
| 959 |
\ifthenelse{\value{stripes@bidipres}=\value{tmpcnta@bidipres}}% Only one stripe left to produce? |
| 960 |
{\vstripe@bidipres{1}{(#2)/\value{stripes@bidipres}}{#3}{}}% Just produce one stripe colored with the end color. |
| 961 |
{% |
| 962 |
\whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}}% Produce the right part of the gradient. |
| 963 |
{% |
| 964 |
\mkgradsecondfactor@bidipres{\tmp@bidipres}% Make the weight for \colorbetween. |
| 965 |
{(\value{stripe@bidipres}-\value{tmpcnta@bidipres})/(\value{stripes@bidipres}-\value{tmpcnta@bidipres}-1)}% |
| 966 |
\colorbetween[\tmp@bidipres]{stripecolor@bidipres}{endcolor@bidipres}{midcolor@bidipres}% Calculate stripe color. |
| 967 |
\stepcounter{stripe@bidipres}% |
| 968 |
\ifthenelse{\value{stripe@bidipres}=\value{stripes@bidipres}}% Last stripe? |
| 969 |
{\vstripe@bidipres{\tmp@bidipres}{(#2)/\value{stripes@bidipres}}{#3}{}}% Yes; make stripe w/o overlap. |
| 970 |
{% Add kern to make stripes overlap. |
| 971 |
\vstripe@bidipres{\tmp@bidipres}{(#2)/\value{stripes@bidipres}+\stripeoverlap}{#3}{\kern-\stripeoverlap}% |
| 972 |
}% |
| 973 |
}% matches \whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}}{% |
| 974 |
}% matches second argument of \ifthenelse{\value{stripes@bidipres}=\value{tmpcnta@bidipres}}% |
| 975 |
}% matches \raisebox{#1}{% |
| 976 |
}% matches second argument of \ifthenelse{\value{stripes@bidipres}<2}% |
| 977 |
}% matches \newcommand{\@@@@dblhgradrule@bidipres}[3][0pt]{% |
| 978 |
|
| 979 |
|
| 980 |
\providecommand{\clipbox}[2][\z@]{\leavevmode\hbox{#2}} |
| 981 |
|
| 982 |
\newcommand{\dgradslope}{1,1} |
| 983 |
|
| 984 |
\newcounter{dgradhslope@bidipres} |
| 985 |
|
| 986 |
\newcounter{dgradvslope@bidipres} |
| 987 |
|
| 988 |
\def\setdgradslope(#1,#2){\setcounter{dgradhslope@bidipres}{#1}\setcounter{dgradvslope@bidipres}{#2}} |
| 989 |
\newcommand{\dgradrule}[1][] |
| 990 |
{% |
| 991 |
\ifthenelse{\equal{#1}{}}{\expandafter\setdgradslope\expandafter(\dgradslope)}{\setdgradslope(#1)}% |
| 992 |
\dgradrule@bidipres |
| 993 |
} |
| 994 |
|
| 995 |
\newcommand{\dgradrule@bidipres}[2][] |
| 996 |
{% |
| 997 |
\ifthenelse{\equal{#1}{}}{\replacecolor{startcolor@bidipres}{#2}}{\definecolor{startcolor@bidipres}{#1}{#2}}% |
| 998 |
\@dgradrule@bidipres |
| 999 |
} |
| 1000 |
|
| 1001 |
\newcommand{\@dgradrule@bidipres}[2][] |
| 1002 |
{% |
| 1003 |
\ifthenelse{\equal{#1}{}}{\replacecolor{endcolor@bidipres}{#2}}{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 1004 |
\@@dgradrule@bidipres |
| 1005 |
} |
| 1006 |
|
| 1007 |
\newcommand{\dstripewd@bidipres}{.7pt} |
| 1008 |
|
| 1009 |
\newcommand{\@@dgradrule@bidipres}[3][0pt] |
| 1010 |
{% |
| 1011 |
\raisebox{#1} |
| 1012 |
{% |
| 1013 |
\thicklines |
| 1014 |
\setcounter{stripe@bidipres}{0}% |
| 1015 |
\setcounter{tmpcnta@bidipres}{1*\ratio{#3}{\dstripewd@bidipres}}% |
| 1016 |
\setcounter{stripes@bidipres}{1*\ratio{#3}{\dstripewd@bidipres}+1*\ratio{#2}{\dstripewd@bidipres}}% |
| 1017 |
\@xarg\c@dgradhslope@bidipres\@yarg\c@dgradvslope@bidipres |
| 1018 |
\makebox[\dstripewd@bidipres] |
| 1019 |
{% |
| 1020 |
\whiledo{\value{stripe@bidipres}<\value{tmpcnta@bidipres}} |
| 1021 |
{% |
| 1022 |
\mkfactor{\tmp@bidipres}{\value{stripe@bidipres}/(\value{stripes@bidipres}-1)}% |
| 1023 |
\colorbetween[\tmp@bidipres]{stripecolor@bidipres}{endcolor@bidipres}{startcolor@bidipres}% |
| 1024 |
\setlength{\@linelen}{\dstripewd@bidipres*\value{stripe@bidipres}}% |
| 1025 |
\raisebox{\dstripewd@bidipres*(\value{tmpcnta@bidipres}-\value{stripe@bidipres})} |
| 1026 |
{\makebox[0pt]{{\setcolor@bidipres{stripecolor@bidipres}\hbox to 0pt{\@sline\hss}}}}% |
| 1027 |
\stepcounter{stripe@bidipres}% |
| 1028 |
}% |
| 1029 |
}% |
| 1030 |
\whiledo{\value{stripe@bidipres}<\value{stripes@bidipres}} |
| 1031 |
{% |
| 1032 |
\mkfactor{\tmp@bidipres}{\value{stripe@bidipres}/(\value{stripes@bidipres}-1)}% |
| 1033 |
\colorbetween[\tmp@bidipres]{stripecolor@bidipres}{endcolor@bidipres}{startcolor@bidipres}% |
| 1034 |
\makebox[\dstripewd@bidipres]{{\setcolor@bidipres{stripecolor@bidipres}.}}% |
| 1035 |
\stepcounter{stripe@bidipres}% |
| 1036 |
}% |
| 1037 |
}% |
| 1038 |
}% |
| 1039 |
\newcommand{\vgradbox}[1][]% Pick up first optional argument: [<stripes>]. |
| 1040 |
{% |
| 1041 |
\let\firstgradprogression@bidipres=\rulefirstgradprogression% Use progression parameter for rules. |
| 1042 |
\ifthenelse{\equal{#1}{}}% First optional argument given? |
| 1043 |
{\setcounter{stripes@bidipres}{\rulestripes}}% No; use default value. |
| 1044 |
{\setcounter{stripes@bidipres}{#1}}% Yes. |
| 1045 |
\vgradbox@bidipres% Pick up remaining optional arguments. |
| 1046 |
} |
| 1047 |
|
| 1048 |
\newcommand{\vgradbox@bidipres}[2][] |
| 1049 |
{% |
| 1050 |
\ifthenelse{\equal{#1}{}}{\replacecolor{startcolor@bidipres}{#2}}{\definecolor{startcolor@bidipres}{#1}{#2}}% |
| 1051 |
\@vgradbox@bidipres |
| 1052 |
} |
| 1053 |
|
| 1054 |
\newcommand{\@vgradbox@bidipres}[2][] |
| 1055 |
{% |
| 1056 |
\ifthenelse{\equal{#1}{}}{\replacecolor{endcolor@bidipres}{#2}}{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 1057 |
\@@gradbox@bidipres\@@vgradrule@bidipres% Make a generic background box with vertical gradient background. |
| 1058 |
} |
| 1059 |
|
| 1060 |
\newcommand{\@@gradbox@bidipres}[2]% Generic background box. |
| 1061 |
{% |
| 1062 |
\leavevmode% Make box behave like \mbox. |
| 1063 |
\setbox\tempbox@bidipres |
| 1064 |
\hbox{\kern\fboxsep{\set@color#2}\kern\fboxsep}% An \hbox containing <contents> plus additional white space. |
| 1065 |
\rlap% Underlay box background with rule command passed as #1. |
| 1066 |
{% |
| 1067 |
#1[-\fboxsep-\dp\tempbox@bidipres]% Box depth augmented by `white' space. |
| 1068 |
{\wd\tempbox@bidipres}% Space on the sides has already been added. |
| 1069 |
{\ht\tempbox@bidipres+\dp\tempbox@bidipres+2\fboxsep}}% Total height. |
| 1070 |
\box\tempbox@bidipres% Overlay box contents. |
| 1071 |
}% |
| 1072 |
\newcommand{\hgradbox}[1][] |
| 1073 |
{% |
| 1074 |
\let\secondgradprogression@bidipres=\rulesecondgradprogression |
| 1075 |
\ifthenelse{\equal{#1}{}}{\setcounter{stripes@bidipres}{\rulestripes}}{\setcounter{stripes@bidipres}{#1}}% |
| 1076 |
\hgradbox@bidipres |
| 1077 |
} |
| 1078 |
|
| 1079 |
\newcommand{\hgradbox@bidipres}[2][] |
| 1080 |
{% |
| 1081 |
\ifthenelse{\equal{#1}{}}{\replacecolor{startcolor@bidipres}{#2}}{\definecolor{startcolor@bidipres}{#1}{#2}}% |
| 1082 |
\@hgradbox@bidipres |
| 1083 |
} |
| 1084 |
|
| 1085 |
\newcommand{\@hgradbox@bidipres}[2][] |
| 1086 |
{% |
| 1087 |
\ifthenelse{\equal{#1}{}}{\replacecolor{endcolor@bidipres}{#2}}{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 1088 |
\@@gradbox@bidipres\@@hgradrule@bidipres |
| 1089 |
} |
| 1090 |
\newcommand{\dblvgradbox}[1][] |
| 1091 |
{% |
| 1092 |
\let\firstgradprogression@bidipres=\rulefirstgradprogression% Use progression parameters for rules. |
| 1093 |
\let\secondgradprogression@bidipres=\rulesecondgradprogression |
| 1094 |
\ifthenelse{\equal{#1}{}}{\let\gradmidpoint@bidipres=\rulegradmidpoint}{\def\gradmidpoint@bidipres{#1}}% |
| 1095 |
\dblvgradbox@bidipres |
| 1096 |
} |
| 1097 |
|
| 1098 |
\newcommand{\dblvgradbox@bidipres}[1][] |
| 1099 |
{% |
| 1100 |
\ifthenelse{\equal{#1}{}}{\setcounter{stripes@bidipres}{\rulestripes}}{\setcounter{stripes@bidipres}{#1}}% |
| 1101 |
\@dblvgradbox@bidipres |
| 1102 |
} |
| 1103 |
|
| 1104 |
\newcommand{\@dblvgradbox@bidipres}[2][] |
| 1105 |
{% |
| 1106 |
\ifthenelse{\equal{#1}{}}{\replacecolor{startcolor@bidipres}{#2}}{\definecolor{startcolor@bidipres}{#1}{#2}}% |
| 1107 |
\@@dblvgradbox@bidipres |
| 1108 |
} |
| 1109 |
|
| 1110 |
\newcommand{\@@dblvgradbox@bidipres}[2][] |
| 1111 |
{% |
| 1112 |
\ifthenelse{\equal{#1}{}}{\replacecolor{midcolor@bidipres}{#2}}{\definecolor{midcolor@bidipres}{#1}{#2}}% |
| 1113 |
\@@@dblvgradbox@bidipres |
| 1114 |
} |
| 1115 |
|
| 1116 |
\newcommand{\@@@dblvgradbox@bidipres}[2][] |
| 1117 |
{% |
| 1118 |
\ifthenelse{\equal{#1}{}}{\replacecolor{endcolor@bidipres}{#2}}{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 1119 |
\@@gradbox@bidipres\@@@@dblvgradrule@bidipres |
| 1120 |
} |
| 1121 |
\newcommand{\dblhgradbox}[1][] |
| 1122 |
{% |
| 1123 |
\let\firstgradprogression@bidipres=\rulefirstgradprogression |
| 1124 |
\let\secondgradprogression@bidipres=\rulesecondgradprogression |
| 1125 |
\ifthenelse{\equal{#1}{}}{\let\gradmidpoint@bidipres=\rulegradmidpoint}{\def\gradmidpoint@bidipres{#1}}% |
| 1126 |
\dblhgradbox@bidipres |
| 1127 |
} |
| 1128 |
|
| 1129 |
\newcommand{\dblhgradbox@bidipres}[1][] |
| 1130 |
{% |
| 1131 |
\ifthenelse{\equal{#1}{}}{\setcounter{stripes@bidipres}{\rulestripes}}{\setcounter{stripes@bidipres}{#1}}% |
| 1132 |
\@dblhgradbox@bidipres |
| 1133 |
} |
| 1134 |
|
| 1135 |
\newcommand{\@dblhgradbox@bidipres}[2][] |
| 1136 |
{% |
| 1137 |
\ifthenelse{\equal{#1}{}}{\replacecolor{startcolor@bidipres}{#2}}{\definecolor{startcolor@bidipres}{#1}{#2}}% |
| 1138 |
\@@dblhgradbox@bidipres |
| 1139 |
} |
| 1140 |
|
| 1141 |
\newcommand{\@@dblhgradbox@bidipres}[2][] |
| 1142 |
{% |
| 1143 |
\ifthenelse{\equal{#1}{}}{\replacecolor{midcolor@bidipres}{#2}}{\definecolor{midcolor@bidipres}{#1}{#2}}% |
| 1144 |
\@@@dblhgradbox@bidipres |
| 1145 |
} |
| 1146 |
|
| 1147 |
\newcommand{\@@@dblhgradbox@bidipres}[2][] |
| 1148 |
{% |
| 1149 |
\ifthenelse{\equal{#1}{}}{\replacecolor{endcolor@bidipres}{#2}}{\definecolor{endcolor@bidipres}{#1}{#2}}% |
| 1150 |
\@@gradbox@bidipres\@@@@dblhgradrule@bidipres |
| 1151 |
} |
| 1152 |
\newcommand{\backgroundstyle}[2][] |
| 1153 |
{% |
| 1154 |
\replacecolor{startcolor@bidipres}{bgndstartcolor}% Initialize the internal counterparts |
| 1155 |
\replacecolor{midcolor@bidipres}{bgndmidcolor}% of parameters to their default values. |
| 1156 |
\replacecolor{endcolor@bidipres}{bgndendcolor}% |
| 1157 |
\replacecolor{bgndtoppanelcolor@bidipres}{toppanelcolor}% |
| 1158 |
\replacecolor{bgndbottompanelcolor@bidipres}{bottompanelcolor}% |
| 1159 |
\replacecolor{bgndleftpanelcolor@bidipres}{leftpanelcolor}% |
| 1160 |
\replacecolor{bgndrightpanelcolor@bidipres}{rightpanelcolor}% |
| 1161 |
\let\firstgradprogression@bidipres=\bgndfirstgradprogression |
| 1162 |
\let\secondgradprogression@bidipres=\bgndsecondgradprogression% |
| 1163 |
\setcounter{stripes@bidipres}{\bgndstripes}% |
| 1164 |
\let\gradmidpoint@bidipres=\bgndgradmidpoint |
| 1165 |
\let\bgndtoppanelheight@bidipres=\empty% The panel dimensions depend on other parameters. If they are not |
| 1166 |
\let\bgndbottompanelheight@bidipres=\empty% set directly, defaults are calculated after setting keyval |
| 1167 |
\let\bgndleftpanelwidth@bidipres=\empty% parameters. |
| 1168 |
\let\bgndrightpanelwidth@bidipres=\empty |
| 1169 |
\let\hpanelsvalue@bidipres=\empty |
| 1170 |
\setboolean{autopanels@bidipres}{true}% |
| 1171 |
\csname set#2bgnd@bidipres\endcsname{#1}% Execute the style-specific command which defines the background box. |
| 1172 |
} |
| 1173 |
\newcommand{\bgndstripes}{10} |
| 1174 |
\newcommand{\bgndgradmidpoint}{.5} |
| 1175 |
\newcommand{\bgndfirstgradprogression}{1} |
| 1176 |
\newcommand{\bgndsecondgradprogression}{1} |
| 1177 |
\newcommand{\bgndtoppanelheight}{0pt} |
| 1178 |
|
| 1179 |
\newcommand{\bgndbottompanelheight}{0pt} |
| 1180 |
|
| 1181 |
\newcommand{\bgndleftpanelwidth}{0pt} |
| 1182 |
|
| 1183 |
\newcommand{\bgndrightpanelwidth}{0pt} |
| 1184 |
\newcommand{\bgndtoppanelheight@bidipres}{0pt} |
| 1185 |
|
| 1186 |
\newcommand{\bgndtoppanelwidth@bidipres}{0pt} |
| 1187 |
|
| 1188 |
\newcommand{\bgndbottompanelheight@bidipres}{0pt} |
| 1189 |
|
| 1190 |
\newcommand{\bgndbottompanelwidth@bidipres}{0pt} |
| 1191 |
|
| 1192 |
\newcommand{\bgndleftpanelheight@bidipres}{0pt} |
| 1193 |
|
| 1194 |
\newcommand{\bgndleftpanelwidth@bidipres}{0pt} |
| 1195 |
|
| 1196 |
\newcommand{\bgndrightpanelheight@bidipres}{0pt} |
| 1197 |
|
| 1198 |
\newcommand{\bgndrightpanelwidth@bidipres}{0pt} |
| 1199 |
|
| 1200 |
\newboolean{hpanels@bidipres} |
| 1201 |
|
| 1202 |
\newboolean{autopanels@bidipres} |
| 1203 |
\define@key{bgnd@bidipres}{stripes}{\setcounter{stripes@bidipres}{#1}} |
| 1204 |
|
| 1205 |
\define@key{bgnd@bidipres}{startcolor}{\replacecolor{startcolor@bidipres}{#1}} |
| 1206 |
|
| 1207 |
\define@key{bgnd@bidipres}{startcolordef}{\definecolor{startcolor@bidipres}#1} |
| 1208 |
|
| 1209 |
\define@key{bgnd@bidipres}{midcolor}{\replacecolor{midcolor@bidipres}{#1}} |
| 1210 |
|
| 1211 |
\define@key{bgnd@bidipres}{midcolordef}{\definecolor{midcolor@bidipres}#1} |
| 1212 |
|
| 1213 |
\define@key{bgnd@bidipres}{endcolor}{\replacecolor{endcolor@bidipres}{#1}} |
| 1214 |
|
| 1215 |
\define@key{bgnd@bidipres}{endcolordef}{\definecolor{endcolor@bidipres}#1} |
| 1216 |
|
| 1217 |
\define@key{bgnd@bidipres}{gradmidpoint}{\edef\gradmidpoint@bidipres{#1}} |
| 1218 |
|
| 1219 |
\define@key{bgnd@bidipres}{firstgradprogression}{\def\firstgradprogression@bidipres{#1}} |
| 1220 |
|
| 1221 |
\define@key{bgnd@bidipres}{secondgradprogression}{\def\secondgradprogression@bidipres{#1}} |
| 1222 |
|
| 1223 |
\define@key{bgnd@bidipres}{hpanels}[true]{\def\hpanelsvalue@bidipres{#1}} |
| 1224 |
|
| 1225 |
\define@key{bgnd@bidipres}{autopanels}[true]{\setboolean{autopanels@bidipres}{#1}} |
| 1226 |
|
| 1227 |
\define@key{bgnd@bidipres}{toppanelcolor}{\replacecolor{bgndtoppanelcolor@bidipres}{#1}} |
| 1228 |
|
| 1229 |
\define@key{bgnd@bidipres}{toppanelcolordef}{\definecolor{bgndtoppanelcolor@bidipres}#1} |
| 1230 |
|
| 1231 |
\define@key{bgnd@bidipres}{bottompanelcolor}{\replacecolor{bgndbottompanelcolor@bidipres}{#1}} |
| 1232 |
|
| 1233 |
\define@key{bgnd@bidipres}{bottompanelcolordef}{\definecolor{bgndbottompanelcolor@bidipres}#1} |
| 1234 |
|
| 1235 |
\define@key{bgnd@bidipres}{leftpanelcolor}{\replacecolor{bgndleftpanelcolor@bidipres}{#1}} |
| 1236 |
|
| 1237 |
\define@key{bgnd@bidipres}{leftpanelcolordef}{\definecolor{bgndleftpanelcolor@bidipres}#1} |
| 1238 |
|
| 1239 |
\define@key{bgnd@bidipres}{rightpanelcolor}{\replacecolor{bgndrightpanelcolor@bidipres}{#1}} |
| 1240 |
|
| 1241 |
\define@key{bgnd@bidipres}{rightpanelcolordef}{\definecolor{bgndrightpanelcolor@bidipres}#1} |
| 1242 |
|
| 1243 |
\define@key{bgnd@bidipres}{toppanelheight}{\mklength@bidipres{\bgndtoppanelheight@bidipres}{#1}} |
| 1244 |
|
| 1245 |
\define@key{bgnd@bidipres}{bottompanelheight}{\mklength@bidipres{\bgndbottompanelheight@bidipres}{#1}} |
| 1246 |
|
| 1247 |
\define@key{bgnd@bidipres}{leftpanelwidth}{\mklength@bidipres{\bgndleftpanelwidth@bidipres}{#1}} |
| 1248 |
|
| 1249 |
\define@key{bgnd@bidipres}{rightpanelwidth}{\mklength@bidipres{\bgndrightpanelwidth@bidipres}{#1}} |
| 1250 |
\newbox\bgndbox@bidipres |
| 1251 |
\setbox\bgndbox@bidipres\null% Default: Empty. |
| 1252 |
\newcommand{\mkpanels@bidipres}[1]% |
| 1253 |
{% |
| 1254 |
\ifthenelse{\boolean{hpanels@bidipres}}% `horizontal' panels? |
| 1255 |
{% Yes. Vertically align top panel, center area with left and right panels, and bottom panel. |
| 1256 |
\vbox% A vbox with \offinterlineskip allows to align the |
| 1257 |
{% horizontal panels with the `background center'. |
| 1258 |
\offinterlineskip |
| 1259 |
\ifthenelse{\lengthtest{\bgndtoppanelheight@bidipres=0pt}}% Should top panel be created? |
| 1260 |
{}% No. |
| 1261 |
{% |
| 1262 |
\hbox{{% |
| 1263 |
\setcolor@bidipres{bgndtoppanelcolor@bidipres}% |
| 1264 |
\rule{\bgndtoppanelwidth@bidipres}{\bgndtoppanelheight@bidipres}% Make horizontal colored area. |
| 1265 |
}}% |
| 1266 |
}% |
| 1267 |
\hbox% Make `background center'. |
| 1268 |
{% |
| 1269 |
\ifthenelse{\lengthtest{\bgndleftpanelwidth@bidipres=0pt}}% Should left panel be created? |
| 1270 |
{}% No. |
| 1271 |
{{% |
| 1272 |
\setcolor@bidipres{bgndleftpanelcolor@bidipres}% |
| 1273 |
\rule{\bgndleftpanelwidth@bidipres}{\bgndleftpanelheight@bidipres}% Make vertical colored area. |
| 1274 |
}}% |
| 1275 |
#1% Make main background object. |
| 1276 |
{\bgndtoppanelwidth@bidipres-\bgndleftpanelwidth@bidipres-\bgndrightpanelwidth@bidipres}% Calculate remaining space in the center. |
| 1277 |
{\bgndleftpanelheight@bidipres}% |
| 1278 |
\ifthenelse{\lengthtest{\bgndrightpanelwidth@bidipres=0pt}}% Should right panel be created? |
| 1279 |
{}% No. |
| 1280 |
{{% |
| 1281 |
\setcolor@bidipres{bgndrightpanelcolor@bidipres}% |
| 1282 |
\rule{\bgndrightpanelwidth@bidipres}{\bgndrightpanelheight@bidipres}% Make vertical colored area. |
| 1283 |
}}% |
| 1284 |
}% matches \hbox{% |
| 1285 |
\ifthenelse{\lengthtest{\bgndbottompanelheight@bidipres=0pt}}% Should bottom panel be created? |
| 1286 |
{}% No. |
| 1287 |
{% |
| 1288 |
\hbox |
| 1289 |
{{% |
| 1290 |
\setcolor@bidipres{bgndbottompanelcolor@bidipres}% |
| 1291 |
\rule{\bgndbottompanelwidth@bidipres}{\bgndbottompanelheight@bidipres}% Make horizontal colored area. |
| 1292 |
}}% |
| 1293 |
}% |
| 1294 |
}% matches \vbox{% |
| 1295 |
}% matches \ifthenelse{\boolean{hpanels@bidipres}}{% |
| 1296 |
{% No. Horizontally align left panel, center area with top and bottom panels, and right panel. |
| 1297 |
\ifthenelse{\lengthtest{\bgndleftpanelwidth@bidipres=0pt}}% Should left panel be created? |
| 1298 |
{}% No. |
| 1299 |
{{% |
| 1300 |
\setcolor@bidipres{bgndleftpanelcolor@bidipres}% |
| 1301 |
\rule{\bgndleftpanelwidth@bidipres}{\bgndleftpanelheight@bidipres}% Make vertical colored area. |
| 1302 |
}}% |
| 1303 |
\vbox% A vbox with \offinterlineskip allows to align |
| 1304 |
{% the horizontal panels with the center object. |
| 1305 |
\offinterlineskip |
| 1306 |
\ifthenelse{\lengthtest{\bgndtoppanelheight@bidipres=0pt}}% Should top panel be created? |
| 1307 |
{}% No. |
| 1308 |
{% |
| 1309 |
\hbox% |
| 1310 |
{{% |
| 1311 |
\setcolor@bidipres{bgndtoppanelcolor@bidipres}% |
| 1312 |
\rule{\bgndtoppanelwidth@bidipres}{\bgndtoppanelheight@bidipres}% Make horizontal colored area. |
| 1313 |
}}% |
| 1314 |
}% |
| 1315 |
\hbox% Make main background object. |
| 1316 |
{% |
| 1317 |
#1% |
| 1318 |
{\bgndtoppanelwidth@bidipres}% |
| 1319 |
{\bgndleftpanelheight@bidipres-\bgndtoppanelheight@bidipres-\bgndbottompanelheight@bidipres}% Calculate space in the center. |
| 1320 |
}% |
| 1321 |
\ifthenelse{\lengthtest{\bgndbottompanelheight@bidipres=0pt}}% Should bottom panel be created? |
| 1322 |
{}% No. |
| 1323 |
{% |
| 1324 |
\hbox% |
| 1325 |
{{% |
| 1326 |
\setcolor@bidipres{bgndbottompanelcolor@bidipres}% |
| 1327 |
\rule{\bgndbottompanelwidth@bidipres}{\bgndbottompanelheight@bidipres}% Make horizontal colored area. |
| 1328 |
}}% |
| 1329 |
}% |
| 1330 |
}% matches \vbox{% |
| 1331 |
\ifthenelse{\lengthtest{\bgndrightpanelwidth@bidipres=0pt}}% Should right panel be created? |
| 1332 |
{}% No. |
| 1333 |
{{% |
| 1334 |
\setcolor@bidipres{bgndrightpanelcolor@bidipres}% |
| 1335 |
\rule{\bgndrightpanelwidth@bidipres}{\bgndrightpanelheight@bidipres}% Make vertical colored area. |
| 1336 |
}}% |
| 1337 |
}% matches second argument of \ifthenelse{\boolean{hpanels@bidipres}} |
| 1338 |
}% matches \newcommand{\mkpanels@bidipres}[1]{% |
| 1339 |
\newcommand{\initpanels@bidipres}[1]% |
| 1340 |
{% |
| 1341 |
\ifx\hpanelsvalue@bidipres\empty% Has the hpanels parameter been given? |
| 1342 |
\setboolean{hpanels@bidipres}{#1}% No; use default. |
| 1343 |
\else |
| 1344 |
\setboolean{hpanels@bidipres}{\hpanelsvalue@bidipres}% Yes; use parameter setting. |
| 1345 |
\fi |
| 1346 |
\ifthenelse{\boolean{hpanels@bidipres}}% `horizontal' panel direction? |
| 1347 |
{% Yes. Horizontal panels are `outer', vertical panels are `inner'. |
| 1348 |
\let\bgndtoppanelwidth@bidipres=\bidiprespagewidth% Full width for horizontal panels. |
| 1349 |
\let\bgndbottompanelwidth@bidipres=\bidiprespagewidth% |
| 1350 |
\ifthenelse{\equal{\bgndtoppanelheight@bidipres}{}}% Has the top panel height been set? |
| 1351 |
{% No. Guess default. |
| 1352 |
\ifx\toppanelcontents@bidipres\empty% Is the panel defined? |
| 1353 |
\mklength@bidipres{\bgndtoppanelheight@bidipres}{\bgndtoppanelheight}% Use background-specific default. |
| 1354 |
\else |
| 1355 |
\ifthenelse{\boolean{autopanels@bidipres}}% Calculate panel dimensions? |
| 1356 |
{% Yes. |
| 1357 |
\calcvdimen@bidipres{\bgndtoppanelheight@bidipres}{\bgndtoppanelwidth@bidipres}% Measure the height of panel contents. |
| 1358 |
{\toppanelcontents@bidipres}% |
| 1359 |
\let\toppanelheight=\bgndtoppanelheight@bidipres% Overwrite panel settings. |
| 1360 |
\let\toppanelwidth=\bgndtoppanelwidth@bidipres% |
| 1361 |
\def\toppanelshift{0pt}% Top panel spans the whole upper screen. |
| 1362 |
} |
| 1363 |
{% No |
| 1364 |
\mklength@bidipres{\bgndtoppanelheight@bidipres}{\toppanelheight}% Use panel-specific default. |
| 1365 |
}% |
| 1366 |
\fi |
| 1367 |
}% matches \ifthenelse{\equal{\bgndtoppanelheight@bidipres}{}} |
| 1368 |
{% Yes. |
| 1369 |
\let\toppanelheight=\bgndtoppanelheight@bidipres% Overwrite panel settings - use user-supplied value. |
| 1370 |
} |
| 1371 |
\ifthenelse{\equal{\bgndbottompanelheight@bidipres}{}}% Has the bottom panel height been set? |
| 1372 |
{% No. Guess default. |
| 1373 |
\ifx\bottompanelcontents@bidipres\empty% Is the bottom panel defined? |
| 1374 |
\mklength@bidipres{\bgndbottompanelheight@bidipres}{\bgndbottompanelheight}% Use background-specific default. |
| 1375 |
\else |
| 1376 |
\ifthenelse{\boolean{autopanels@bidipres}}% Calculate panel dimensions? |
| 1377 |
{% Yes. |
| 1378 |
\calcvdimen@bidipres{\bgndbottompanelheight@bidipres}{\bgndbottompanelwidth@bidipres}% Measure the height of panel contents. |
| 1379 |
{\bottompanelcontents@bidipres}% |
| 1380 |
\let\bottompanelheight=\bgndbottompanelheight@bidipres% Overwrite panel settings. |
| 1381 |
\let\bottompanelwidth=\bgndbottompanelwidth@bidipres% |
| 1382 |
\def\bottompanelshift{0pt}% Bottom panel spans the whole upper screen. |
| 1383 |
} |
| 1384 |
{% No |
| 1385 |
\mklength@bidipres{\bgndbottompanelheight@bidipres}{\bottompanelheight}% Use panel-specific default. |
| 1386 |
}% |
| 1387 |
\fi |
| 1388 |
}% matches \ifthenelse{\equal{\bgndbottompanelheight@bidipres}{}} |
| 1389 |
{% Yes. |
| 1390 |
\let\bottompanelheight=\bgndbottompanelheight@bidipres% Overwrite panel settings - use user-supplied value. |
| 1391 |
} |
| 1392 |
\mklength@bidipres{\bgndleftpanelheight@bidipres}% Calculate remaining space in the center. |
| 1393 |
{\bidiprespageheight-\bgndtoppanelheight@bidipres-\bgndbottompanelheight@bidipres}% |
| 1394 |
\let\bgndrightpanelheight@bidipres=\bgndleftpanelheight@bidipres% Height of left and right panels is equal. |
| 1395 |
\ifthenelse{\equal{\bgndleftpanelwidth@bidipres}{}}% Has the left panel width been set? |
| 1396 |
{% No. Guess default. |
| 1397 |
\ifx\leftpanelcontents@bidipres\empty% Is the panel defined? |
| 1398 |
\mklength@bidipres{\bgndleftpanelwidth@bidipres}{\bgndleftpanelwidth}% Use background-specific default. |
| 1399 |
\else |
| 1400 |
\ifthenelse{\boolean{autopanels@bidipres}}% Calculate panel dimensions? |
| 1401 |
{% Yes. |
| 1402 |
\calchdimen@bidipres{\bgndleftpanelwidth@bidipres}{\bgndleftpanelheight@bidipres}% Measure the `optimal' width of panel contents. |
| 1403 |
{\leftpanelcontents@bidipres}% |
| 1404 |
\let\leftpanelheight=\bgndleftpanelheight@bidipres% Overwrite panel settings. |
| 1405 |
\let\leftpanelwidth=\bgndleftpanelwidth@bidipres% |
| 1406 |
\let\leftpanelraise=\bgndbottompanelheight@bidipres% Left panel is raised above bottom panel. |
| 1407 |
} |
| 1408 |
{% No |
| 1409 |
\mklength@bidipres{\bgndleftpanelwidth@bidipres}{\leftpanelwidth}% Use panel-specific default. |
| 1410 |
}% |
| 1411 |
\fi |
| 1412 |
}% matches \ifthenelse{\equal{\bgndleftpanelwidth@bidipres}{}} |
| 1413 |
{% Yes. |
| 1414 |
\let\leftpanelwidth=\bgndleftpanelwidth@bidipres% Overwrite panel settings - use user-supplied value. |
| 1415 |
} |
| 1416 |
\ifthenelse{\equal{\bgndrightpanelwidth@bidipres}{}}% Has the right panel width been set? |
| 1417 |
{% No. Guess default. |
| 1418 |
\ifx\rightpanelcontents@bidipres\empty% Is the panel defined? |
| 1419 |
\mklength@bidipres{\bgndrightpanelwidth@bidipres}{\bgndrightpanelwidth}% Use background-specific default. |
| 1420 |
\else |
| 1421 |
\ifthenelse{\boolean{autopanels@bidipres}}% Calculate panel dimensions? |
| 1422 |
{% Yes. |
| 1423 |
\calchdimen@bidipres{\bgndrightpanelwidth@bidipres}{\bgndrightpanelheight@bidipres}% Measure `optimal' width of panel contents. |
| 1424 |
{\rightpanelcontents@bidipres}% |
| 1425 |
\let\rightpanelheight=\bgndrightpanelheight@bidipres% Overwrite panel settings. |
| 1426 |
\let\rightpanelwidth=\bgndrightpanelwidth@bidipres% |
| 1427 |
\let\rightpanelraise=\bgndbottompanelheight@bidipres% Right panel is raised above bottom panel. |
| 1428 |
} |
| 1429 |
{% No |
| 1430 |
\mklength@bidipres{\bgndrightpanelwidth@bidipres}{\rightpanelwidth}% Use panel-specific default. |
| 1431 |
}% |
| 1432 |
\fi |
| 1433 |
}% matches \ifthenelse{\equal{\bgndrightpanelwidth@bidipres}{}} |
| 1434 |
{% Yes. |
| 1435 |
\let\rightpanelwidth=\bgndrightpanelwidth@bidipres% Overwrite panel settings - use user-supplied value. |
| 1436 |
} |
| 1437 |
}% matches \ifthenelse{\boolean{hpanels@bidipres}} |
| 1438 |
{% No. Vertical panels are `outer', horizontal panels are `inner'. |
| 1439 |
\let\bgndleftpanelheight@bidipres=\bidiprespageheight% Full height for vertical panels. |
| 1440 |
\let\bgndrightpanelheight@bidipres=\bidiprespageheight% |
| 1441 |
\ifthenelse{\equal{\bgndleftpanelwidth@bidipres}{}}% Has the left panel width been set? |
| 1442 |
{% No. Guess default. |
| 1443 |
\ifx\leftpanelcontents@bidipres\empty% Is the panel defined? |
| 1444 |
\mklength@bidipres{\bgndleftpanelwidth@bidipres}{\bgndleftpanelwidth}% Use background-specific default. |
| 1445 |
\else |
| 1446 |
\ifthenelse{\boolean{autopanels@bidipres}}% Calculate panel dimensions? |
| 1447 |
{% Yes. |
| 1448 |
\calchdimen@bidipres{\bgndleftpanelwidth@bidipres}{\bgndleftpanelheight@bidipres}% Measure the `optimal' width of panel contents. |
| 1449 |
{\leftpanelcontents@bidipres}% |
| 1450 |
\let\leftpanelheight=\bgndleftpanelheight@bidipres% Overwrite panel settings. |
| 1451 |
\let\leftpanelwidth=\bgndleftpanelwidth@bidipres% |
| 1452 |
\def\leftpanelraise{0pt}% Left panel spans the whole left part of the screen. |
| 1453 |
} |
| 1454 |
{% No |
| 1455 |
\mklength@bidipres{\bgndleftpanelwidth@bidipres}{\leftpanelwidth}% Use panel-specific default. |
| 1456 |
}% |
| 1457 |
\fi |
| 1458 |
}% matches \ifthenelse{\equal{\bgndleftpanelwidth@bidipres}{}} |
| 1459 |
{% Yes. |
| 1460 |
\let\leftpanelwidth=\bgndleftpanelwidth@bidipres% Overwrite panel settings - use user-supplied value. |
| 1461 |
} |
| 1462 |
\ifthenelse{\equal{\bgndrightpanelwidth@bidipres}{}}% Has the right panel width been set? |
| 1463 |
{% No. Guess default. |
| 1464 |
\ifx\rightpanelcontents@bidipres\empty% Is the panel defined? |
| 1465 |
\mklength@bidipres{\bgndrightpanelwidth@bidipres}{\bgndrightpanelwidth}% Use background-specific default. |
| 1466 |
\else |
| 1467 |
\ifthenelse{\boolean{autopanels@bidipres}}% Calculate panel dimensions? |
| 1468 |
{% Yes. |
| 1469 |
\calchdimen@bidipres{\bgndrightpanelwidth@bidipres}{\bgndrightpanelheight@bidipres}% Measure `optimal' width of panel contents. |
| 1470 |
{\rightpanelcontents@bidipres}% |
| 1471 |
\let\rightpanelheight=\bgndrightpanelheight@bidipres% Overwrite panel settings. |
| 1472 |
\let\rightpanelwidth=\bgndrightpanelwidth@bidipres% |
| 1473 |
\def\rightpanelraise{0pt}% Right panel spans the whole left part of the screen. |
| 1474 |
} |
| 1475 |
{% No |
| 1476 |
\mklength@bidipres{\bgndrightpanelwidth@bidipres}{\rightpanelwidth}% Use panel-specific default. |
| 1477 |
}% |
| 1478 |
\fi |
| 1479 |
}% matches \ifthenelse{\equal{\bgndrightpanelwidth@bidipres}{}} |
| 1480 |
{% Yes. |
| 1481 |
\let\rightpanelwidth=\bgndrightpanelwidth@bidipres% Overwrite panel settings - use user-supplied value. |
| 1482 |
} |
| 1483 |
\mklength@bidipres{\bgndtoppanelwidth@bidipres}% Calculate remaining space in the center. |
| 1484 |
{\bidiprespagewidth-\bgndleftpanelwidth@bidipres-\bgndrightpanelwidth@bidipres}% |
| 1485 |
\let\bgndbottompanelwidth@bidipres=\bgndtoppanelwidth@bidipres% Width of top and bottom panels is equal. |
| 1486 |
\ifthenelse{\equal{\bgndtoppanelheight@bidipres}{}}% Has the top panel height been set? |
| 1487 |
{% No. Guess default. |
| 1488 |
\ifx\toppanelcontents@bidipres\empty% Is the panel defined? |
| 1489 |
\mklength@bidipres{\bgndtoppanelheight@bidipres}{\bgndtoppanelheight}% Use background-specific default. |
| 1490 |
\else |
| 1491 |
\ifthenelse{\boolean{autopanels@bidipres}}% Calculate panel dimensions? |
| 1492 |
{% Yes. |
| 1493 |
\calcvdimen@bidipres{\bgndtoppanelheight@bidipres}{\bgndtoppanelwidth@bidipres}% Measure the height of panel contents. |
| 1494 |
{\toppanelcontents@bidipres}% |
| 1495 |
\let\toppanelheight=\bgndtoppanelheight@bidipres% Overwrite panel settings. |
| 1496 |
\let\toppanelwidth=\bgndtoppanelwidth@bidipres% |
| 1497 |
\let\toppanelshift=\bgndleftpanelwidth@bidipres% Shift top panel to the right of left panel. |
| 1498 |
} |
| 1499 |
{% No |
| 1500 |
\mklength@bidipres{\bgndtoppanelheight@bidipres}{\toppanelheight}% Use panel-specific default. |
| 1501 |
}% |
| 1502 |
\fi |
| 1503 |
}% matches \ifthenelse{\equal{\bgndtoppanelheight@bidipres}{}} |
| 1504 |
{% Yes. |
| 1505 |
\let\toppanelheight=\bgndtoppanelheight@bidipres% Overwrite panel settings - use user-supplied value. |
| 1506 |
} |
| 1507 |
\ifthenelse{\equal{\bgndbottompanelheight@bidipres}{}}% Has the bottom panel height been set? |
| 1508 |
{% No. Guess default. |
| 1509 |
\ifx\bottompanelcontents@bidipres\empty% Is the panel defined? |
| 1510 |
\mklength@bidipres{\bgndbottompanelheight@bidipres}{\bgndbottompanelheight}% Use background-specific default. |
| 1511 |
\else |
| 1512 |
\ifthenelse{\boolean{autopanels@bidipres}}% Calculate panel dimensions? |
| 1513 |
{% Yes. |
| 1514 |
\calcvdimen@bidipres{\bgndbottompanelheight@bidipres}{\bgndbottompanelwidth@bidipres}% Measure the height of panel contents. |
| 1515 |
{\bottompanelcontents@bidipres}% |
| 1516 |
\let\bottompanelheight=\bgndbottompanelheight@bidipres% Overwrite panel settings. |
| 1517 |
\let\bottompanelwidth=\bgndbottompanelwidth@bidipres% |
| 1518 |
\let\bottompanelshift=\bgndleftpanelwidth@bidipres% Shift bottom panel to the right of left panel. |
| 1519 |
} |
| 1520 |
{% No |
| 1521 |
\mklength@bidipres{\bgndbottompanelheight@bidipres}{\bottompanelheight}% Use panel-specific default. |
| 1522 |
}% |
| 1523 |
\fi |
| 1524 |
}% matches \ifthenelse{\equal{\bgndbottompanelheight@bidipres}{}} |
| 1525 |
{% Yes. |
| 1526 |
\let\bottompanelheight=\bgndbottompanelheight@bidipres% Overwrite panel settings - use user-supplied value. |
| 1527 |
} |
| 1528 |
}% matches second argument of \ifthenelse{\boolean{hpanels@bidipres}} |
| 1529 |
}% matches \newcommand{\initpanels@bidipres}[1]{ |
| 1530 |
\newcommand{\phantomrule@bidipres}[2]{\rule{0pt}{#2}\rule{#1}{0pt}} |
| 1531 |
\newcommand{\setnonebgnd@bidipres}[1]% Implementation of the background style ``none''. |
| 1532 |
{\global\setbox\bgndbox@bidipres=\null}% Just produce an empty box. |
| 1533 |
|
| 1534 |
\newcommand{\setplainbgnd@bidipres}[1]% Implementation of the background style ``plain''. |
| 1535 |
{% |
| 1536 |
\setkeys{bgnd@bidipres}{#1}% Evaluate parameters. |
| 1537 |
\initpanels@bidipres{true}% Initialize panel parameters. |
| 1538 |
\global\setbox\bgndbox@bidipres=\hbox{\mkpanels@bidipres{\phantomrule@bidipres}}% Make panels only. |
| 1539 |
}% |
| 1540 |
|
| 1541 |
\newcommand{\setvgradientbgnd@bidipres}[1]% Implementation of the background style ``vgradient''. |
| 1542 |
{% |
| 1543 |
\setkeys{bgnd@bidipres}{#1}% Evaluate parameters. |
| 1544 |
\initpanels@bidipres{false}% Initialize panel parameters. |
| 1545 |
\global\setbox\bgndbox@bidipres=\hbox{\mkpanels@bidipres{\@@vgradrule@bidipres}}% Make background box. |
| 1546 |
} |
| 1547 |
|
| 1548 |
\newcommand{\sethgradientbgnd@bidipres}[1]% Implementation of the background style ``hgradient''. |
| 1549 |
{% |
| 1550 |
\setkeys{bgnd@bidipres}{#1}% Evaluate parameters. |
| 1551 |
\initpanels@bidipres{true}% Initialize panel parameters. |
| 1552 |
\global\setbox\bgndbox@bidipres=\hbox{\mkpanels@bidipres{\@@hgradrule@bidipres}}% Make background box. |
| 1553 |
} |
| 1554 |
|
| 1555 |
\newcommand{\setdoublevgradientbgnd@bidipres}[1]% Implementation of the background style ``doublevgradient''. |
| 1556 |
{% |
| 1557 |
\setkeys{bgnd@bidipres}{#1}% Evaluate parameters. |
| 1558 |
\initpanels@bidipres{false}% Initialize panel parameters. |
| 1559 |
\global\setbox\bgndbox@bidipres=\hbox{\mkpanels@bidipres{\@@@@dblvgradrule@bidipres}}% Make background box. |
| 1560 |
} |
| 1561 |
|
| 1562 |
\newcommand{\setdoublehgradientbgnd@bidipres}[1]% Implementation of the background style ``doublehgradient''. |
| 1563 |
{% |
| 1564 |
\setkeys{bgnd@bidipres}{#1}% Evaluate parameters. |
| 1565 |
\initpanels@bidipres{true}% Initialize panel parameters. |
| 1566 |
\global\setbox\bgndbox@bidipres=\hbox{\mkpanels@bidipres{\@@@@dblhgradrule@bidipres}}% Make background box. |
| 1567 |
} |
| 1568 |
\providecommand{\hpagecolor}[2][] |
| 1569 |
{% |
| 1570 |
\ifthenelse{\equal{#1}{}} |
| 1571 |
{\colorbetween{ppendcolor}{#2}{white}\backgroundstyle[startcolor=#2,endcolor=ppendcolor]{hgradient}} |
| 1572 |
{\backgroundstyle[startcolor=#1,endcolor=#2]{hgradient}}% |
| 1573 |
} |
| 1574 |
\providecommand{\vpagecolor}[2][] |
| 1575 |
{% |
| 1576 |
\ifthenelse{\equal{#1}{}} |
| 1577 |
{\colorbetween{ppendcolor}{#2}{white}\backgroundstyle[startcolor=#2,endcolor=ppendcolor]{vgradient}} |
| 1578 |
{\backgroundstyle[startcolor=#1,endcolor=#2]{vgradient}}% |
| 1579 |
} |
| 1580 |
\mklength@bidipres{\panelmargin}{\fboxsep} |
| 1581 |
\newcommand{\toppanelwidth}{\bidiprespagewidth}% Width. |
| 1582 |
\newcommand{\toppanelheight}{\bidiprespageheight/5}% Height. |
| 1583 |
\newcommand{\toppanelshift}{0pt}% Space between left screen edge and left edge of top panel. |
| 1584 |
\newcommand{\bottompanelwidth}{\bidiprespagewidth}% Width. |
| 1585 |
\newcommand{\bottompanelheight}{\bidiprespageheight/5}% Height. |
| 1586 |
\newcommand{\bottompanelshift}{0pt}% Space between left screen edge and left edge of bottom panel. |
| 1587 |
\newcommand{\leftpanelwidth}{\bidiprespagewidth/5}% Width. |
| 1588 |
\newcommand{\leftpanelheight}{\bidiprespageheight}% Height. |
| 1589 |
\newcommand{\leftpanelraise}{0pt}% Space between bottom screen edge and bottom edge of left panel. |
| 1590 |
\newcommand{\rightpanelwidth}{\bidiprespagewidth/5}% Width. |
| 1591 |
\newcommand{\rightpanelheight}{\bidiprespageheight}% Height. |
| 1592 |
\newcommand{\rightpanelraise}{0pt}% Space between bottom screen edge and bottom edge of left panel. |
| 1593 |
\newcommand*{\toppanelcontents@bidipres}{} |
| 1594 |
\newcommand*{\bottompanelcontents@bidipres}{} |
| 1595 |
\newcommand*{\leftpanelcontents@bidipres}{} |
| 1596 |
\newcommand*{\rightpanelcontents@bidipres}{} |
| 1597 |
\newcommand{\DeclarePanel}{\@ifstar\auto@declarepanel@bidipres\declarepanel@bidipres} |
| 1598 |
|
| 1599 |
\newcommand{\declarepanel@bidipres}[3][]% Non-starred version of \DeclarePanel. |
| 1600 |
{% |
| 1601 |
\expandafter\gdef\csname #2panelcontents@bidipres\endcsname{#3}% Just store panel contents. |
| 1602 |
\ifthenelse{\equal{#1}{}}{}{\csname store#2panel@bidipres\endcsname{#1}}% If <name> was given, store panel parameters away. |
| 1603 |
}% |
| 1604 |
|
| 1605 |
\newcommand{\storetoppanel@bidipres}[1] |
| 1606 |
{% |
| 1607 |
\expandafter\global\expandafter\let\csname toppanelcontents@bidipres@#1\endcsname\toppanelcontents@bidipres% Contents. |
| 1608 |
\expandafter\global\expandafter\let\csname toppanelwidth@bidipres@#1\endcsname\toppanelwidth@bidipres% Width. |
| 1609 |
\expandafter\global\expandafter\let\csname toppanelheight@bidipres@#1\endcsname\toppanelheight@bidipres% Height. |
| 1610 |
\expandafter\global\expandafter\let\csname toppanelshift@bidipres@#1\endcsname\toppanelshift@bidipres% Raise. |
| 1611 |
} |
| 1612 |
|
| 1613 |
\newcommand{\storebottompanel@bidipres}[1] |
| 1614 |
{% |
| 1615 |
\expandafter\global\expandafter\let\csname bottompanelcontents@bidipres@#1\endcsname\bottompanelcontents@bidipres% |
| 1616 |
\expandafter\global\expandafter\let\csname bottompanelwidth@bidipres@#1\endcsname\bottompanelwidth@bidipres% |
| 1617 |
\expandafter\global\expandafter\let\csname bottompanelheight@bidipres@#1\endcsname\bottompanelheight@bidipres% |
| 1618 |
\expandafter\global\expandafter\let\csname bottompanelshift@bidipres@#1\endcsname\bottompanelshift@bidipres% |
| 1619 |
} |
| 1620 |
|
| 1621 |
\newcommand{\storeleftpanel@bidipres}[1] |
| 1622 |
{% |
| 1623 |
\expandafter\global\expandafter\let\csname leftpanelcontents@bidipres@#1\endcsname\leftpanelcontents@bidipres% |
| 1624 |
\expandafter\global\expandafter\let\csname leftpanelwidth@bidipres@#1\endcsname\leftpanelwidth@bidipres% |
| 1625 |
\expandafter\global\expandafter\let\csname leftpanelheight@bidipres@#1\endcsname\leftpanelheight@bidipres% |
| 1626 |
\expandafter\global\expandafter\let\csname leftpanelraise@bidipres@#1\endcsname\leftpanelraise@bidipres% |
| 1627 |
} |
| 1628 |
|
| 1629 |
\newcommand{\storerightpanel@bidipres}[1] |
| 1630 |
{% |
| 1631 |
\expandafter\global\expandafter\let\csname rightpanelcontents@bidipres@#1\endcsname\rightpanelcontents@bidipres% |
| 1632 |
\expandafter\global\expandafter\let\csname rightpanelwidth@bidipres@#1\endcsname\rightpanelwidth@bidipres% |
| 1633 |
\expandafter\global\expandafter\let\csname rightpanelheight@bidipres@#1\endcsname\rightpanelheight@bidipres% |
| 1634 |
\expandafter\global\expandafter\let\csname rightpanelraise@bidipres@#1\endcsname\rightpanelraise@bidipres% |
| 1635 |
} |
| 1636 |
|
| 1637 |
\newcommand{\auto@declarepanel@bidipres}[2]% Starred version of \DeclarePanel. |
| 1638 |
{\csname calc#1dimen@bidipres\endcsname{#2}\declarepanel@bidipres{#1}{#2}} % Calculate `optimal' dimension and store contents. |
| 1639 |
|
| 1640 |
\newcommand{\restorepanels}[1] |
| 1641 |
{% |
| 1642 |
\@ifundefined{toppanelcontents@bidipres@#1}{\global\let\toppanelcontents@bidipres\empty} |
| 1643 |
{% |
| 1644 |
\expandafter\global\expandafter\let\expandafter\toppanelcontents@bidipres\csname toppanelcontents@bidipres@#1\endcsname |
| 1645 |
\expandafter\global\expandafter\let\expandafter\toppanelwidth@bidipres\csname toppanelwidth@bidipres@#1\endcsname |
| 1646 |
\expandafter\global\expandafter\let\expandafter\toppanelheight@bidipres\csname toppanelheight@bidipres@#1\endcsname |
| 1647 |
\expandafter\global\expandafter\let\expandafter\toppanelshift@bidipres\csname toppanelshift@bidipres@#1\endcsname |
| 1648 |
}% |
| 1649 |
\@ifundefined{bottompanelcontents@bidipres@#1}{\global\let\bottompanelcontents@bidipres\empty} |
| 1650 |
{% |
| 1651 |
\expandafter\global\expandafter\let\expandafter\bottompanelcontents@bidipres\csname bottompanelcontents@bidipres@#1\endcsname |
| 1652 |
\expandafter\global\expandafter\let\expandafter\bottompanelwidth@bidipres\csname bottompanelwidth@bidipres@#1\endcsname |
| 1653 |
\expandafter\global\expandafter\let\expandafter\bottompanelheight@bidipres\csname bottompanelheight@bidipres@#1\endcsname |
| 1654 |
\expandafter\global\expandafter\let\expandafter\bottompanelshift@bidipres\csname bottompanelshift@bidipres@#1\endcsname |
| 1655 |
}% |
| 1656 |
\@ifundefined{leftpanelcontents@bidipres@#1}{\global\let\leftpanelcontents@bidipres\empty} |
| 1657 |
{% |
| 1658 |
\expandafter\global\expandafter\let\expandafter\leftpanelcontents@bidipres\csname leftpanelcontents@bidipres@#1\endcsname |
| 1659 |
\expandafter\global\expandafter\let\expandafter\leftpanelwidth@bidipres\csname leftpanelwidth@bidipres@#1\endcsname |
| 1660 |
\expandafter\global\expandafter\let\expandafter\leftpanelheight@bidipres\csname leftpanelheight@bidipres@#1\endcsname |
| 1661 |
\expandafter\global\expandafter\let\expandafter\leftpanelraise@bidipres\csname leftpanelraise@bidipres@#1\endcsname |
| 1662 |
}% |
| 1663 |
\@ifundefined{rightpanelcontents@bidipres@#1}{\global\let\rightpanelcontents@bidipres\empty} |
| 1664 |
{% |
| 1665 |
\expandafter\global\expandafter\let\expandafter\rightpanelcontents@bidipres\csname rightpanelcontents@bidipres@#1\endcsname |
| 1666 |
\expandafter\global\expandafter\let\expandafter\rightpanelwidth@bidipres\csname rightpanelwidth@bidipres@#1\endcsname |
| 1667 |
\expandafter\global\expandafter\let\expandafter\rightpanelheight@bidipres\csname rightpanelheight@bidipres@#1\endcsname |
| 1668 |
\expandafter\global\expandafter\let\expandafter\rightpanelraise@bidipres\csname rightpanelraise@bidipres@#1\endcsname |
| 1669 |
}% |
| 1670 |
} |
| 1671 |
\newcommand{\calctopdimen@bidipres}[1]{\calcvdimen@bidipres{\toppanelheight}{\toppanelwidth}{#1}} |
| 1672 |
\newcommand{\calcbottomdimen@bidipres}[1]{\calcvdimen@bidipres{\bottompanelheight}{\bottompanelwidth}{#1}} |
| 1673 |
\newcommand{\calcleftdimen@bidipres}[1]{\calchdimen@bidipres{\leftpanelwidth}{\leftpanelheight}{#1}}% |
| 1674 |
\newcommand{\calcrightdimen@bidipres}[1]{\calchdimen@bidipres{\rightpanelwidth}{\rightpanelheight}{#1}}% |
| 1675 |
\newcommand{\panel@sanitize@bidipres} |
| 1676 |
{% |
| 1677 |
\let\hyperlink=\@secondoftwo |
| 1678 |
\let\Acrobatmenu=\@secondoftwo |
| 1679 |
} |
| 1680 |
\newcommand{\calcvdimen@bidipres}[3] |
| 1681 |
{% |
| 1682 |
\setbox\tempbox@bidipres=\hbox{\panel@sanitize@bidipres\@@mk@panel@bidipres{#2}{}{toppaneltextcolor}{#3}}% Set panel into a dummy box. |
| 1683 |
\mklength@bidipres{#1}{\ht\tempbox@bidipres+\dp\tempbox@bidipres}% % Measure total height. |
| 1684 |
} |
| 1685 |
\newcommand{\calchdimen@bidipres}[3] |
| 1686 |
{% |
| 1687 |
\optwidth@bidipres{#1}{#2-\panelmargin*2}% Calculate `optimal' width of a parbox. Panel margins are respected. |
| 1688 |
{.5\textwidth-\panelmargin*2}{\panelalignment#3}% .5\textwidth is the hardcoded absolute maximum width. |
| 1689 |
\mklength@bidipres{#1}{#1+\panelmargin*2}% |
| 1690 |
} |
| 1691 |
\newcommand{\optwidthsteps}{100} |
| 1692 |
\newcommand{\optwidthlinetolerance}{200} |
| 1693 |
\let\maxbadness@bidipres=\@tempcnta |
| 1694 |
\def\optwidthdisablecommands@bidipres |
| 1695 |
{% |
| 1696 |
\let\Hy@colorlink\@firstofone |
| 1697 |
\let\Hy@endcolorlink\relax |
| 1698 |
} |
| 1699 |
\newcommand{\optwidth@bidipres}[4] |
| 1700 |
{% |
| 1701 |
\setcounter{tmpcnta@bidipres}{0}% Initialize `probe counter' for box width. |
| 1702 |
\let\best@cnt@bidipres=\empty% Initialize number of best `probe' so far. |
| 1703 |
\def\bestbadness@bidipres{1000000}% Initialize badness of best `probe'. |
| 1704 |
\setboolean{carryon@bidipres}{true}% Flag for breaking out of loop. |
| 1705 |
\setlength{\tempdimb@bidipres}{#2}% Store maximal box height. |
| 1706 |
\whiledo |
| 1707 |
{\value{tmpcnta@bidipres}<\optwidthsteps\and\boolean{carryon@bidipres}}% Probes done or break of loop? |
| 1708 |
{% |
| 1709 |
\stepcounter{tmpcnta@bidipres}% Start next probe. |
| 1710 |
\setbox\@tempboxa=\hbox% The trick with vbox/lastbox is to get the vbox |
| 1711 |
{% produced by \parbox `immediately' into a box register. |
| 1712 |
\optwidthdisablecommands@bidipres% Turn off some nasties not needed when measuring. |
| 1713 |
\parbox[b]{(#3)/\optwidthsteps*\value{tmpcnta@bidipres}}% Make the next parbox. |
| 1714 |
{\hfuzz\maxdimen\hbadness\@M\relax#4}% |
| 1715 |
\global\setbox\tempbox@bidipres=\lastbox% ... and assign \tempbox@bidipres to it. |
| 1716 |
}% |
| 1717 |
\setlength{\tempdima@bidipres}{\ht\tempbox@bidipres+\dp\tempbox@bidipres}% Measure total height. |
| 1718 |
\ifthenelse{\lengthtest{\tempdima@bidipres>\tempdimb@bidipres}}% If it exceeds the maximum height given, the box isn't |
| 1719 |
{}% acceptable anyway. |
| 1720 |
{% |
| 1721 |
\calcmaxbadness@bidipres{\maxbadness@bidipres}{\tempbox@bidipres}% Calculate `worst badness' of any hbox appearing in parbox. |
| 1722 |
\ifthenelse{\not\maxbadness@bidipres>\optwidthlinetolerance}% Below Threshold? |
| 1723 |
{% Yes. Accept this width. |
| 1724 |
\edef\best@cnt@bidipres{\thetmpcnta@bidipres}% Store this probe number. |
| 1725 |
\setboolean{carryon@bidipres}{false}% Break loop. |
| 1726 |
} |
| 1727 |
{% No. Carry on. |
| 1728 |
\ifthenelse{\maxbadness@bidipres<\bestbadness@bidipres}% Below lowest badness found so far? |
| 1729 |
{% Yes. Store probe number. |
| 1730 |
\edef\bestbadness@bidipres{\number\maxbadness@bidipres}% Store badness value. |
| 1731 |
\edef\best@cnt@bidipres{\thetmpcnta@bidipres}% Store probe number. |
| 1732 |
} |
| 1733 |
{}% No. Try next probe. |
| 1734 |
}% matches second argument of \ifthenelse{\not\maxbadness@bidipres>\optwidthlinetolerance}% |
| 1735 |
}% matches second argument of \ifthenelse{\lengthtest{\tempdima@bidipres>\tempdimb@bidipres}}% |
| 1736 |
}% matches \whiledo{\value{tmpcnta@bidipres}<\optwidthsteps\and\boolean{carryon@bidipres}}{% |
| 1737 |
\ifx\best@cnt@bidipres\empty% Was _any_ badness below the initialization value found? |
| 1738 |
\mklength@bidipres{#1}{#3}% No; return max width. |
| 1739 |
\else |
| 1740 |
\mklength@bidipres{#1}{(#3)/\optwidthsteps*\best@cnt@bidipres}% Yes; return width of best probe. |
| 1741 |
\fi |
| 1742 |
}% matches \newcommand{\optwidth@bidipres}[4]{% |
| 1743 |
\newcommand{\calcmaxbadness@bidipres}[2] |
| 1744 |
{% |
| 1745 |
\let\@resultcnt@bidipres=#1% Here we store the result. |
| 1746 |
\global\@resultcnt@bidipres=\z@\relax% Just in case no hbox occurs... |
| 1747 |
\setlength{\@tempdima}{\wd#2}% This is the width to which every hbox is stretched for finding its badness. |
| 1748 |
\setbox\@tempboxa=\vbox% A dummy vbox for recursively analysing the vbox contents using \lastbox |
| 1749 |
{% |
| 1750 |
\hfuzz\maxdimen\hbadness\@M |
| 1751 |
\unvbox#2% `free' the contents of the vbox. |
| 1752 |
\measureboxes@bidipres% Analyse `tail to head' using \lastbox. |
| 1753 |
}% |
| 1754 |
} |
| 1755 |
\newcommand{\measureboxes@bidipres}% |
| 1756 |
{% |
| 1757 |
\unskip\unpenalty\unkern% This is a kluge for TeX, because there is no certain way of finding out whether there's a |
| 1758 |
\unskip\unpenalty\unkern% penalty, glue or kern on the vertical list. \lastpenalty will give its value, but a |
| 1759 |
\unskip\unpenalty\unkern% value of 0 might mean there was none or there was one of value 0. |
| 1760 |
\unskip\unpenalty\unkern% This is different in eTeX. I might make a switch to a smarter solution. |
| 1761 |
\unskip\unpenalty\unkern |
| 1762 |
\unskip\unpenalty\unkern |
| 1763 |
\unskip\unpenalty\unkern |
| 1764 |
\unskip\unpenalty\unkern |
| 1765 |
\unskip\unpenalty\unkern |
| 1766 |
\unskip\unpenalty\unkern |
| 1767 |
\setbox\@tempboxa=\lastbox% Grab last box. |
| 1768 |
\ifhbox\@tempboxa% Was this an hbox? |
| 1769 |
\setbox0=\hb@xt@\@tempdima{\unhbox\@tempboxa}% Yes. Reformat with given width. |
| 1770 |
\ifnum\badness>\@resultcnt@bidipres% Badness larger than largest recorded badness? |
| 1771 |
\global\@resultcnt@bidipres=\badness% Yes. Memorize. |
| 1772 |
\fi |
| 1773 |
\expandafter\measureboxes@bidipres% Recursive call. |
| 1774 |
\else |
| 1775 |
\ifvbox\@tempboxa% Was this a vbox? |
| 1776 |
\expandafter\expandafter\expandafter\measureboxes@bidipres% Ignore, but execute recursive call. |
| 1777 |
\fi |
| 1778 |
\fi |
| 1779 |
} |
| 1780 |
\newcommand{\mk@toppanel@bidipres}% top panel |
| 1781 |
{% |
| 1782 |
\ifx\toppanelcontents@bidipres\empty% top panel specified? |
| 1783 |
\else% Yes; create box with appropriate dimensions, background color and contents. |
| 1784 |
\@mk@panel@bidipres{\toppanelwidth}{\toppanelheight}{toppaneltextcolor}{\toppanelcontents@bidipres}% |
| 1785 |
\fi |
| 1786 |
} |
| 1787 |
|
| 1788 |
\newcommand{\mk@bottompanel@bidipres}% bottom panel |
| 1789 |
{% |
| 1790 |
\ifx\bottompanelcontents@bidipres\empty% bottom panel specified? |
| 1791 |
\else% Yes; create box with appropriate dimensions, background color and contents. |
| 1792 |
\@mk@panel@bidipres{\bottompanelwidth}{\bottompanelheight}{bottompaneltextcolor}{\bottompanelcontents@bidipres}% |
| 1793 |
\fi |
| 1794 |
} |
| 1795 |
|
| 1796 |
\newcommand{\mk@leftpanel@bidipres}% left panel |
| 1797 |
{% |
| 1798 |
\ifx\leftpanelcontents@bidipres\empty% left panel specified? |
| 1799 |
\else% Yes; create box with appropriate dimensions, background color and contents. |
| 1800 |
\@mk@panel@bidipres{\leftpanelwidth}{\leftpanelheight}{leftpaneltextcolor}{\leftpanelcontents@bidipres}% |
| 1801 |
\fi |
| 1802 |
} |
| 1803 |
|
| 1804 |
\newcommand{\mk@rightpanel@bidipres}% right panel |
| 1805 |
{% |
| 1806 |
\ifx\rightpanelcontents@bidipres\empty% right panel specified? |
| 1807 |
\else% Yes; create box with appropriate dimensions, text color and contents. |
| 1808 |
\@mk@panel@bidipres{\rightpanelwidth}{\rightpanelheight}{rightpaneltextcolor}{\rightpanelcontents@bidipres}% |
| 1809 |
\fi |
| 1810 |
} |
| 1811 |
|
| 1812 |
\newcommand{\@mk@panel@bidipres}[2]% Generate `standard' parbox parameters for panels. |
| 1813 |
{% |
| 1814 |
\@@mk@panel@bidipres{#1}{[#2-\panelmargin*2][s]}% |
| 1815 |
} |
| 1816 |
|
| 1817 |
\@ifclassloaded{powersem} |
| 1818 |
{% |
| 1819 |
\newcommand{\panelalignment}{\sem@ptsize{\slide@ptsize}\large\normalsize}% |
| 1820 |
} |
| 1821 |
{% |
| 1822 |
\newcommand{\panelalignment}% Justification for panels. This setting allows a certain amount of |
| 1823 |
{\setlength{\rightskip}{0pt plus 20pt}}% `right-raggedness'. Leave empty for standard parbox formatting. |
| 1824 |
} |
| 1825 |
|
| 1826 |
\newcommand{\@@mk@panel@bidipres}[4] |
| 1827 |
{% |
| 1828 |
\vbox |
| 1829 |
{% |
| 1830 |
\offinterlineskip |
| 1831 |
\kern\panelmargin% Top margin. |
| 1832 |
\hbox |
| 1833 |
{{% |
| 1834 |
\ifthenelse{\boolean{instepwise@bidipres}}% Inside \stepwise, colors mat have been dimmed, leaking out to panels. |
| 1835 |
{\usecolorset{stwcolors}}{}% Restore them, just in case. |
| 1836 |
\xecolor{#3}% Set panel text color. |
| 1837 |
\kern\panelmargin% Left margin. |
| 1838 |
\parbox[b]#2{#1-\panelmargin*2}% The parbox with the main panel contents. |
| 1839 |
{% |
| 1840 |
\normalfont |
| 1841 |
\panelalignment#4% |
| 1842 |
\hrule\@height\z@% The hrule makes sure the total height of this box can be measured appropriately. |
| 1843 |
}% |
| 1844 |
\kern\panelmargin% Right margin. |
| 1845 |
}}% |
| 1846 |
\kern\panelmargin% Bottom margin. |
| 1847 |
}% |
| 1848 |
} |
| 1849 |
\newcommand{\buttonsep}{\fboxsep} |
| 1850 |
\newcommand{\buttonrule}{0pt} |
| 1851 |
\newcommand{\buttonshadowhshift}{.3\fboxsep} |
| 1852 |
\newcommand{\buttonshadowvshift}{-.3\fboxsep} |
| 1853 |
\newcommand{\button}[1][0pt]% Collect first optional parameter. |
| 1854 |
{% |
| 1855 |
\mklength@bidipres\bt@width@bidipres{#1}% Store optional argument. |
| 1856 |
\button@bidipres |
| 1857 |
} |
| 1858 |
|
| 1859 |
\newcommand{\button@bidipres}[1][0pt]% Collect second optional parameter. |
| 1860 |
{% |
| 1861 |
\mklength@bidipres\bt@height@bidipres{#1}% Store optional argument. |
| 1862 |
\@button@bidipres |
| 1863 |
} |
| 1864 |
|
| 1865 |
\newcommand{\@button@bidipres}[1][0pt]% Collect third optional parameter. |
| 1866 |
{% |
| 1867 |
\mklength@bidipres\bt@depth@bidipres{#1}% Store optional argument. |
| 1868 |
\@@button@bidipres |
| 1869 |
} |
| 1870 |
|
| 1871 |
\newcommand{\@@button@bidipres}[3][c]% Collect fourth optional and two mandatory parameters and proceed. |
| 1872 |
{% |
| 1873 |
\ifthenelse{\lengthtest{\bt@width@bidipres=0pt}}% <width> given? |
| 1874 |
{\mklength@bidipres{\bt@width@bidipres}{\widthof{#3}}}% No. Calculate width of <text>. |
| 1875 |
{\mklength@bidipres{\bt@width@bidipres}{\bt@width@bidipres-\buttonsep*2-\buttonrule*2}}% Yes. Calculate area left for <text>. |
| 1876 |
\ifthenelse{\lengthtest{\bt@height@bidipres=0pt}}% <height> given? |
| 1877 |
{\mklength@bidipres{\bt@height@bidipres}{\heightof{#3}}}% No. Calculate height of <text>. |
| 1878 |
{\mklength@bidipres{\bt@height@bidipres}{\bt@height@bidipres-\buttonsep-\buttonrule}}% Yes. Calculate area left for <text>. |
| 1879 |
\ifthenelse{\lengthtest{\bt@depth@bidipres=0pt}}% <depth> given? |
| 1880 |
{\mklength@bidipres{\bt@depth@bidipres}{\depthof{#3}}}% No. Calculate depth of <text>. |
| 1881 |
{\mklength@bidipres{\bt@depth@bidipres}{\bt@depth@bidipres-\buttonsep-\buttonrule}}% Yes. Calculate area left for <text>. |
| 1882 |
\leavevmode% \rlap creates a `raw' hbox. So we get into horizontal mode. |
| 1883 |
\rlap% Make shadow. |
| 1884 |
{% |
| 1885 |
\hspace*{\buttonshadowhshift}% Horizontal displacement. |
| 1886 |
\raisebox{\buttonshadowvshift}% Vertical displacement. |
| 1887 |
{% |
| 1888 |
{% Inner group for correct color handling. |
| 1889 |
\setcolor@bidipres{buttonshadowcolor}% Button shadow color. |
| 1890 |
\rule% Create colored rectangular patch of appropriate dimensions. |
| 1891 |
[-\bt@depth@bidipres-\buttonsep-\buttonrule] |
| 1892 |
{\bt@width@bidipres+\buttonsep*2+\buttonrule*2} |
| 1893 |
{\bt@height@bidipres+\bt@depth@bidipres+\buttonsep*2+\buttonrule*2}% |
| 1894 |
}% matches inner group |
| 1895 |
}% matches \raisebox{\buttonshadowvshift}{% |
| 1896 |
}% matches \rlap{% |
| 1897 |
\edef\o@fboxrule@bidipres{\the\fboxrule}% Preserve original definitions of \fbox parameters. |
| 1898 |
\edef\o@fboxsep@bidipres{\the\fboxsep}% |
| 1899 |
#2% Execute <navcommand>. |
| 1900 |
{% |
| 1901 |
\setlength{\fboxrule}{\buttonrule}% Set \fbox parameters for button frame. |
| 1902 |
\setlength{\fboxsep}{\buttonsep}% |
| 1903 |
\fcolorbox{buttonframecolor}{buttoncolor}% Create button frame with the right colors. |
| 1904 |
{% |
| 1905 |
\makebox[\bt@width@bidipres][#1]% Create box of correct width to contain <text>. |
| 1906 |
{% |
| 1907 |
\raisebox{0pt}[\bt@height@bidipres][\bt@depth@bidipres]% Create box of correct height and depth. |
| 1908 |
{% |
| 1909 |
\setlength{\fboxrule}{\o@fboxrule@bidipres}\setlength{\fboxsep}{\o@fboxsep@bidipres}% Restore fbox parameters. |
| 1910 |
\setcolor@bidipres{buttontextcolor}#3% Produce <text>. |
| 1911 |
}% matches \raisebox{0pt}[\bt@height@bidipres][\bt@depth@bidipres]{% |
| 1912 |
}% matches \makebox[\bt@width@bidipres][#1]{% |
| 1913 |
}% matches \fcolorbox{buttonframecolor}{buttoncolor}{% |
| 1914 |
}% matches argument of <navcommand>. |
| 1915 |
}% matches \newcommand{\@@button@bidipres}[3][c]{% |
| 1916 |
\newcommand{\buttonsymbolsize}{\footnotesize} |
| 1917 |
\@ifpackageloaded{amssymb}% AMS symbols available? |
| 1918 |
{% Yes. Use `black' symbols. |
| 1919 |
\newcommand{\buttonleftarrowsymbol}{{\buttonsymbolsize\boldmath\origmath{\blacktriangleleft}}}% `left' arrow. |
| 1920 |
\newcommand{\buttonrightarrowsymbol}{{\buttonsymbolsize\boldmath\origmath{\blacktriangleright}}}% `right' arrow. |
| 1921 |
\newcommand{\buttonbackarrowsymbol}{{\buttonsymbolsize\boldmath\origmath{\vartriangleleft}}}% `back' arrow. |
| 1922 |
} |
| 1923 |
{% No. Use replacements from standard set. |
| 1924 |
\newcommand{\buttonleftarrowsymbol}{{\buttonsymbolsize\boldmath\origmath{\lhd}}}% `left' arrow. |
| 1925 |
\newcommand{\buttonrightarrowsymbol}{{\buttonsymbolsize\boldmath\origmath{\rhd}}}% `right' arrow. |
| 1926 |
\newcommand{\buttonbackarrowsymbol}{{\buttonsymbolsize\boldmath\origmath{\leftarrow}}}% `back' arrow. |
| 1927 |
} |
| 1928 |
\newcommand{\stdbuttonwidth}{\widthof{\buttonrightarrowsymbol\buttonrightarrowsymbol\buttonrightarrowsymbol}+4pt} |
| 1929 |
\newcommand{\currentpagevalue}{\value{page}} |
| 1930 |
\newcommand{\backpagebutton}[1][\stdbuttonwidth] |
| 1931 |
{% |
| 1932 |
\button[#1]{\setcounter{tmpcnta@bidipres}{\currentpagevalue-1}\hyperlink{page.\thetmpcnta@bidipres}} |
| 1933 |
{\buttonleftarrowsymbol\buttonleftarrowsymbol}% |
| 1934 |
} |
| 1935 |
\newcommand{\backstepbutton}[1][\stdbuttonwidth] |
| 1936 |
{% |
| 1937 |
\button[#1]{\Acrobatmenu{PrevPage}} |
| 1938 |
{\buttonleftarrowsymbol}% |
| 1939 |
} |
| 1940 |
\newcommand{\gobackbutton}[1][\stdbuttonwidth] |
| 1941 |
{% |
| 1942 |
\button[#1]{\Acrobatmenu{GoBack}} |
| 1943 |
{\buttonbackarrowsymbol}% |
| 1944 |
} |
| 1945 |
\newcommand{\nextstepbutton}[1][\stdbuttonwidth] |
| 1946 |
{% |
| 1947 |
\button[#1]{\Acrobatmenu{NextPage}} |
| 1948 |
{\buttonrightarrowsymbol}% |
| 1949 |
} |
| 1950 |
\newcommand{\nextpagebutton}[1][\stdbuttonwidth] |
| 1951 |
{% |
| 1952 |
\button[#1]{\setcounter{tmpcnta@bidipres}{\currentpagevalue+1}\hyperlink{firstpage.\thetmpcnta@bidipres}} |
| 1953 |
{\buttonrightarrowsymbol\buttonrightarrowsymbol}% |
| 1954 |
} |
| 1955 |
\newcommand{\nextfullpagebutton}[1][\stdbuttonwidth] |
| 1956 |
{% |
| 1957 |
\button[#1]{\setcounter{tmpcnta@bidipres}{\currentpagevalue+1}\hyperlink{page.\thetmpcnta@bidipres}} |
| 1958 |
{\buttonrightarrowsymbol\buttonrightarrowsymbol\buttonrightarrowsymbol}% |
| 1959 |
} |
| 1960 |
\newcommand{\fullscreenbutton}[1][\stdbuttonwidth] |
| 1961 |
{% |
| 1962 |
\button[#1]{\Acrobatmenu{FullScreen}} |
| 1963 |
{\buttonrightarrowsymbol\buttonleftarrowsymbol}% |
| 1964 |
} |
| 1965 |
\ifthenelse{\boolean{display}}% Are dynamic features enabled? |
| 1966 |
{% Yes. |
| 1967 |
\newcommand{\pagetransition}[1]% Definition for preamble. |
| 1968 |
{% |
| 1969 |
\@ifpackageloaded{hyperref}% Can we use \hypersetup? |
| 1970 |
{% Yes. |
| 1971 |
\hypersetup{pdfpagetransition={#1}}% Set page transition with \hypersetup. |
| 1972 |
} |
| 1973 |
{% No. In this case, we can't set the page transition. |
| 1974 |
\ClassWarning{bidipresentation} |
| 1975 |
{Package hyperref not loaded.\MessageBreak Page transition not set}% |
| 1976 |
}% |
| 1977 |
}% matches \newcommand{\pagetransition}[1]{% |
| 1978 |
\AtBeginDocument% Definition for document body. |
| 1979 |
{% |
| 1980 |
\@ifpackageloaded{hyperref}% Can we use \hypersetup? |
| 1981 |
{% Yes. |
| 1982 |
\hypersetup{pdfpagetransition={}}% Make pagetransition setting (consistently) local to groups. |
| 1983 |
\renewcommand{\pagetransition}[1]{\hypersetup{pdfpagetransition={#1}}}% |
| 1984 |
} |
| 1985 |
{% No. Disable page transitions. |
| 1986 |
\ClassWarning{bidipresentation} |
| 1987 |
{Package hyperref not loaded.\MessageBreak Page transitions disabled}% |
| 1988 |
\let\pagetransition=\@gobble |
| 1989 |
}% |
| 1990 |
}% matches \AtBeginDocument{% |
| 1991 |
}% matches \ifthenelse{\boolean{display}}{% |
| 1992 |
{\let\pagetransition=\@gobble}% No. Disable page transitions. |
| 1993 |
\newcommand{\pageTransitionSplitHO}{\pagetransition{Split /Dm /H /M /O}}% Split Horizontally to the outside. |
| 1994 |
|
| 1995 |
\newcommand{\pageTransitionSplitHI}{\pagetransition{Split /Dm /H /M /I}}% Split Horizontally to the inside. |
| 1996 |
|
| 1997 |
\newcommand{\pageTransitionSplitVO}{\pagetransition{Split /Dm /V /M /O}}% Split Vertically to the outside. |
| 1998 |
|
| 1999 |
\newcommand{\pageTransitionSplitVI}{\pagetransition{Split /Dm /V /M /I}}% Split Vertically to the inside. |
| 2000 |
|
| 2001 |
\newcommand{\pageTransitionBlindsH}{\pagetransition{Blinds /Dm /H}}% Horizontal Blinds. |
| 2002 |
|
| 2003 |
\newcommand{\pageTransitionBlindsV}{\pagetransition{Blinds /Dm /V}}% Vertical Blinds. |
| 2004 |
|
| 2005 |
\newcommand{\pageTransitionBoxO}{\pagetransition{Box /M /O}}% Growing Box. |
| 2006 |
|
| 2007 |
\newcommand{\pageTransitionBoxI}{\pagetransition{Box /M /I}}% Shrinking Box. |
| 2008 |
|
| 2009 |
\newcommand{\pageTransitionWipe}[1]{\pagetransition{Wipe /Di #1}}% Wipe from one edge of the page to the facing edge. |
| 2010 |
|
| 2011 |
\newcommand{\pageTransitionDissolve}{\pagetransition{Dissolve}}% Dissolve. |
| 2012 |
|
| 2013 |
\newcommand{\pageTransitionGlitter}[1]{\pagetransition{Glitter /Di #1}}% Glitter from one edge to the facing edge. |
| 2014 |
|
| 2015 |
\newcommand{\pageTransitionReplace}{\pagetransition{Replace}}% Simple Replace (the default). |
| 2016 |
\newcommand{\infinitepageduration}{}% Default: No page duration setting on every page. |
| 2017 |
|
| 2018 |
\ifthenelse{\boolean{nineminutes@bidipres}}% If the option nineminutes is given, every page without explicit setting |
| 2019 |
{\renewcommand{\infinitepageduration}{546}}{}% gets a setting of 546 seconds (9.1 minutes). |
| 2020 |
\ifthenelse{\boolean{display}}% Are dynamic features enabled? |
| 2021 |
{% Yes. |
| 2022 |
\newcommand{\pageDuration}[1]% Definition for preamble. |
| 2023 |
{% |
| 2024 |
\@ifpackageloaded{hyperref}% Can we use \hypersetup? |
| 2025 |
{% Yes. |
| 2026 |
\hypersetup{pdfpageduration={#1}}% Set page duration with \hypersetup. |
| 2027 |
}% |
| 2028 |
{% No. In this case, we can't set the page duration. |
| 2029 |
\ClassWarning{bidipresentation} |
| 2030 |
{Package hyperref not loaded.\MessageBreak Page duration not set}% |
| 2031 |
}% |
| 2032 |
}% matches \newcommand{\pageDuration}[1]{% |
| 2033 |
\AtBeginDocument% Make sure this also works if bidipresentation is loaded before hyperref. |
| 2034 |
{% |
| 2035 |
\@ifpackageloaded{hyperref}% Can we use \hypersetup? |
| 2036 |
{% Yes. |
| 2037 |
\edef\next{\noexpand\hypersetup{pdfpageduration={\infinitepageduration}}}% |
| 2038 |
\next% Set default page duration. |
| 2039 |
\renewcommand{\pageDuration}[1]{\hypersetup{pdfpageduration={#1}}}% Set page duration with \hypersetup. |
| 2040 |
}% |
| 2041 |
{% No. In this case, we can't set the page duration. |
| 2042 |
\ClassWarning{bidipresentation} |
| 2043 |
{Package hyperref not loaded.\MessageBreak Page duration disabled}% |
| 2044 |
\let\pageDuration=\@gobble |
| 2045 |
}% |
| 2046 |
}% matches \AtBeginDocument{% |
| 2047 |
}% matches \ifthenelse{\boolean{display}}{% |
| 2048 |
{\let\pageDuration=\@gobble}% No. Disable page duration. |
| 2049 |
\newcommand{\stopAdvancing} |
| 2050 |
{\edef\next{\noexpand\pageDuration{\infinitepageduration}}\next}% Reset to default page duration. |
| 2051 |
\AtBeginDocument{\shipoutinit@bidipres}% |
| 2052 |
\newcommand*{\shipoutinit@bidipres} |
| 2053 |
{% |
| 2054 |
\let\o@shipout@bidipres=\shipout% Memorize previous definition. |
| 2055 |
\let\shipout\shipout@bidipres% Replace by own one. |
| 2056 |
}% |
| 2057 |
\newcommand{\shipout@bidipres} |
| 2058 |
{% |
| 2059 |
\afterassignment\shipout@test@bidipres |
| 2060 |
\global\setbox\@cclv= % |
| 2061 |
}% |
| 2062 |
\newcommand{\shipout@test@bidipres} |
| 2063 |
{% |
| 2064 |
\ifvoid\@cclv\relax% Is the box assigned yet? |
| 2065 |
\aftergroup\shipout@output@bidipres% No; defer execution of \shipout@output@bidipres. |
| 2066 |
\else |
| 2067 |
\shipout@output@bidipres% Yes; execute \shipout@output@bidipres immediately. |
| 2068 |
\fi% |
| 2069 |
}% |
| 2070 |
\newcommand{\shipout@output@bidipres} |
| 2071 |
{% |
| 2072 |
\shipout@hook@bidipres% Here, our own stuff is executed, manipulating \@cclv. |
| 2073 |
\o@shipout@bidipres\box\@cclv% Execute original shipout routine. |
| 2074 |
}% |
| 2075 |
\newcommand{\AtShipout}[1] |
| 2076 |
{\expandafter\gdef\expandafter\at@shipout@once@bidipres\expandafter{\at@shipout@once@bidipres#1}}% Add argument to container. |
| 2077 |
\newcommand{\at@shipout@once@bidipres}{} |
| 2078 |
\AtBeginDocument{\global\let\o@hyper@@anchor\hyper@@anchor} |
| 2079 |
\@ifpackageloaded{hyperref}% Is hyperref loaded? |
| 2080 |
{% Yes. Prepare hook. |
| 2081 |
\newcommand{\do@insert@firstanchor@bidipres}% This is executed on the first subpage of every page. |
| 2082 |
{\hypertarget{firstpage.\number\currentpagevalue}{}}% Create target. |
| 2083 |
} |
| 2084 |
{\newcommand{\do@insert@firstanchor@bidipres}{}}% No. Leave hook empty. |
| 2085 |
\newcommand{\dont@insert@firstanchor@bidipres}{}% |
| 2086 |
\newcommand{\insert@firstanchor@bidipres}{\do@insert@firstanchor@bidipres}% |
| 2087 |
\newcommand{\shipout@hook@bidipres} |
| 2088 |
{% |
| 2089 |
\filterpage@bidipres% Filter out whatsits on duplicate pages. |
| 2090 |
\setbox\@cclv=% Create `real' page box (which is later shipped out). |
| 2091 |
\hbox{% |
| 2092 |
\set@typeset@protect |
| 2093 |
\raise\ht\@cclv\rlap% Place background box. |
| 2094 |
{% |
| 2095 |
\vtop to \bidiprespageheight |
| 2096 |
{% |
| 2097 |
\offinterlineskip |
| 2098 |
\hrule\@height\z@\relax |
| 2099 |
\kern -1truein\relax |
| 2100 |
\kern -\voffset\relax |
| 2101 |
\moveleft 1truein\hbox{\kern-\hoffset\copy\bgndbox@bidipres}% |
| 2102 |
\vss |
| 2103 |
\kern 1truein\relax |
| 2104 |
\kern\voffset\relax |
| 2105 |
}% |
| 2106 |
}% |
| 2107 |
\raise\ht\@cclv\rlap% Place `vertical' panels. |
| 2108 |
{% |
| 2109 |
\vtop to \bidiprespageheight |
| 2110 |
{% |
| 2111 |
\offinterlineskip |
| 2112 |
\hrule\@height\z@\relax |
| 2113 |
\kern -1truein\relax |
| 2114 |
\kern -\voffset\relax |
| 2115 |
\moveleft 1truein\hb@xt@\bidiprespagewidth |
| 2116 |
{% |
| 2117 |
\kern-\hoffset\raise\leftpanelraise\hbox{\mk@leftpanel@bidipres}% |
| 2118 |
\hfill |
| 2119 |
\raise\rightpanelraise\hbox{\mk@rightpanel@bidipres}% |
| 2120 |
\kern\hoffset |
| 2121 |
}% |
| 2122 |
\vss |
| 2123 |
\kern 1truein\relax |
| 2124 |
\kern\voffset\relax |
| 2125 |
}% |
| 2126 |
}% |
| 2127 |
\raise\ht\@cclv\rlap% Place `horizontal' panels. |
| 2128 |
{% |
| 2129 |
\vtop to \bidiprespageheight |
| 2130 |
{% |
| 2131 |
\offinterlineskip |
| 2132 |
\hrule\@height\z@\relax |
| 2133 |
\kern -1truein\relax |
| 2134 |
\kern -\voffset\relax |
| 2135 |
\moveleft 1truein\hbox{\kern-\hoffset\kern\toppanelshift\mk@toppanel@bidipres}% |
| 2136 |
\vfill |
| 2137 |
\moveleft 1truein\hbox{\kern-\hoffset\kern\bottompanelshift\mk@bottompanel@bidipres}% |
| 2138 |
\kern 1truein\relax |
| 2139 |
\kern\voffset\relax |
| 2140 |
}% |
| 2141 |
}% |
| 2142 |
\raise\ht\@cclv\rlap |
| 2143 |
{% |
| 2144 |
\let\hyper@@anchor\o@hyper@@anchor% Reactivate hyper anchors. |
| 2145 |
\insert@firstanchor@bidipres% Execute hook for creating target firstpage.<n> |
| 2146 |
\ifshippingduplicate% Will further subpages follow? |
| 2147 |
\global\let\insert@firstanchor@bidipres=\dont@insert@firstanchor@bidipres% Deactivate hook for next page. |
| 2148 |
\else |
| 2149 |
\global\let\insert@firstanchor@bidipres=\do@insert@firstanchor@bidipres% Reactivate hook for next page. |
| 2150 |
\fi |
| 2151 |
\at@shipout@once@bidipres% Execute code stored away by \AtShipout. |
| 2152 |
}% |
| 2153 |
\global\let\at@shipout@once@bidipres=\empty% Clear \AtShipout container. |
| 2154 |
\box\@cclv |
| 2155 |
}% |
| 2156 |
} |
| 2157 |
\def\colorcorrections@bidipres{\relax}% The `counter stack' of color correction codes, reset at every \shipout. |
| 2158 |
|
| 2159 |
\AtBeginDocument% Make sure to catch color.sty even if it's loaded after bidipresentation. |
| 2160 |
{% |
| 2161 |
\ifthenelse{\boolean{fixcolorstack@bidipres}}% Was the fixcolorstack option given? |
| 2162 |
{% |
| 2163 |
\@ifundefined{VTeXversion}% Using vtex? |
| 2164 |
{% No. Go on. |
| 2165 |
\ifthenelse{\boolean{pdf}}% Producing pdf with pdftex? |
| 2166 |
{% Yes. Color stack fixing unnecessary. |
| 2167 |
\ClassWarning{bidipresentation} |
| 2168 |
{pdftex doesn't need color stack correction.\MessageBreak Option fixcolorstack disabled.}% |
| 2169 |
} |
| 2170 |
{% No. We need to add corrections for the color stack... |
| 2171 |
\@ifpackageloaded{color}% ... but only if color.sty is loaded at all. |
| 2172 |
{% |
| 2173 |
\expandafter\def\expandafter\shipout@hook@bidipres\expandafter% Extend \shipout hook ... |
| 2174 |
{\shipout@hook@bidipres\clearcolorcorrections@bidipres}% ... by a command to clear counter stack. |
| 2175 |
% |
| 2176 |
\newcommand{\clearcolorcorrections@bidipres}% The counter stack is cleared... |
| 2177 |
{% ... on all `final' shipouts. |
| 2178 |
\ifshippingduplicate |
| 2179 |
\else |
| 2180 |
\gdef\colorcorrections@bidipres{\relax}% |
| 2181 |
\fi |
| 2182 |
} |
| 2183 |
\expandafter\def\expandafter\o@set@color@bidipres\expandafter% |
| 2184 |
{% |
| 2185 |
\set@color% This is the `real' original definition. |
| 2186 |
\expandafter\aftergroup\csname\current@color\endcsname% Add definition of \current@color. |
| 2187 |
}% |
| 2188 |
|
| 2189 |
\let\o@reset@color@bidipres=\reset@color% Save original definition of \reset@color. |
| 2190 |
\def\remove@resetcolor@bidipres#1\aftergroup\reset@color% |
| 2191 |
{\def\pushcolor@bidipres##1{{\def\current@color{##1}#1}}}% |
| 2192 |
% |
| 2193 |
\expandafter\remove@resetcolor@bidipres\set@color |
| 2194 |
\def\pushcolorname@bidipres#1% |
| 2195 |
{% |
| 2196 |
\begingroup \escapechar\m@ne\xdef\@gtempa{\string#1}\endgroup% Get the coded tokens back (without \ ). |
| 2197 |
\expandafter\pushcolor@bidipres\expandafter{\@gtempa}% ... and execute push. |
| 2198 |
}% |
| 2199 |
\def\set@color% |
| 2200 |
{% |
| 2201 |
\o@set@color@bidipres% `Original' definition of \set@color. |
| 2202 |
\expandafter\@temptokena\expandafter{\colorcorrections@bidipres}% Add \o@reset@color@bidipres command at the front |
| 2203 |
\xdef\colorcorrections@bidipres{\noexpand\o@reset@color@bidipres\the\@temptokena}% ... of \colorcorrections@bidipres. |
| 2204 |
} |
| 2205 |
|
| 2206 |
\def\reset@color#1% \reset@color now receives the name of the color. |
| 2207 |
{% |
| 2208 |
\expandafter\addpushtoccor@bidipres\colorcorrections@bidipres\@nil{#1}% Add a push command for this color to the front |
| 2209 |
% of \colorcorrections@bidipres. |
| 2210 |
\o@reset@color@bidipres% `Original' definition of \reset@color. |
| 2211 |
}% |
| 2212 |
|
| 2213 |
\def\addpushtoccor@bidipres#1#2\@nil#3% Add a push command for some color to the front of \colorcorrections@bidipres. |
| 2214 |
{% |
| 2215 |
\ifx\o@reset@color@bidipres#1% For efficiency, a push immediately followed by a reset cancel out. |
| 2216 |
\gdef\colorcorrections@bidipres{#2}% |
| 2217 |
\else |
| 2218 |
\gdef\colorcorrections@bidipres{\pushcolorname@bidipres{#3}#1#2}% Otherwise, add the push to \colorcorrections@bidipres. |
| 2219 |
\fi |
| 2220 |
}% |
| 2221 |
}% matches \@ifpackageloaded{color} |
| 2222 |
{}% No changes needed if color.sty is not loaded. |
| 2223 |
}% matches second argument of \ifthenelse{\boolean{pdf}} |
| 2224 |
}% matches \@ifundefined{VTeXversion} |
| 2225 |
{% Yes. Color stack fixing unnecessary. |
| 2226 |
\ClassWarning{bidipresentation} |
| 2227 |
{vtex doesn't need color stack correction.\MessageBreak Option fixcolorstack disabled.}% |
| 2228 |
}% |
| 2229 |
}% matches \ifthenelse{\boolean{fixcolorstack@bidipres}} |
| 2230 |
{}% |
| 2231 |
}% matches \AtBeginDocument |
| 2232 |
\newif\ifshippingduplicate |
| 2233 |
\providecommand{\bidipreseject}{\newpage} |
| 2234 |
\newbox\mempageconts@bidipres |
| 2235 |
\newinsert\memfootins@bidipres |
| 2236 |
\newtoks\memoutput@bidipres |
| 2237 |
\def\cl@@ckptpause@bidipres{\@elt{page}} |
| 2238 |
\def\savepausecounters@bidipres{% |
| 2239 |
\begingroup |
| 2240 |
\def\@elt##1{\global\csname c@##1\endcsname\the\csname c@##1\endcsname}% |
| 2241 |
\xdef\restorepausecounters@bidipres{\cl@@ckptpause@bidipres}% |
| 2242 |
\endgroup |
| 2243 |
} |
| 2244 |
\newcommand{\pausesafecounter}[1]% |
| 2245 |
{\expandafter\def\expandafter\cl@@ckptpause@bidipres\expandafter{\cl@@ckptpause@bidipres\@elt{#1}}} |
| 2246 |
\@ifclassloaded{seminar}{\pausesafecounter{slide}}{} |
| 2247 |
\ifthenelse{\boolean{display}}{% |
| 2248 |
\AtBeginDocument{\@ifpackageloaded{hyperref}{% |
| 2249 |
\let\hyper@anchor@bidipres=\hyper@anchor |
| 2250 |
\long\def\hyper@@anchor#1#2{% |
| 2251 |
%%% \ifthenelse{\boolean{instepwise@bidipres}}% |
| 2252 |
\ifthenelse{\boolean{instepwise@bidipres} \AND \NOT \boolean{strongfiltering@bidipres}}% |
| 2253 |
{\ifthenelse{\NOT \boolean{instep@bidipres}}% |
| 2254 |
{\ifthenelse{\value{step}=\value{firststep}}{\@hyper@@anchor#1\relax#2\relax}{}}% |
| 2255 |
{\ifthenelse{\boolean{active} \AND \boolean{firstactivation}}% |
| 2256 |
{\@hyper@@anchor#1\relax#2\relax}{}}% End \ifthenelse{\boolean{active} ... |
| 2257 |
}% End \ifthenelse{\NOT \boolean{instep@bidipres}} |
| 2258 |
{\@hyper@@anchor#1\relax#2\relax}% End \ifthenelse{\boolean{instepwise@bidipres}} |
| 2259 |
} |
| 2260 |
\let\hyper@anchorstart@bidipres=\hyper@anchorstart |
| 2261 |
\def\hyper@anchorstart#1{% |
| 2262 |
\ifthenelse{\boolean{instepwise@bidipres} \AND \NOT \boolean{strongfiltering@bidipres}}% |
| 2263 |
{\ifthenelse{\NOT \boolean{instep@bidipres}}% |
| 2264 |
{\ifthenelse{\value{step}=\value{firststep}}{\hyper@anchorstart@bidipres{#1}}{}}% |
| 2265 |
{\ifthenelse{\boolean{active} \AND \boolean{firstactivation}}% |
| 2266 |
{\hyper@anchorstart@bidipres{#1}}{}}% End \ifthenelse{\boolean{active} ... |
| 2267 |
}% End \ifthenelse{\NOT \boolean{instep@bidipres}} |
| 2268 |
{\hyper@anchorstart@bidipres{#1}}% End \ifthenelse{\boolean{instepwise@bidipres}} |
| 2269 |
} |
| 2270 |
}{}}% End \AtBeginDocument{\@ifpackageloaded{hyperref}{ |
| 2271 |
% Changing \protected@write to avoid duplicates in aux-file |
| 2272 |
\let\protected@write@bidipres=\protected@write |
| 2273 |
\long\def\protected@write#1#2#3{% |
| 2274 |
\ifthenelse{\boolean{instepwise@bidipres} \AND \NOT \boolean{strongfiltering@bidipres}}% |
| 2275 |
{\ifthenelse{\NOT \boolean{instep@bidipres}}% |
| 2276 |
{\ifthenelse{\value{step}=\value{firststep}}{\protected@write@bidipres{#1}{#2}{#3}}{}}% |
| 2277 |
{\ifthenelse{\boolean{active} \AND \boolean{firstactivation}}% |
| 2278 |
{\protected@write@bidipres{#1}{#2}{#3}}{}}% End \ifthenelse{\boolean{active} ... |
| 2279 |
}% End \ifthenelse{\NOT \boolean{instep@bidipres}} |
| 2280 |
{\protected@write@bidipres{#1}{#2}{#3}}% End \ifthenelse{\boolean{instepwise@bidipres}} |
| 2281 |
}% |
| 2282 |
}{}% End \ifthenelse{\boolean{display}} |
| 2283 |
\def\save@bidipres |
| 2284 |
{% |
| 2285 |
\par% Always end current paragraph. |
| 2286 |
\global\setbox\mempageconts@bidipres=\copy\voidb@x% Initialise \mempageconts@bidipres (suggested by Ross Moore). |
| 2287 |
\savepausecounters@bidipres% Save counters. |
| 2288 |
\memoutput@bidipres=\output% Make backup copy of output routine. |
| 2289 |
\output={\global\setbox\mempageconts@bidipres=\box\@cclv}% Copy current page contents. |
| 2290 |
\eject% Trigger now. |
| 2291 |
\global\setbox\memfootins@bidipres=\copy\footins% Save footnotes. |
| 2292 |
\global\skip\memfootins@bidipres=\skip\footins |
| 2293 |
\global\count\memfootins@bidipres=\count\footins |
| 2294 |
\global\dimen\memfootins@bidipres=\dimen\footins |
| 2295 |
\output=\memoutput@bidipres% Restore output routine. |
| 2296 |
} |
| 2297 |
\let\filterpage@bidipres\relax |
| 2298 |
\newcommand{\filterwhatsits@bidipres}{% |
| 2299 |
\ifthenelse{\boolean{strongfiltering@bidipres}}% |
| 2300 |
{\global\setbox\@cclv=\hbox{\leaders\copy\@cclv\hskip\wd\@cclv}}% Old aggressive/robust filtering |
| 2301 |
{}% No filtering - handled by \insertfilterwhatsits@bidipres and stepwise aware commands. |
| 2302 |
} |
| 2303 |
\newcommand{\insertfilterwhatsits@bidipres}{% |
| 2304 |
\global\setbox\tempbox@bidipres=\hbox{\leaders\copy\tempbox@bidipres\hskip\wd\tempbox@bidipres}% |
| 2305 |
} |
| 2306 |
\newcommand{\insertfirstduplicate@bidipres} |
| 2307 |
{\unvcopy\mempageconts@bidipres}% Just output the vbox's contents. |
| 2308 |
\newcommand{\do@colorcorrections@bidipres} |
| 2309 |
{% |
| 2310 |
{% |
| 2311 |
\colorcorrections@bidipres% Execute color correction stack. |
| 2312 |
\gdef\colorcorrections@bidipres{\relax}% Re-initialize for next round. |
| 2313 |
}% |
| 2314 |
} |
| 2315 |
\newcommand{\insertsecondduplicate@bidipres} |
| 2316 |
{% |
| 2317 |
\do@colorcorrections@bidipres% Execute color correction stack. |
| 2318 |
\global\setbox\footins=\copy\memfootins@bidipres% Restore footnotes. |
| 2319 |
\global\skip\footins=\skip\memfootins@bidipres |
| 2320 |
\global\count\footins=\count\memfootins@bidipres |
| 2321 |
\global\dimen\footins=\dimen\memfootins@bidipres |
| 2322 |
\ifthenelse{\boolean{strongfiltering@bidipres}}% |
| 2323 |
{\unvcopy\mempageconts@bidipres}% |
| 2324 |
{\setbox\tempbox@bidipres=\vbox{\unvcopy\mempageconts@bidipres}% |
| 2325 |
\insertfilterwhatsits@bidipres |
| 2326 |
\copy\tempbox@bidipres% |
| 2327 |
} |
| 2328 |
} |
| 2329 |
\newcommand{\outputduplicate@bidipres} |
| 2330 |
{% |
| 2331 |
\shippingduplicatetrue% This switch can be evaluated in panels or headers/footers. |
| 2332 |
\global\let\filterpage@bidipres\filterwhatsits@bidipres% Filter out file whatsits when shipping out. |
| 2333 |
\global\let\o@hyper@@anchor@bidipres\hyper@@anchor% Save definition of hyperref command for hyper anchors. |
| 2334 |
\global\let\hyper@@anchor\@gobble% Disable hyper anchors on duplicate pages to avoid duplicate page anchors. |
| 2335 |
\bidipreseject% Shipout page. |
| 2336 |
\global\let\hyper@@anchor\o@hyper@@anchor@bidipres% Restore definition of hyperref command for hyper anchors. |
| 2337 |
\global\let\filterpage@bidipres\relax% Disable whatsit filtering. |
| 2338 |
\shippingduplicatefalse% Unset switch. |
| 2339 |
}% |
| 2340 |
\providecommand\pause% If pause.sty is loaded, the existing definition of \pause is not overwritten. |
| 2341 |
{% |
| 2342 |
\save@bidipres% Save contents of the page... |
| 2343 |
\insertfirstduplicate@bidipres% ... and insert again. |
| 2344 |
\ifthenelse{\boolean{display}}% Are dynamic features enabled? |
| 2345 |
{% Yes. |
| 2346 |
\outputduplicate@bidipres% Output page. |
| 2347 |
\restorepausecounters@bidipres% Restore counters (page number). |
| 2348 |
\insertsecondduplicate@bidipres% Reinsert saved contents. |
| 2349 |
} |
| 2350 |
{}% |
| 2351 |
}% |
| 2352 |
\newcommand{\@onlyinstepwise@bidipres}[1] |
| 2353 |
{% |
| 2354 |
\providecommand#1% |
| 2355 |
{% |
| 2356 |
\ClassError{bidipresentation}% |
| 2357 |
{Command \string#1 can be used only inside \string\stepwise} |
| 2358 |
{% |
| 2359 |
Commands like \string\step, \string\switch, |
| 2360 |
\string\multistep\space or \string\overlays\MessageBreak |
| 2361 |
can be used only inside the argument of a \string\stepwise\space variant. |
| 2362 |
}% |
| 2363 |
}% |
| 2364 |
} |
| 2365 |
\newcounter{totalsteps} |
| 2366 |
\newcounter{firststep} |
| 2367 |
\newcounter{step} |
| 2368 |
\newcounter{stepcommand} |
| 2369 |
\newcounter{stepsperformed} |
| 2370 |
\newboolean{firstactivation} |
| 2371 |
\newboolean{active} |
| 2372 |
\newcommand{\displayboxed} |
| 2373 |
{% |
| 2374 |
\ifmmode % We need to distinguish between math and text mode. |
| 2375 |
\expandafter\mathpalette\expandafter\math@db@bidipres % In math mode, the style has to be respected. |
| 2376 |
\else |
| 2377 |
\expandafter\text@db@bidipres |
| 2378 |
\fi |
| 2379 |
} |
| 2380 |
\newcommand{\text@db@bidipres}[1]{\mbox{#1}} % In text mode, we just use an \mbox. |
| 2381 |
\newcommand{\math@db@bidipres}[2]{\mbox{$\m@th#1{#2}$}} % In math mode, the style (#1) is inserted by \mathpalette. |
| 2382 |
\let\displayidentical=\@iden |
| 2383 |
\newcommand{\hidephantom}[1] |
| 2384 |
{% |
| 2385 |
{% a group makes redefinitions local |
| 2386 |
\leavevmode\phantom{#1}% |
| 2387 |
}% |
| 2388 |
} |
| 2389 |
\newcommand{\hideignore}[1]{} |
| 2390 |
\newcommand{\hidesmartignore}[1]{\setbox\tempbox@bidipres=\vbox{#1}} |
| 2391 |
|
| 2392 |
\ifthenelse{\boolean{colormath@bidipres}}{% |
| 2393 |
\newcommand{\commitcolor@bidipres} |
| 2394 |
{\textxecolor{\ifmmode mathcolor\else textcolor\fi}} |
| 2395 |
}{ |
| 2396 |
\newcommand{\commitcolor@bidipres}{\textxecolor{textcolor}} |
| 2397 |
} |
| 2398 |
\ifthenelse{\boolean{bidiprescolor}}{ |
| 2399 |
\newcommand{\hidedimmed}[1]{% |
| 2400 |
{ |
| 2401 |
\ifthenelse{\boolean{instepwise@bidipres}}{\usecolorset{stwcolors}}{}% |
| 2402 |
\dimcolors |
| 2403 |
\commitcolor@bidipres{#1} |
| 2404 |
} |
| 2405 |
} |
| 2406 |
}{ |
| 2407 |
\let\hidedimmed=\displayidentical |
| 2408 |
} |
| 2409 |
\ifthenelse{\boolean{bidiprescolor}}{ |
| 2410 |
\newcommand{\hidevanish}[1]{\textxecolor{\vanishcolor}{\vanishcolors#1}} |
| 2411 |
}{ |
| 2412 |
\let\hidevanish=\hidephantom |
| 2413 |
} |
| 2414 |
\newcommand{\boxedsteps} % Use boxed versions. |
| 2415 |
{\let\displaystepcontents=\displayboxed\let\hidestepcontents=\hidephantom} |
| 2416 |
|
| 2417 |
\newcommand{\nonboxedsteps} % Use nonboxed versions. |
| 2418 |
{\let\displaystepcontents=\displayidentical\let\hidestepcontents=\hideignore} |
| 2419 |
\nonboxedsteps |
| 2420 |
\let\activatestep=\displayidentical |
| 2421 |
\newlength{\highlightboxsep} |
| 2422 |
\setlength{\highlightboxsep}{.5\fboxsep} |
| 2423 |
\DeclareRobustCommand{\highlightboxed} |
| 2424 |
{% |
| 2425 |
\ifmmode% Check for math mode. |
| 2426 |
\expandafter\mathpalette\expandafter\math@hb@bidipres% Math mode version needs to respect current style. |
| 2427 |
\else |
| 2428 |
\expandafter\text@hb@bidipres% Text mode version. |
| 2429 |
\fi |
| 2430 |
} |
| 2431 |
\newcommand{\math@hb@bidipres}[2]{\text@hb@bidipres{$\m@th#1{#2}$}} |
| 2432 |
\ifthenelse{\boolean{colorhighlight@bidipres}}% Color highlighting enabled? |
| 2433 |
{% Yes; use a box with colored background. |
| 2434 |
\newcommand{\text@hb@bidipres}[1] |
| 2435 |
{% |
| 2436 |
\makebox[\width-2\highlightboxsep]% Make the frame stick out at the sides. |
| 2437 |
{% |
| 2438 |
\setlength{\fboxsep}{\highlightboxsep}% Set frame size. |
| 2439 |
\raisebox{0pt}[\height-\fboxsep][\depth-\fboxsep]% Make the frame stick out above and below. |
| 2440 |
{\colorbox{highlightcolor}{#1}}% Make colored box containing <text>. |
| 2441 |
}% |
| 2442 |
}% |
| 2443 |
}% matches \ifthenelse{\boolean{colorhighlight@bidipres}} |
| 2444 |
{% No; use an \fbox. |
| 2445 |
\newcommand{\text@hb@bidipres}[1] |
| 2446 |
{% |
| 2447 |
\makebox[\width-2\highlightboxsep-2\fboxrule]% Make the frame stick out at the sides. |
| 2448 |
{% |
| 2449 |
\setlength{\fboxsep}{\highlightboxsep}% Set frame size. |
| 2450 |
\raisebox{0pt}[\height-\fboxsep-\fboxrule][\depth-\fboxsep-\fboxrule]% Make the frame stick out above and below. |
| 2451 |
{\fbox{#1}}%% Make an fbox containing <text>. |
| 2452 |
}% |
| 2453 |
}% |
| 2454 |
}% matches second argument of \ifthenelse{\boolean{colorhighlight@bidipres}} |
| 2455 |
|
| 2456 |
\ifthenelse{\boolean{bidiprescolor}}% Can we use colors at all? |
| 2457 |
{% Yes. |
| 2458 |
\newcommand{\highlightenhanced}[1]% Make argument appear in `enhanced' colors. |
| 2459 |
{% |
| 2460 |
{% A group makes the color changes local. |
| 2461 |
\ifthenelse{\boolean{instepwise@bidipres}}{\usecolorset{stwcolors}}{}% Just in case we currently are in enhanced mode... |
| 2462 |
\enhancecolors% Enhance colors. |
| 2463 |
\commitcolor@bidipres{#1}% Switch on enhanced color. |
| 2464 |
}% |
| 2465 |
}% |
| 2466 |
} |
| 2467 |
{\let\highlightenhanced=\displayidentical}% No. Disable this command. |
| 2468 |
\newcommand{\pickup@s@optargs@bidipres} |
| 2469 |
{% |
| 2470 |
\@ifnextchar[%] Check for first optional argument in [...] syntax. |
| 2471 |
{\f@brackstep@bidipres}% |
| 2472 |
{% |
| 2473 |
\@ifnextchar(%) Check for first optional argument in (...) syntax. |
| 2474 |
{\f@parenstep@bidipres} |
| 2475 |
{\f@brackstep@bidipres[]}% No optional argument given; call with empty argument in [...] syntax (default). |
| 2476 |
}% |
| 2477 |
} |
| 2478 |
|
| 2479 |
\def\f@brackstep@bidipres[#1]% First optional argument was given in [...] syntax. |
| 2480 |
{% |
| 2481 |
\def\tmp@bidipres{#1}% |
| 2482 |
\ifx\tmp@bidipres\empty% Optional argument empty? |
| 2483 |
\def\f@step@bidiprescheck{\ifthenelse{\value{step}=\value{stepcommand}}}% Yes; use default. |
| 2484 |
\else |
| 2485 |
\def\f@step@bidiprescheck{\ifthenelse{#1}}% No; condition is defined via \ifthenelse. |
| 2486 |
\fi |
| 2487 |
\f@step@bidipres% Go on and check for second optional argument. |
| 2488 |
} |
| 2489 |
|
| 2490 |
\def\f@parenstep@bidipres(#1)% First optional argument was given in (...) syntax. |
| 2491 |
{% |
| 2492 |
\def\f@step@bidiprescheck{#1}% Save condition (given as argument). |
| 2493 |
\f@step@bidipres% Go on and check for second optional argument. |
| 2494 |
} |
| 2495 |
|
| 2496 |
\newcommand{\f@step@bidipres}% Pick up the second optional argument. |
| 2497 |
{% |
| 2498 |
\@ifnextchar[%] Check for second optional argument in [...] syntax. |
| 2499 |
{\s@brackstep@bidipres} |
| 2500 |
{% |
| 2501 |
\@ifnextchar(%) Check for second optional argument in (...) syntax. |
| 2502 |
{\s@parenstep@bidipres} |
| 2503 |
{\s@parenstep@bidipres(\if@first@bidipres@true)}% No second optional argument given; |
| 2504 |
}% call with \if@first@bidipres@true in (...) syntax (default). |
| 2505 |
} |
| 2506 |
|
| 2507 |
\def\s@brackstep@bidipres[#1]% Second optional argument was given in [...] syntax. |
| 2508 |
{% |
| 2509 |
\def\s@step@bidiprescheck{\ifthenelse{#1}}% Condition is defined via \ifthenelse. |
| 2510 |
\@do@s@bidipres% Go on. |
| 2511 |
} |
| 2512 |
|
| 2513 |
\def\s@parenstep@bidipres(#1)% Second optional argument was given in (...) syntax. |
| 2514 |
{% |
| 2515 |
\def\s@step@bidiprescheck{#1}% Save condition (given as argument). |
| 2516 |
\@do@s@bidipres% Go on. |
| 2517 |
} |
| 2518 |
\newcommand{\deactivate@inner@bidipres}% \switch behaviour. |
| 2519 |
{% |
| 2520 |
\let\inner@display@bidipres=\displayidentical% |
| 2521 |
\let\inner@hide@bidipres=\displayidentical% |
| 2522 |
} |
| 2523 |
|
| 2524 |
\newcommand{\activate@inner@bidipres}% \step behaviour. |
| 2525 |
{% |
| 2526 |
\let\inner@display@bidipres=\displaystepcontents% |
| 2527 |
\let\inner@hide@bidipres=\hidestepcontents% |
| 2528 |
} |
| 2529 |
\@onlyinstepwise@bidipres\step |
| 2530 |
\newcommand{\proper@step@bidipres}{\let\@do@s@bidipres=\@step@bidipres\pickup@s@optargs@bidipres} |
| 2531 |
\newcommand{\@step@bidipres}[1]{\activate@inner@bidipres\@@switch@bidipres{#1}{#1}} |
| 2532 |
\@onlyinstepwise@bidipres\switch |
| 2533 |
\newcommand{\proper@switch@bidipres}{\deactivate@inner@bidipres\let\@do@s@bidipres=\@@switch@bidipres\pickup@s@optargs@bidipres} |
| 2534 |
\newcommand{\if@first@bidipres@true}[2]% |
| 2535 |
{% |
| 2536 |
\expandafter % \first@bidipres@<n> is set to \@undefined if \switch command number <n> has not yet been |
| 2537 |
\ifx\csname first@bidipres@\the\c@stepcommand\endcsname\empty% activated and \empty otherwise. |
| 2538 |
#1% |
| 2539 |
\else |
| 2540 |
#2% |
| 2541 |
\fi |
| 2542 |
} |
| 2543 |
\@ifundefined{ifmeasuring@}{\newif\ifmeasuring@}{} |
| 2544 |
\newcommand{\@switch@bidipres}[2] |
| 2545 |
{% |
| 2546 |
\global\advance\c@stepcommand by 1\relax% This execution of \switch is counted. |
| 2547 |
\setboolean{instep@bidipres}{true}% Set indicator. |
| 2548 |
% |
| 2549 |
% If the verbose option is set, type out some accounting information which can be used for debugging. |
| 2550 |
\ifthenelse{\boolean{verbose@bidipres}} |
| 2551 |
{% |
| 2552 |
\ClassInfo{bidipresentation} |
| 2553 |
{Step: \the\c@step, Stepcommand: \the\c@stepcommand,\MessageBreak Stepsperformed: \the\c@stepsperformed}% |
| 2554 |
} |
| 2555 |
{}% |
| 2556 |
% |
| 2557 |
\f@step@bidiprescheck% Is this step to be activated? \f@step@bidiprescheck is defined by the first optional argument of \switch. |
| 2558 |
{% Yes. |
| 2559 |
\if@first@bidipres@true{}% For non-unique conditions given as optional argument or when \reswitch is used, it might happen |
| 2560 |
{% that \first@bidipres@\value{stepcommand} is already set. In this case, don't advance the counter stepsperformed. |
| 2561 |
\ifmeasuring@\else% Do nothing in AMSLaTeX's measuring pass for aligned equations. |
| 2562 |
\global\expandafter\let\csname first@bidipres@\the\c@stepcommand\endcsname=\empty% Set \first@bidipres@\value{stepcommand} |
| 2563 |
\fi |
| 2564 |
\global\advance\c@stepsperformed by 1\relax% Advance the counter for `real' first activations. |
| 2565 |
\gdef\current@step@bidipres{#2}% |
| 2566 |
}% |
| 2567 |
\setboolean{firstactivation}{true}% This switch can be tested in <stepcontents>, but also in <whenactive>. |
| 2568 |
} |
| 2569 |
{% No. |
| 2570 |
\setboolean{firstactivation}{false}% This switch can be tested in <stepcontents>, but also in <whenactive>. |
| 2571 |
}% End of \f@step@bidiprescheck |
| 2572 |
% |
| 2573 |
\let\o@afterstep@bidipres=\afterstep% We need to save the current definition of \afterstep. |
| 2574 |
% |
| 2575 |
\s@step@bidiprescheck% Is this step active? \s@step@bidiprescheck is defined by the second optional argument of \switch. |
| 2576 |
{% Yes. |
| 2577 |
\setboolean{active}{true}% Make this fact known to the user. |
| 2578 |
\ifthenelse{\boolean{firstactivation}} |
| 2579 |
{\inner@display@bidipres{\activatestep{#2}}}% `First' display of <stepcontents>. |
| 2580 |
{\inner@display@bidipres{#2}}% Display <stepcontents>. |
| 2581 |
} |
| 2582 |
{% No. |
| 2583 |
\setboolean{active}{false}% Make this fact known to the user. |
| 2584 |
\let\afterstep=\@gobble% Don't execute \afterstep here. |
| 2585 |
\ifthenelse{\boolean{firstactivation}} |
| 2586 |
{\inner@hide@bidipres{\activatestep{#1}}}% Hide <stepcontents>, but with `first activation'. |
| 2587 |
{\inner@hide@bidipres{#1}}% Hide <stepcontents>. |
| 2588 |
}% End of \s@step@bidiprescheck |
| 2589 |
% |
| 2590 |
\let\afterstep=\o@afterstep@bidipres% Restore the definition of \afterstep. |
| 2591 |
\setboolean{instep@bidipres}{false}% Set indicator. |
| 2592 |
}% End of the definition of \@switch@bidipres. |
| 2593 |
\@onlyinstepwise@bidipres\restep |
| 2594 |
|
| 2595 |
\newcommand{\proper@restep@bidipres} |
| 2596 |
{% |
| 2597 |
\global\advance\c@stepcommand by -1% This is done by simply counting \value{stepcommand} backwards. |
| 2598 |
\proper@step@bidipres% Go on with \step. |
| 2599 |
} |
| 2600 |
\@onlyinstepwise@bidipres\reswitch |
| 2601 |
|
| 2602 |
\newcommand{\proper@reswitch@bidipres} |
| 2603 |
{% |
| 2604 |
\global\advance\c@stepcommand by -1% This is done by simply counting \value{stepcommand} backwards. |
| 2605 |
\proper@switch@bidipres% Go on with \switch. |
| 2606 |
} |
| 2607 |
\@onlyinstepwise@bidipres\bstep |
| 2608 |
|
| 2609 |
\newcommand{\proper@bstep@bidipres}{\let\@do@s@bidipres=\@bstep@bidipres\pickup@s@optargs@bidipres} |
| 2610 |
\newcommand{\@bstep@bidipres}[1]{{\boxedsteps\@step@bidipres{#1}}} |
| 2611 |
\@onlyinstepwise@bidipres\rebstep |
| 2612 |
|
| 2613 |
\newcommand{\proper@rebstep@bidipres} |
| 2614 |
{% |
| 2615 |
\global\advance\c@stepcommand by -1% This is done by simply counting \value{stepcommand} backwards. |
| 2616 |
\proper@bstep@bidipres% Go on with \bstep. |
| 2617 |
} |
| 2618 |
\ifthenelse{\boolean{colormath@bidipres}}% Should we color math? |
| 2619 |
{% Yes. |
| 2620 |
\newcommand{\commitcolors@bidipres} |
| 2621 |
{\xecolor{\ifmmode mathcolor\else textcolor\fi}}% Switch to mathcolor if in math mode, to textcolor otherwise. |
| 2622 |
} |
| 2623 |
{% No. |
| 2624 |
\newcommand{\commitcolors@bidipres}{\xecolor{textcolor}}% Switch to textcolor. |
| 2625 |
} |
| 2626 |
|
| 2627 |
\@onlyinstepwise@bidipres\dstep |
| 2628 |
|
| 2629 |
\newcommand{\proper@dstep@bidipres}{\deactivate@inner@bidipres\let\@do@s@bidipres=\@dstep@bidipres\pickup@s@optargs@bidipres} |
| 2630 |
|
| 2631 |
\ifthenelse{\boolean{bidiprescolor}}% Can we use colors at all? |
| 2632 |
{% Yes. |
| 2633 |
\newcommand{\@dstep@bidipres}{\@@switch@bidipres{\dimcolors\commitcolors@bidipres}{\set@color}} |
| 2634 |
} |
| 2635 |
{\newcommand{\@dstep@bidipres}{\@@switch@bidipres{}{}}}% No. Disable this command. |
| 2636 |
\@onlyinstepwise@bidipres\redstep |
| 2637 |
|
| 2638 |
\newcommand{\proper@redstep@bidipres} |
| 2639 |
{% |
| 2640 |
\global\advance\c@stepcommand by -1% This is done by simply counting \value{stepcommand} backwards. |
| 2641 |
\proper@dstep@bidipres% Go on with \dstep. |
| 2642 |
} |
| 2643 |
\@onlyinstepwise@bidipres\vstep |
| 2644 |
|
| 2645 |
\newcommand{\proper@vstep@bidipres}{\deactivate@inner@bidipres\let\@do@s@bidipres=\@vstep@bidipres\pickup@s@optargs@bidipres} |
| 2646 |
|
| 2647 |
\ifthenelse{\boolean{bidiprescolor}}% Can we use colors at all? |
| 2648 |
{% Yes. |
| 2649 |
\newcommand{\@vstep@bidipres}{\@@switch@bidipres{\vanishcolors\xecolor{textcolor}}{\set@color}} |
| 2650 |
} |
| 2651 |
{\newcommand{\@vstep@bidipres}{\@@switch@bidipres{}{}}}% No. Disable this command. |
| 2652 |
\@onlyinstepwise@bidipres\revstep |
| 2653 |
|
| 2654 |
\newcommand{\proper@revstep@bidipres} |
| 2655 |
{% |
| 2656 |
\global\advance\c@stepcommand by -1% This is done by simply counting \value{stepcommand} backwards. |
| 2657 |
\proper@vstep@bidipres% Go on with \vstep. |
| 2658 |
} |
| 2659 |
\@onlyinstepwise@bidipres\steponce |
| 2660 |
|
| 2661 |
\newcommand{\proper@steponce@bidipres} |
| 2662 |
{\@ifnextchar[{\brack@steponce@bidipres}{\@steponce@bidipres}}% Optional argument in square brackets? |
| 2663 |
|
| 2664 |
\newcommand{\@steponce@bidipres} |
| 2665 |
{% |
| 2666 |
\@ifnextchar(%% Optional argument in parentheses? |
| 2667 |
{\paren@steponce@bidipres}% |
| 2668 |
{\brack@steponce@bidipres[]}% [] is the default if no optional argument is given. |
| 2669 |
} |
| 2670 |
|
| 2671 |
\def\brack@steponce@bidipres[#1]% |
| 2672 |
{% |
| 2673 |
\def\optarg@so@bidipres{[#1]}% Store optional argument for later re-insertion. |
| 2674 |
\@@steponce@bidipres% Proceed. |
| 2675 |
}% |
| 2676 |
|
| 2677 |
\def\paren@steponce@bidipres(#1){\def\optarg@so@bidipres{(#1)}\@@steponce@bidipres} |
| 2678 |
\newcommand{\@@steponce@bidipres}[1]{\expandafter\step\optarg@so@bidipres[\boolean{firstactivation}]{#1}} |
| 2679 |
\newcounter{substep} |
| 2680 |
\@onlyinstepwise@bidipres\multistep |
| 2681 |
|
| 2682 |
\newcommand{\proper@multistep@bidipres} |
| 2683 |
{% |
| 2684 |
\let\ns@ms@bidipres=\normalstep@ms@bidipres% Placeholder for `every step but the last one'. |
| 2685 |
\let\nshook@ms@bidipres=\relax% These hooks are used by \movie. |
| 2686 |
\let\lshook@ms@bidipres=\relax |
| 2687 |
\@ifstar% Starred version? |
| 2688 |
{% |
| 2689 |
\let\ls@ms@bidipres=\laststep@ms@bidipres% Last step acts differently. |
| 2690 |
\multistep@bidipres% Collect optional argument and proceed. |
| 2691 |
} |
| 2692 |
{% |
| 2693 |
\let\ls@ms@bidipres=\normalstep@ms@bidipres% Last step acts like all other steps. |
| 2694 |
\multistep@bidipres% Collect optional argument and proceed. |
| 2695 |
}% |
| 2696 |
} |
| 2697 |
|
| 2698 |
\newcommand{\multistep@bidipres}% Collect optional argument. |
| 2699 |
{\@ifnextchar[{\brack@multistep@bidipres}{\@multistep@bidipres}}% Optional argument in square brackets? |
| 2700 |
|
| 2701 |
\newcommand{\@multistep@bidipres} |
| 2702 |
{% |
| 2703 |
\@ifnextchar(%% Optional argument in parentheses? |
| 2704 |
{\paren@multistep@bidipres}% |
| 2705 |
{\brack@multistep@bidipres[]}% [] is the default if no optional argument is given. |
| 2706 |
} |
| 2707 |
|
| 2708 |
\def\brack@multistep@bidipres[#1]% |
| 2709 |
{% |
| 2710 |
\def\optarg@ms@bidipres{[#1]}% Store optional argument for later re-insertion. |
| 2711 |
\@@multistep@bidipres% Proceed. |
| 2712 |
}% |
| 2713 |
|
| 2714 |
\def\paren@multistep@bidipres(#1){\def\optarg@ms@bidipres{(#1)}\@@multistep@bidipres} |
| 2715 |
|
| 2716 |
\newcommand{\normalstep@ms@bidipres}[1] |
| 2717 |
{% |
| 2718 |
\expandafter\switch\optarg@ms@bidipres% Re-insert optional argument. |
| 2719 |
[\boolean{firstactivation}]{}{#1}% `normal' steps appear only once. |
| 2720 |
} |
| 2721 |
|
| 2722 |
\newcommand{\laststep@ms@bidipres}[1] |
| 2723 |
{\expandafter\switch\optarg@ms@bidipres{}{#1}}% In the starred version, the last step doesn't disappear. |
| 2724 |
\newcommand{\@@multistep@bidipres}[2] |
| 2725 |
{% |
| 2726 |
\setcounter{substep}{0}% Initialize substep counter. |
| 2727 |
\whiledo{\value{substep}<#1}% Iterate <n> times. |
| 2728 |
{% |
| 2729 |
\stepcounter{substep}% |
| 2730 |
\ifthenelse{\value{substep}=#1}% Last step? |
| 2731 |
{\ls@ms@bidipres{\lshook@ms@bidipres#2}}% Execute single step (together with \movie hooks). |
| 2732 |
{\ns@ms@bidipres{\nshook@ms@bidipres#2}}% |
| 2733 |
}% |
| 2734 |
} |
| 2735 |
\@onlyinstepwise@bidipres\movie |
| 2736 |
|
| 2737 |
\newcommand{\proper@movie@bidipres} |
| 2738 |
{% |
| 2739 |
\let\ns@ms@bidipres=\normalstep@ms@bidipres% Placeholder for `every step but the last one'. |
| 2740 |
\def\nshook@ms@bidipres{\afterstep{\pageDuration{\dur@ms@bidipres}}}% Page duration to be used between steps. |
| 2741 |
\def\lshook@ms@bidipres{\afterstep{\end@ms@bidipres}}% Page duration setting after last step. |
| 2742 |
\@ifstar% Starred version? |
| 2743 |
{% |
| 2744 |
\let\ls@ms@bidipres=\laststep@ms@bidipres% Last step acts differently. |
| 2745 |
\movie@bidipres% Collect optional argument and proceed. |
| 2746 |
} |
| 2747 |
{% |
| 2748 |
\let\ls@ms@bidipres=\normalstep@ms@bidipres% Last step acts like all other steps. |
| 2749 |
\movie@bidipres% Collect optional argument and proceed. |
| 2750 |
}% |
| 2751 |
} |
| 2752 |
|
| 2753 |
\newcommand{\movie@bidipres}% Collect optional argument. |
| 2754 |
{\@ifnextchar[{\brack@movie@bidipres}{\@movie@bidipres}}% Optional argument in square brackets? |
| 2755 |
|
| 2756 |
\newcommand{\@movie@bidipres} |
| 2757 |
{\@ifnextchar({\paren@movie@bidipres}{\brack@movie@bidipres[]}}% Optional argument in parentheses? |
| 2758 |
|
| 2759 |
\def\brack@movie@bidipres[#1]{\def\optarg@ms@bidipres{[#1]}\@@movie@bidipres}% Store optional argument and proceed. |
| 2760 |
\def\paren@movie@bidipres(#1){\def\optarg@ms@bidipres{(#1)}\@@movie@bidipres} |
| 2761 |
|
| 2762 |
\newcommand{\@@movie@bidipres}[2]% Collect <n> and <dur> arguments. |
| 2763 |
{\gdef\dur@ms@bidipres{#2}\gdef\nosteps@ms@bidipres{#1}\@@@movie@bidipres} |
| 2764 |
|
| 2765 |
\newcommand{\@@@movie@bidipres}[1][\stopAdvancing]% Collect second optional argument and call body of \multistep. |
| 2766 |
{\gdef\end@ms@bidipres{#1}\@@multistep@bidipres{\nosteps@ms@bidipres}} |
| 2767 |
\@onlyinstepwise@bidipres\overlays |
| 2768 |
|
| 2769 |
\providecommand{\proper@overlays@bidipres} |
| 2770 |
{\@ifnextchar[{\brack@overlays@bidipres}{\@overlays@bidipres}}% Optional argument in square brackets? |
| 2771 |
|
| 2772 |
\newcommand{\@overlays@bidipres} |
| 2773 |
{% |
| 2774 |
\@ifnextchar(%% Optional argument in parentheses? |
| 2775 |
{\paren@overlays@bidipres}% |
| 2776 |
{\brack@overlays@bidipres[]}% [] is the default if no optional argument is given. |
| 2777 |
} |
| 2778 |
|
| 2779 |
\def\brack@overlays@bidipres[#1]% |
| 2780 |
{% |
| 2781 |
\def\optarg@ov@bidipres{[#1]}% Store optional argument for later re-insertion. |
| 2782 |
\@@overlays@bidipres% Proceed. |
| 2783 |
}% |
| 2784 |
|
| 2785 |
\def\paren@overlays@bidipres(#1){\def\optarg@ov@bidipres{(#1)}\@@overlays@bidipres} |
| 2786 |
\newcommand{\@@overlays@bidipres}[2] |
| 2787 |
{% |
| 2788 |
\setcounter{substep}{1}% Initialize substep counter. |
| 2789 |
\leavevmode% Make sure that \rlap doesn't insert anything in the vertical list. |
| 2790 |
\whiledo{\value{substep}<#1}% Iterate <n-1> times (since we start at 1). |
| 2791 |
{% |
| 2792 |
\expandafter\switch\optarg@ov@bidipres{}{\ifthenelse{\boolean{firstactivation}}{\mbox{#2}}{\rlap{#2}}}% |
| 2793 |
\stepcounter{substep}% |
| 2794 |
}% |
| 2795 |
\expandafter\switch\optarg@ov@bidipres{}{\mbox{#2}}% Always using \mbox for last overlay. |
| 2796 |
} |
| 2797 |
\newenvironment{stepcapsule}{}{} |
| 2798 |
\newcommand{\afterstep}[1] |
| 2799 |
{% |
| 2800 |
\gdef\@afterstep@bidipres{#1}% The argument is simply stored in \@afterstep@bidipres, which is executed in \stepwise. |
| 2801 |
} |
| 2802 |
\newcounter{o@fs@bidipres} |
| 2803 |
\newcommand{\stepwise} |
| 2804 |
{% |
| 2805 |
\global\c@o@fs@bidipres=\c@firststep\relax% Save the default value of counter firststep. |
| 2806 |
\@ifstar% Using the starred version? |
| 2807 |
{% Yes. |
| 2808 |
\c@firststep=1\relax% Start with counter step at number 1. |
| 2809 |
\@stepwise@bidipres% Collect optional argument and proceed. |
| 2810 |
} |
| 2811 |
{% No. |
| 2812 |
\@stepwise@bidipres% Use the default. |
| 2813 |
}% End of \@ifstar. |
| 2814 |
}% |
| 2815 |
\newcommand{\list@stepcapsule} |
| 2816 |
{% |
| 2817 |
\renewenvironment{stepcapsule}% stepcapsule is to put an invisible rule on the vertical list. |
| 2818 |
{\vspace*{\parskip}\hrule \@height\z@\relax}{} |
| 2819 |
}% |
| 2820 |
|
| 2821 |
\let\par@stepcapsule=\list@stepcapsule% Identical for \parstepwise. |
| 2822 |
\newcommand{\liststepwise} |
| 2823 |
{% |
| 2824 |
\@ifstar% Starred version? |
| 2825 |
{\def\star@bidipres{*}\@liststepwise@bidipres}% Save star in \star@bidipres, collect optional argument and proceed. |
| 2826 |
{\def\star@bidipres{}\@liststepwise@bidipres}% Collect optional argument and proceed (non-starred version). |
| 2827 |
} |
| 2828 |
|
| 2829 |
\newcommand{\@liststepwise@bidipres}[1][]% Collect optional argument. |
| 2830 |
{% |
| 2831 |
\expandafter\stepwise\star@bidipres% Re-insert the star (if given). |
| 2832 |
[% |
| 2833 |
\list@stepcapsule% Activate special stepcapsule. |
| 2834 |
#1% Insert optional argument of \liststepwise. |
| 2835 |
]% |
| 2836 |
} |
| 2837 |
\newcommand{\parstepwise} |
| 2838 |
{% |
| 2839 |
\@ifstar% Starred version? |
| 2840 |
{\def\star@bidipres{*}\@parstepwise@bidipres}% Save star in \star@bidipres, collect optional argument and proceed. |
| 2841 |
{\def\star@bidipres{}\@parstepwise@bidipres}% Collect optional argument and proceed (non-starred version). |
| 2842 |
} |
| 2843 |
|
| 2844 |
\newcommand{\@parstepwise@bidipres}[1][]% Collect optional argument. |
| 2845 |
{% |
| 2846 |
\expandafter\stepwise\star@bidipres% Re-insert the star (if given). |
| 2847 |
[% |
| 2848 |
\boxedsteps% Activate \boxedsteps. |
| 2849 |
\par@stepcapsule% Activate special stepcapsule. |
| 2850 |
#1% Insert optional argument of \parstepwise. |
| 2851 |
]% |
| 2852 |
} |
| 2853 |
\newcommand{\count@em@bidipres}[2] |
| 2854 |
{% |
| 2855 |
\global\advance\c@stepcommand by 1\relax% We simply advance the number of \step commands... |
| 2856 |
#2% ... and execute the second argument (to find nested uses of \step). |
| 2857 |
} |
| 2858 |
\def\@nb@bidipresfalse{\global\let\if@nb@bidipres\iffalse} |
| 2859 |
\def\@nb@bidiprestrue{\global\let\if@nb@bidipres\iftrue} |
| 2860 |
\newtoks\ep@bidipres |
| 2861 |
\def\savecounters@bidipres{% |
| 2862 |
\begingroup |
| 2863 |
\def\@elt##1{\global\csname c@##1\endcsname\the\csname c@##1\endcsname}% |
| 2864 |
\xdef\restorecounters@bidipres{\cl@@ckpt}% |
| 2865 |
\endgroup |
| 2866 |
\if@nobreak\@nb@bidiprestrue\else\@nb@bidipresfalse\fi |
| 2867 |
\global\ep@bidipres\everypar |
| 2868 |
} |
| 2869 |
\def\savebidiprescounters@bidipres{% |
| 2870 |
\begingroup |
| 2871 |
\def\@elt##1{\global\csname c@##1\endcsname\the\csname c@##1\endcsname}% |
| 2872 |
\xdef\restorebidiprescounters@bidipres{\cl@@ckpt@bidipres}% |
| 2873 |
\endgroup |
| 2874 |
} |
| 2875 |
\def\cl@@ckpt@bidipres{\@elt{totalsteps}\@elt{firststep}\@elt{step}\@elt{stepcommand}\@elt{stepsperformed}\@elt{o@fs@bidipres}} |
| 2876 |
\newcommand{\releasecounter}[1]% |
| 2877 |
{\expandafter\def\expandafter\cl@@ckpt@bidipres\expandafter{\cl@@ckpt@bidipres\@elt{#1}}} |
| 2878 |
\newcommand{\disable@counting@bidipres} |
| 2879 |
{% |
| 2880 |
\let\afterstep=\@gobble |
| 2881 |
\renewcommand{\backgroundstyle}[2][]{}% |
| 2882 |
\renewcommand{\@@vgradrule@bidipres}[3][0pt]{}% |
| 2883 |
\renewcommand{\@@@@dblvgradrule@bidipres}[3][0pt]{}% |
| 2884 |
\renewcommand{\@@hgradrule@bidipres}[3][0pt]{}% |
| 2885 |
\renewcommand{\@@@@dblhgradrule@bidipres}[3][0pt]{}% |
| 2886 |
} |
| 2887 |
\newboolean{instepwise@bidipres} |
| 2888 |
\newboolean{instep@bidipres} |
| 2889 |
\newcommand{\@stepwise@bidipres}[2][] |
| 2890 |
{% |
| 2891 |
\save@bidipres% Save the current contents of the page. |
| 2892 |
\savecounters@bidipres% Save the values of all counters. |
| 2893 |
\dumpcolorset{stwcolors}% Make a copy of all color definitions. |
| 2894 |
\begingroup% A group makes redefinitions local. |
| 2895 |
\setboolean{instepwise@bidipres}{true}% Set indicatior. |
| 2896 |
\let\step\proper@step@bidipres% By default, \step executes \proper@step@bidipres. |
| 2897 |
\let\restep\proper@restep@bidipres% |
| 2898 |
\let\bstep\proper@bstep@bidipres% |
| 2899 |
\let\rebstep\proper@rebstep@bidipres% |
| 2900 |
\let\dstep\proper@dstep@bidipres% |
| 2901 |
\let\redstep\proper@redstep@bidipres% |
| 2902 |
\let\vstep\proper@vstep@bidipres% |
| 2903 |
\let\revstep\proper@revstep@bidipres% |
| 2904 |
\let\steponce\proper@steponce@bidipres% |
| 2905 |
\let\multistep\proper@multistep@bidipres% |
| 2906 |
\let\movie\proper@movie@bidipres% |
| 2907 |
\let\overlays\proper@overlays@bidipres% |
| 2908 |
\let\switch\proper@switch@bidipres% By default, \switch executes \proper@switch@bidipres. |
| 2909 |
\let\reswitch\proper@reswitch@bidipres% |
| 2910 |
\let\orig@mathchoice@bidipres=\mathchoice% Save the current definition of \mathchoice... |
| 2911 |
\def\mathchoice##1##2##3##4% ... and redefine. |
| 2912 |
{% |
| 2913 |
\orig@mathchoice@bidipres% The original definition of \mathchoice is called... |
| 2914 |
{##1}% ... with the first argument untouched and in all other arguments, \step ... |
| 2915 |
{\let\step\restep\let\bstep\rebstep\let\dstep\redstep\let\vstep\revstep\let\switch\reswitch##2}% ... redefined ... |
| 2916 |
{\let\step\restep\let\bstep\rebstep\let\dstep\redstep\let\vstep\revstep\let\switch\reswitch##3}% ... to execute ... |
| 2917 |
{\let\step\restep\let\bstep\rebstep\let\dstep\redstep\let\vstep\revstep\let\switch\reswitch##4}% ... \restep. |
| 2918 |
}% |
| 2919 |
% |
| 2920 |
\c@stepcommand=0\relax% Initialize the counter for \step commands. |
| 2921 |
\let\@@switch@bidipres=\count@em@bidipres% Next, we count the \step commands in <contents>... |
| 2922 |
\setbox\tempbox@bidipres% ... by putting <contents> into a \vbox (which is then discarded). |
| 2923 |
=\vbox |
| 2924 |
{% |
| 2925 |
\hfuzz\maxdimen\hbadness\@M\relax% No bogus `overfull \hbox' warnings. |
| 2926 |
\disable@counting@bidipres#2% Inside the \vbox, some commands are redefined for safety and efficiency. |
| 2927 |
}% |
| 2928 |
\c@totalsteps=\c@stepcommand% Now, we know the total number of \step commands. |
| 2929 |
% |
| 2930 |
% Next, we have to reset \first@bidipres@<n> for <n>=0...\value{totalsteps}. |
| 2931 |
\c@step=0\relax |
| 2932 |
\loop |
| 2933 |
\ifnum\c@step<\c@totalsteps |
| 2934 |
\advance\c@step by 1\relax |
| 2935 |
\expandafter\let\csname first@bidipres@\the\c@step\endcsname=\@undefined% \first@bidipres@<n>=\@undefined means step <n> |
| 2936 |
% hasn't yet been activated. |
| 2937 |
\repeat |
| 2938 |
#1% |
| 2939 |
% |
| 2940 |
\c@step=\c@firststep% Set the counter for the current step to its starting value... |
| 2941 |
\c@stepsperformed=0\relax% ... and also the counter for the \step commands which are already activated. |
| 2942 |
\let\@@switch@bidipres=\@switch@bidipres% \step will now act normally. |
| 2943 |
\ifthenelse{\boolean{verbose@bidipres}}% Some accounting info (if verbose option is set). |
| 2944 |
{\ClassInfo{bidipresentation}{Total number of step commands: \the\c@totalsteps}} |
| 2945 |
{}% |
| 2946 |
% |
| 2947 |
\ifthenelse{\boolean{display}}% Are dynamic features enabled? |
| 2948 |
{}% Yes. |
| 2949 |
{% No. Do only one loop. |
| 2950 |
\c@stepsperformed=\c@totalsteps% Set everything up for the last loop. |
| 2951 |
\c@step=0\relax% Set \first@bidipres@<n> for <n>=0...\value{totalsteps}. |
| 2952 |
\loop |
| 2953 |
\ifnum\c@step<\c@totalsteps |
| 2954 |
\advance\c@step by 1\relax |
| 2955 |
\expandafter\let\csname first@bidipres@\the\c@step\endcsname=\@empty% \first@bidipres@<n>=\@empty means step <n> |
| 2956 |
% has already been activated. |
| 2957 |
\repeat |
| 2958 |
\advance\c@step by 1\relax% This way, the last step won't think it's `first activated'. |
| 2959 |
}% |
| 2960 |
\let\insertdup@bidipres=\insertfirstduplicate@bidipres% Setup command to restore page contents for the first time. |
| 2961 |
\loop% This is the central loop. |
| 2962 |
\c@stepcommand=0\relax% Initialize the counter for the current \step command. |
| 2963 |
\savebidiprescounters@bidipres% Save the `stepwise-specific' counters. |
| 2964 |
\restorecounters@bidipres% Restore the `original' values of all counters... |
| 2965 |
\restorebidiprescounters@bidipres% ... and the current values of the `stepwise-specific' counters. |
| 2966 |
\let\@afterstep@bidipres=\relax% Reset the container for \afterstep. |
| 2967 |
% |
| 2968 |
\insertdup@bidipres% Insert saved page contents. |
| 2969 |
\begin{stepcapsule}% This is usually empty, but may start a minipage (or whatever). |
| 2970 |
\usecolorset{stwcolors}% Restore colors to state at the beginning of \stepwise. |
| 2971 |
\if@nb@bidipres\@nobreaktrue\else\@nobreakfalse\fi |
| 2972 |
\global\everypar\ep@bidipres |
| 2973 |
#2% Execute <contents> |
| 2974 |
\end{stepcapsule}% |
| 2975 |
% |
| 2976 |
\@afterstep@bidipres% Whatever has been saved with \afterstep is now executed. |
| 2977 |
\ifnum\c@stepsperformed<\c@totalsteps% Doing one more round? |
| 2978 |
\outputduplicate@bidipres% Shipout this page and round we go again. |
| 2979 |
\let\insertdup@bidipres=\insertsecondduplicate@bidipres% Setup command to restore page contents for subsequent times. |
| 2980 |
\advance\c@step by 1\relax% Round we go again |
| 2981 |
\repeat |
| 2982 |
\endgroup |
| 2983 |
\global\c@firststep=\c@o@fs@bidipres\relax% Restore default value of counter firststep. |
| 2984 |
} |
| 2985 |
\newenvironment{fragilesteps}{% |
| 2986 |
\def\bidipresentation@verbatimfilename{\jobname-bidipresentation.vrb}% |
| 2987 |
\immediate\openout\bidipresentation@verbatimfileout=\bidipresentation@verbatimfilename% |
| 2988 |
\bidipresentation@verbatimreadframe% |
| 2989 |
} |
| 2990 |
{% |
| 2991 |
\immediate\closeout\bidipresentation@verbatimfileout% |
| 2992 |
\stepwise{\input{\bidipresentation@verbatimfilename}}% |
| 2993 |
} |
| 2994 |
\newwrite\bidipresentation@verbatimfileout |
| 2995 |
|
| 2996 |
\def\bidipresentation@verbatimreadframe{% |
| 2997 |
\begingroup% |
| 2998 |
\let\do\@makeother\dospecials% |
| 2999 |
\count@=127% |
| 3000 |
\@whilenum\count@<255 \do{% |
| 3001 |
\advance\count@ by 1% |
| 3002 |
\catcode\count@=11% |
| 3003 |
}% |
| 3004 |
\@makeother\^^L% and whatever other special cases |
| 3005 |
\endlinechar`\^^M \catcode`\^^M=12 \bidipresentation@processframefirstline} |
| 3006 |
|
| 3007 |
{\catcode`\^^M=12\endlinechar=-1% |
| 3008 |
\long\gdef\bidipresentation@processframefirstline#1^^M{% |
| 3009 |
\def\bidipresentation@test{#1}% |
| 3010 |
\ifx\bidipresentation@test\bidipresentation@stopframefirst% |
| 3011 |
\let\next=\bidipresentation@endfragilesteps% |
| 3012 |
\else |
| 3013 |
\ifx\bidipresentation@test\@empty% |
| 3014 |
\else% |
| 3015 |
\@temptokena={#1}% |
| 3016 |
\immediate\write\bidipresentation@verbatimfileout{\the\@temptokena}% |
| 3017 |
\fi% |
| 3018 |
\let\next=\bidipresentation@processframeline% |
| 3019 |
\fi% |
| 3020 |
\next% |
| 3021 |
} |
| 3022 |
\long\gdef\bidipresentation@processframeline#1^^M{% |
| 3023 |
\def\bidipresentation@test{#1}% |
| 3024 |
\ifx\bidipresentation@test\bidipresentation@stopframe% |
| 3025 |
\let\next=\bidipresentation@endfragilesteps% |
| 3026 |
\else |
| 3027 |
\immediate\write\bidipresentation@verbatimfileout{#1}% |
| 3028 |
\fi% |
| 3029 |
\next% |
| 3030 |
} |
| 3031 |
} |
| 3032 |
|
| 3033 |
{ |
| 3034 |
\escapechar=-1\relax% |
| 3035 |
\xdef\bidipresentation@stopframe{\string\\end\string\{fragilesteps\string\}} |
| 3036 |
\xdef\bidipresentation@stopframefirst{\noexpand\end\string\{fragilesteps\string\}} |
| 3037 |
} |
| 3038 |
|
| 3039 |
\def\bidipresentation@endfragilesteps{\endgroup\end{fragilesteps}} |
| 3040 |
|
| 3041 |
\newboolean{bidipresl@paralist} |
| 3042 |
\@ifpackageloaded{paralist}{\setboolean{bidipresl@paralist}{true}}{} |
| 3043 |
\newboolean{bidipresl@eqlist} |
| 3044 |
\@ifpackageloaded{eqlist}{\setboolean{bidipresl@eqlist}{true}}{} |
| 3045 |
\newboolean{bidipresl@pausestep} |
| 3046 |
\DeclareOption{pausestep}{\setboolean{bidipresl@pausestep}{true}} |
| 3047 |
\newboolean{bidipresl@noflipendstep} |
| 3048 |
\DeclareOption{noflipendstep}{\setboolean{bidipresl@noflipendstep}{true}} |
| 3049 |
|
| 3050 |
\ProcessOptions |
| 3051 |
\define@key{bidipresl}{pausestep}[true]{% |
| 3052 |
\setboolean{bidipresl@pausestep}{#1} |
| 3053 |
} |
| 3054 |
\define@key{bidipresl}{noflipendstep}[true]{% |
| 3055 |
\setboolean{bidipresl@noflipendstep}{#1} |
| 3056 |
} |
| 3057 |
\newcommand*{\bidipreslsetup}{\setkeys{bidipresl}} |
| 3058 |
\newif\ifbidipresl@instepenv \bidipresl@instepenvfalse |
| 3059 |
\newif\ifbidipresl@inpausestepenv \bidipresl@inpausestepenvfalse |
| 3060 |
\newif\ifbidipresl@indimenv \bidipresl@indimenvfalse |
| 3061 |
\newif\ifbidipresl@inflipenv \bidipresl@inflipenvfalse |
| 3062 |
\let\oldenumerate=\enumerate |
| 3063 |
\let\olditemize=\itemize |
| 3064 |
\let\olddescription=\description |
| 3065 |
\let\endoldenumerate=\endenumerate |
| 3066 |
\let\endolditemize=\enditemize |
| 3067 |
\let\endolddescription=\enddescription |
| 3068 |
\ifthenelse{\boolean{bidipresl@eqlist}}{% |
| 3069 |
\let\oldeqlist=\eqlist |
| 3070 |
\let\endoldeqlist=\endeqlist |
| 3071 |
}{} |
| 3072 |
\ifthenelse{\boolean{bidipresl@paralist}}{% |
| 3073 |
\let\oldcompactenum=\compactenum |
| 3074 |
\let\oldcompactitem=\compactitem |
| 3075 |
\let\endoldcompactenum=\endcompactenum |
| 3076 |
\let\endoldcompactitem=\endcompactitem |
| 3077 |
}{} |
| 3078 |
\let\bidipresl@nx\noexpand |
| 3079 |
\let\bidipresl@xp\expandafter |
| 3080 |
\newtoks\bidipresl@emptytoks |
| 3081 |
\newtoks\bidipresl@envbody |
| 3082 |
\long\def\bidipresl@addto@envbody#1{\global\bidipresl@envbody\bidipresl@xp{\the\bidipresl@envbody#1}} |
| 3083 |
\def\bidipresl@collect@body#1{% |
| 3084 |
\bidipresl@envbody{\bidipresl@xp#1\bidipresl@xp{\the\bidipresl@envbody}}% |
| 3085 |
\edef\bidipresl@process@envbody{\the\bidipresl@envbody\bidipresl@nx\end{\@currenvir}}% |
| 3086 |
\bidipresl@envbody\bidipresl@emptytoks \def\begin@stack{b}% |
| 3087 |
\begingroup |
| 3088 |
\bidipresl@xp\let\csname\@currenvir\endcsname\bidipresl@collect@@body |
| 3089 |
\edef\bidipresl@process@envbody{\bidipresl@xp\bidipresl@nx\csname\@currenvir\endcsname}% |
| 3090 |
\bidipresl@process@envbody |
| 3091 |
} |
| 3092 |
\long\def\bidipresl@push@begins#1\begin#2{% |
| 3093 |
\ifx\end#2\else b\bidipresl@xp\bidipresl@push@begins\fi |
| 3094 |
} |
| 3095 |
\long\def\bidipresl@collect@@body#1\end#2{% |
| 3096 |
\edef\begin@stack{\bidipresl@push@begins#1\begin\end \bidipresl@xp\@gobble\begin@stack}% |
| 3097 |
\ifx\@empty\begin@stack |
| 3098 |
\endgroup |
| 3099 |
\@checkend{#2}% |
| 3100 |
\bidipresl@addto@envbody{#1}% |
| 3101 |
\else |
| 3102 |
\bidipresl@addto@envbody{#1\end{#2}}% |
| 3103 |
\fi |
| 3104 |
\bidipresl@process@envbody |
| 3105 |
} |
| 3106 |
\def\bidipresl@addmargin#1{% |
| 3107 |
\advance\@listdepth 1 |
| 3108 |
\addtolength{\csname leftmargin\romannumeral\@listdepth\endcsname}{#1} |
| 3109 |
\advance\@listdepth -1 |
| 3110 |
} |
| 3111 |
|
| 3112 |
\ifthenelse{\boolean{display}}{% |
| 3113 |
\ifthenelse{\boolean{bidiprescolor}}% Can we use colors? |
| 3114 |
{% Yes. In this case highlighting is implemented by switching color. |
| 3115 |
\def\bidipresl@flipstep{% |
| 3116 |
\step{\ifthenelse{\boolean{firstactivation}}% |
| 3117 |
{\xecolor{textcolor}}% |
| 3118 |
{\xecolor{inactivecolor}}% |
| 3119 |
}% |
| 3120 |
}% |
| 3121 |
} |
| 3122 |
{% No. In this case highlighting is implemented by putting the item in boldface. |
| 3123 |
\def\bidipresl@flipstep{% |
| 3124 |
\step{\ifthenelse{\boolean{firstactivation}}{\bfseries}{\mdseries}} |
| 3125 |
}% |
| 3126 |
} |
| 3127 |
\ifthenelse{\boolean{bidiprescolor}}% Can we use colors? |
| 3128 |
{% Yes. In this case highlighting is implemented by using \dstep |
| 3129 |
\def\bidipresl@dimstep{\dstep}% |
| 3130 |
} |
| 3131 |
{% No. In this case highlighting is implemented by putting the item in boldface. |
| 3132 |
\def\bidipresl@dimstep{% |
| 3133 |
\step{\bfseries}% |
| 3134 |
\ifthenelse{\boolean{active}}{}{\mdseries}% |
| 3135 |
}% |
| 3136 |
} |
| 3137 |
\ifthenelse{\boolean{bidiprescolor}}% Can we use colors? |
| 3138 |
{% Yes. In this case stepping is implemented by using \vstep |
| 3139 |
\def\bidipresl@step{\vstep}% |
| 3140 |
} |
| 3141 |
{% No. In this case stepping is implemented using \pause |
| 3142 |
\def\bidipresl@step{\pause}% |
| 3143 |
} |
| 3144 |
}{% \boolean{display} is false |
| 3145 |
\def\bidipresl@flipstep{\relax}% |
| 3146 |
\def\bidipresl@dimstep{\relax}% |
| 3147 |
\def\bidipresl@step{\relax}% |
| 3148 |
} |
| 3149 |
\newenvironment{flipitem}[1][0cm]{% |
| 3150 |
\bidipresl@addmargin{#1} |
| 3151 |
\bidipresl@collect@body\@flipitem}% |
| 3152 |
{\global\@ignoretrue} |
| 3153 |
\newenvironment{flipdesc}[1][0cm]{% |
| 3154 |
\bidipresl@addmargin{#1} |
| 3155 |
\bidipresl@collect@body\@flipdesc}% |
| 3156 |
{\global\@ignoretrue} |
| 3157 |
\newenvironment{flipenum}[1][0cm]{% |
| 3158 |
\bidipresl@addmargin{#1} |
| 3159 |
\bidipresl@collect@body\@flipenum}% |
| 3160 |
{\global\@ignoretrue} |
| 3161 |
\ifthenelse{\boolean{bidipresl@eqlist}}{% |
| 3162 |
\newenvironment{flipeqlist}[1][0cm]{% |
| 3163 |
\bidipresl@collect@body\@flipeqlist}% |
| 3164 |
{\global\@ignoretrue} |
| 3165 |
\newenvironment{flipcompacteqlist}[1][0cm]{% |
| 3166 |
\bidipresl@collect@body\@flipcompacteqlist}% |
| 3167 |
{\global\@ignoretrue} |
| 3168 |
}{} |
| 3169 |
\ifthenelse{\boolean{bidipresl@paralist}}{% |
| 3170 |
\newenvironment{flipcompactitem}[1][0cm]{% |
| 3171 |
\bidipresl@addmargin{#1} |
| 3172 |
\bidipresl@collect@body\@flipcompactitem}% |
| 3173 |
{\global\@ignoretrue} |
| 3174 |
\newenvironment{flipcompactenum}[1][0cm]{% |
| 3175 |
\bidipresl@addmargin{#1} |
| 3176 |
\bidipresl@collect@body\@flipcompactenum}% |
| 3177 |
{\global\@ignoretrue} |
| 3178 |
}{} |
| 3179 |
|
| 3180 |
\newcommand\@fliplist[2]{% |
| 3181 |
\ifbidipresl@indimenv |
| 3182 |
\ClassError{bidipresentation}{% |
| 3183 |
dim* and flip* environments do NOT nest}{% |
| 3184 |
Do not continue! Type 'q' to stop and fix the nested list. |
| 3185 |
} |
| 3186 |
\else\ifbidipresl@instepenv |
| 3187 |
\begin{#1} |
| 3188 |
\let\hidestepcontents=\displaystepcontents |
| 3189 |
\renewcommand{\item}{\bidipresl@flipstep\bidipresl@origitem}% |
| 3190 |
#2 |
| 3191 |
\end{#1}% |
| 3192 |
\else |
| 3193 |
\ifbidipresl@inpausestepenv\let\liststepwise=\stepwise\fi |
| 3194 |
\liststepwise[\let\hidestepcontents=\displaystepcontents]{% |
| 3195 |
\begin{#1} |
| 3196 |
\ifbidipresl@inpausestepenv\else |
| 3197 |
\ifbidipresl@instepenv\else\let\bidipresl@origitem=\item\fi |
| 3198 |
\fi |
| 3199 |
\bidipresl@instepenvtrue |
| 3200 |
\bidipresl@inflipenvtrue |
| 3201 |
\renewcommand{\item}{\bidipresl@flipstep\bidipresl@origitem}% |
| 3202 |
#2 |
| 3203 |
\ifthenelse{\boolean{bidipresl@noflipendstep}}{}{\step{}}% |
| 3204 |
\end{#1}} |
| 3205 |
\fi\fi |
| 3206 |
} |
| 3207 |
|
| 3208 |
\newcommand\@flipitem[1]{% |
| 3209 |
\@fliplist{olditemize}{#1}} |
| 3210 |
\newcommand\@flipdesc[1]{% |
| 3211 |
\@fliplist{olddescription}{#1}} |
| 3212 |
\newcommand\@flipenum[1]{% |
| 3213 |
\@fliplist{oldenumerate}{#1}} |
| 3214 |
\ifthenelse{\boolean{bidipresl@eqlist}}{% |
| 3215 |
\newcommand\@flipeqlist[1]{% |
| 3216 |
\@fliplist{oldeqlist}{#1}} |
| 3217 |
\newcommand\@flipcompacteqlist[1]{% |
| 3218 |
\@fliplist{compacteqlist}{#1}} |
| 3219 |
}{} |
| 3220 |
\ifthenelse{\boolean{bidipresl@paralist}}{% |
| 3221 |
\newcommand\@flipcompactitem[1]{% |
| 3222 |
\@fliplist{oldcompactitem}{#1}} |
| 3223 |
\newcommand\@flipcompactenum[1]{% |
| 3224 |
\@fliplist{oldcompactenum}{#1}} |
| 3225 |
}{} |
| 3226 |
\newenvironment{dimitem}[1][0cm]{% |
| 3227 |
\bidipresl@addmargin{#1} |
| 3228 |
\bidipresl@collect@body\@dimitem}% |
| 3229 |
{\global\@ignoretrue} |
| 3230 |
\newenvironment{dimdesc}[1][0cm]{% |
| 3231 |
\bidipresl@addmargin{#1} |
| 3232 |
\bidipresl@collect@body\@dimdesc}% |
| 3233 |
{\global\@ignoretrue} |
| 3234 |
\newenvironment{dimenum}[1][0cm]{% |
| 3235 |
\bidipresl@addmargin{#1} |
| 3236 |
\bidipresl@collect@body\@dimenum}% |
| 3237 |
{\global\@ignoretrue} |
| 3238 |
\ifthenelse{\boolean{bidipresl@eqlist}}{% |
| 3239 |
\newenvironment{dimeqlist}[1][0cm]{% |
| 3240 |
\bidipresl@collect@body\@dimeqlist}% |
| 3241 |
{\global\@ignoretrue} |
| 3242 |
\newenvironment{dimcompacteqlist}[1][0cm]{% |
| 3243 |
\bidipresl@collect@body\@dimcompacteqlist}% |
| 3244 |
{\global\@ignoretrue} |
| 3245 |
}{} |
| 3246 |
\ifthenelse{\boolean{bidipresl@paralist}}{% |
| 3247 |
\newenvironment{dimcompactitem}[1][0cm]{% |
| 3248 |
\bidipresl@addmargin{#1} |
| 3249 |
\bidipresl@collect@body\@dimcompactitem}% |
| 3250 |
{\global\@ignoretrue} |
| 3251 |
\newenvironment{dimcompactenum}[1][0cm]{% |
| 3252 |
\bidipresl@addmargin{#1} |
| 3253 |
\bidipresl@collect@body\@dimcompactenum}% |
| 3254 |
{\global\@ignoretrue} |
| 3255 |
}{} |
| 3256 |
|
| 3257 |
\newcommand\@dimlist[2]{% |
| 3258 |
\ifbidipresl@inflipenv |
| 3259 |
\ClassError{bidipresentation}{% |
| 3260 |
dim* and flip* environments do NOT nest}{% |
| 3261 |
Do not continue! Type <q> to stop and fix the nested list. |
| 3262 |
} |
| 3263 |
\else\ifbidipresl@instepenv |
| 3264 |
\begin{#1} |
| 3265 |
\renewcommand{\item}{\bidipresl@dimstep\bidipresl@origitem}% |
| 3266 |
#2 |
| 3267 |
\end{#1}% |
| 3268 |
\else |
| 3269 |
\ifbidipresl@inpausestepenv\let\liststepwise=\stepwise\fi |
| 3270 |
\liststepwise{% |
| 3271 |
\begin{#1} |
| 3272 |
\ifbidipresl@inpausestepenv\else |
| 3273 |
\ifbidipresl@instepenv\else\let\bidipresl@origitem=\item\fi |
| 3274 |
\fi |
| 3275 |
\bidipresl@instepenvtrue |
| 3276 |
\bidipresl@indimenvtrue |
| 3277 |
\renewcommand{\item}{\bidipresl@dimstep\bidipresl@origitem}% |
| 3278 |
#2 |
| 3279 |
\end{#1}} |
| 3280 |
\fi\fi |
| 3281 |
} |
| 3282 |
|
| 3283 |
\newcommand\@dimitem[1]{% |
| 3284 |
\@dimlist{olditemize}{#1}} |
| 3285 |
\newcommand\@dimdesc[1]{% |
| 3286 |
\@dimlist{olddescription}{#1}} |
| 3287 |
\newcommand\@dimenum[1]{% |
| 3288 |
\@dimlist{oldenumerate}{#1}} |
| 3289 |
\ifthenelse{\boolean{bidipresl@eqlist}}{% |
| 3290 |
\newcommand\@dimeqlist[1]{% |
| 3291 |
\@dimlist{oldeqlist}{#1}} |
| 3292 |
\newcommand\@dimcompacteqlist[1]{% |
| 3293 |
\@dimlist{compacteqlist}{#1}} |
| 3294 |
}{} |
| 3295 |
\ifthenelse{\boolean{bidipresl@paralist}}{% |
| 3296 |
\newcommand\@dimcompactitem[1]{% |
| 3297 |
\@dimlist{oldcompactitem}{#1}} |
| 3298 |
\newcommand\@dimcompactenum[1]{% |
| 3299 |
\@dimlist{oldcompactenum}{#1}} |
| 3300 |
}{} |
| 3301 |
\newenvironment{stepitem}[1][0cm]{% |
| 3302 |
\bidipresl@addmargin{#1} |
| 3303 |
\bidipresl@collect@body\@stepitem}% |
| 3304 |
{\global\@ignoretrue} |
| 3305 |
\newenvironment{stepdesc}[1][0cm]{% |
| 3306 |
\bidipresl@addmargin{#1} |
| 3307 |
\bidipresl@collect@body\@stepdesc}% |
| 3308 |
{\global\@ignoretrue} |
| 3309 |
\newenvironment{stepenum}[1][0cm]{% |
| 3310 |
\bidipresl@addmargin{#1} |
| 3311 |
\bidipresl@collect@body\@stepenum}% |
| 3312 |
{\global\@ignoretrue} |
| 3313 |
\ifthenelse{\boolean{bidipresl@eqlist}}{% |
| 3314 |
\newenvironment{stepeqlist}[1][0cm]{% |
| 3315 |
\bidipresl@collect@body\@stepeqlist}% |
| 3316 |
{\global\@ignoretrue} |
| 3317 |
\newenvironment{stepcompacteqlist}[1][0cm]{% |
| 3318 |
\bidipresl@collect@body\@stepcompacteqlist}% |
| 3319 |
{\global\@ignoretrue} |
| 3320 |
}{} |
| 3321 |
\ifthenelse{\boolean{bidipresl@paralist}}{% |
| 3322 |
\newenvironment{stepcompactitem}[1][0cm]{% |
| 3323 |
\bidipresl@addmargin{#1} |
| 3324 |
\bidipresl@collect@body\@stepcompactitem}% |
| 3325 |
{\global\@ignoretrue} |
| 3326 |
\newenvironment{stepcompactenum}[1][0cm]{% |
| 3327 |
\bidipresl@addmargin{#1} |
| 3328 |
\bidipresl@collect@body\@stepcompactenum}% |
| 3329 |
{\global\@ignoretrue} |
| 3330 |
}{} |
| 3331 |
\newcommand\@steplist[2]{% |
| 3332 |
\ifthenelse{\boolean{bidipresl@pausestep}}{% |
| 3333 |
\ifbidipresl@inflipenv |
| 3334 |
\ClassError{bidipresentation}{% |
| 3335 |
flip* followed by step* environment does NOT work \MessageBreak |
| 3336 |
when the pausestep option is used}{% |
| 3337 |
Do not continue! Type <q> to stop and fix the nested list. |
| 3338 |
} |
| 3339 |
\else\ifbidipresl@indimenv |
| 3340 |
\ClassError{bidipresentation}{% |
| 3341 |
dim* followed by step* environment does NOT work \MessageBreak |
| 3342 |
when the pausestep option is used}{% |
| 3343 |
Do not continue! Type <q> to stop and fix the nested list. |
| 3344 |
} |
| 3345 |
\else |
| 3346 |
\begin{#1} |
| 3347 |
\ifbidipresl@inpausestepenv\else\let\bidipresl@origitem=\item\fi |
| 3348 |
\bidipresl@inpausestepenvtrue |
| 3349 |
\renewcommand{\item}{\pause\bidipresl@origitem}% |
| 3350 |
#2 |
| 3351 |
\end{#1} |
| 3352 |
\fi\fi |
| 3353 |
}{ |
| 3354 |
\ifbidipresl@inflipenv |
| 3355 |
\begin{#1} |
| 3356 |
\renewcommand{\item}{\bidipresl@flipstep\bidipresl@origitem} |
| 3357 |
#2 |
| 3358 |
\end{#1}% |
| 3359 |
\else\ifbidipresl@indimenv |
| 3360 |
\begin{#1} |
| 3361 |
\renewcommand{\item}{\dstep\bidipresl@origitem}% |
| 3362 |
#2 |
| 3363 |
\end{#1}% |
| 3364 |
\else\ifbidipresl@instepenv |
| 3365 |
\begin{#1} |
| 3366 |
\renewcommand{\item}{\bidipresl@step\bidipresl@origitem}% |
| 3367 |
#2 |
| 3368 |
\end{#1}% |
| 3369 |
\else |
| 3370 |
\liststepwise{% |
| 3371 |
\begin{#1} |
| 3372 |
\ifbidipresl@instepenv\else\let\bidipresl@origitem=\item\fi |
| 3373 |
\bidipresl@instepenvtrue |
| 3374 |
\renewcommand{\item}{\bidipresl@step\bidipresl@origitem}% |
| 3375 |
#2 |
| 3376 |
\end{#1}} |
| 3377 |
\fi\fi\fi |
| 3378 |
} |
| 3379 |
} |
| 3380 |
|
| 3381 |
\newcommand\@stepitem[1]{% |
| 3382 |
\@steplist{olditemize}{#1}} |
| 3383 |
\newcommand\@stepdesc[1]{% |
| 3384 |
\@steplist{olddescription}{#1}} |
| 3385 |
\newcommand\@stepenum[1]{% |
| 3386 |
\@steplist{oldenumerate}{#1}} |
| 3387 |
\ifthenelse{\boolean{bidipresl@eqlist}}{% |
| 3388 |
\newcommand\@stepeqlist[1]{% |
| 3389 |
\@steplist{oldeqlist}{#1}} |
| 3390 |
\newcommand\@stepcompacteqlist[1]{% |
| 3391 |
\@steplist{compacteqlist}{#1}} |
| 3392 |
}{} |
| 3393 |
\ifthenelse{\boolean{bidipresl@paralist}}{% |
| 3394 |
\newcommand\@stepcompactitem[1]{% |
| 3395 |
\@steplist{oldcompactitem}{#1}} |
| 3396 |
\newcommand\@stepcompactenum[1]{% |
| 3397 |
\@steplist{oldcompactenum}{#1}} |
| 3398 |
}{} |
| 3399 |
\newenvironment{compacteqlist}[1][0cm]{% |
| 3400 |
% \bidipresl@addmargin{#1} |
| 3401 |
\begin{eqlist}[\parsep0pt\itemsep0pt]}% |
| 3402 |
{\end{eqlist}} |
| 3403 |
\renewenvironment{enumerate}[1][0cm]{% |
| 3404 |
\bidipresl@addmargin{#1} |
| 3405 |
\begin{oldenumerate} |
| 3406 |
\ifbidipresl@instepenv |
| 3407 |
\renewcommand{\item}{\bidipresl@origitem}% |
| 3408 |
\fi |
| 3409 |
}% |
| 3410 |
{\end{oldenumerate}} |
| 3411 |
|
| 3412 |
\renewenvironment{itemize}[1][0cm]{% |
| 3413 |
\bidipresl@addmargin{#1} |
| 3414 |
\begin{olditemize} |
| 3415 |
\ifbidipresl@instepenv |
| 3416 |
\renewcommand{\item}{\bidipresl@origitem}% |
| 3417 |
\fi |
| 3418 |
}% |
| 3419 |
{\end{olditemize}} |
| 3420 |
|
| 3421 |
\renewenvironment{description}[1][0cm]{% |
| 3422 |
% \bidipresl@addmargin{#1} % Has no effect - FIXME |
| 3423 |
\begin{olddescription} |
| 3424 |
\ifbidipresl@instepenv |
| 3425 |
\renewcommand{\item}{\bidipresl@origitem}% |
| 3426 |
\fi |
| 3427 |
}% |
| 3428 |
{\end{olddescription}} |
| 3429 |
\ifthenelse{\boolean{bidipresl@paralist}}{% |
| 3430 |
\renewenvironment{compactenum}[1][0cm]{% |
| 3431 |
\bidipresl@addmargin{#1} |
| 3432 |
\begin{oldcompactenum} |
| 3433 |
\ifbidipresl@instepenv |
| 3434 |
\renewcommand{\item}{\bidipresl@origitem}% |
| 3435 |
\fi |
| 3436 |
}% |
| 3437 |
{\end{oldcompactenum}} |
| 3438 |
|
| 3439 |
\renewenvironment{compactitem}[1][0cm]{% |
| 3440 |
\bidipresl@addmargin{#1} |
| 3441 |
\begin{oldcompactitem} |
| 3442 |
\ifbidipresl@instepenv |
| 3443 |
\renewcommand{\item}{\bidipresl@origitem}% |
| 3444 |
\fi |
| 3445 |
}% |
| 3446 |
{\end{oldcompactitem}} |
| 3447 |
}{} |
| 3448 |
\endinput |
| 3449 |
%% |
| 3450 |
%% End of file `bidipresentation.cls'. |