# Conflict between xwatermark and exam class

I want to print a watermark in exam class in the following way as I don't want water mark in the foreground and with some opacity. As soon as I uncomment the \usepackage[printwatermark]{xwatermark} it gives the error:

! LaTeX Error: Command \lhead already defined.
! LaTeX Error: Command \lfoot already defined.
! LaTeX Error: Command \cfoot already defined.
! LaTeX Error: Command \lfoot already defined.


\documentclass{exam}
\usepackage[english]{babel}
\usepackage{tikz}

\usepackage[printwatermark]{xwatermark}
\newsavebox\mybox
\savebox\mybox{\tikz[opacity=0.1]\node{Sankhya};}
%\newwatermark*[
%  allpages,
% angle=60,
%  scale=12,
%  xpos=-30,
%  ypos=15
%]{\usebox\mybox}

\begin{document}

\begin{questions}

\question This is my first Question.

\question This is my second question

\end{questions}

\end{document}

• xwatermark loads fancyhdr and exam.cls defines precisely some of the commands which fancyhdr uses as well. Perhaps the background package is the better option here – user31729 Feb 18 '16 at 14:37

I fear xwatermark and exam.cls are really incompatible (unless a lot of redefinition occurs)

I switched to use the background package that can be used for watermarks etc. as well. Apply the placement= or position=... options to \backgroundsetup to shift the watermark.

\documentclass{exam}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{background}
\newsavebox\mybox
\savebox\mybox{\tikz[opacity=0.4]\node{Sankhya};}

\backgroundsetup{angle=60,contents={\usebox\mybox}}

\begin{document}

\begin{questions}

\question This is my first Question.

\question This is my second question

\end{questions}

\end{document}