2

I am using a amsrefs bibstyle and I need to count the number of authors.

\documentclass{article}
\usepackage{amsrefs}

\begin{document}
\begin{thebibliography}{9}

\bib{CR1}{article}
{
author={Author},
year={2012},
volume={5},
number={5},
pages={428\ndash{}45}
}

\bib{CR2}{article}
{
author={Author1},
author={Author2},
year={2012},
volume={5},
number={5},
}

\bib{CR3}{article}
{
author={Author1},
author={Author2},
author={Author3},
number={5},
pages={428\ndash{}45}
}

\end{thebibliography}
\end{document}

If 2 authors - separator is "and"

else 3 or more - separator is "&"

Output should be:

[1] Author 5 ( 2012 ),no. 5 , 428{ 45.

[2] Author1 and Author2 5 ( 2012 ),no. 5.

[3] Author1 , Author2 ,& Author3 5 , 428{ 45 .

2
  • Just to clarify: Are you using BibTeX to create the bibliography, or are you building the bibliography by hand? Please advise. – Mico Aug 9 '16 at 10:46
  • building by hand.. – jeecabz Aug 9 '16 at 10:49
3

This can be achieved by modifying \PrintNames@a macro from the package amsref.

MWE:

\documentclass{article}

\usepackage{amsrefs}

\makeatletter
\renewcommand{\PrintNames@a}[4]{%
    \PrintSeries{\name}
        {#1}
        {}{ and \set@othername}
        {,}{ \set@othername}
        %{,}{ and \set@othername}
        {,}{ \& \set@othername}%changed to "\&" from "and" for the customized output 
        {#2}{#4}{#3}%
}
\makeatother

\begin{document}
\begin{thebibliography}{9}

\bib{CR1}{article}
{
author={Author},
year={2012},
volume={5},
number={5},
pages={428\ndash{}45}
}

\bib{CR2}{article}
{
author={Author1},
author={Author2},
year={2012},
volume={5},
number={5},
}

\bib{CR3}{article}
{
author={Author1},
author={Author2},
author={Author3},
number={5},
pages={428\ndash{}45}
}

\end{thebibliography}
\end{document}

Output:

output

Note: The same change is applicable for Editor presentation as well.

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.