0

I am using the commands \DefineName, \DefineJournal and \DefinePublisher to use abbreviations in my bibliography along the lines mentioned in Section 8.4 of the AMSRefs package documentation. Now, I have an entry with ten authors, and using abbreviations for all ten authors throws an rkeyval error.

MCVE: newtest.tex

\documentclass{amsart}

\usepackage{amsrefs}

\DefineName{bas-t}      {Bascelli, Tiziana}
\DefineName{bla-p}      {B{\l}aszczyk, Piotr}
\DefineName{bor-a-v}    {Borovik, Alexandre~Vasilievich}
\DefineName{kan-v-g}    {Kanovei, Vladimir~G.}
\DefineName{kat-k-u}    {Katz, Karin~Usadi}
\DefineName{kat-m-g}    {Katz, Mikhail~Gersh}
\DefineName{kut-s-s}    {Kutateladze, Sem{\"e}n~Samsonovich}
\DefineName{mcgaf-t}    {McGaffey, Thomas}
\DefineName{sch-d-m}    {Schaps, David~M.}
\DefineName{she-d-m}    {Sherry, David~M.}

\DefineJournal{fs}{1233-1821, 1572-8471/e}
    {Found. Sci.}
    {Foundations of Science}

\begin{document}

\begin{bibdiv}
\begin{biblist}

\raggedright

\bib{BasBlaBor18}{article}{
      author={bas-t},
      author={bla-p},
      author={bor-a-v},
      author={kan-v-g},
      author={kat-k-u},
      author={kat-m-g},
      author={kut-s-s},
      author={mcgaf-t},
      author={sch-d-m},
      author={she-d-m},
       title={Cauchy's infinitesimals, his sum theorem, and foundational paradigms},
        date={2018},
     journal={fs},
      volume={23},
      number={2},
       pages={267\ndash 296},
         doi={10.1007/s10699-017-9534-y},
      review={\MR{3803893}},
}

\end{biblist}
\end{bibdiv}

\end{document}

The console output says:

./newtest.tex:47: Package rkeyval Error: Invalid key name character.

See the rkeyval package documentation for explanation.
Type H <return> for immediate help.
 ...

l.47 }

?

I dutifully checked the rkeyval package documentation for any explanation, but it was not fruitful for a novice such as myself.

Next, I entered R <return> in the console to let the engine run without stopping, and the same error message repeated itself nine more times before the document was compiled. The PDF output was exactly as it should have been.

My guess is that having a double digit number of author abbreviations in a single \bib entry is somehow causing this error. If I remove any one of the abbreviations and instead enter that name normally, then the document compiles normally.

What can I do to fix or, at the very least, avoid this error?

2 Answers 2

1

If I add \tracingmacros=1, I find in the log file

\@tempa ->\def \bib'author {\name {Bascelli, Tiziana}\name {B{\l }aszczyk, Piot
r}\name {Borovik, Alexandre~Vasilievich}\name {Kanovei, Vladimir~G.}\name {Katz
, Karin~Usadi}\name {Katz, Mikhail~Gersh}\name {Kutateladze, Sem{\"e}n~Samsonov
ich}\name {McGaffey, Thomas}\name {Schaps, David~M.}\name {Sherry, David~M.}}\r
eset@nth@property \bib'author 1{}\reset@nth@property \bib'author 2{}\reset@nth@
property \bib'author 3{}\reset@nth@property \bib'author 4{}\reset@nth@property
\bib'author 5{}\reset@nth@property \bib'author 6{}\reset@nth@property \bib'auth
or 7{}\reset@nth@property \bib'author 8{}\reset@nth@property \bib'author 9{}\re
set@nth@property \bib'author 10{}

and then

\reset@nth@property #1#2#3->\begingroup \edef \@tempa {\extract@group #1}\@temp
cnta #2\relax \@temptokena {#3}\toks@ \@emptytoks \@tempcntb \z@ \@xp \reset@sc
an \@xp #1\csname \@tempa ,aux\endcsname \edef \@tempa {\def \@xp \@nx \csname
\@tempa ,aux\endcsname {\the \toks@ }}\@xp \endgroup \@tempa
#1<-\bib'author
#2<-1
#3<-

so your conjecture is correct. When \reset@nth@property is followed by 10{} and \@tempcnta is set to 1, while \@temptokena to 0. So everything breaks down.

I'm not sure where to find a way to add braces around the number, which would solve the issue, but this seems to work.

\documentclass{amsart}

\usepackage{amsrefs}

\makeatletter
\let\saved@reset@nth@property\reset@nth@property
\def\reset@nth@property#1#2#{\saved@reset@nth@property{#1}{#2}}
\makeatother

\DefineName{bas-t}      {Bascelli, Tiziana}
\DefineName{bla-p}      {B{\l}aszczyk, Piotr}
\DefineName{bor-a-v}    {Borovik, Alexandre~Vasilievich}
\DefineName{kan-v-g}    {Kanovei, Vladimir~G.}
\DefineName{kat-k-u}    {Katz, Karin~Usadi}
\DefineName{kat-m-g}    {Katz, Mikhail~Gersh}
\DefineName{kut-s-s}    {Kutateladze, Sem{\"e}n~Samsonovich}
\DefineName{mcgaf-t}    {McGaffey, Thomas}
\DefineName{sch-d-m}    {Schaps, David~M.}
\DefineName{she-d-m}    {Sherry, David~M.}

\DefineJournal{fs}{1233-1821, 1572-8471/e}
    {Found. Sci.}
    {Foundations of Science}

\begin{document}

\begin{bibdiv}
\begin{biblist}

\raggedright

\bib{BasBlaBor18}{article}{
      author={bas-t},
      author={bla-p},
      author={bor-a-v},
      author={kan-v-g},
      author={kat-k-u},
      author={kat-m-g},
      author={kut-s-s},
      author={mcgaf-t},
      author={sch-d-m},
      author={she-d-m},
       title={Cauchy's infinitesimals, his sum theorem, and foundational paradigms},
        date={2018},
     journal={fs},
      volume={23},
      number={2},
       pages={267\ndash 296},
         doi={10.1007/s10699-017-9534-y},
      review={\MR{3803893}},
}

\end{biblist}
\end{bibdiv}

\end{document}

This is based on the assumption that \reset@nth@property is followed by one token (say \bib'author or something else), then by a number and then by an open brace. If this is not always the case, you'll get informed by weird error messages.

2
  • Thank you for adding the extra information about how you went about searching for the bug and the solution, this is always helpful :) Commented Jul 4, 2021 at 6:57
  • @egreg a (maybe) more stable approach to number collection could be something like: \def\reset@nth@property#1{\def\thefirsttoken{#1}\afterassignment\forwardarguments\mycount=} and \def\forwardarguments{\expandafter\forwardarguments@\expandafter{\the\mycount}}\def\forwardarguments@#1{\expandafter\saved@reset@nth@property\expandafter{\thefirsttoken}{#1}}.
    – Skillmon
    Commented Jul 4, 2021 at 18:19
2

This seems to work too:

\documentclass{amsart}

\usepackage{amsrefs}
\makeatletter
\catcode`\'=11
\def\xref@check@ab#1#2{%
    \csname bi@#2\endcsname
    \ifx\@empty\bib'name
        \@temptokena{#2}%
    \else 
        \@temptokena\@xp{\bib'name}%
        \get@property\@tempa\bib'name
        \edef\@tempa{%
            \@nx\addto@hook\@temptokenb{%
                \@nx\reset@nth@property\@nx#1{\the\series@index}{\@tempa}% missing braces
            }%
        }%
        \@tempa
    \fi
    \edef\@tempa{\@nx\add@toks@{\@nx\name{\the\@temptokena}}}%
    \@tempa
}
\catcode`\'=12
\makeatother

\DefineName{bas-t}      {Bascelli, Tiziana}
\DefineName{bla-p}      {B{\l}aszczyk, Piotr}
\DefineName{bor-a-v}    {Borovik, Alexandre~Vasilievich}
\DefineName{kan-v-g}    {Kanovei, Vladimir~G.}
\DefineName{kat-k-u}    {Katz, Karin~Usadi}
\DefineName{kat-m-g}    {Katz, Mikhail~Gersh}
\DefineName{kut-s-s}    {Kutateladze, Sem{\"e}n~Samsonovich}
\DefineName{mcgaf-t}    {McGaffey, Thomas}
\DefineName{sch-d-m}    {Schaps, David~M.}
\DefineName{she-d-m}    {Sherry, David~M.}

\DefineJournal{fs}{1233-1821, 1572-8471/e}
    {Found. Sci.}
    {Foundations of Science}

\begin{document}

\begin{bibdiv}
\begin{biblist}

\raggedright
\bib{BasBlaBor18}{article}{
      author={bas-t},
      author={bla-p},
      author={bor-a-v},
      author={kan-v-g},
      author={kat-k-u},
      author={kat-m-g},
      author={kut-s-s},
      author={mcgaf-t},
      author={sch-d-m},
      author={she-d-m},
       title={Cauchy's infinitesimals, his sum theorem, and foundational paradigms},
        date={2018},
     journal={fs},
      volume={23},
      number={2},
       pages={267\ndash 296},
         doi={10.1007/s10699-017-9534-y},
      review={\MR{3803893}},
}

\end{biblist}
\end{bibdiv}

\end{document}
1
  • Thank you :) I have upvoted your answer, but I'll mark egreg's answer as accepted, if you don't mind; since I found their added descriptions to be helpful. Commented Jul 4, 2021 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .