
У меня проблема со следующим. Мне нужен следующий стиль цитирования:
- если один автор просто покажет этого автора,
- если авторов три, то в первый раз показывать всех троих, а в последующих цитатах показывать только первого ии другие.
- если авторов больше трех, то просто укажите первого, тогдаи другие.
Следующий документ работает правильно, показывая авторов, если их больше трех в первый раз, а затем последовательно показывая первого автора плюси другие.
НО проблема, когда авторов больше четырех, как показать только первого автора, тогдаи другие.
\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}