9

I am using draftwatermark package. Is there any option to exclude watermark from some specific pages? Say no watermark from pg 3-4. I can not use xwatermark package. It conflicts with the geometry package of my document. MWE:

\documentclass[12pt,a4paper]{exam}
\usepackage{draftwatermark} 
\usepackage{lipsum}  
\SetWatermarkAngle{45} 
\SetWatermarkLightness{.8} 
\SetWatermarkFontSize{10cm} 
\SetWatermarkScale{5} 
\SetWatermarkText{\tt{12345}}

\begin{document} 
\lipsum[1-20] 
\end{document}

3 Answers 3

3

You can define a command \watermarkoff that works like the one for the background package, and place it in the page you want to turn off.

Output

enter image description here

Code

\documentclass[12pt,a4paper]{exam}
\usepackage{draftwatermark}
\usepackage{etoolbox} 
\usepackage{lipsum}  
\SetWatermarkAngle{45} 
\SetWatermarkLightness{.8} 
\SetWatermarkFontSize{10cm} 
\SetWatermarkScale{5} 
\SetWatermarkText{\tt{12345}}

\makeatletter
\def\watermarkoff{%
        \@sc@wm@stampfalse
}
\makeatother


\begin{document} 
\lipsum[1-8]
\watermarkoff
\lipsum[9-12] 
\end{document}
2
  • hmmm, does not seem to be working if I use the watermark for included pdfs... thanks anyway.
    – CasperYC
    Nov 7, 2019 at 1:51
  • 3
    With TexLive 2020 I get this error message: ! Undefined control sequence.\watermarkoff ->\@sc@wm@stampfalse \watermarkoff
    – PascalS
    Dec 21, 2020 at 8:56
4

As the current documentation for draftwatermark at ctan says in section 2.1, one can use \DraftwatermarkOptions{stamp=false} anywhere in the document, which will turn off the watermark from there on.

Using \DraftwatermarkOptions{stamp=true} one can turn the watermarks on again.

2
  • 1
    Exactly what I was looking for!
    – Matteo
    Sep 19, 2021 at 13:42
  • 1
    This works and is easier than defining the new command. Based on the dates of the answers, I suspect this wasn't in the package functionality when the question was first asked.
    – kgrafton
    Feb 25, 2022 at 16:35
1

With package background you can select which pages don't show a default watermark. You must use command \NoBgThispage in every individual page.

\documentclass[12pt,a4paper]{exam}
\usepackage{lipsum}  
\usepackage{background}

\begin{document} 
\lipsum[1-8]
\NoBgThispage
\lipsum
\end{document}

enter image description here

3
  • 2
    Thanks for the response @Ignasi. I tried background package in my file. But it is showing error whenever I am inserting new page. Error is ! Undefined control sequence. \sc@everypage@hook...@watermark\oldbg@material l.44 \newpage Jan 23, 2016 at 8:51
  • Yeah, this example also did not work when using the draftwatermark package. This completely by-passes the draftwatermark package and just slaps its own "draft" watermark. It has no affect on the draftwatermark package and its configurations.
    – Code Doggo
    May 27, 2022 at 11:41
  • @CodeDoggo I don't understand the comment (and down vote?) My answer doesn't mention draftwatermark package at all. It only proposes an alternative solution to avoid watermarks in specific pages.
    – Ignasi
    May 27, 2022 at 14:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .