rename \alpha ↦ \coffeealpha
See https://bugs.debian.org/958346
These macros are being renamed:
\alpha ↦ \coffeealpha
\angle ↦ \coffeeangle
\bleed ↦ \coffeebleed
\scale ↦ \coffeescale
\variety ↦ \coffeevariety
\xoff ↦ \coffeexoff
\yoff ↦ \coffeeyoff
Barak A. Pearlmutter
3 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 | % | |
33 | 45 | |
34 | 46 | |
35 | 47 | \NeedsTeXFormat{LaTeX2e} |
36 | \ProvidesPackage{coffee}[2014/12/17 Coffe Staints Version 6] | |
48 | \ProvidesPackage{coffee}[2020/04/21 Coffe Staints Version 7] | |
37 | 49 | |
38 | 50 | \RequirePackage{kvoptions} |
39 | 51 | |
515 | 527 | |
516 | 528 | %generate random cofe splash: |
517 | 529 | \newcommand{\cofeSplash}{ |
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} | |
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} | |
529 | 541 | }{ |
530 | \cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
542 | \cofeBm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
531 | 543 | } |
532 | 544 | }{ |
533 | \ifthenelse{\variety=2}{ | |
534 | \cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
545 | \ifthenelse{\coffeevariety=2}{ | |
546 | \cofeCm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
535 | 547 | }{ |
536 | \cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
548 | \cofeDm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
537 | 549 | } |
538 | 550 | } |
539 | 551 | |
551 | 563 | |
552 | 564 | %generate bleeding cofe splash: |
553 | 565 | \newcommand{\cofeBleed}[7]{ |
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} | |
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} | |
564 | 576 | }{ |
565 | \cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
577 | \cofeBm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
566 | 578 | } |
567 | 579 | }{ |
568 | \ifthenelse{\variety=2}{ | |
569 | \cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
580 | \ifthenelse{\coffeevariety=2}{ | |
581 | \cofeCm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
570 | 582 | }{ |
571 | \cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff} | |
583 | \cofeDm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff} | |
572 | 584 | } |
573 | 585 | } |
574 | 586 | |
583 | 595 | |
584 | 596 | \newcounter{depth}\setcounter{depth}{0} |
585 | 597 | |
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}} | |
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}} | |
596 | 608 | }{} |
597 | 609 | |
598 | 610 | |
599 | \endinput⏎ | |
611 | \endinput |