All counter representation commands like \arabic
or \alph
call an associated internal command (\@arabic
or \@alph
) that takes the number represented by the counter as input. For a counter <counter>
this is always a TeX \count
named \c@<ounter>
. The scheme is always as follows:
\def\cntformat#1{\expandafter\@cntformat\csname c@#1\endcsname}
\def\@cntformat#1{<do something with integer #1 that formats the number>}
where \cntformat
stands for a command like \arabic
.
Our user command now could look like this (using \newcommand*
instead of \def
):
\newcommand*\arabicminusone[1]{\expandafter\@arabicminusone\csname c@#1\endcsname}
This command takes an argument (#1
, the counter name) from which the associated count is built (\csname c@#1\endcsname
). This is then the argument to our internal command \@arabicminusone
. In order to build the \c@<counter>
before is is parsed by \@arabicminusone
the latter needs to be preceded by \expandafter
.
The internal command should take an integer as argument and simply substract one. There are a few possibilities to do this, one of them is e-TeX's \numexpr ... \relax
. The \relax
is not mandatory, strictly speaking, but will do no harm. It prevents \numexpr
from scanning further ahead until the number expression ends and is removed from the input stream.
\newcommand*\@arabicminusone[1]{\the\numexpr(#1)-1\relax}
With these two definitions you can now use it to format a counter:
\newcounter{test}
\setcounter{test}{8}
\arabicminusone{test}% will print `7'
A complete example:
\documentclass{exam}
% make @ a letter so we can use it in names of command sequences:
\makeatletter
% call the internal \c@<counter> command and apply number formatting:
\newcommand*\arabicminusone[1]{\expandafter\@arabicminusone\csname c@#1\endcsname}
% number formatting:
\newcommand*\@arabicminusone[1]{\the\numexpr(#1)-1\relax}
% make @ other again:
\makeatother
\renewcommand*\thequestion{\arabicminusone{question}}
\begin{document}
\begin{questions}
\addpoints
\question[5] foo
\question[4] bar
\end{questions}
\gradetable
\end{document}

\setcounter{question}{-1}
at the start and inside thequestions
environment, and things should be fine. Don't tinker with\thequestion
.