I have the following (minimal) document class:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{minimal-article}[2013/01/11 Test class, extends article]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
% Load parent class with preset options
\LoadClass[a4paper,titlepage]{article}
\RequirePackage{tikz}
\renewcommand\maketitle{%
\begin{titlepage}%
\begin{tikzpicture}[remember picture, overlay]%
\typeout{Drawing a rectangle?} %
\fill [fill=red] at (current page.south west) rectangle (current page.south east);%
\typeout{Background rectangle built.}%
\end{tikzpicture}%
\end{titlepage}%
}
\AtBeginDocument{
\maketitle
}
\endinput
When using this from the minimal document file:
\documentclass[11pt]{minimal-article}
\begin{document}
\tableofcontents
\section{Foo!}
\end{document}
I get a strange error message:
Drawing a rectangle?
! Use of \@next doesn't match its definition.
\maketitle ...ng a rectangle?} \fill [fill=red] at
(current page.south west)...
l.3 \begin{document}
As far as I can guess, it has to be some local environment problem, since yesterday the non-minimal version of that same class worked just fine, and now everything fails with that cryptic message.
Any ideas what would case this?