0

I want to have on each page a watermark which covers as well images. After solving a problem with the font I tried it now on one of my test documents.

My document has about 220 pgs, with several addtional packages. I need to compile it twice due to ToC. I am using LuaTeX 1.0.4 on a Linux machine. The duration for two pass compile is about 84 sec!!!

When I use the simple background package I have about 24 secs!!! (But doesn't cover images.)

I would guess the major diff between 84 sec and 24 sec is due to the usage of the ltxkeys package. Most likely it requires some additional runs.

I wouldn't have expected that watermarks causes that kind of speed penalty - if I want to place it over images. Are there other solutions available without that speed problem? E.g. options in xwatermark, ltxkeys, redefinition of command, different package or perhaps Luacode...

LeO
  • 1,451
  • 1
    I wouldn't use xwatermark. It uses the catoptions package and lots of special code which makes it very difficult to debug. – Ulrike Fischer Jun 17 '19 at 09:42

1 Answers1

2

I would use eso-pic to setup watermarks (screenshot compiled with lualatex):

\documentclass{article}
\usepackage{pdfpages,xcolor}
\usepackage{eso-pic}

\AddToShipoutPictureFG{\AtPageCenter{\rotatebox{45}{\makebox[0pt]{\fontsize{3cm}{3cm}\bfseries\textcolor{red}{DRAFT}}}}}

\begin{document}
\includepdf{example-image-a}
\end{document}

enter image description here

Ulrike Fischer
  • 327,261
  • 1
    With the combination of the package transparent it works great! Thx. – LeO Jun 17 '19 at 11:36
  • Just for the sake of completeness at the beginning of this year: eso-pic is automatically loaded with pdfpages. So there is no need to load it. – LeO Jan 04 '21 at 15:17
  • @LeO I know, but you can't write an answer "use eso-pic" and then hide its loading in a package needed only for the example. That is not very pedagogical. – Ulrike Fischer Jan 04 '21 at 15:22
  • Uhhh... I see now... For the \includepdf you need the pdfpages for the watermarks itself only the eso-pic is required. Thanx for your mother take care. – LeO Jan 04 '21 at 16:53