1

I am working on repeating a watermark as answered here. Using that approach I find the drawn background always appears below images added using \includegraphics. Take the following document:

\documentclass{scrartcl}
\usepackage{background}
\usepackage{lipsum}

\backgroundsetup{
  color=red,
  angle=45,
  opacity=.8,
  contents={\large{Hellow World}}
}

\begin{document}
\lipsum[1-2]
\begin{center}
\includegraphics[width=5cm]{wikimedia}
\end{center}
\lipsum[2]
\end{document}

Rendering a PDF with tectonic works but the image added always appears on top:rendered PDF with graphic clobbering watermark text

Is there a way to configure background package or another setting so that the Hello World text below always appears on top of everything in the document? I do realize that the name of the package suggests otherwise.

Or should I invest more time solving this with KOMA Script's scrlayer-scrpage or another alternative?

2

Well the background package uses the everypage package, at this package is only about adding background material.

I personally prefer to use the eso-pic package (also because background uses a tikzpicture which makes it difficult to use them in the material). But if you want to stay with background you could try to tweak background:

\documentclass{scrartcl}
\usepackage{background}
\usepackage{lipsum}
\usepackage{eso-pic}
\makeatletter
\let \AddEverypageHook \AddToShipoutPictureFG
\renewcommand\AddThispageHook{\AddToShipoutPictureFG*}
\ifbg@some
  \AddThispageHook{}
\else
  \AddEverypageHook{\bg@material}
\fi
\makeatother

\backgroundsetup{
  color=red,
  angle=45,
  opacity=.8,
  contents={\large{Hellow World}},
}

\begin{document}
\lipsum[1-2]
\begin{center}
\includegraphics[width=5cm]{example-image-duck}
\end{center}
\lipsum[2]
\end{document}

enter image description here

| improve this answer | |
  • Interesting! Something eso-pic can do that everypage cannot. – John Kormylo Aug 4 '19 at 18:17
  • Thank you for the answer and working example. How would you achieve the layered text using eso-pic directly without using background? – efx Aug 5 '19 at 18:27

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.