About these ads

Classic coffee stains with LaTeX

Probably not for your thesis, but nevertheless worth checking out: Hanno Rein wrote the LaTeX Coffee Stains package which adds beautiful coffee stains to documents.

Usage (coffee4)

\usepackage{coffee4}
...
\cofeAm{alpha}{scale}{angle}{xoff}{yoff}
\cofeBm{alpha}{scale}{angle}{xoff}{yoff}
\cofeCm{alpha}{scale}{angle}{xoff}{yoff}
\cofeDm{alpha}{scale}{angle}{xoff}{yoff}

Stains

  • cofeAm: 270° circle stain (see example above)
  • cofeBm: 60° circle stain
  • cofeCm: two splashes, light color
  • cofeDm: colorful twin splash (see example below)

Parameters

  • alpha: transparency factor [0,1]
  • scale: scale factor (default: 1)
  • angle: angle in degrees
  • xoff: horizontal placement
  • yoff: vertical placement

Some sample code

\documentclass{article}
\usepackage{blindtext}
\usepackage{coffee4}
\begin{document}
\cofeAm{1}{1}{90}{5.5cm}{5.5cm}
\Blindtext
\cofeDm{0.5}{0.2}{0}{3cm}{3cm}
\blindtext
\end{document}

I had to typeset the document twice for the stains to appear. Also, drawing the stains may take a few seconds.

Check out the website for more details and the latest version of the package. The version used to generate the examples above can be downloaded here (coffee4). Coffee4 works with pdfLaTeX and provides more flexibility in terms of size of the stains and placement.

About these ads

8 Responses to “Classic coffee stains with LaTeX”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 745 other followers

%d bloggers like this: