Adding watermarks to documents is common, especially in professional and academic publishing. In this blog post, we will explore the process of adding watermarks to LaTeX documents, providing step-by-step instructions and examples to help you effectively incorporate this feature into your work.
Watermarking in LaTeX using the “draftwatermark” Package
Watermarking in LaTeX can be easily achieved using the draftwatermark
package, which provides a set of commands to control various aspects of watermarking. This guide outlines the key commands and options for incorporating watermarks into your LaTeX documents.
Package Inclusion
Ensure that the draftwatermark
package is included in your LaTeX document. You can achieve this by adding the following line to the preamble.
\usepackage{draftwatermark}
Basic Watermarking Commands
The draftwatermark
package defines several commands for controlling watermarks. The most significant ones are:
\SetWatermarkAngle{}
: Sets the inclination angle of the watermark.\SetWatermarkScale{}
: Sets the scaling factor for the watermark.\SetWatermarkText{}
: Specifies the text or figure to be used as the watermark.
Example Usage:
\SetWatermarkAngle{45} % Set inclination angle to 45 degrees
\SetWatermarkScale{3.5} % Set scaling factor to 3.5
\SetWatermarkText{Electricalvoice.com} % Set text watermark to "Electricalvoice.com"
Watermarking Options
Watermark on All Pages
If you want the watermark to appear on all pages of your document, include the draftwatermark
package without any options as follows.
\usepackage{draftwatermark}
Watermark Only on the First Page
To restrict watermarking to the first page only, use the firstpage
option when loading the package as follows.
\usepackage[firstpage]{draftwatermark}
Textual and Pictorial Watermarks
Textual Watermarks
For text-based watermarks, directly specify the desired text as the argument of \SetWatermarkText{}
. For example:
\SetWatermarkText{electricalvoicelogo.png}
Pictorial Watermarks
Use a figure insertion command within \SetWatermarkText{}
for image-based watermarks. For example:
\SetWatermarkText{\includegraphics[width=10mm]{electricalvoicelogo.png}}
Example
Consider the following example: a textual watermark is added to the LaTeX document.
\documentclass{article}
\usepackage{lipsum}
\usepackage{draftwatermark}
\SetWatermarkAngle{45}
\SetWatermarkScale{2.5}
\SetWatermarkText{Electricalvoice.com}
\begin{document}
\lipsum[3-7]
\end{document}
Output
In the above example, lipsum
the package generates the dummy text in the document.
Consider the following example: a pictorial watermark is added to the LaTeX document.
\documentclass{article}
\usepackage{lipsum}
\usepackage{draftwatermark}
\SetWatermarkAngle{45}
\SetWatermarkScale{2.5}
\SetWatermarkText{\includegraphics[width=20mm]{electricalvoicelogo.png}}
\begin{document}
\lipsum[3-7]
\end{document}
Output