diff --git a/.gitignore b/.gitignore index 7ce1410..d9db294 100644 --- a/.gitignore +++ b/.gitignore @@ -1,109 +1,7 @@ -## Core latex/pdflatex auxiliary files: *.aux -*.lof +*.dvi +*.fdb_latexmk +*.fls *.log -*.lot -*.fls -*.out -*.toc - -## Intermediate documents: -*.dvi -*-converted-to.* -# these rules might exclude image files for figures etc. -# *.ps -# *.eps -# *.pdf - -## Bibliography auxiliary files (bibtex/biblatex/biber): -*.bbl -*.bcf -*.blg -*-blx.aux -*-blx.bib -*.brf -*.run.xml - -## Build tool auxiliary files: -*.fdb_latexmk -*.synctex.gz -*.synctex.gz(busy) -*.pdfsync - -## Auxiliary and intermediate files from other packages: - -# algorithms -*.alg -*.loa - -# amsthm -*.thm - -# beamer -*.nav -*.snm -*.vrb - -#(e)ledmac/(e)ledpar -*.end -*.[1-9] -*.[1-9][0-9] -*.[1-9][0-9][0-9] -*.[1-9]R -*.[1-9][0-9]R -*.[1-9][0-9][0-9]R -*.eledsec[1-9] -*.eledsec[1-9]R -*.eledsec[1-9][0-9] -*.eledsec[1-9][0-9]R -*.eledsec[1-9][0-9][0-9] -*.eledsec[1-9][0-9][0-9]R - -# glossaries -*.acn -*.acr -*.glg -*.glo -*.gls - -# hyperref -*.brf - -# listings -*.lol - -# makeidx -*.idx -*.ilg -*.ind -*.ist - -# minitoc -*.maf -*.mtc -*.mtc0 - -# minted -*.pyg - -# morewrites -*.mw - -# nomencl -*.nlo - -# sagetex -*.sagetex.sage -*.sagetex.py -*.sagetex.scmd - -# sympy -*.sout -*.sympy -sympy-plots-for-*.tex/ - -# todonotes -*.tdo - -# xindy -*.xdy +*.pdf +*.ps diff --git a/README.md b/README.md index 40e7f98..53e91f8 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,21 @@ \usepackage[onEveryPage]{coffee} ``` -For more fine grained controll, use the original commands: +Since version 6, there is a convenient command: +``` +\cofeBleed{alpha}{scale}{angle}{xoff}{yoff}{bleed}{variety} +``` +to place a `variety` type splash with random parameters on the +current page. There is now also a package option to put a bleeding +coffee throughout the pages like +``` +\usepackage[bleed]{coffee} +``` + +For more fine grained control, use the original commands: To place a coffee stain on a page, put one of the following commands -in the source code of the relevant page: +in the source code of the relevant page: ``` \cofeAm{alpha}{scale}{angle}{xoff}{yoff} @@ -38,13 +49,13 @@ the transparency factor $\in [0,1]$. The scale factor is `scale`, and the standard is `scale=1`. The angle is in degrees $\in [0,360]$. The position relative to the centre of the page is given by -x and y offsets `xoff and `yoff`. +x and y offsets `xoff` and `yoff`. ## Genesis -The latex-coffee package. +The latex-coffee package. by Hanno Rein, Cambridge University @@ -67,7 +78,7 @@ Adding more options and compatible with pdflatex -by Luis Randez, IUMA, University of Zaragoza +by Luis Randez, IUMA, University of Zaragoza http://pcmap.unizar.es/~pilar/ randez@unizar.es @@ -92,6 +103,17 @@ http://www.thp.uni-koeln.de/~ses/ +#### November, 2018 + +Added random \cofeBleed{} (requires ifthen) and bleed package option + +added to github + +by Anthony Mirand + +https://anthonymirand.github.io/ + + ## License MIT License, see LICENSE. diff --git a/coffee.sty b/coffee.sty index 618eca9..338fd5e 100644 --- a/coffee.sty +++ b/coffee.sty @@ -25,10 +25,16 @@ % by Sebastian Schmittner % http://www.thp.uni-koeln.de/~ses/ ses@thp.uni-koeln.de % +% November, 2018 +% Added: random bleeding splash \cofeBleed{} (requires ifthen) +% Added: package option to put random bleeding splash throughout pages +% by Anthony Mirand +% https://anthonymirand.github.io anthonypmirand@gmail.com +% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{coffee}[2014/12/17 Coffe Staints Version 5] +\ProvidesPackage{coffee}[2014/12/17 Coffe Staints Version 6] \RequirePackage{kvoptions} @@ -40,6 +46,7 @@ \SetupKeyvalOptions{family=coffee,prefix=coffee@} \DeclareBoolOption{onEveryPage} +\DeclareBoolOption{bleed} \ProcessKeyvalOptions*\relax @@ -542,4 +549,52 @@ }{} + +%generate bleeding cofe splash: +\newcommand{\cofeBleed}[7]{ +\pgfmathsetmacro{\alpha}{#1 - #7 * \value{depth}} +\pgfmathsetmacro{\scale}{#2} +\pgfmathsetmacro{\angle}{#3} +\pgfmathsetlengthmacro{\xoff}{#4} +\pgfmathsetlengthmacro{\yoff}{#5} +\pgfmathtruncatemacro{\variety}{#6} + +\ifthenelse{\variety<2}{ + \ifthenelse{\variety=0}{ + \cofeAm{\alpha}{\scale}{\angle}{\xoff}{\yoff} + }{ + \cofeBm{\alpha}{\scale}{\angle}{\xoff}{\yoff} + } +}{ + \ifthenelse{\variety=2}{ + \cofeCm{\alpha}{\scale}{\angle}{\xoff}{\yoff} + }{ + \cofeDm{\alpha}{\scale}{\angle}{\xoff}{\yoff} + } +} + +\addtocounter{depth}{1} +}%end bleed command + + + +\ifthenelse{\boolean{coffee@bleed}}{ +%bleed random splash across multiple pages: +\RequirePackage{eso-pic} + +\newcounter{depth}\setcounter{depth}{0} + +\pgfmathsetmacro{\alpha}{0.9 + 0.1 * rand} +\pgfmathsetmacro{\scale}{0.7 + 0.5 * rand} +\pgfmathsetmacro{\angle}{360 * rand} +\pgfmathsetlengthmacro{\xoff}{rand * 2cm} +\pgfmathsetlengthmacro{\yoff}{rand * 5cm} + +\pgfmathtruncatemacro{\variety}{4 * rand} +\pgfmathsetmacro{\bleed}{0.1 + 0.1 * rand} + +\AddToShipoutPicture{\cofeBleed{\alpha}{\scale}{\angle}{\xoff}{\yoff}{\variety}{\bleed}} +}{} + + \endinputdiff --git a/coffee.tex b/coffee.tex index 3a955ee..677ee50 100644 --- a/coffee.tex +++ b/coffee.tex @@ -1,5 +1,5 @@ \documentclass{article} -\usepackage[onEveryPage]{coffee} +\usepackage[bleed]{coffee} \usepackage{verbatim} @@ -54,6 +54,17 @@ \usepackage[onEveryPage]{coffee} \end{verbatim} +\medskip +Since version 6, you may also use +\begin{verbatim} +\cofeBleed{alpha}{scale}{angle}{xoff}{yoff}{bleed}{variety} +\end{verbatim} +to place a \texttt{variety} $\in [0,4]$ with random parameters on the current +page. There is now also a package option to put a bleeding coffee throughout the pages like +\begin{verbatim} +\usepackage[bleed]{coffee} +\end{verbatim} + \section{Copyright} You can freely distribute this package as I do not believe in imaginary property. All stains are self-made, photographed by myself, processed with gimp and traced with Inkscape.