# Strange error after upgrading to MacTeX 2011 (TeXLive)

I have my own personal style file that I use for exams. It keeps track of points each question is worth and prints a grading table on the front page, automatically adding all points for the total. It works slightly different than the point table in exam.sty, or I would use that.

Anyway, when I upgraded to MacTeX 2011, I started getting the following error:

./M113F10E1.tex:25: Undefined control sequence.
\rc@set ...safe@activestrue\endcsname \rc@refused
{#4}\expandafter \rc@@set ...
l.25 \PointTable{1}
\nextpage


\PointTable is my command to create the grade table. The system indicates it is hanging at rc@refused. The control sequence above is not in my style file, so I assume it must be in one of the style files that I require. My style file uses calc, comment, ifthen, refcount and tabls.

Has anyone seen this? Can anyone point where to look? I'd rather not post my style file as its pretty long. It's also been years since I've messed with it (the code originally came from somewhere else before I tweaked it). I've been meaning to update the package, but for now, I'd like to get it working again.

Hoping this isn't a stupid question.

-
Welcome to TeX.sx! It's not necessary to sign your questions (as there is already a box with your username below it) or to begin them with a greeting. – Werner Oct 26 '11 at 17:02
Without more info, this might be hard to test. Did you delete your previous TeXLive distribution? If not, the simplest way to diagnose things would be to switch back to the previous distribution (using the TeX Distribution Control Panel) and compile the document again. If you put \listfiles at the beginning and compare the logs of both documents you might find out whether one of the dependent packages has changed. The \rc@... macros are defined by the refcount package which was last updated Dec 2010. – Alan Munn Oct 26 '11 at 19:20

My money's on this being a bug in refcount. In TL2010 and TL2011, I get a single match for \rc@refused and it matches your error since it is:

\def\rc@set#1#2#3#4{%
\begingroup
\csname @safe@activestrue\endcsname
\rc@refused{#4}%
\expandafter\rc@@set\csname r@#4\endcsname{#1}{#2}{#3}%
\endgroup
}


Fortunately, I'm on a Debian system so have an ancient copy of refcount.sty from TL2009 lying around not doing a lot. There, I have a little more:

\long\def\rc@refused#1{%
\expandafter\ifx\csname r@#1\endcsname\relax
\protect\G@refundefinedtrue
\@latex@warning{%
Reference #1' on page \thepage\space undefined%
}%
\fi
}

\newcommand*{\refused}[1]{%
\begingroup
\csname @safe@activestrue\endcsname
\rc@refused{#1}{}%
\endgroup
}

\def\rc@set#1#2#3#4{%
\begingroup
\csname @safe@activestrue\endcsname
\rc@refused{#4}%
\expandafter\rc@@set\csname r@#4\endcsname{#1}{#2}{#3}%
\endgroup
}


The definition of \refused has been greatly changed, with the place formally going to \rc@refused now being taken up by one of:

  \ltx@IfUndefined{r@#1}{%
\protect\G@refundefinedtrue
\rc@WarningUndefined{#1}%
}{}%


or

  \ltx@IfUndefined{r@#1}{%
\csname protect\expandafter\endcsname
\csname G@refundefinedtrue\endcsname
\rc@WarningUndefined{#1}%
}{}%


(depending on some conditional which tests if \G@refundefinedtrue is defined). So you could try replacing \rc@refused in the definition of \rc@set by one of these bits of code. To do it properly, you should probably do something like:

\ltx@IfUndefined{G@refundefinedtrue}{%
\def\rc@set#1#2#3#4{%
\begingroup
\csname @safe@activestrue\endcsname
\ltx@IfUndefined{r@#1}{%
\protect\G@refundefinedtrue
\rc@WarningUndefined{#1}%
}{}%
\expandafter\rc@@set\csname r@#4\endcsname{#1}{#2}{#3}%
\endgroup
}
}{%
\def\rc@set#1#2#3#4{%
\begingroup
\csname @safe@activestrue\endcsname
\ltx@IfUndefined{r@#1}{%
\csname protect\expandafter\endcsname
\csname G@refundefinedtrue\endcsname
\rc@WarningUndefined{#1}%
}{}%
\expandafter\rc@@set\csname r@#4\endcsname{#1}{#2}{#3}%
\endgroup
}
}


(Not tested ... this may break in unexpected ways).

But if I'm right then really this should be reported as a bug to Heiko Oberdiek.

-
Thanks, Andrew. I'll try to contact Heiko to let him know I'm having trouble with refcount. I was hoping someone else might have seen this. Otherwise I may be using refcount in an undocumented way - I'll check that as well. – S. McKay Oct 26 '11 at 20:28
I'm always hesitant to call something a bug without knowing more about it, but this does look pretty clear that something isn't right since there is a macro that is used but not defined, and it used to be defined in an older version. So I think you're on safe ground to contact Heiko and say that you think there might be a bug. – Loop Space Oct 26 '11 at 20:35

I contacted Heiko, and he knows about this and has fixed it. He hasn't uploaded it yet, though. I attached the following to the end of my .sty file and all is good. Thanks for your help.

\makeatletter
\let\rc@refused\refused
\makeatother
`
-
Just to be clear: is that what Heiko told you to do? – Loop Space Oct 27 '11 at 6:32