
Tengo un problema con lo siguiente. Necesito el siguiente estilo de cita:
- si un autor simplemente muestra ese autor,
- si son tres autores, por primera vez muestre los tres, pero en citas posteriores muestre solo el primero yet al.
- si más de tres autores solo muestran el primero, entonceset al.
El siguiente documento funciona correctamente para mostrar los autores si hay más de tres por primera vez y luego muestra el primer autor máset al.
PERO el problema cuando hay más de cuatro autores es cómo mostrar, simplemente muestra el primer autor y luegoet al.
\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}