I tried to adapt How to add “DRAFT” along the left/right margin? to have symmetrical "DRAFT"s along both margins, one running down the right margin, and one running down the left margin. Trying the obvious thing of using \backgroundsetup
twice doesn't work – only the second one is printed.
I tried an approach based on How do you add multiple watermarks?, but had trouble getting it to work.
Here is my code based on the approach described in
How to set two backgrounds?:
I tried replacing (0,0)
with current page.east
, but the watermark disappeared. How do I get something similar to the example in
How to set two backgrounds??
I'm open to other approaches to this.
\documentclass{article}
\usepackage{lipsum}
\usepackage{background}
\backgroundsetup{
angle=0,
opacity=1,
scale=3,
contents={%
\begin{tikzpicture}[remember picture,overlay]
\node[text=gray,rotate=-90,anchor=east, yshift=5mm] at (0,0) {DRAFT1};
\node[text=gray,rotate=90,anchor=west, yshift=5mm] at (0,0) {DRAFT2};
\end{tikzpicture}}
}
\begin{document}
\lipsum
\end{document}
Best Answer
You can use the tikzpagenodes package to easily access the textarea as a node.
Code
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 thancurrent 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:With this syntax, one can compute the position of a coordinate that runs vertically through
current page.west
and horizontally throughcurrent page text area.west
(black dot). Then one can use the midpoint of this position andcurrent page text area.west
to find the final position where the watermark will be placed (red dot).Code
Output