# Biblatex - show first author, second author, ..., last author

I have a style in my bibliography that I need to follow. The style is "ieee" but with a custom format of the authors.

Normal ieee: A. Uthor, W. Riter, R. Esearcher, S. C. Ientist, S. T. Udent, P. R. Ofessor, and L. E. C. Turer, “A very interesting article with a lot of authors,” Journal of Articles, vol. 5, no. 8, pp. 8–12, 2012. doi: 12345/6789.10.

What I want: A. Uthor, W. Riter, ..., and L. E. C. Turer, “A very interesting article with a lot of authors,” Journal of Articles, vol. 5, no. 8, pp. 8–12, 2012. doi: 12345/6789.10.

I.e., I want authors number 3 through (n-1) to not be shown but \ldots instead.

Any ideas how to achieve this?

Minimal not working example (Ref 1 should be abbreviated and Ref 2 should stay the same):

\documentclass[american]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=ieee,backend=biber,maxnames=999]{biblatex}
\usepackage{hyperref}

\begin{filecontents}{\jobname.bib}
@article{testartlong,
author        = {Arnold Uthor and William Riter and Rita Esearcher and Steven C. Ientist and Stuart T. Udent and Peter R. Ofessor and Lewis E. C. Turer},
title         = {A Very Interesting Article With a Lot of Authors},
journal       = {Journal of Articles},
volume        = {5},
number        = {8},
pages         = {8-12},
date          = {2012},
doi           = {12345/6789.10},
}
@article{testart,
author        = {Arnold Uthor and William Riter},
title         = {A Very Interesting Article},
journal       = {Journal of Articles},
volume        = {7},
number        = {3},
pages         = {1-5},
date          = {2010},
issn          = {1234-5678},
}
\end{filecontents}

\begin{document}
Test
\begin{refsection}
\nocite{*}
\end{refsection}
\end{document}

• Jan 26, 2018 at 9:44

\documentclass[american]{article}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=ieee,backend=biber,maxnames=999]{biblatex}
\usepackage{hyperref}
\begin{filecontents}{\jobname.bib}
@article{testartlong,
author        = {Arnold Uthor and William Riter and Rita Esearcher and Steven C. Ientist and Stuart T. Udent and Peter R. Ofessor and Lewis E. C. Turer},
title         = {A Very Interesting Article With a Lot of Authors},
journal       = {Journal of Articles},
volume        = {5},
number        = {8},
pages         = {8-12},
date          = {2012},
doi           = {12345/6789.10},
}
@article{testart,
author        = {Arnold Uthor and William Riter},
title         = {A Very Interesting Article},
journal       = {Journal of Articles},
volume        = {7},
number        = {3},
pages         = {1-5},
date          = {2010},
issn          = {1234-5678},
}
\end{filecontents}

\DeclareNameFormat{FirstLast}{%
\ifthenelse{\value{listtotal}=1}
{\ifthenelse{\value{listtotal}=2}
{\ifthenelse{\value{listcount}<\value{listtotal}}
{\ifthenelse{\value{listcount}=1}
{\ifthenelse{\value{listcount}<\value{listtotal}}
{}
}%
}%
}

\DeclareNameAlias{author}{FirstLast}

\begin{document}
Test
\begin{refsection}
\nocite{*}
\end{refsection}
\end{document}


More or less adapted from this Biblatex citations first and last author only

## Edit

The following seems to work too:

\DeclareNameFormat{FirstLast}{%
\ifthenelse{\value{listtotal} < 3}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
\ifthenelse{\value{listcount}=1 \OR \value{listcount}=\value{listtotal}}
{\usebibmacro{name:given-family}
{\namepartfamily}
{\namepartgiveni}
{\namepartprefix}
{\namepartsuffix}}
{}}%
}%
}%

• I'd have preferred if this solution called \usebibmacro{name:given-family} or \usebibmacro{name:family-given} instead of trying to format the names directly. That way the names obey \ifuseprefix, \ifprefchar, \mkbibname... etc. Jan 26, 2018 at 11:14
• @moewe I was to lazy ;-). Perhaps I will edit later. Are you already a TUG member? If not consider to add your name here: tex.meta.stackexchange.com/questions/7543/… Jan 26, 2018 at 12:23
• I see. Maybe I should complain to Guido as well. In fact I became a Dante+TUG member this January. Jan 26, 2018 at 12:26
• @moewe I can't use \usebibmacro{name:given-family}. I get errors like ! You can't use \begingroup' after \advance. \ifprefchar ->\ifhmode \begingroup ` . Jan 26, 2018 at 12:46
• I'll have a look later. It should work I'd have thought. Jan 26, 2018 at 13:00