One option would be to use the background
package; to have the watermark appear on some pages, you can say something like
\documentclass{article}
\usepackage{background}
\usepackage{lipsum}
\begin{document}
\SetBgContents{}
\section{Test Section Without Draftwatermark}
\lipsum[1-12]
\section{Test Section With Draftwatermark}
\SetBgContents{Draft}
\lipsum[1-12]
\section{Test Section Without Draftwatermark}
\SetBgContents{}
\lipsum[1-12]
\end{document}
The background material (which can be almost anything you want (image, text) with control over the attributes (placement, color, scale, opacity, etc.) and, by default, "Draft" written diagonally, in red and in a large size) will appear on all the pages between \SetBgContents{Draft}
and the following \SetBgContenst{}
.
To have the watermark to appear only on selected pages, you can use the pages=some
package option and then use \BgThispage
on the page(s) you want the watermark to appear:
\documentclass{article}
\usepackage[pages=some]{background}
\usepackage{lipsum}
\begin{document}
\section{Test Section Without Draftwatermark}
\lipsum[1-12]
\section{Test Section With Draftwatermark}
\BgThispage
\lipsum[1-12]
\section{Test Section Without Draftwatermark}
\lipsum[1-12]
\end{document}
If the most recent version of the package is not available in your system, the line
\usepackage[pages=some]{background}
has to be replaced with
\usepackage[some]{background}
Here's an example that manually places the "Draft" mark only for section two:
\documentclass{article}
\usepackage{background}
\usepackage{lipsum}
\begin{document}
\SetBgContents{}
\section{Test Section Without Draftwatermark}
\lipsum[1-6]
\section{Test Section With Draftwatermark}
\backgroundsetup{contents=Draft,scale=4,position={2,-3.5},opacity=1}
\lipsum[1-6]
\section{Test Section Without Draftwatermark}
\backgroundsetup{contents=Draft,scale=4,position={2,-1.4},opacity=1}
\lipsum[1-3]
\SetBgContents{}
\lipsum[1-2]
\end{document}
You can use the tikzpagenodes package to easily access the textarea as a node.
Code
\documentclass{article}
\usepackage{tikz}
\usepackage{background}
\usepackage{tikzpagenodes}
\usepackage{lmodern}
\usepackage{lipsum}
\backgroundsetup%
{ angle=0,
opacity=1,
scale=1,
contents=%
{ \begin{tikzpicture}[remember picture,overlay, scale=3]
\fontsize{100}{120}\selectfont
\node[text=gray!50!red,rotate=90, above=1cm] at (current page text area.west) {DRAFT 1};
\node[text=gray!50!blue,rotate=-90, above=1cm] at (current page text area.east) {DRAFT 2};
\end{tikzpicture}
}
}
\begin{document}
\lipsum \lipsum
\end{document}
Output
Edit 1: You can also place the "Draft" watermarks automatically in the middle of the margin. I assume you want them to be centered at the text area rather than the page area. While for most cases it will be almost the same, I constructed an extreme case to show the differences.
Here, the top margin is only 5mm while the bottom margin is 90mm. This leads to current page.west
(orange dot) being at a much lower position than current page text area.west
(green dot). So if one simply computes the midpoint via the calc library's (A)!0.5!(B)
one arrives at a quite low postition (blue dot). To work around that, one can use a special syntax:
In general, the meaning of (p |- q) is “the intersection of a vertical line through p and a horizontal line through q.”
With this syntax, one can compute the position of a coordinate that runs vertically through current page.west
and horizontally through current page text area.west
(black dot). Then one can use the midpoint of this position and current page text area.west
to find the final position where the watermark will be placed (red dot).
Code
\documentclass{article}
\usepackage[inner=30mm, outer=50mm, top=5mm, bottom=90mm, twoside]{geometry}
\usepackage{tikzpagenodes}
\usepackage{background}
% for coordinate computations
\usetikzlibrary{calc}
% allows for arbitrarily large font sizes
\usepackage{lmodern}
% dummy text
\usepackage{lipsum}
\backgroundsetup%
{ angle=0,
opacity=1,
scale=1,
color=black,
contents=%
{ \begin{tikzpicture}[remember picture,overlay]
\fontsize{80}{108}\selectfont
% nodes for illustration purposes
\node[circle,minimum width=4mm,fill=green] (PTAW) at (current page text area.west) {};
\node[circle,minimum width=4mm,fill=orange] (PW) at (current page.west) {};
\node[circle,minimum width=4mm,fill=red] (BMW) at ($(current page text area.west -| current page.west)!0.5!(current page text area.west)$) {};
\node[circle,minimum width=4mm,fill=blue] (GMW) at ($(current page.west)!0.5!(current page text area.west)$) {};
\node[circle,minimum width=4mm,fill=black] (GW) at (current page text area.west -| current page.west) {};
% the watermarks
%\node[text=gray,rotate=90] at ($(current page text area.west -| current page.west)!0.5!(current page text area.west)$) {DRAFT 1};
\node[text=gray,rotate=-90] at ($(current page text area.east -| current page.east)!0.5!(current page text area.east)$) {DRAFT 2};
\end{tikzpicture}
}
}
\begin{document}
\lipsum \lipsum
\end{document}
Output
Best Answer
your example file is not usable but
http://www.pnas.org/site/misc/pnas-new.cls
suggests that
is what you are looking for.