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

new line not working in the text option in [] #23

Closed pchtsp closed 4 years ago

pchtsp commented 4 years ago

This did not work for me:

\usepackage[firstpageonly, text=PRELIMINARY\\VERSION]{draftwatermark}

This works:

\usepackage[firstpageonly]{draftwatermark}
\SetWatermarkText{PRELIMINARY\\VERSION}

According to the documentation the first one should work, right? I installed the package from the current github sources.

pchtsp commented 4 years ago

There was no error: the document never ended compiling. I have not tried it in a smaller example, though.

callegar commented 4 years ago

@pchtsp Hi, I think that the problem is not with draftwatermark, but with the way in which LaTeX manages package options. In fact, in the first case (the one not working) the string is passed via \usepackage, while the the second one (the one working correctly), you are explicitly using the package option-setting-command SetWatermarkText. My guess is that in the first case the issue occurs even before your text gets to draftwatermark. You may try to put your text in braces, but I do not really know if it can help here.

The draftwatermark manual tries to warn about it, see Sect. 2.1

[...], the parsing of options by the `\usepackage` command is a bit quirky, hence when specifying options with the
`<key>=<value>` syntax, some values that are accepted by `\DraftwatermarkOptions` may cause issues when specifying
options with `\usepackage`.

If you feel that this not in sufficient evidence, please consider opening a bug about the documentation.

pchtsp commented 4 years ago

hello @callegar. First of all: thanks for the package which, as I said ended up working correctly. And sorry for the overly short description.

I also tried with braces and it did not work either. I will open a bug for the documentation as you say for example 6.1.

Thanks again!

Franco