callegar / LaTeX-draftwatermark

The "draftwatermark" package extends LaTeX providing a means to add a textual, light gray watermark on every page or on the first page of a document. Typical usage may consist in writing words such as "DRAFT" or "CONFIDENTIAL" across document pages. The package may remind in some sense "draftcopy" by Dr. Juergen Vollmer, but its implementation is much lighter (as the reduced code footprint shows) and does not rely on postscript specials, making the package fully compatible with pdfLaTeX. The package depends on package "everypage" by the same author.
15 stars 6 forks source link

Watermark on selected pages #29

Closed anikfal closed 1 year ago

anikfal commented 1 year ago

Please give me a specific example of putting watermark on selected pages. The method to do so was not much clear in the documentation.

callegar commented 1 year ago

You really have multiple alternatives, depending on your needs:

  1. If you need to watermark only the 1st page, use firstpageonly when loading the package.
  2. If at some point in the text you realize that you need to start watermarking and at some later point you need to stop it, put some \DraftwatermarkOptions{stamp} and \DraftwatermarkOptions{nostamp} in your source at the points where you want to activate and deactivate the stamping of the watermark.
    • This is best if the need to activate and deactivate the watermark depends on your content (e.g. you have a section "foo" and you want it watermarked, however you do not know in advance from what page number this section will be typeset, e.g., because you still add stuff at the beginning of your document, or you plan changing the font size, etc.)
  3. If at some specific page numbers you want the watermark and not at others, you can include conditional expressions based on the page number in the watermark text. Namely, you redefine the watermark text using \DraftwatermarkOptions{text={.....}) and in the watermark text you include a conditional expression. For instance, you may use text={\ifodd\thepage ODD\else EVEN\fi} to put the watermark "ODD" on odd pages and the watermark "EVEN" on even pages. Alternatively, for more complex conditionals, you may want to use the ifthen package and then do things like text={\ifthenelse{\thepage=2}{HERE}{\relax}} (this will print the watermark only on page 2).

Hope this helps...