I've researched this problem, but am not coming up with the right solution. I have a online resource with no author, so with APA style, biblatex produces: ("Title of article" 2009} with no comma. But the style requires a comma in between the title and the year. I think I need something along the lines of:
\AtBeginBibliography{%
\renewcommand*{\nonameyeardelim}{\addcomma\space}}
But it is not working.
Here is a minimal example:
\documentclass[man,]{apa6}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[backend=biber,style=apa,natbib=true]{biblatex}
\usepackage{float}
\usepackage{graphicx}
\addbibresource{example.bib}
\DeclareLanguageMapping{american}{american-apa}
%\AtBeginDocument{\renewcommand\nonameyeardelim}{\addcomma\space}
%\AtBeginDocument{\renewcommand*{\nonameyeardelim}{\addcomma\space}}
\AtBeginBibliography{%
\renewcommand*{\nonameyeardelim}{\addcomma\space}}
\title{Title}
\shorttitle{Short Title}
\author{Tom }
\affiliation{University of Ignorance}
\date{May 28, 2017}
\abstract{This paper is meant to illustrate a problem I have with Latex
}
\keywords{ignorance}
\begin{document}
\maketitle
\section{Introduction}
I want to cite this \citep{vicodin}.
\printbibliography[heading=bibnumbered]
\end{document}
The minimal bib file (example.bib) would be this:
@Online{vicodin,
title = {Life Without Vicodin?},
year = {2009},
date = {2009-07-02},
url = {http://nymag.com/news/intelligencer/topic/57770/},
}
Note: when I reproduce the error in the minimal example above, I notice that the reference occurs correctly in the reference listing at the end, but it still has no comma in the inline citation.
Best Answer
If you wanted the comma for everything,
would be enough. You don't need the
\AtBeginBibliography
hook.But you don't actually need that here, the citation macros of
biblatex-apa
use\nameyeardelim
, which is set to\addcomma\space
inapa.cbx
.Your problem here is different, though.
You are not seeing the comma because of US punctuation and the question mark that ends the title.
With
american
(American English)biblatex
uses\uspunctuation
, this involves moving punctuation inside quotation marks. So you haveand not (British style/'logical' punctuation)
This is also what happens here. The comma is moved inside the quotation mark. Instead of (British)
you would have (American)
but that double punctuation is not acceptable and the quotation mark wins (it is more important), so you get you would have
Try dropping the question mark in the title and check the output.
If you don't want US punctuation, issue