TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following (minimal) document class:

\ProvidesClass{minimal-article}[2013/01/11 Test class, extends article]

% Load parent class with preset options


  \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.}%


When using this from the minimal document file:



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?

share|improve this question
The error is caused by that rectangle drawing, since uncommenting it removes the errors. – Jukka Dahlbom Jan 11 '13 at 8:45
up vote 11 down vote accepted

Jake has already shown the Tikz syntax error that caused the problem but to answer the question about what the error message means (as opposed to how to avoid getting it:-) This is a primitive TeX error caused when you use a "delimited argument". Consider


\def\aaa * #1 *{\typeout{argument is #1}}

\aaa * hello *

\aaa !* goodbye *


The macro \aaa instead of taking arguments in the usual way \aaa 1 or \aaa{123} takes its argument delimited by two token sequences *_ and _* (using _ as a visible space) note any sequence of tokens may be used between the parameter markers #1, #2, ...

So in the first case

argument is hello

is echoed to the terminal, but in the second case \aaa requires a * as the following token and it is not there, so you get the error message in the subject line:

! Use of \aaa doesn't match its definition.
l.8 \aaa !
          * goodbye *
? x
No pages of output.

While the\def form and delimited arguments are not supported at the top level in LaTeX, it is quite common to use them internally for all sorts of parsing tasks clearly TikZ but also standard latex optional and picture mode arguments using [ ] and ( ) use this kind of definition internally.

share|improve this answer
+1 for knowing about all aspects of TeX, short of TikZ. And for didactic skills. – Jake Jan 11 '13 at 9:26

You've got a spurious at in your TikZ code. at is only used to place nodes, not as a path command. If you use

\fill [fill=red] (current page.north east) rectangle (current page.south west);%

instead (note I also changed the coordinates), everything works.

share|improve this answer
+1 for knowing something about tikz:-) – David Carlisle Jan 11 '13 at 9:15
Great answer, thank you. I will however accept Davids answer because it answers the broader question of what causes this type of error message. – Jukka Dahlbom Jan 11 '13 at 9:31
I wish I could accept 2 answers ;) – Jukka Dahlbom Jan 11 '13 at 9:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.