
我有以下問題。我需要以下引用樣式:
- 如果一位作者只顯示該作者,
- 如果是三個作者,則第一次顯示所有三個作者,但在隨後的引用中僅顯示第一個作者,並且等人。
- 如果超過三位作者只顯示第一個作者那麼等人。
以下文件可以正確顯示作者,如果第一次超過三個,然後顯示第一作者加上等人。
但當有超過四位作者時,問題是如何只顯示第一作者等人。
\documentclass{article}
\usepackage{etoolbox}
\usepackage{natbib}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{test1,
author = {Author, A. and Buthor, B and Cuthor, C and Duthor, D},
title = {Title},
journal = {Journal},
year = 2013
}
@article{test2,
author = {Author, A. and Buthor, B and Cuthor, C and Duthor, D},
title = {Title},
journal = {Journal},
year = 2012
}
@article{test3,
author = {Author, A. and Buthor, B and Cuthor, C and Duthor, D and wael , mohamed and yafooz },
title = {Title},
journal = {Journal},
year = 2013
}
\end{filecontents}
\newcommand{\citelist}{}
\newcounter{currentcite}
\newcounter{currentcitetotal}
\newcommand{\mycite}[1]{
\setcounter{currentcitetotal}{0}
\renewcommand{\do}[1]{\addtocounter{currentcitetotal}{1}}
\docsvlist{#1}
\renewcommand{\do}[1]{%
\addtocounter{currentcite}{1}%
\ifinlist{##1}{\citelist}
{\citet{##1}}
{\citet*{##1}\listadd{\citelist}{##1}}%
\ifnumcomp{\value{currentcitetotal}}{>}{\value{currentcite}}
{, }
{}%
}
\docsvlist{#1}
}
\begin{document}
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\mycite{test1,test2}
ffffffffffffffffff
\mycite{test1}
yyyyyyyyyyyyyyyyyyyyyyyyyyyy
\mycite{test2}
ffffffffffffffffff\mycite{test3}
\bibliographystyle{plainnat}
\bibliography{\jobname}
\end{document}