Import upstream version 7+git20190313.1.9fd82c6
Debian Janitor
2 years ago
30 | 30 | % by Anthony Mirand |
31 | 31 | % https://anthonymirand.github.io anthonypmirand@gmail.com |
32 | 32 | % |
33 | % April, 2020 | |
34 | % To avoid stepping on it, rename \alpha ↦ \coffeealpha. | |
35 | % See https://bugs.debian.org/958346 | |
36 | % These macros are being renamed, for extra safety: | |
37 | % \alpha ↦ \coffeealpha | |
38 | % \angle ↦ \coffeeangle | |
39 | % \bleed ↦ \coffeebleed | |
40 | % \scale ↦ \coffeescale | |
41 | % \variety ↦ \coffeevariety | |
42 | % \xoff ↦ \coffeexoff | |
43 | % \yoff ↦ \coffeeyoff | |
44 | % | |
45 | 33 | |
46 | 34 | |
47 | 35 | \NeedsTeXFormat{LaTeX2e} |
48 | \ProvidesPackage{coffee}[2020/04/21 Coffe Staints Version 7] | |
36 | \ProvidesPackage{coffee}[2014/12/17 Coffe Staints Version 6] | |
49 | 37 | |
50 | 38 | \RequirePackage{kvoptions} |
51 | 39 | |
527 | 515 | |
528 | 516 | %generate random cofe splash: |
529 | 517 | \newcommand{\cofeSplash}{ |
530 | \pgfmathsetmacro{\coffeealpha}{0.5*rnd+0.2} | |
531 | \pgfmathsetmacro{\coffeescale}{0.7 + 0.5*rand} | |
532 | \pgfmathsetmacro{\coffeeangle}{360*rnd} | |
533 | \pgfmathsetlengthmacro{\coffeexoff}{rand*2cm} | |
534 | \pgfmathsetlengthmacro{\coffeeyoff}{rand*5cm} | |
535 | ||
536 | \pgfmathtruncatemacro{\coffeevariety}{4*rnd} | |
537 | ||
538 | \ifthenelse{\coffeevariety<2}{ | |
539 | \ifthenelse{\coffeevariety=0}{ | |
540 | \cofeAm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
518 | \pgfmathsetmacro{\alpha}{0.5*rnd+0.2} | |
519 | \pgfmathsetmacro{\scale}{0.7 + 0.5*rand} | |
520 | \pgfmathsetmacro{\angle}{360*rnd} | |
521 | \pgfmathsetlengthmacro{\xoff}{rand*2cm} | |
522 | \pgfmathsetlengthmacro{\yoff}{rand*5cm} | |
523 | ||
524 | \pgfmathtruncatemacro{\variety}{4*rnd} | |
525 | ||
526 | \ifthenelse{\variety<2}{ | |
527 | \ifthenelse{\variety=0}{ | |
528 | \cofeAm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
541 | 529 | }{ |
542 | \cofeBm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
530 | \cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
543 | 531 | } |
544 | 532 | }{ |
545 | \ifthenelse{\coffeevariety=2}{ | |
546 | \cofeCm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
533 | \ifthenelse{\variety=2}{ | |
534 | \cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
547 | 535 | }{ |
548 | \cofeDm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
536 | \cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
549 | 537 | } |
550 | 538 | } |
551 | 539 | |
563 | 551 | |
564 | 552 | %generate bleeding cofe splash: |
565 | 553 | \newcommand{\cofeBleed}[7]{ |
566 | \pgfmathsetmacro{\coffeealpha}{#1 - #7 * \value{depth}} | |
567 | \pgfmathsetmacro{\coffeescale}{#2} | |
568 | \pgfmathsetmacro{\coffeeangle}{#3} | |
569 | \pgfmathsetlengthmacro{\coffeexoff}{#4} | |
570 | \pgfmathsetlengthmacro{\coffeeyoff}{#5} | |
571 | \pgfmathtruncatemacro{\coffeevariety}{#6} | |
572 | ||
573 | \ifthenelse{\coffeevariety<2}{ | |
574 | \ifthenelse{\coffeevariety=0}{ | |
575 | \cofeAm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
554 | \pgfmathsetmacro{\alpha}{#1 - #7 * \value{depth}} | |
555 | \pgfmathsetmacro{\scale}{#2} | |
556 | \pgfmathsetmacro{\angle}{#3} | |
557 | \pgfmathsetlengthmacro{\xoff}{#4} | |
558 | \pgfmathsetlengthmacro{\yoff}{#5} | |
559 | \pgfmathtruncatemacro{\variety}{#6} | |
560 | ||
561 | \ifthenelse{\variety<2}{ | |
562 | \ifthenelse{\variety=0}{ | |
563 | \cofeAm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
576 | 564 | }{ |
577 | \cofeBm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
565 | \cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
578 | 566 | } |
579 | 567 | }{ |
580 | \ifthenelse{\coffeevariety=2}{ | |
581 | \cofeCm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
568 | \ifthenelse{\variety=2}{ | |
569 | \cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
582 | 570 | }{ |
583 | \cofeDm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
571 | \cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
584 | 572 | } |
585 | 573 | } |
586 | 574 | |
595 | 583 | |
596 | 584 | \newcounter{depth}\setcounter{depth}{0} |
597 | 585 | |
598 | \pgfmathsetmacro{\coffeealpha}{0.9 + 0.1 * rand} | |
599 | \pgfmathsetmacro{\coffeescale}{0.7 + 0.5 * rand} | |
600 | \pgfmathsetmacro{\coffeeangle}{360 * rand} | |
601 | \pgfmathsetlengthmacro{\coffeexoff}{rand * 2cm} | |
602 | \pgfmathsetlengthmacro{\coffeeyoff}{rand * 5cm} | |
603 | ||
604 | \pgfmathtruncatemacro{\coffeevariety}{4 * rand} | |
605 | \pgfmathsetmacro{\coffeebleed}{0.1 + 0.1 * rand} | |
606 | ||
607 | \AddToShipoutPicture{\cofeBleed{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff}{\coffeevariety}{\coffeebleed}} | |
586 | \pgfmathsetmacro{\alpha}{0.9 + 0.1 * rand} | |
587 | \pgfmathsetmacro{\scale}{0.7 + 0.5 * rand} | |
588 | \pgfmathsetmacro{\angle}{360 * rand} | |
589 | \pgfmathsetlengthmacro{\xoff}{rand * 2cm} | |
590 | \pgfmathsetlengthmacro{\yoff}{rand * 5cm} | |
591 | ||
592 | \pgfmathtruncatemacro{\variety}{4 * rand} | |
593 | \pgfmathsetmacro{\bleed}{0.1 + 0.1 * rand} | |
594 | ||
595 | \AddToShipoutPicture{\cofeBleed{\alpha}{\scale}{\angle}{\xoff}{\yoff}{\variety}{\bleed}} | |
608 | 596 | }{} |
609 | 597 | |
610 | 598 | |
611 | \endinput | |
599 | \endinput⏎ |