6

When using \footcites all cites are equally separated by \multicitedelim. However, I would like the last two cites to be separated by "and". With certain limitations, this is possible with \textcites and a workaround would be to use \footnote{\textcites{}.}. Strangely, this only works for two cites. If three or more cites are included ", and" and not "and" is produced. Considering this, I was wondering what would have to be done to obtain the desired result using \footcites.

Here is a minimal working example:

\documentclass{article}
\usepackage[style=authoryear-icomp]{biblatex}
\usepackage{filecontents}

\begin{filecontents}{references.bib}
@article{greenwade93,
    author  = {George D. Greenwade},
    title   = {The {C}omprehensive {T}ex {A}rchive {N}etwork ({CTAN})},
    year    = {1993},
    journal = {TUGBoat},
    volume  = {14},
    number  = {3},
    pages   = {342--351}
}
@book{goossens93,
    author    = {Michel Goossens and Frank Mittelbach and Alexander Samarin},
    title     = {The LaTeX Companion},
    year      = {1993},
    publisher = {Addison-Wesley},
    address   = {Reading, Massachusetts}
}

@book{Knuth86,
    author = {Knuth, Donald E.},
    year = {1986},
    title = {The \TeX book}
}
\end{filecontents}

\addbibresource{references.bib}
\begin{document}
How it should look like.\footnote{\cites{goossens93}{greenwade93} and \cite{Knuth86}.}

How it should not look like.\footcites{goossens93}{greenwade93}[and][]{Knuth86}
\printbibliography
\end{document}

Thanks a lot!

1
  • 1
    Nice first question. Just a remark: it is better to use {...} (see your book Knuth86) instead of "..." (first and second bib entry) in your bib file. BTW: Welcome to TeX.SE!
    – Mensch
    Dec 1, 2014 at 17:09

1 Answer 1

2

Luckily, biblatex already provides everything we need for this (so much so that I am surprised this is not actually already implemented - other \multi...delims already have \final...delim versions).

We just need to make use of biblatex's \iflastcitekey test to determine whether we are at the last item, and if so slightly change the definition of \multicitedlim

\renewcommand*{\multicitedelim}{%
  \iflastcitekey
    {\addspace\bibstring{and}}
    {\addsemicolon}%
  \space}

That's it!

This will not work in all comer cases (especially in case of compressed citations), in these cases it might be better to use \textcite in the footnote directly. Like

\footnote{\textcite{geer,knuth:ct:a,knuth:ct:b,knuth:ct:c}}

Depending on your stance on the Oxford comma you will need to tweak \finalandcomma/\finalandsemicolon.

MWE

\documentclass{article}
\usepackage[style=authoryear-icomp]{biblatex}
\addbibresource{biblatex-examples.bib}

\renewcommand*{\multicitedelim}{%
  \iflastcitekey
    {\addspace\bibstring{and}}
    {\addsemicolon}%
  \space}

\begin{document}
How it should look like.\footcites{geer}{sigfridsson}{worman} vs this\footcites{geer,sigfridsson,worman}
\printbibliography
\end{document}

enter image description here

2
  • 1
    The test only works with non-compact citation labels. Citation labels that form part of a sentence should be generated only with \textcite or \textcites; the solution here should be to invoke one of these citation commands in \footnote and add something like \DefineBibliographyExtras{english}{\renewcommand{\finalandcomma}{}} to the preamble (or redefine \textcitedelim).
    – Audrey
    Aug 4, 2015 at 22:09
  • @Audrey Thanks for the comment! I had feared something like this would be the case. (I hoped though, no-one would notice ;-)). I will update the answer a bit with your suggestions.
    – moewe
    Aug 5, 2015 at 4:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .