is it possible to change this solution (for printing all authors, when \citeauthor is used the first time) that it prints
Author1, Author2, Author3 (short Author1 et. al)
?
changing the source to
\newbibmacro*{labelname}{%
\ifcategory{nameseen}
{\printnames{labelname}}
{\addtocategory{nameseen}{\thefield{entrykey}}%
\printnames[][1-99] {labelname}\addspace\printtext{(kurz\addspace\printnames{labelname})}}}
doesn't work, because it does the same for single authors:
Author1 (short Author1)
Here the full example:
\documentclass[a4paper]{book}
\usepackage[american]{babel}
\usepackage[utf8]{inputenc}
\usepackage[style=authoryear, maxcitenames=2,maxbibnames=99, backend=biber,citetracker=true]{biblatex}
\DeclareBibliographyCategory{nameseen}
% old, but with no "short" in the parents:
%\newbibmacro*{labelname}{%
% \ifcategory{nameseen}
% {\printnames{labelname}}
% {\addtocategory{nameseen}{\thefield{entrykey}}%
% \printnames[][1-99]{labelname}}}
% new, but with the problem:
\newbibmacro*{labelname}{%
\ifcategory{nameseen}
{\printnames{labelname}}
{\addtocategory{nameseen}{\thefield{entrykey}}%
\printnames[][1-99]{labelname}\addspace\printtext{(short\addspace\printnames{labelname})}}}
% Based on generic definition from biblatex.def
\DeclareCiteCommand{\citeauthor}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\usebibmacro{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}
\makeatletter
% Based on definition from alphabetic.cbx
\renewbibmacro*{textcite}{%
\ifcategory{nameseen}
{}
{\clearfield{namehash}}%
\iffieldequals{namehash}{\cbx@lasthash}
{\multicitedelim}
{\cbx@tempa
\ifnameundef{labelname}
{}
{\usebibmacro{labelname}\space}%
\bibopenbracket}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite}%
\savefield{namehash}{\cbx@lasthash}%
\gdef\cbx@tempa{\bibclosebracket\multicitedelim}}
\makeatother
\begin{filecontents}{test.bib}
@article{foobar,
Author = {Author1, A. and Author2, B. and Author3, C.},
Journal = {Journal of Foo},
Pages = {1--2},
Title = {Foo is bar},
Volume = {1},
Year = {1999}
}
@article{foobar2,
Author = {SingleAuthor, A.},
Journal = {Journal of Foo},
Pages = {1--2},
Title = {Foo is bar},
Volume = {1},
Year = {1999}
}
\end{filecontents}
\addbibresource{test.bib}
\begin{document}
1. \citeauthor{foobar}\\
2. \citeauthor{foobar}
3. \citeauthor{foobar}
1. \citeauthor{foobar2}\\
2. \citeauthor{foobar2}
3. \citeauthor{foobar2}
\end{document}
\documentclass{...}and ending with\end{document}. – Marco Daniel Jun 10 '13 at 15:40\printnames{labelname}is different from\printnames[][1-99]{labelname}i'm sure there must be an easy way to check if an "et. al"-truncation needs to be made or not. – Christian Jun 10 '13 at 16:23\ifciteseen– Marco Daniel Jun 10 '13 at 16:24but that will not indicate, if there are more than 2 authors. the identification for first time vs. any other time works well. i need to avoid situations like "Author1 (short Author1)".
– Christian Jun 10 '13 at 16:27liststopcounter and compare this withlisttotalfor the name list (see page 218 of biblatex manual). If there is any name list truncation to "et al" it means thatliststop<listtotal. – PLK Jun 12 '13 at 06:52