12

I am using MikTeX with PDFLaTeX and it has worked fine. After an update if MikTeX xwatermark throws an error:

! Extra \endgroup. 
\document ->\endgroup 
\let \BeforeStartOfDocument \@firstofone \cpt@beforest... 
l.5 \begin{document} 
Things are pretty
mixed up, but I think the worst is over.

Test tex file:

\documentclass{article}

\usepackage{xwatermark}

\begin{document}
Text
\end{document}

But as I understand it Xwatermark has not been updated since 2012!? What could be producing the error?

3

2 Answers 2

5

This issue was happening with many packages. Apparently the catoptions package does not work with some of the last versions of latex, and so any package depending on it. This should be solved in the last versions, though. However, many distributions will not ship them for a while. I got the issue in the texlive version distributed in debian testing when this was posted.

A solution: add the following line before the documentclass definition:

\RequirePackage[2020-02-02]{latexrelease}

(I read this solution from github's user u-fischer in the following link: https://github.com/tweh/menukeys/issues/59)

2
  • thanks, fine solution Jul 22, 2021 at 17:36
  • Doesn't work me. It makes all pages blank except for footers and headers.
    – Don Kreher
    Feb 6 at 1:37
2

I ran into the same problem and now use this...

\usepackage{eso-pic}

...

\AddToShipoutPictureFG{
          \begin{tikzpicture}[remember picture, overlay]
              \node[opacity=0.5, inner sep=0] at (current page.center)
                  {\includegraphics{data/images/watermark}};
          \end{tikzpicture}
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .