14

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): enter image description here

4

1 Answer 1

7

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

\documentclass{memoir}
\usepackage{graphicx}
\newsubfloat{figure}
\usepackage{coffee}
\usepackage{eso-pic}
\AddToShipoutPictureFG{\cofeSplash{}}
\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}

enter image description here

4
  • 6
    If that's meant to be coffee, I'm sticking to tea ....
    – cfr
    Commented Jun 15, 2017 at 0:46
  • 1
    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) Commented Jun 15, 2017 at 0:50
  • 1
    Why don't you simply try it out? Commented 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. Commented Nov 14, 2017 at 21:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .