0

I found it extremely weird.

When I want to add 2 references together, the second reference becomes below: which I do not want to have

Author 1, Author 2 et al. (year)

Reference Two is Hermann, N ̈olker et al. (2002)

I want:

Author 1 et al. (year)

Reference Two is Hermann et al. (2002)

Below is the printscreen: Both references together: enter image description here

When only 1 reference:

enter image description here

I am using:

maxcitenames=2

My full MWE (with 2 references):

\documentclass[12pt,oneside]{book}  % Remove draft option to show figures (for final draft), otherwise keep for faster production

\usepackage{enumitem} % macros to modify appearance of 'itemize' environments

\usepackage[english]{babel} 
\RequirePackage{xcolor}

\definecolor{darkblue}{rgb}{0, 0, 0.5}
\usepackage[colorlinks=true, allcolors=darkblue]{hyperref}         

\usepackage[style=british]{csquotes}

\usepackage[backend=biber, 
% style=authoryear, 
 style=authoryear-comp,
% citestyle=authoryear, 
dashed=false,
maxcitenames=2,
maxbibnames=99,
giveninits,
alldates=comp, %for online citing
dateabbrev=false, %for online citing for data format month in full
uniquename=init]{biblatex}


\DeclareNameAlias{sortname}{family-given} %

\usepackage{xpatch}
\renewcommand{\labelnamepunct}{\space} %to delete . after (1997)
\DeclareFieldFormat[article, incollection, unpublished]{title}{#1}

% for title italic
% \DeclareFieldFormat*{title}{\mkbibemph{#1}} %for title italic in all format (conference, paper..)
\DeclareFieldFormat*{title}{#1} %for conference title delete ".."
\DeclareFieldFormat[incollection]{title}{\mkbibemph{#1}} %for incollecion title italic ONLY
\DeclareFieldFormat[thesis]{title}{\mkbibemph{#1}} %for phdthesis title italic ONLY
\DeclareFieldFormat[book]{title}{\mkbibemph{#1}} %for book title italic ONLY
% for title italic

% to delete "In:" for article
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
% to delete "In:" for article

% for delete comma after Author A and Aurhor b
\DefineBibliographyExtras{english}{%
   \let\finalandcomma\empty
   \let\finalandsemicolon\empty
 }

\renewcommand{\compcitedelim}{\addsemicolon\space}
\DeclareNameAlias{editorin}{given-family}

\newbibmacro*{byeditor:in}{%
  \ifnameundef{editor}
    {}
    {\printnames[editorin]{editor}%
     \setunit{\addcomma\space}%
     \usebibmacro{editorstrg}%
     \clearname{editor}}}     


\xpatchbibdriver{inbook}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{byeditor:in}%
   \newunit\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}

\xpatchbibdriver{incollection}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor}}
  {}{}

\xpatchbibdriver{inproceedings}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}

\xpatchbibdriver{phdthesis}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}







\DeclareDelimFormat[textcite]{postnotedelim}{\addsemicolon\space}
\DeclareDelimFormat[parencite]{postnotedelim}{\addcolon\space}

\DeclareFieldFormat{postnote}{\printtext[bibhyperref]{#1}}
\DeclareFieldFormat{multipostnote}{#1}


\DeclareFieldFormat{url}{Available at\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
\DeclareFieldFormat[online]{title}{\mkbibemph{#1}}
\DefineBibliographyStrings{english}{%
   urlseen = {Accessed},
}
% below is to keep 'english' format as babel
\DefineBibliographyExtras{english}{%
  \protected\def\mkdaterangecomp{%
    \mkdaterangetrunc{long}}%
  \protected\def\mkdaterangeterse{%
    \mkdaterangetrunc{short}}%
  \protected\def\mkdaterangecompextra{%
    \mkdaterangetruncextra{long}}%
  \protected\def\mkdaterangeterseextra{%
    \mkdaterangetruncextra{short}}%
  \protected\def\mkbibdatelong#1#2#3{%
    \iffieldundef{#3}
      {}
      {\thefield{#3}%
       \iffieldundef{#2}{}{\nobreakspace}}%
    \iffieldundef{#2}
      {}
      {\mkbibmonth{\thefield{#2}}%
       \iffieldundef{#1}{}{\space}}%
    \iffieldbibstring{#1}
      {\bibstring{\thefield{#1}}}
      {\dateeraprintpre{#1}\stripzeros{\thefield{#1}}}}%
}



\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}


@article{hermann2005guest,
   title={Guest editors' introduction: An introduction to interactive sonification},
   author={Hermann, Thomas and Hunt, Andy},
   journal={IEEE multimedia},
   year={2005},
 }


@inproceedings{hermann2001hand,
  title={Hand postures for sonification control},
  author={Hermann, Thomas and N{\"o}lker, Claudia and Ritter, Helge},
  booktitle={International Gesture Workshop},
  year={2002},
}

\end{filecontents*}

\addbibresource{\jobname.bib}


\begin{document}


Reference One is \textcite{hermann2005guest}. 

Reference Two is \textcite{hermann2001hand}


\printbibliography
\appendix
\include{chapters/99-appendix}
\end{document}

My Full MWE (with 1 reference):

\documentclass[12pt,oneside]{book}  % Remove draft option to show figures (for final draft), otherwise keep for faster production

\usepackage{enumitem} % macros to modify appearance of 'itemize' environments

\usepackage[english]{babel} 
\RequirePackage{xcolor}

\definecolor{darkblue}{rgb}{0, 0, 0.5}
\usepackage[colorlinks=true, allcolors=darkblue]{hyperref}         

\usepackage[style=british]{csquotes}

\usepackage[backend=biber, 
% style=authoryear, 
 style=authoryear-comp,
% citestyle=authoryear, 
dashed=false,
maxcitenames=2,
maxbibnames=99,
giveninits,
alldates=comp, %for online citing
dateabbrev=false, %for online citing for data format month in full
uniquename=init]{biblatex}


\DeclareNameAlias{sortname}{family-given} %

\usepackage{xpatch}
\renewcommand{\labelnamepunct}{\space} %to delete . after (1997)
\DeclareFieldFormat[article, incollection, unpublished]{title}{#1}

% for title italic
% \DeclareFieldFormat*{title}{\mkbibemph{#1}} %for title italic in all format (conference, paper..)
\DeclareFieldFormat*{title}{#1} %for conference title delete ".."
\DeclareFieldFormat[incollection]{title}{\mkbibemph{#1}} %for incollecion title italic ONLY
\DeclareFieldFormat[thesis]{title}{\mkbibemph{#1}} %for phdthesis title italic ONLY
\DeclareFieldFormat[book]{title}{\mkbibemph{#1}} %for book title italic ONLY
% for title italic

% to delete "In:" for article
\renewbibmacro{in:}{%
  \ifentrytype{article}{}{\printtext{\bibstring{in}\intitlepunct}}}
% to delete "In:" for article

% for delete comma after Author A and Aurhor b
\DefineBibliographyExtras{english}{%
   \let\finalandcomma\empty
   \let\finalandsemicolon\empty
 }

\renewcommand{\compcitedelim}{\addsemicolon\space}
\DeclareNameAlias{editorin}{given-family}

\newbibmacro*{byeditor:in}{%
  \ifnameundef{editor}
    {}
    {\printnames[editorin]{editor}%
     \setunit{\addcomma\space}%
     \usebibmacro{editorstrg}%
     \clearname{editor}}}     


\xpatchbibdriver{inbook}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{bybookauthor}%
   \newunit\newblock
   \usebibmacro{byeditor:in}%
   \newunit\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}

\xpatchbibdriver{incollection}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{byeditor}}
  {}{}

\xpatchbibdriver{inproceedings}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}

\xpatchbibdriver{phdthesis}
  {\usebibmacro{in:}%
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {\usebibmacro{in:}%
   \usebibmacro{byeditor:in}%
   \setunit{\labelnamepunct}\newblock
   \usebibmacro{maintitle+booktitle}%
   \newunit\newblock
   \usebibmacro{event+venue+date}%
   \newunit\newblock
   \usebibmacro{byeditor+others}}
  {}{}







\DeclareDelimFormat[textcite]{postnotedelim}{\addsemicolon\space}
\DeclareDelimFormat[parencite]{postnotedelim}{\addcolon\space}

\DeclareFieldFormat{postnote}{\printtext[bibhyperref]{#1}}
\DeclareFieldFormat{multipostnote}{#1}


\DeclareFieldFormat{url}{Available at\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\mkbibbrackets{\bibstring{urlseen}\space#1}}
\DeclareFieldFormat[online]{title}{\mkbibemph{#1}}
\DefineBibliographyStrings{english}{%
   urlseen = {Accessed},
}
% below is to keep 'english' format as babel
\DefineBibliographyExtras{english}{%
  \protected\def\mkdaterangecomp{%
    \mkdaterangetrunc{long}}%
  \protected\def\mkdaterangeterse{%
    \mkdaterangetrunc{short}}%
  \protected\def\mkdaterangecompextra{%
    \mkdaterangetruncextra{long}}%
  \protected\def\mkdaterangeterseextra{%
    \mkdaterangetruncextra{short}}%
  \protected\def\mkbibdatelong#1#2#3{%
    \iffieldundef{#3}
      {}
      {\thefield{#3}%
       \iffieldundef{#2}{}{\nobreakspace}}%
    \iffieldundef{#2}
      {}
      {\mkbibmonth{\thefield{#2}}%
       \iffieldundef{#1}{}{\space}}%
    \iffieldbibstring{#1}
      {\bibstring{\thefield{#1}}}
      {\dateeraprintpre{#1}\stripzeros{\thefield{#1}}}}%
}



\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}


@article{hermann2005guest,
   title={Guest editors' introduction: An introduction to interactive sonification},
   author={Hermann, Thomas and Hunt, Andy},
   journal={IEEE multimedia},
   year={2005},
 }


@inproceedings{hermann2001hand,
  title={Hand postures for sonification control},
  author={Hermann, Thomas and N{\"o}lker, Claudia and Ritter, Helge},
  booktitle={International Gesture Workshop},
  year={2002},
}

\end{filecontents*}

\addbibresource{\jobname.bib}


\begin{document}


% Reference One is \textcite{hermann2005guest}. 

Reference Two is \textcite{hermann2001hand}


\printbibliography
\appendix
\include{chapters/99-appendix}
\end{document}
aan
  • 2,663
  • Yet reference one is what you want? – Bernard Oct 16 '19 at 22:54
  • @Bernard, I want to be Reference Two is Hermann et al. (2002). I want Author1 et al. (year) – aan Oct 16 '19 at 22:58
  • Well, add the option mincitenames=1. – Bernard Oct 16 '19 at 23:01
  • @Bernard, I had added mincitenames=1, and become \usepackage[backend=biber, style=authoryear-comp, dashed=false, maxcitenames=2, maxbibnames=99, mincitenames=1, giveninits, alldates=comp, dateabbrev=false, uniquename=init]{biblatex}. Still the same error. – aan Oct 16 '19 at 23:02
  • By default biblatex tries to disambiguate potentially ambiguous lists of names by adding more names to make them unique. You need uniquelist=false if you want to turn off that feature. This feature is context-dependent (since the ambiguity depends on whether or not you cited works with similar author lists), so it only comes into play once you cite a second work (with a similar author list). – moewe Oct 17 '19 at 05:34
  • @moewe, thanks. Brillant! It works well! – aan Oct 17 '19 at 11:38

0 Answers0