This is to show you another option with powerful background
package. Just adding \usepackage{background}
will add the the Draft
text.
\documentclass{article}
\usepackage{background}
\usepackage{lipsum}%used to generate false content
\begin{document}
%starts page numbers at i
\pagenumbering{roman}
NOTICES:\par
\lipsum[1-2]
\clearpage
\tableofcontents
\clearpage
\listoffigures
\clearpage
%starts page numbers at 1
\pagenumbering{arabic}
\section{Demo Section}
\lipsum[1-2]
\subsection{Demo Subsection}
\lipsum[1-2]
\subsubsection{Demo Subsubsection}
\lipsum[1-2]
%includes figure in list of figures
\begin{figure}[h]
\includegraphics[width=.5\linewidth]{PlaceHolder}
\centering
\caption{Demo Graphic}
\label{fig:figure1}
\end{figure}
\end{document}
You can customize the background contents with \backgroundsetup
\backgroundsetup{
scale=15,
color=gray!40,
angle=45,
opacity=1,
contents= {Draft}
}
contents=
can be anything like a tikzpicture
or any picture/text.
If you don't want the background for just one page like title page
, use \NoBgThispage
in that page.
%\thispagestyle{empty}
\NoBgThispage
This is the title page
\clearpage
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
The problem is due to the fact that I was using the additional package
Removing this line solves the problem.
So if the packages
printwatermark
andxwatermark
are used, thebackground
package should not be.