Add a watermark in LaTeX (draftwatermark)
Load the draftwatermark package. It prints the word DRAFT in light gray across every page, at an angle of 45 degrees; the option text or \SetWatermarkText changes the word.
A text watermark on every page
The default font size is a quarter of the paper width, which fits a word of five letters. The standard Computer Modern fonts stop at about 25 pt, so load a font that scales to any size, such as lmodern; without it the watermark comes out much too small.
This goes into the preamble.
\usepackage{lmodern}
\usepackage[text=DRAFT]{draftwatermark}Text, size, colour and angle
\DraftwatermarkOptions takes the same keys as the package: text, fontsize, color, angle (in degrees) and scale. A colour mix such as red!30 needs the xcolor package.
This goes into the preamble.
\usepackage{lmodern}
\usepackage{xcolor}
\usepackage{draftwatermark}
\DraftwatermarkOptions{text=CONFIDENTIAL, fontsize=2cm, color=red!30, angle=45}Only on the first page
The package option firstpageonly limits the watermark to page 1. It can only be given when the package is loaded.
This goes into the preamble.
\usepackage{lmodern}
\usepackage[firstpageonly, text=COPY]{draftwatermark}An image as watermark
The text can be any content, also \includegraphics. Set the angle to 0 so the image stays upright. The package does not make the image lighter; use a pale image file.
This goes into the preamble.
\usepackage{graphicx}
\usepackage{draftwatermark}
\DraftwatermarkOptions{text={\includegraphics[width=8cm]{logo.png}}, angle=0}Pitfalls
- The class option
draft, as in\documentclass[draft]{article}, adds no watermark. It marks lines that are too wide with a black bar, andgraphicxthen prints a frame with the file name in place of every image. - The package option
finalswitches the watermark off without removing the settings.
Compiled with pdfLaTeX from TeX Live 2023.
Related pages
- Package
draftwatermark - Package
xcolor - Package
lmodern - How-to Insert an image in LaTeX
- How-to Headers and footers in LaTeX
- Package
graphicx