Package list latex-coffee-stains / 9703fb9
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 2 years ago
1 changed file(s) with 53 addition(s) and 41 deletion(s). Raw diff Collapse all Expand all
3030 % by Anthony Mirand
3131 % https://anthonymirand.github.io anthonypmirand@gmail.com
3232 %
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 %
3345
3446
3547 \NeedsTeXFormat{LaTeX2e}
36 \ProvidesPackage{coffee}[2014/12/17 Coffe Staints Version 6]
48 \ProvidesPackage{coffee}[2020/04/21 Coffe Staints Version 7]
3749
3850 \RequirePackage{kvoptions}
3951
515527
516528 %generate random cofe splash:
517529 \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}
529541 }{
530 \cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
542 \cofeBm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff}
531543 }
532544 }{
533 \ifthenelse{\variety=2}{
534 \cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
545 \ifthenelse{\coffeevariety=2}{
546 \cofeCm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff}
535547 }{
536 \cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
548 \cofeDm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff}
537549 }
538550 }
539551
551563
552564 %generate bleeding cofe splash:
553565 \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}
564576 }{
565 \cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
577 \cofeBm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff}
566578 }
567579 }{
568 \ifthenelse{\variety=2}{
569 \cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
580 \ifthenelse{\coffeevariety=2}{
581 \cofeCm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff}
570582 }{
571 \cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff}
583 \cofeDm{\coffeealpha}{\coffeescale}{\coffeeangle}{\coffeexoff}{\coffeeyoff}
572584 }
573585 }
574586
583595
584596 \newcounter{depth}\setcounter{depth}{0}
585597
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}}
596608 }{}
597609
598610
599 \endinput
611 \endinput