# Biblatex citations first and last author only

I would like to include only the first and the last author in my citations within the text. In case, there are only two authors, they should be connected by 'and'. For more than two authors, the remaining author names should be replaced by dots.

• (1 author ) John Doe (2004)
• (2 authors) John Doe and Peter Noel (2004)
• (3 authors) John Doe, ..., Peter Noel (2004)

What I am looking for is some way of formatting it, so that the following commands, in particular 'FirstLast' gives me the desired output.

``````\DeclareCiteCommand{\longcite}{}{%
\printnames[FirstLast]{author} (\printfield{year}),
\printfield{journaltitle}}{;}{}
``````

So my question is, what should FirstLast look like, to get the desired output?

-
add comment

## 1 Answer

Here is a possible redefinition of `FirstLast` name formatting directive

``````\DeclareNameFormat{FirstLast}{%
\ifthenelse{\value{listtotal}=1}
{#3\addspace\ifblank{#5}{}{#5\addnbspace}#1}
{\ifthenelse{\value{listtotal}=2}
{\ifthenelse{\value{listcount}<\value{listtotal}}
{#3\addspace\ifblank{#5}{}{#5\addnbspace}#1\addspace}
{\bibstring{and}\addspace#3\addspace\ifblank{#5}{}{#5\addnbspace}#1}}
{\ifthenelse{\value{listcount}=1}
{#3\addspace\ifblank{#5}{}{#5\addnbspace}#1\addcomma\addspace\dots\isdot\addcomma}
{\ifthenelse{\value{listcount}<\value{listtotal}}
{}
{\addspace#3\addspace\ifblank{#5}{}{#5\addnbspace}#1}}%
}%
}%
}
``````

producing

-
The problem here is that for more than two authors, I only get John Doe, ..., (2004), JournalXY. What I would need is John Doe, ..., LastAuthor (2004), JournalXY. That's the tricky part for me. I only want to suppress the authors in between basically. –  glaux Oct 18 '13 at 12:48
You have to set `maxcitenames` to a large value (e.g., 999) otherwise it is truncated as in the example you report. `maxcitenames` is an option of `biblatex` –  Guido Oct 18 '13 at 22:47
add comment