I have a problem, that came up after updating the whole package list of Miktex, and I am 100% sure it is due to the package xwatermarks
.
After compiling the text I get the following error, right before \begin{document}
:
! Extra \endgroup.
\document ->\endgroup
\let \BeforeStartOfDocument \@firstofone \cpt@beforest...
l.161 \begin{document}
I am sure because removing the usage of \usepackage[printwatermark]{xwatermark}
the documents get properly compiled.
Below I report my full preamble (so as to be 100% accurate in my topic); I would like to ask if someone can help me in using xwatermarks
anyhow and avoid the problem. As far as the final document anything is fine, it is enough to remove \usepackage[printwatermark]{xwatermark}
.
Thank you in advance for any eventual help.
\documentclass[11pt,a4paper]{scrartcl}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{parskip}
\usepackage{lipsum}
\usepackage{changepage}
\usepackage{caption}
\usepackage{soul}
\usepackage{booktabs}
\usepackage[english]{babel}
\usepackage{placeins}
\usepackage{hyperref}
\usepackage{textcomp}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{multicol}
\usepackage{wasysym}
\usepackage{datetime}
\ddmmyyyydate
\usepackage{longtable}
\usepackage{multirow}
\usepackage{color}
\usepackage[printwatermark]{xwatermark}
\usepackage{xcolor}
\usepackage{graphicx}
%%\new[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT} %Questo mette la filigrana sotto l'immagine
%%\newwatermark[allpages,color=red!10,angle=45,scale=2,xpos=0,ypos=0]{DRAFT \today} %Questo mette la filigrana sopra l'immagine
\usepackage[TABTOPCAP, FIGBOTCAP]{subfigure}
\newcommand{\figbox}[1]{%
\fcolorbox{white}{white}{
\vbox to 6.5 cm{%
\vfil
\hbox to 8 cm{%
\hfil
#1%
\hfil}%
\vfil}}}
\newcommand{\Bfigbox}[1]{%
\fcolorbox{white}{white}{%
\vbox to 5.6 cm{%
\vfil
\hbox to 7 cm{%
\hfil
#1%
\hfil}%
\vfil}}}
\newcommand{\Cfigbox}[1]{%
\fcolorbox{white}{white}{%
\vbox to 4.5 cm{%
\vfil
\hbox to 6.4 cm{%
\hfil
#1%
\hfil}%
\vfil}}}
\makeatletter
\def\subfigtopskip{4pt}
\def\subfigbottomskip{4pt}
\def\subfigcapskip{2pt}
\subtabletopcaptrue
\makeatletter
\def\printtitle{
{\centering \Large \normalfont \textbf{\@title}\par}}
\def\piedipagina{%
{ \textup{\@title}}}
\makeatother
\title{\large{Title}}
\makeatletter
\def\printauthor{
{\large \@author}}
\makeatother
\author{%
\textup{dt. Giacomo Del Bianco} \\
\textup{Research \& Development \footnotesize{\textsc{Reactive Hot-Melts}}} \\
\vspace{50pt}
\textup{\today}\\
}
%%% Headers and footers
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{lastpage}
\lhead{}
\chead{}
\rhead{}
\footnotesize{\lfoot{\footnotesize ~\scshape{\piedipagina} $\cdot$ \footnotesize\today}}
\cfoot{}
\rfoot{\footnotesize Page \thepage\ of \pageref{LastPage}}
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.4pt}
\setkomafont{sectioning}{\rmfamily\bfseries\boldmath}
\usepackage[runin]{abstract}
\setlength\absleftindent{10pt}
\setlength\absrightindent{10pt}
\abslabeldelim{\quad}
\setlength{\abstitleskip}{-10pt}
\renewcommand{\abstracttextfont}{\small \slshape}
\textheight = 22 cm
\renewcommand{\figurename}{Figura}
\renewcommand{\listfigurename}{Indice delle figure}
\renewcommand{\listtablename}{Indice delle tabelle}
%%% Start of the document
\begin{document}
\end{document}