0

I want to place my image as a watermark at every page. Here's what I do in preamble:

\backgroundsetup{
    scale=1.5,
    angle=0,
    firstpage = true, 
    opacity=0.1, 
    contents = {
        \begin{tikzpicture}
            \node at ([yshift = 0pt, xshift = 0pt] current page.center){
                \includegraphics{shkolkovoLogo}
            }
        \end{tikzpicture}
    }
}   

which gives me this:

pic1

But I have two problems:

  1. As soon as I have done it I saw this in my log

pic2

Strange thing, because everything was okay until I placed this watermark.

  1. The watermark's opacity on the first page is somehow greater than on the others. Here's a photo of the first page

pic3

as you can see it's a bit different than what is shown on the very first picture. What could be the reason of these things happen? Thank you in advance!

MWE, but it has a lot of errors on the last line

\documentclass{article}
\usepackage{background}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{lipsum}
\usepackage{graphicx}

\backgroundsetup{
    scale=1.5,
    angle=0,
    firstpage = true, 
    opacity=0.1, 
    contents = {
        \begin{tikzpicture}
            \node at ([yshift = 0pt, xshift = 0pt] current page.center){
                \includegraphics{example-image-duck};
            }
        \end{tikzpicture}
    }
}  

\begin{document}
    \lipsum[1-150]
\end{document}
6
  • well read the error message: you forgot a semicolon at the end of the node. (I wouldn't use the background package and a tikzpicture to insert a simple graphic, you can do that directly with the shipout/background hook, see e.g tex.stackexchange.com/a/604943/2388). Sep 19 at 13:55
  • I tried to place semicolon, but it doesn't change anything. I saw the link you added, but unfortunately I don't really understand how to do it. Would you be so kind to explain what does this shipout/background do and how to use it? Sep 19 at 14:21
  • sorry but you didn't provide a small but complete example. Sep 19 at 14:30
  • Example of code? Sep 19 at 14:43
  • Did you add the semicolon after \node at ([yshift = 0pt, xshift = 0pt] current page.center){ \includegraphics{shkolkovoLogo} } ;? It is also possible that some errors stem from other parts of your document. You should always provide a minimal working example (MWE) that starts with \documentclass and ends with \end{document} so that others can compile it. Sep 19 at 15:09

1 Answer 1

1
\documentclass{article}
\usepackage{background}
\usepackage{tikz}
\usepackage{lipsum}

\backgroundsetup{
scale=1.5,
angle=0,
firstpage=true,
opacity=0.1,
contents={
\begin{tikzpicture}
\node at ([xshift=0pt, yshift=0pt] current page.center){\includegraphics{example-image-duck}};
\end{tikzpicture}
}}
\begin{document}
\lipsum[1-5]
\end{document}

Page with text and background image

Edit: For me it seem that there is a bug in the background package. In the documentation it says:

firstpage= This boolean option allows the user to specify, setting the value true, that the background material must be displayed only in the first page of the document. The deafulat value is false.

What really happens is that the material is placed on all pages independent of this option. -and It seems that the material is placed twice on the first page, if the option is true. -making the first page less opaque.

In your case, you can just keep the option with the default false like this:

\documentclass{article}
\usepackage{background}
\usepackage{lipsum}
\backgroundsetup{
scale=1.5,
angle=0,
contents={\includegraphics{example-image-duck}}
}
\begin{document}
\lipsum[1-150]
\end{document}
2
  • Thank you very much! I feel so stupid that I just put the semicolon the wrong place... But do you have any idea why opacity on the first page is different compare to other pages? Sep 19 at 15:46
  • Thank you very much, that really helped me a lot! Sep 19 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.