2

I am pretty new to Latex but I thought it would be better to write my bachelors thesis in latex than in word... its pretty easy to look up the main parts for latex but I'm at my wit's end:

A specific entry in my .bib file results in some problem in in-text citation. Following is my pre amble for the bibliography (I copied it from a friend's template. It should (and does nearly every time except this one) cite and build references in APA-Style

 \usepackage[babel=true]{csquotes}
\usepackage[style=apa,backend=biber,
%minbibnames=5, maxbibnames=5, %mincitenames=1, 
%maxcitenames=6, 
doi=false, url=false, sortcites=true, natbib]{biblatex}  
%\usepackage{apacite}
\bibliography{literatur.bib}
\DeclareLanguageMapping{ngerman}{ngerman-apa}
\DefineBibliographyStrings{ngerman}{andothers={et\ \addabbrvspace al\adddot}}
\AtBeginBibliography{%
  \renewcommand\finalandcomma{\addcomma}%
  \renewcommand*{\finalnamedelim}{%
    \ifthenelse{\value{listcount}>\maxprtauth}
      {}
      {\finalandcomma\addspace\&\space}}}
\newcommand*\mcite[1]{\citeauthor{#1} (\citeyear{#1})}
%\newcommand*\asdcite[1,2]{(\citeyear{#1};\citeauthor{#2},\citeyear{#2})}
%\newcommand*\xcite[1]{\citeauthor{#1} (\citeyear{#1}}
%\newcommand*\ycite[1]{\citeauthor{#1}, \citeyear{#1})}
\AtEveryBibitem{%
      \clearfield{day}%
      \clearfield{month}%
      \clearfield{endday}%
      \clearfield{endmonth}%
    }

  \renewcommand\maxprtauth{12}
\DeclareNameFormat{apaauthor}{%
  \ifthenelse{\value{listcount}=\maxprtauth \AND\value{listcount}<\value{listtotal}}
    {,~et~al.\addspace\setcounter{listcount}{\thelisttotal}}
    {\ifthenelse{\value{listcount}>\maxprtauth\AND\value{listcount}<\value{listtotal}}
      {}%
      {\ifthenelse{\iffieldequalstr{usere}{unkauth}\OR\iffieldequalstr{usere}{unkauthdate}}%
        {\iffirstinits
          {\mkbibbrackets{\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}?}}%
          {\mkbibbrackets{\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}?}}}%
        {\iffirstinits
          {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}%
          {\usebibmacro{name:last-first}{#1}{#4}{#5}{#7}}}}}%
  \ifmorenames{\andothersdelim\bibstring{andothers}}{}}
\renewcommand\finalandcomma{\addcomma}

Now...I came across a weird error. I use the \citep and \citet options to cite my references in APA-Style either name and year in parentheses or only year in parentheses respectively. The error results when I want to cite a paper from Cohen, XY. First I thought there was something wrong with my bibliography but that wasn't the case.

The error looks like this: when I cite a reference the code generates a citation in APA style that does not contain any first names. But when I want to cite a paper written by an author called Cohen the \citep and \citet options result in compiling the first names into the citations.

As an Example

It was shown by \citep{cohen} that cows don't fly.

would result in

It was shown by M. M. Cohen & Massaro (1993) that cows don't fly.

and not in

It was shown by Cohen & Massaro (1993) that cows don't fly.

with the bibliography entry being:

@incollection{cohen,
title={Cows don't fly},
author={Cohen, Michael M and Massaro, Dominic W},
booktitle={Pigs fly},
pages={139--156},
year={1993},
publisher={Springer},
location={Tokyo}
}

This only happens if the first name after author={ is Cohen. I tried mixing the order of the names and stumbled upon that fact.

The best solution would be to mix the names up...but that is not the point of the references if this is the first named author.

I hope that someone will be able to help me =)

marked as duplicate by moewe, user13907, AboAmmar, Fran, barbara beeton Aug 31 '15 at 21:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    do you have another entry with a Cohen? – Ulrike Fischer Aug 29 '15 at 22:09
  • 2
    I can only reproduce the issue by adding further entries involving a different Cohen. I can't reproduce just by putting your code fragments together and adding a minimal amount of code to make a compilable document. I don't understand the declaration of apaauthor, though. That seems weird: what is the point of saying if condition A holds, then do B; otherwise, do B? – cfr Aug 30 '15 at 0:42
  • 1
    Ulrike Fischer and cfr have already put their finger on the major issue: It seems as though you have another Cohen (maybe even the same in a different name format) in your .bib file, biblatex then tries to disambiguate. I just want to point out a few other things. (1) Use andothers={et\addabbrvspace al\adddot} instead of \ \addabbrvspace, they will have the same output because biblatex is very clever, but at first it looks as though you want two spaces. (2) Your \mcite should do what \textcite/\citet already do. Why do you define a new command for that? ... – moewe Aug 30 '15 at 7:06
  • 4
    Since you have another Cohen this is just one of the nice features of biblatex to disambiguate the two authors (Philip and Michael). With the standard styles there are was to turn that off, that might also work with biblatex-apa, but since biblatex-apa has a very special name format it might not work. The features you are looking for are uniquename and uniquelist (see Literature with Biber generates strange citations: firstnames appear erratically for example). – moewe Aug 30 '15 at 7:15
  • 1
    I just did a check and biblatex-apa does support the uniquename and uniquelist features (at least in so far that I was able to get rid of first names in citations when using uniquename=false). Please check if uniquename=false (maybe plus unqiuelist=false) works for you and report back. – moewe Aug 30 '15 at 7:21