The draftwatermark
package implements a few simple commands for adding watermarks to documents. It provides some flexibility that is sufficient in most cases.
A basic example:
\usepackage{draftwatermark} \SetWatermarkText{Confidential} \SetWatermarkScale{5}
The following 5 properties of a watermark can be modified through commands defined by the package.
Text (default DRAFT):
The following command controls the watermark text:
\SetWatermarkText{Confidential}
To change the text style, e.g. to small capitals, use:
\SetWatermarkText{\textsc{Confidential}}
Color (default 80% gray):
The color is modified through the following command:
\SetWatermarkColor[rgb]{1,0,0}
To change the color to another gray-level, use:
\SetWatermarkColor[gray]{0.5}
The color
package is automatically loaded with draftwatermark
.
Font size (default 5cm (max)):
Changing the font size is decreased as follows:
\SetWatermarkFontSize{2cm}
Scale (default 1.2):
To get a watermark across the whole page, you probably want to set scale to a value somewhere around five.
\SetWatermarkScale{5}
Angle (default 45°):
The text can be rotated to another angel using:
\SetWatermarkAngle{30}
Package options:
The package includes options to control the placement. For a watermark on the first page only, use:
\usepackage[firstpage]{draftwatermark}
The option nostamp
will suppress any watermark.
\usepackage[nostamp]{draftwatermark}
Documentation:
Link to the draftwatermark package documentation.
Example:
\documentclass[11pt]{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{draftwatermark} \SetWatermarkText{Confidential} \SetWatermarkScale{5} \SetWatermarkColor[rgb]{0.7,0,0} \begin{document} \blindtext[10] \end{document}
A code-based, but certainly more flexible approach was described by Filox on his blog.
It’s a really good tip, but I have a question.
How can I add a image watermark?.
I need to make a template letter for company, but need the logo behind the text.
Thank you for your posts.
Best regards.
Hi Thanatos,
Thanks for that question. Yes, you can add an image instead of text using
includegraphics
:The
graphicx
package is required bydraftwatermark
and therefore, you won’t need to load it again.Best, Tom.
Reblogged this on g3t conn3ct3d and commented:
Nice post, just rebloging
Dear Tom, Thanks for this.
Could you please help me What command should i use in order to place text message i.e. “Under Review” in the every page background in my IEEE survey paper.
Thanks and Regards
Sarvesh
(Moved here by Tom.)
Hi Sarvesh,
The
draftwatermark
package (documentation) would be one way to add watermarks. Here is some sample code to play with:Cheers,
Tom.
Dear Tom,
Today i have tried these code:
Draft is appearing for every pages but while compiling it was showing following types of Latex Warning and so failed to display all my tables and figures.
LaTex Warning: Reference ‘table:nonlin’ on page 1 undefined on input line 168.
! Too many }’s.
\color@endbox ->\color@endgroup \egroup
1.99 \end{table}
?
Please help me to short out the above mention problems.
With regards
Sarvesh
Hi Sarvesh,
You probably just have to make sure you get the number of curly brackets right. Count how many you opening and closing brackets. It seems that you don’t need the last two “}”, just try.
Also you seem to reference a table that has either no label or the spelling is different (warning).
I will move your comments to a post where they seem to fit and block comments for this page. This is to benefit others who are having the same or similar problems.
Best, Tom.
Hi Tom, Your blog is awesome!!!
When I was compiling my water.tex, I get this error:
“Undefined control sequence”
The mistake is in this line:
I don’t know why? I have read through Google, but I haven’t found any answer. Well, Here is my source code for water.tex
Greetings
Hi Raul,
Thanks for your command and the minimum working example. Running the code does not produce an error in my editor though. I suspect you don’t have the latest version of the package. According to the documentation colored watermarks were only added at the beginning of this year (Jan 2012). I suggest updating your LaTeX distribution.
Let me know if that didn’t help.
Best, Tom.
Hi Tom!
I didn’t read the documentation, but in your comment, I can see the date of the update (Jan 2012). I think that’s my problem. I’m using Debian GNU/Linux, sqeeze. I’m going to try update my packages manually because with a ‘apt-get update’ doesn’t find any update.
Thanks for your rapid answer.
Greetings from Mexico
Hi Raul,
Hope updating you distribution / the package will fix the problem. Good luck!
Tom.
Hi,
I tried to use this package with a “letter” class (actually “lettre”) instead of an “article” class but it did not work.
Any idea to solve the problem?
Thanks!
Lan
Hi there,
There seems to be a problem indeed. The class
lettre
somehow uses a different page layout. I can see the watermark, but its shifted to the top-right corner. It works with theletter
documentclass, so maybe you want to consider changing documentclass. I will get back to you if I can think of any work-around.Cheers, Tom.
Thanks, really helpful and easy to implement!
Great, thanks for your comment!
Dear Sir Tom Could u pls tell me how how to make latex to make use of entire page,I mean it is leaving some space at the bottom of every page and I was not able to fill it up.I had even kept \pagebreak after 6-7 lines (the space is such that 6-7 lines could fit in it.Even then it is writing only those 6-7 lines in another new page and remaining in another page(3rd).
How can I avoid this
Thanks for your request. If you are not satisfied with the margins defined by default, you can change these through the geometry package.
Hi,
How could I make the draft note start from,say, page 3 or show only at odd pages or some specific pages?
Thanks
Hi Panha,
Thanks for your question. In the example below, the watermark is only printed on odd pages greater 1. With that, you should be able derive the two scenarios you were interested in.
Best wishes,
Tom
Great code, thanks! I’m trying to fit “Under Review: do not cite or copy without author’s permission”, is there a way to do a line break? \\ doesn’t seem to work…
Hi Alejandro
Thanks, that’s an interesting question. The draftwatermark package has some limitations. Below is a possible solution using background. Just ask if you need help with the code. I adapted the code from here.
Hey Tom
How do i put a watermark on top of pictures, mine goes below them.
Hi Gonzos,
Thanks for your question. It seems this is not possible with the package discussed in the article. However, the xwatermark package provides that functionality. See here for more details.
Best, Tom
Thanks Tom, this is very beautiful! Just got my problem solved in a second
Great to hear. Thanks for the feedback. Best, Tom.
Can this package also make the watermark stay on top of images?
Hi LN,
Thanks for your question. You can’t do that with the
draftwatermark
package. However, the xwatermark package provides a starred version of thenewwatermark
macro that prints the watermark on top of the regular content. Here’s an example:true, however the xwatermark package suppresses the watermark from all the pages after the toc, if the line \pagenumbering{gobble} is used in the toc section (page numbering suppression). I would highly appreciate a work around in that regards. I would like to use xwatermark with page numbering suppression in the toc
Hi Tom. I solved the problem by using ‘background’ package. Thank you
Thanks for following up with the solution that worked for you. Best, Tom
Is it possible to do multi line water mark?
For example
Line 1: ” Draft document”
Line 2: ” Confidential”
Hi Sam,
The
\parbox
macro adds line breaks. However, the behavior seems a little unpredictable. I included a reasonably looking example below.Best, Tom
try
\SetWatermarkText{\shortstack{Line1\\Line2}}
Best, Rainer