Featured Post

We've moved to tex.my!

It’s been great writing on Blogger.com, but we’ve decided to move to a new platform, thanks to some valuable help from a great, great friend...

Friday, August 24, 2012

Putting Dates in Watermarks

It’s been rather a long time sine I last posted anything as I’ve been working on my thesis and article… sorry!

Theses and articles typically go through many versions, ding-dong to-and-fro between supervisors and co-authors. Some people keep track of the version number (or date-last-modified) by giving each draft a different file name. Personally, though, I tend to get inconsistent with the file naming, especially when it's 2:30am. So I figured it might work better for me if the date-last-modified was printed in the PDF of the thesis/article draft itself.

One could always put the date in the header or footer, but there might already be some content in those regions. Besides, it's probably not a good idea to mess with the formattings for a journal article. Instead, I put \today in a watermark, so the date would get updated I compile my draft:

\usepackage{draftwatermark}
\usepackage{datetime}
\ddmmyydate
\SetWatermarkLightness{.9}
\SetWatermarkText{Draft\string@\today}
\SetWatermarkScale{.6}

The colour, lightness, font and other attributes of the watermark are configurable. I also used the datetime package to configure the date formatting. Here’s how the output looks like (a page from my thesis draft):