如果作者分隔符超过 3 个或更多,如何将其更改为“\&”?

如果作者分隔符超过 3 个或更多,如何将其更改为“\&”?

我正在使用 amsrefs bibstyle,需要计算作者数量。

\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}

如果有两个作者 - 分隔符为“and”

否则 3 个或更多 - 分隔符为“&”

输出应该是:

[1] 作者5(2012),第5期,428{45.

[2] 作者1作者2 5 (2012),第5期。

[3] 作者1,作者2,&作者3 5 , 428{ 45 .

答案1

\PrintNames@a这可以通过修改包中的宏来实现amsref

梅威瑟:

\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}

输出:

输出

注意:同样的更改也适用于编辑器演示。

相关内容