XeLaTeX watermarking environment macro

I’m totally enjoying my switch from LaTeX to XeLaTeX, with all of the added benefits that entails. Over the years I’ve cobbled together and built a number of helpful macros so this will be my first of many posts to share them. Some may not be XeLaTeX specific, but as that’s the environment I use, many of them will not be fully LaTeX compatible.

The first entry is a simple watermarking system, it’s a slight modification of a script from Filox, an environment throughout which each page receives a watermark. just create a file named ‘watermark .png’, and put the macro in a file named ‘watermark.sty’.

Now I want another type of draft watermark I can use when circulating incomplete documents, so I alter that to put ‘DRAFT’ diagonally across the background. I put this into a file called ‘draft_watermark.sty’.

and now I can switch between the two identical environments by simply switching which style file is included, and I open and close the environment simple using the following syntax:

It’s a little hacky in the way it works, but I’ve used it without issue for quite a while. Enjoy.

Leave a Reply