Difference between revisions of "LaTeX/C3/Adding-a-Watermark-to-a-Document/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
Line 260: Line 260:
 
'''Assignment'''
 
'''Assignment'''
  
Add a watermark with:
+
Add a watermark using draftwatermark
 +
with:
 
* '''Text''': PRELIMINARY
 
* '''Text''': PRELIMINARY
 
* '''Color''': red
 
* '''Color''': red

Latest revision as of 16:27, 21 October 2025

Title of the Script: Adding a Watermark to a Document

Author: Ambika Vanchinathan

Keywords: LaTeX, Draftwatermark, watermark text, customized watermark, stamp, hpos, vpos, angle, color, text, DraftWatermarkOptions, video tutorial.


Visual Cue Narration
Slide 1

Title Slide

Welcome to the spoken tutorial on Adding a Watermark to a Document.
Slide 2

Learning Objectives

In this tutorial, we will learn to,
  • Create and customize watermarks using the draftwatermark package
  • Control watermark visibility on specific pages
  • Use the eso-pic package for watermarking over the images
Slide 3

System Requirements

To record this tutorial, I am using:
  • Linux Mint OS version 21.3
  • Texworks version 0.6.6
Slide 4

Pre-requisites

To follow this tutorial, learners should have basic knowledge of LaTeX.
Slide 5

Code files

The following code files are required to practice this tutorial:

1. draftwatermark-eg.tex

2. Free-Stock-Photos.jpg

The following code files are required to practice this tutorial.

These files are provided in the Code Files link of this tutorial page.

Let us get started.
Highlight:

\usepackage{draftwatermark}

This command imports the draftwatermark package.
Select XeLaTeX typesetting option from the dropdown.

Click the green Typeset button and show the output

Select XeLaTeX and click the green Typeset button to run the code.

Here is the output

Default watermark DRAFT is printed across all the pages

Comment line 7

uncomment line 8

Run the code and show the output

Let us comment line 7 and

uncomment line 8.

Let’s run the code.

The watermark is printed only on the first page.

Comment line 8

uncomment line 7, 12

Run the code

Highlight:

line 12

Comment line 8.

uncomment lines 7 and 12.

Run the code

Watermark Draftcopy is printed across all the pages.

Observe the options given in the \DraftwatermarkOptions command.

Comment line 12

uncomment line 27

Run the code and show the output

Cursor on the text keyword.

Cursor on the changed watermark.

Comment line 12.

uncomment line 27.

Run the code

text keyword in the command changes the watermark text.

Here the watermark changes to Sample.

uncomment line 28

Run the code and show the output

Uncomment line 28 and run the code.

color keyword changes the watermark colour.

Here it changes to blue

We can also use values like [gray]{0.5} or [rgb]{1, 0, 1}.

That is by name and its strength or with the rgb option.

For that we have to load \usepackage{xcolor} in the preamble.

uncomment line 29

Run the code and show the output

Uncomment line 29

Run the code

fontsize keyword changes the watermark’s fontsize.

uncomment line 30

Run the code and show the output

Uncomment line 30.

Run the code

Here is the output.

hpos keyword

changes the horizontal position of the watermark.

uncomment line 31

Run the code and show the output

Uncomment line 31

Run the code

Here is the output.

vpos keyword changes the vertical position of the watermark.

uncomment line 32

Run the code and show the output

Uncomment line 32

Run the code.

angle keyword in the command changes the angle of the watermark

Here it changes to 60 degrees.

uncomment line 33

Run the code and show the output

Uncomment line 33

Run the code

Stamp keyword is set to true or false.

Here false makes the watermark vanish from all the pages.

Comment line 33, 32, 31, 30, 29, 28, 27

uncomment line 34

Run the code and show the output

Highlight:

Highlight lines 27 to 33 and then Highlight line 34.

Highlight the text EduPyramids in the code.

Comment the lines 27 to 33.

Uncomment the line 34

Run the code.

Notice that all the options are given in a single line of code.

Here watermarking text is EduPyramids.

So far, the watermark has only appeared on the pages, but not on top of the image.

Now, let us see how to get the watermark on top of the image too.

Comment the lines 34 and 7 Comment the lines 34 and 7.
Uncomment the lines from 36 to 48 Uncomment the lines from 36 to 48.
Highlight line 36

Highlight lines 37 to 43

Highlight Line 46

In line 36, we load the eso-pic package.

We use this package to get a watermark on top of the images.

In lines 37 to 43 we define a new command called MyWatermark.

This command defines the watermark’s text colour to blue and the text to Confidential.

Line 46 instructs the compiler to ship out every page with the watermark on foreground.

Let’s run the code to see the output.

Cursor on the Output

Let us run the code

Now we see the watermark on the image too.

Watermarking it with blue colour and with the text Confidential.

Slide 6

Summary

In this tutorial, we have learnt to:

  • Create and customize watermarks using the draftwatermark package
  • Control watermark visibility on specific pages
  • Use the eso-pic package for watermarking over the images
With this we come to the end of this tutorial.

Let us summarise.

Slide 7

Assignment

Add a watermark using draftwatermark with:

  • Text: PRELIMINARY
  • Color: red
  • Font size: 3cm
  • Angle: 60 degrees
As an Assignment , add a watermark with the following attributes.
Slide 8

Thank you

Thank you for joining.

Contributors and Content Editors

Ketkinaina, Madhurig