1

My question is related to question How can I have references list with [author year] format?. I got a customisation to get 1 author and the year in the reference tag, however I noticed that when the article has 2 authors both names appear. actual style

How could be the style customised in order to have ALWAYS ONLY 1 author in the tag?

Even though my preamble hasn't changed from last question I copy/paste it here to make it easier to check for you.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear, backend=biber, dashed=false]{biblatex}
\addbibresource{biblatex-examples.bib}

% implementation copied from biblatex-ext
\makeatletter
\newbibmacro*{bbx:introcite}{\usebibmacro{cite}}

\DeclareFieldFormat{bbx@introcite}{#1}
\newcommand*{\introcitepunct}{\addcolon\space}
\newcommand*{\introcitebreak}{\leavevmode\newline}

\newlength{\extbl@this@introcitewidth}
\newlength{\introcitewidth}
\setlength{\introcitewidth}{8\biblabelsep}
\newlength{\introcitesep}
\setlength{\introcitesep}{\biblabelsep}

\newbibmacro{introcite:typeset}{%
  \begingroup
    \iftoggle{blx@citation}
      {}
      {\togglefalse{blx@bibliography}%
       \toggletrue{blx@citation}}%
    \delimcontext{bbx@introcite}%
    \csuse{blx@hook@cite}%
    \csuse{blx@hook@citekey}%
    \DeclareFieldFormat{bibhyperref}{##1}%
    \undef\cbx@lasthash
    \undef\cbx@lastyear
    \citetrackerfalse\pagetrackerfalse\backtrackerfalse
    \defcounter{maxnames}{\blx@maxcitenames}%
    \defcounter{minnames}{\blx@mincitenames}%
    \printtext[bbx@introcite]{\usebibmacro{bbx:introcite}}%
  \endgroup
}

% This macro is used in \defbibenvironment
\newbibmacro*{introcite:break}{%
  \settowidth{\extbl@this@introcitewidth}
    {\usebibmacro{introcite:typeset}}%
  \ifdimgreater{\extbl@this@introcitewidth}{\introcitewidth}
    {\introcitebreak}
    {}}


\defbibenvironment{bibliography}
  {\list
     {\usebibmacro{introcite:typeset}}
     {\setlength{\labelwidth}{\introcitewidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\introcitesep}%
      \addtolength{\leftmargin}{\labelsep}%
      \renewcommand*{\makelabel}[1]{##1\hss}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}
  {\item
   \usebibmacro{introcite:break}}
\makeatother


% customisation starts here
\DeclareFieldFormat{bbx@introcite}{\mkbibbrackets{#1}}
\setlength{\introcitewidth}{8\biblabelsep}
\setlength{\introcitesep}{\biblabelsep}

\begin{document}
\cite{sigfridsson,worman,geer,knuth:ct:a,knuth:ct:b}
\printbibliography
\end{document}
Bernard
  • 271,350

1 Answers1

1

Use:

\usepackage[style=authoryear, dashed=false, maxnames=1]{biblatex}

maxnames=1 tells biblatex to use only one name in the citations and bibliography labels.

Sometimes you will still get more than one name printed in order to avoid ambiguity. You can control this with the uniquename and uniquelist options.

From the comments below it looks like the options you want are:

\usepackage[style=authoryear, dashed=false, maxcitenames=1, maxbibnames=999,
            uniquelist=false]{biblatex}

Note that "et. al." will still be printed if there is more than one name.

David Purton
  • 25,884
  • No et all. doesn't appear in the citetaion tag. It is customised in orther to not appear. However, maxnames=1, uniquename and uniquelist don't work in my usepackage options. I always get both author names in citation tag when article has 2 authors. – Aurea 1994 Sep 04 '19 at 14:42
  • 2
    @Aurea1994 In the MWE you posted maxnames=1 (you can control the number of names in citations and the bibliography separately with maxcitenames and maxbibnames, you could for example have maxbibnames=999, maxcitenames=1,) results in only one name (and possibly "et al.") appearing in the citation labels. If that is not the case for you, it is very likely caused by uniquelist options, you may want to try uniquelist=false. If that still doesn't help, please show us code that reproduces the undesirable behaviour. – moewe Sep 04 '19 at 17:35
  • Thank you very much! uniquelist=false was the solution! I added it to the previous maxbibnames=999, maxcitenames=1 With this new option everything works perfectly and I get and only name in the cite tag. – Aurea 1994 Sep 05 '19 at 06:49
  • @Aurea1994 You may want to consider accepting the answer, since it mentions all the necessary ingredients to answer your question in the MWE and elsewhere. – moewe Sep 06 '19 at 04:54
  • 2
    Since it is mentioned now in the last sentence of the answer and I can not let an opportunity pass to advertise new biblatex features: Should you want to remove the "et al." in citations this is now possible without side effects, see https://tex.stackexchange.com/q/262612/35864. – moewe Sep 06 '19 at 12:12