4

This question already has an answer here:

I'm writing a document but now I'm just in the beginning of it, it's a draft phase. I already know the section names and how many pages each section will spam, i.e. \section{Intro} should have up to 3 pages. After that comes \section{Objectives}.

I would like to put a watermark and reserve the 3 pages for the Intro. Below is something I tried:

\documentclass[12pt]{article}

\usepackage[brazil]{babel} 
\usepackage{lineno,xcolor}
\usepackage[printwatermark]{xwatermark}

\begin{document}

\section{Intro}

\newwatermark[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}

\newpage~
\newpage~
\newpage~

\section{Objectives}

This section contain only this text. It is not a draft and should not have the watermark.

\end{document}

But the watermark goes over the next section. Is it possible to watermark only a section?

marked as duplicate by CarLaTeX, Stefan Pinnow, egreg, Mico, Mensch Feb 28 '17 at 15:23

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Please complete your example so we can compile it. Not much point answering without knowing the class, at the very least. – cfr Feb 27 '17 at 1:51
  • 1
    Please edit to provide a complete example. Have you looked at any of the packages you've tagged this with? This does not seem engine specific, though. – cfr Feb 27 '17 at 2:36
  • Question edited. May I add something else? – KcFnMi Feb 27 '17 at 3:13
  • 1
    You can edit again. Is that what you mean? Is there an option other than allpages? That seems not likely to do what you want! – cfr Feb 27 '17 at 4:13
1

Directly for xwatermark package documentation, p. 4:

The boolean options firstpage, lastpage, allpages, firstpage, oddpages and evenpages, which specify the pages that should receive watermarks, may be replaced by any of the options page=x, pages=x-y, pagex={x,y,z}, where `x', etc., stand for any page number.

Let me know if this is what you're looking for.

\documentclass[12pt]{article}

\usepackage[brazil]{babel} 
\usepackage{lineno,xcolor}
\usepackage[printwatermark]{xwatermark}

\begin{document}

    \section{Intro}

    \newwatermark[pages=1-3,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}% <-- watermark only for pages 1, 2 and 3

    \newpage~
    \newpage~
    \newpage~

    \section{Objectives}

    This section contain only this text. It is not a draft and should not have the watermark.

\end{document}

Edit:

You can set \xwmwatermarkoff if you don't want to specify the pages, see this answer:

\documentclass[12pt]{article}

\usepackage[brazil]{babel} 
\usepackage{lineno,xcolor}
\usepackage{xwatermark}

\begin{document}

    \section{Intro}

    \newwatermark[allpages=true,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT}% <-- watermark only for pages 1, 2 and 3

    \newpage~
    \newpage~
    \newpage~

    \section{Objectives}
    \xwmwatermarkoff
    This section contain only this text. It is not a draft and should not have the watermark.

\end{document}

Page 1 (also page 2 and 3 have the watermark):

enter image description here

Page 4 without watermark:

enter image description here

  • The undesirable effect I see with this approach is that pages are fixed. I would like to specify the section Intro is a draft no matter which is the page number, i.e. – KcFnMi Feb 28 '17 at 12:07
  • @KcFnMi Have you look at my edit? – CarLaTeX Mar 7 '17 at 18:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.