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 an existing command, defined within a \newenvironment:

\newcommand{\param}[3]{\textbf{##1} & \emph{##2} & ##3 \\ }

That command on its own works fine.

What I want to be able to do is to alias this command for typical use cases. The second argument to this command is a type, so I want something like:


However, this gives the error: Argument of \number has an extra }.

This error appears even if the \number command is never used.

What would the cause of this be?

share|improve this question
The idea is fine per se, but \number is a TeX primitive, so redefining it is probably causing an issue with a place where the original version is expected. – Joseph Wright Jan 17 '13 at 6:23
Aha, that appears to be it. I realised that \number was an existing command, but I thought that if I redefined it within the \newenvironment, it wouldn't cause any problems (as the scope would be limited). It seems I was wrong on that! If you post that as an answer, I'll accept you. – sapi Jan 17 '13 at 6:29
up vote 5 down vote accepted

As Joseph said, redefining \number is a bad idea, It's particularly self referential here as \newcommand (and \providecommand etc) all use \number to process the [2] optional argument that specifies how many arguments the command has. This normalises away any space and TeX constructs that expand to a number and exposes the literal digit that is needed to construct the #1#2 primitive TeX \def syntax.

\long \def \@yargdef #1#2#3{%
    \@yargd@f \expandafter{\number #3}#1%
share|improve this answer

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.