xwatermark 与 exam class 冲突

xwatermark 与 exam class 冲突

我想以以下方式在课堂上打印水印,exam因为我不希望水印在前景中并且具有一定的不透明度。一旦我取消注释,它\usepackage[printwatermark]{xwatermark}就会出现错误:

! LaTeX Error: Command \lhead already defined.
! LaTeX Error: Command \chead already defined.
! LaTeX Error: Command \rhead already defined.
! LaTeX Error: Command \lfoot already defined.
! LaTeX Error: Command \cfoot already defined.
! LaTeX Error: Command \lfoot already defined.
! LaTeX Error: Command \rhead 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}

答案1

我担心xwatermark并且exam.cls确实不相容(除非发生大量的重新定义)

我转而使用background可用于水印等的包。应用placement=position=...选项来\backgroundsetup移动水印。

\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}

在此处输入图片描述

相关内容