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 =)
apaauthor, though. That seems weird: what is the point of sayingif condition A holds, then do B; otherwise, do B? – cfr Aug 30 '15 at 00:42Cohen(maybe even the same in a different name format) in your.bibfile,biblatexthen tries to disambiguate. I just want to point out a few other things. (1) Useandothers={et\addabbrvspace al\adddot}instead of\ \addabbrvspace, they will have the same output becausebiblatexis very clever, but at first it looks as though you want two spaces. (2) Your\mciteshould do what\textcite/\citetalready do. Why do you define a new command for that? ... – moewe Aug 30 '15 at 07:06\xciteand friends, look as if they should do manually what\cite{foo,bar}already does. But maybe I'm not getting the whole point of the two. Anyway, the do have the disadvantages mentioned above as well. (4) With your redefinition ofapaauthoryou lose APA compliance and the definitions looks kind of weird. It is never a good idea to hard code theet al.string .... – moewe Aug 30 '15 at 07:10userefield does? In my recent version ofbiblatex-apathis check has been superseded by a much more transparent and understandable construction. Where did you get this from (or the base for your redefinition). – moewe Aug 30 '15 at 07:12biblatexto disambiguate the two authors (Philip and Michael). With the standard styles there are was to turn that off, that might also work withbiblatex-apa, but sincebiblatex-apahas a very special name format it might not work. The features you are looking for areuniquenameanduniquelist(see Literature with Biber generates strange citations: firstnames appear erratically for example). – moewe Aug 30 '15 at 07:15biblatex-apadoes support theuniquenameanduniquelistfeatures (at least in so far that I was able to get rid of first names in citations when usinguniquename=false). Please check ifuniquename=false(maybe plusunqiuelist=false) works for you and report back. – moewe Aug 30 '15 at 07:21@moewe yes!
– domix07 Aug 30 '15 at 07:33uniquename=falseanduniquelist=falsedid the trick!biblatex-apaalready implements the requirements of the APA by the book. So there should be no need at all to modify anything. If you feel that some of the output you get does not conform to the APA style, double check if everything is all right and if you are certain it shuld look different, contact the author ofbiblatex-apaand let him know (best via the github issue page). Instead of\mciteuse\textcite(\citetif you prefer natbib names). – moewe Aug 30 '15 at 08:12biblatex-apahave changed, so if you must have this output (it is not APA conform, mind) you better ask a new question with a pointer to this old one. The other answer of mine did not correct the slight mistakes I pointed out above, this has now been changed. – moewe Aug 30 '15 at 08:21\DefineBibliographyStrings{ngerman}{andothers={et\ \addabbrvspace al\adddot}}to\DefineBibliographyStrings{ngerman}{andothers={et\addabbrvspace al\adddot}}, the output will be identical, but the code won't look horrible any more). I will vote to close your question as a duplicate of http://tex.stackexchange.com/q/91225/35864, but if you have any other questions feel free to as a new one. – moewe Aug 30 '15 at 08:48*is rarely used to signify multiplication in mathematics texts, sometimes letter fall out of the subscript: usep_{kl}instead ofp_kl(check the difference!). If you want a dash (Gedankenstrich) you should use--instead of just one hyphen, as inMarkov chains -- although slightly mathematical -- are very interesting.– moewe Aug 30 '15 at 08:51vP^n=Vis really more an approximation for large n -- the last point is important, n needs to be large) – moewe Aug 30 '15 at 09:00