5

I wrote an article, and one author contributed to write an appendix. He suggested that I applied the command \contrib[With an appendix by]{sb.}. However, I don't know why it does not work. When I compile, it reads: undefined control sequence.

\documentclass{amsart}
\begin{document}
\title{title}
\author{names}
\contrib[With an appendix by]{sb}
\maketitle
content
\end{document} 

Do I need to input some new packages to run the \contrib? Thanks in advance!

4
  • 1
    Apparently adding \makeatletter\let\@wraptoccontribs\wraptoccontribs\makeatother to your preamble lets you compile. I found this here. – Max Jul 3 '18 at 8:42
  • 2
    amsart does appear to have a \contrib command, as described in the documentation (page 20) – preferred_anon Jul 3 '18 at 8:48
  • @MaxSnippe Yes! It works! Thanks a lot! I also observed your link, and it solved my problem! Unfortunately, there are few questions on this problem... – Higgs-Boson Jul 3 '18 at 11:58
  • @DENGYa Great, I've added an answer so this question can be marked as answered. – Max Jul 3 '18 at 12:08
5

As mentioned in the comments, this can be solved by adding

\makeatletter
\let\@wraptoccontribs\wraptoccontribs
\makeatother

to your preamble.

According to this link, it is a bug in the ams classes. All credits to Enrico Gregorio at the Google forum.

2
  • 3
    Oh, that's eleven years ago! I completely forgot about that! – egreg Jul 3 '18 at 13:06
  • actually, the bug was first reported in september 2005. i've been trying to get it fixed in the ctan version ever since, and can only say i'm sorry that my pleas have been overruled. – barbara beeton Jul 4 '18 at 20:06
3

This is a very old bug of amsart.cls that I appear to have analyzed back in 2007 in a comp.text.tex thread.

Here are the relevant lines in amsart.cls, where the error is apparent on line 495:

480 \newcommand\contrib[2][]{%
481   \def\@tempa{#1}%
482   \ifx\@empty\@tempa
483   \else
484     \ifresetcontrib \@xcontribs
485     \else \global\resetcontribtrue
486     \fi
487   \fi
488   \ifx\@empty\contribs
489     \gdef\contribs{#1 #2}%
490   \else
491     \g@addto@macro\contribs{\and#1 #2}%
492   \fi
493   \@wraptoccontribs{#1}{#2}%
494 }
495 \def\wraptoccontribs#1#2{}

The correct code should be

495 \def\@wraptoccontribs#1#2{}

The macro is just a hook, possibly used for some in-house processing if the paper is to be inserted as a contribution to some volume.

The workaround is adding

\makeatletter
\let\@wraptoccontribs\wraptoccontribs
\makeatother

to the document preamble.

\documentclass{amsart}

\makeatletter
\let\@wraptoccontribs\wraptoccontribs
\makeatother

\begin{document}
\title{title}
\author{names}
\contrib[With an appendix by]{sb}
\maketitle
content
\end{document} 

enter image description here

1
  • 1
    This is a lot more clear than my answer! Thanks for the clarification. – Max Jul 4 '18 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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