19 | 19 |
% http://nepsweb.co.uk/homeapr/
|
20 | 20 |
%
|
21 | 21 |
% December, 2014
|
22 | |
% Added random \cofeSplash{} (requires ifthen)
|
|
22 |
% Added: -random \cofeSplash{} (requires ifthen)
|
|
23 |
% -package option to put random splashes onEveryPage
|
23 | 24 |
% by Sebastian Schmittner
|
24 | 25 |
% http://www.thp.uni-koeln.de/~ses/ ses@thp.uni-koeln.de
|
25 | 26 |
%
|
26 | 27 |
|
|
28 |
|
|
29 |
\NeedsTeXFormat{LaTeX2e}
|
|
30 |
\ProvidesPackage{coffee}[2014/12/17 Coffe Staints Version 5]
|
|
31 |
|
27 | 32 |
\RequirePackage{kvoptions}
|
28 | 33 |
|
|
34 |
\RequirePackage{tikz}
|
|
35 |
|
|
36 |
\RequirePackage{ifthen}
|
|
37 |
|
|
38 |
|
29 | 39 |
\SetupKeyvalOptions{family=coffee,prefix=coffee@}
|
30 | 40 |
|
|
41 |
\DeclareBoolOption{onEveryPage}
|
|
42 |
|
31 | 43 |
\ProcessKeyvalOptions*\relax
|
32 | 44 |
|
33 | |
\RequirePackage{tikz}
|
34 | |
|
35 | |
\RequirePackage{ifthen}
|
36 | 45 |
|
37 | 46 |
\definecolor{coffee1}{rgb}{0.80784315,0.68627453,0.60392159}
|
38 | 47 |
\definecolor{coffee2}{rgb}{0.77254903,0.58039218,0.43921569}
|
|
500 | 509 |
%generate random cofe splash:
|
501 | 510 |
\newcommand{\cofeSplash}{
|
502 | 511 |
\pgfmathsetmacro{\alpha}{0.5*rnd+0.2}
|
503 | |
\pgfmathsetmacro{\scale}{1.0 + 0.5*rand}
|
|
512 |
\pgfmathsetmacro{\scale}{0.7 + 0.5*rand}
|
504 | 513 |
\pgfmathsetmacro{\angle}{360*rnd}
|
505 | 514 |
\pgfmathsetlengthmacro{\xoff}{rand*2cm}
|
506 | 515 |
\pgfmathsetlengthmacro{\yoff}{rand*5cm}
|
507 | 516 |
|
508 | 517 |
\pgfmathtruncatemacro{\variety}{4*rnd}
|
509 | 518 |
|
510 | |
\ifthenelse{\variety=0}{
|
511 | |
\cofeAm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
|
|
519 |
\ifthenelse{\variety<2}{
|
|
520 |
\ifthenelse{\variety=0}{
|
|
521 |
\cofeAm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
|
|
522 |
}{
|
|
523 |
\cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
|
|
524 |
}
|
512 | 525 |
}{
|
513 | |
\ifthenelse{\variety=1}{
|
514 | |
\cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
|
|
526 |
\ifthenelse{\variety=2}{
|
|
527 |
\cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
|
515 | 528 |
}{
|
516 | |
\ifthenelse{\variety=2}{
|
517 | |
\cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
|
518 | |
}{
|
519 | |
\cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
|
520 | |
}
|
|
529 |
\cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
|
521 | 530 |
}
|
522 | 531 |
}
|
523 | 532 |
|
524 | |
}
|
525 | |
|
|
533 |
}%end splash command
|
|
534 |
|
|
535 |
|
|
536 |
|
|
537 |
\ifthenelse{\boolean{coffee@onEveryPage}}{
|
|
538 |
%put splashes on every page:
|
|
539 |
\RequirePackage{eso-pic}
|
|
540 |
\AddToShipoutPicture{\cofeSplash{}}
|
|
541 |
}{}
|
|
542 |
|
|
543 |
|
|
544 |
\endinput⏎
|