# Coffee package puts coffee stain behind pictures

The coffee package is great fun, however on documents with figures the coffee is placed behind the figures. It seems improper to do this on a printed version. How do I get my coffee on top of the figures?

MWE:

\documentclass{memoir}
\usepackage{graphicx}
\newsubfloat{figure}
\usepackage[onEveryPage]{coffee}
\begin{document}
\begin{figure}[htb]
\centering
\subbottom[A \label{fig:examplea}]{\includegraphics[width=0.4\columnwidth,height=20cm]{example-image-a}}
\hspace{0.1\columnwidth}
\subbottom[B\label{fig:exampleb}]{\includegraphics[width=0.4\columnwidth,height=10cm]{example-image-b}}
\caption{Example A and B}
\label{fig:examples}
\end{figure}
\end{document}


Which might produce this (the coffee spot is random):

• The “stains” are in the background layer. Jun 14, 2017 at 20:46
• @egreg but is it possible to get them on the front layer? Jun 14, 2017 at 20:47
• I don't doubt that it is possible. But as the coffee sty here hanno-rein.de/archives/349 doesn't know an "onEveryPage" option and as there is no coffee sty on CTAN, it is quite unclear which commands your version of the sty uses. Jun 14, 2017 at 21:07
• @UlrikeFischer It's an upgrade to the hanno-rein.de/archives/349 package from the github of Echsecutor: github.com/Echsecutor/coffee It's the coffe5 package (i renamed it when i put it in my folder) Jun 14, 2017 at 21:19

You can load the eso-pic yourself and then place the coffee stain:

\documentclass{memoir}
\usepackage{graphicx}
\newsubfloat{figure}
\usepackage{coffee}
\usepackage{eso-pic}
\begin{document}
\begin{figure}[htb]
\centering
\subbottom[A \label{fig:examplea}]{\includegraphics[width=0.4\columnwidth,height=20cm]{example-image-a}}
\hspace{0.1\columnwidth}
\subbottom[B\label{fig:exampleb}]{\includegraphics[width=0.4\columnwidth,height=10cm]{example-image-b}}
\caption{Example A and B}
\label{fig:examples}
\end{figure}
\end{document}


• If that's meant to be coffee, I'm sticking to tea ....
– cfr
Jun 15, 2017 at 0:46
• Will this solution put a random splash on every page? (the coffee5 class readjusts the size, location and rotation of all of the four coffee splashes n the original coffee class, and put's one on each page) Jun 15, 2017 at 0:50
• Why don't you simply try it out? Jun 15, 2017 at 7:11
• I'm sorry for being so slow at accepting your answer, I was writing my bachelors thesis and apparently I asked this question around 18 hours before deadline, so I had thrown it off my mind. Nov 14, 2017 at 21:51