1

When using the authoryear-icomp style of BibLaTeX, I would like to cite only the first author of a multi-author work, even if that is not unique, when the citation is a repeated (e.g. ibidem) one. My reasoning is that the ibidem makes it possible to uniquely identify the reference anyway.

I have not been able to find a way to do so, but suspect that it is possible given the incredible flexibility of BibLaTeX (I have recently started using it and love it so far). Is it possible to achieve the above?

Consider the following MWE:

\documentclass{article}

\usepackage{filecontents}

\usepackage{csquotes}
\usepackage[%
    backend = biber,
    style = authoryear-icomp,
    giveninits = true,
    ibidpage = true,
    maxbibnames = 99,
    maxcitenames = 2,
    uniquename = init,
    useprefix = true
  ]{biblatex}
% always have first name, last name in bibliography
\DeclareNameAlias{sortname}{given-family}
\addbibresource{references.bib}

\begin{filecontents}{references.bib}
  @misc{keyA,
    title = {Title A},
    author = {First, Author and Second, Author and Third, Author},
    year = 2019,
  }

  @misc{keyB,
    title = {Title B},
    author = {First, Author and Fourth, Author and Fifth, Author},
    year = 2019,
  }
\end{filecontents}


\begin{document}

  We first note that~\textcite{keyA} and~\textcite{keyB} did a lot of work.
  The latter wrote \enquote{important stuff}, so we quote~\textcite{keyB} again.

  \printbibliography

\end{document}

Which renders something like:

Screenshot of PDF output of the above LaTeX source

Instead of rendering First, Fourth, et al. (ibid.) for the last citation, I would like it to render First et al. (ibid.). The reader would then just find the previous citation and be able to uniquely identify the right reference. Is this possible using BibLaTeX? Thanks in advance for any pointers and help.

3
  • What is you stance on the uniquelist option in general? Do you want to retain uniqueness of lists in non-"ibid." labels? (Note that this issue is only relevant with \textcite, all other cite commands just write "ibid." for "ibid"-citations, but \textcite can't do that due to the assumptions about the grammatical context of the passage.)
    – moewe
    Commented Apr 11, 2019 at 8:29
  • If at all possible, I would like to be able to do that, @moewe. The "ibid." helps to uniquely identify a reference, but without it it is ambiguous. I would be okay with a solution that locally modifies that counter value. (In other words, if I have to manually do some extra work for "ibid." citations that would be a workable solution for me. I would of course prefer a fully automatic solution.) Commented Apr 11, 2019 at 8:33
  • And I am aware of only \textcite exhibiting this issue, unfortunately I have to use that way of referencing in a text I am writing currently. Commented Apr 11, 2019 at 8:34

1 Answer 1

1

It isn't particularly pretty, but it is possible.

We can obtain the desired effect by replacing

\printnames{labelname}

in the textcite bibmacro with

\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
  {\printnames[][1-1]{labelname}}
  {\printnames{labelname}}%

Since the textcite macro for authoryear-icomp is quite long, the result might look a bit daunting.

Unfortunately, it is not enough to simply inject a different value for maxnames into the citation with \AtEveryCitekey as I initially hoped, since maxname values can be overridden by the uniquelist-maxname value calculated by the backend (for the unqiuelist option), this happens at a very late stage so that the standard hooks offer no way to interfere.

\documentclass{article}

\usepackage{filecontents}

\usepackage{csquotes}
\usepackage[%
    backend = biber,
    style = authoryear-icomp,
    giveninits = true,
    ibidpage = true,
    maxbibnames = 99,
    maxcitenames = 2,
    uniquename = init,
    useprefix = true
  ]{biblatex}

\DeclareNameAlias{sortname}{given-family}

\makeatletter
\renewbibmacro*{textcite}{%
  \iffieldequals{namehash}{\cbx@lasthash}
    {\iffieldundef{shorthand}
       {\ifthenelse{\iffieldequals{labelyear}{\cbx@lastyear}\AND
                    \(\value{multicitecount}=0\OR\iffieldundef{postnote}\)}
          {\setunit{\addcomma}%
           \usebibmacro{cite:extradate}}
          {\setunit{\compcitedelim}%
           \usebibmacro{cite:labeldate+extradate}%
           \savefield{labelyear}{\cbx@lastyear}}}
       {\setunit{\compcitedelim}%
        \usebibmacro{cite:shorthand}%
        \global\undef\cbx@lastyear}}
    {\ifnameundef{labelname}
       {\iffieldundef{shorthand}
          {\usebibmacro{cite:label}%
           \setunit{%
             \global\booltrue{cbx:parens}%
             \printdelim{nonameyeardelim}\bibopenparen}%
           \ifnumequal{\value{citecount}}{1}
             {\usebibmacro{prenote}}
             {}%
           \ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
             {\usebibmacro{cite:ibid}}
             {\usebibmacro{cite:labeldate+extradate}}}
          {\usebibmacro{cite:shorthand}}}
       {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
          {\printnames[][1-1]{labelname}}
          {\printnames{labelname}}%
        \setunit{%
          \global\booltrue{cbx:parens}%
          \printdelim{nameyeardelim}\bibopenparen}%
        \ifnumequal{\value{citecount}}{1}
          {\usebibmacro{prenote}}
          {}%
        \iffieldundef{shorthand}
          {\iffieldundef{labelyear}
             {\usebibmacro{cite:label}}
             {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
                {\usebibmacro{cite:ibid}}
                {\usebibmacro{cite:labeldate+extradate}}}%
           \savefield{labelyear}{\cbx@lastyear}}
          {\usebibmacro{cite:shorthand}%
           \global\undef\cbx@lastyear}}%
     \stepcounter{textcitecount}%
     \savefield{namehash}{\cbx@lasthash}}%
  \setunit{%
    \ifbool{cbx:parens}
      {\bibcloseparen\global\boolfalse{cbx:parens}}
      {}%
    \textcitedelim}}
\makeatother


\begin{filecontents}{\jobname.bib}
@misc{keyA,
  title  = {Title A},
  author = {First, Author and Second, Author and Third, Author},
  year   = 2019,
}
@misc{keyB,
  title  = {Title B},
  author = {First, Author and Fourth, Author and Fifth, Author},
  year   = 2019,
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
  We first note that~\textcite{keyA} and~\textcite{keyB} did a lot of work.
  The latter wrote \enquote{important stuff}, so we quote~\textcite{keyB} again.

  \printbibliography
\end{document}

We first note that First, Second, et al. (2019) and First, Fourth, et al. (2019) did a lot of work. The latter wrote “important stuff”, so we quote First et al. (ibid.) again.


If you don't like long redefinitions, you can of course use xpatch to patch the macro instead

\usepackage{xpatch}
\xpatchbibmacro{textcite}
  {\printnames{labelname}}
  {\ifthenelse{\ifciteibid\AND\NOT\iffirstonpage}
     {\printnames[][1-1]{labelname}}
     {\printnames{labelname}}}
  {}{}

The pros and cons of patching vs. redefining are discussed at Biblatex's bibmacros, bibliography drivers, formats - patch or redefine?.

2
  • Thank you so much! I was hoping it would be possible to do this with a small patch somewhere, but had no idea where to look. I'll definitely read up on the patching vs. redefining discussion you linked to, thanks for that as well. Commented Apr 11, 2019 at 8:47
  • I will use the patch approach, for completeness. Thanks again for the quick and thorough answer. Commented Apr 11, 2019 at 8:54

You must log in to answer this question.

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