plk / biblatex-apa

APA style for BibLaTeX
93 stars 49 forks source link

Period after url and doi when there shouldn't be #62

Closed PsychicBirdy closed 5 years ago

PsychicBirdy commented 6 years ago

Consider

\documentclass[paper=a4]{article}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa]{biblatex} 

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{testentry1,
    author = {William James},
    title = {Psychology},
    date = {2014},
    origdate = {1920},
    url = {https://archive.org/details/00311290R.nlm.nih.gov},
}

@BOOK{testentry2,
    author = {William James},
    title = {Psychology},
    date = {2014},
    origdate = {1920},
    doi = {10.1000/182},
}

% (APA 7.02 Example 21)
% NOTE is automatically generated from ORIGDATE
@INBOOK{7.02:21,
    AUTHOR         = {S. Freud},
    EDITOR         = {J. Strachey},
    TRANSLATOR     = {J. Strachey},
    TITLE          = {The Method of Interpreting Dreams},
    BOOKTITLE      = {The Standard Edition of the Complete Psychological Works of {S}igmund {F}reud},
    VOLUME         = {4},
    PAGES          = {96--121},
    SUBTITLE       = {An Analysis of a Specimen Dream},
    DATE           = {1953},
    ORIGDATE       = {1900},
    URL            = {http://books.google.com/books},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
    \cite{testentry1}

    \cite{testentry2}

    \cite{7.02:21}

    \printbibliography
\end{document}

Testentry1 is based on APA examples 7.02:19 (Electronic version of print book) and 7.02:21 (Electronic version of republished book). 7.02:21 is actually a reprint of a book published as part of a larger book and thus as a chapter, which is why it is using entry type INBOOK.

INBOOK works fine. Testentry1 and testentry2, however, being entry type BOOK, erroneously have a period after the url and doi, respectively. They give

James, W. (2014a). Psychology. Retrieved from https://archive.org/details/00311290R.nlm.nih.gov. (Original work published 1920) James, W. (2014b). Psychology. doi:10.1000/182. (Original work published 1920)

when they should give

James, W. (2014a). Psychology. Retrieved from https://archive.org/details/00311290R.nlm.nih.gov (Original work published 1920) James, W. (2014b). Psychology. doi:10.1000/182 (Original work published 1920)

I haven't checked the other entry types. Surely, there shouldn't be a period after url or doi in any of them when followed by "(Original work ...)".

plk commented 5 years ago

Fixed in the latest 7th edition conformant release.

moewew commented 5 years ago

I was having a look at this for biblatex-apa6 and I'm wondering whether \finentrypunct should be suppressed when there is text between the URL and the end of the entry. I would have though not, but I can't be sure. What do the manuals say (6th. and 7th. ed.)? (There seem to be special rules when an origdate is involved?)

Implementation-wise I would go with a conditional (possibly starred) \printunit{\addspace} instead of \setunit{\addspace} which could get overwritten by later \setunits. The tricky bit would be to get \finentrypunct to cooperate. I'd probably use a toggle for that to track whether or not that is necessary, but I couldn't get that to work just now and I'm not too sure about the actual requirements here, so I gave up for now.

PsychicBirdy commented 5 years ago

It's great we have a biblatex-apa6 for backward compatibility. I suppose \finentrypunct is for putting a punctuation at the end of an entry? Well, such a punctuation should indeed be suppressed when there is text between the URL and the end of the entry. I suppose there should never be a punctuation at the end of a DOI or URL.

That's the case in APA6, example 21: ... (Vol. 4, pp. 96-121). Retrieved from http://books.google.com/books (Original work published 1900) So there is neither a period at the end of the URL nor one at the end of the parantheses.

In APA7 see examples 10 and 29, which are consistent with this idea. Also on page 300 it is explicitly stated that there should not be a period added after a DOI or URL to not interfere with its functionality. In biblatex-apa-test.pdf the entries 10.1:10 and 10.2:29b look good and adhere to the rule. Great work, much appreciated.

Hope this helps. Unfortunately, I can't help with the programming.

plk commented 5 years ago

APA is not consistent with this sort of thing. In 7th Ed, they do explicitly say that periods after URLS are to be suppressed because they are easy to accidentally include in the URL. However, there are other cases where entries ending with certain punctuation like parens also lack final periods. The code in the 6th Ed is messy as it morphed over years dealing with obscure cases and some comments on the APA blog - it's cleaner in the 7th Ed code. Are there examples which are not working?

moewew commented 5 years ago

(Just to be sure, in what follows I'll be talking about biblatex-apa6 and the 6th ed. manual.)

Unfortunately, I don't have access to the manual (and I even lost my second-hand access), so I will have to rely on the APA style blog.

According to https://blog.apastyle.org/apastyle/2011/07/punctuating-the-reference-list-entry.html and https://blog.apastyle.org/apastyle/2016/08/periods-in-reference-list-entries.html periods after URLs and DOIs have to go. I noted that the last link cleverly says

One case where you should never add a period is after a DOI or URL.

Hence, there may be more cases where the period has to go even though it might conceivably be shown otherwise.

Indeed one other case where the following/ending period is suppressed seems to be the Original work published in parentheses (https://blog.apastyle.org/apastyle/2011/09/how-to-cite-a-musical-score.html)


@PsychicBirdy You say

I suppose \finentrypunct is for putting a punctuation at the end of an entry? Well, such a punctuation should indeed be suppressed when there is text between the URL and the end of the entry.

Do you mean to say that even if there is text between the URL and the end of the entry, there should be no period at the end of the entry just because there was a URL at some point? Can you point to specific examples from the APA manual? (Since I don't have access to the manual at the moment it would be great if you could give the full number and reproduce the expected result.)

The example

Retrieved from http://books.google.com/books (Original work published 1900)

Is unfortunately not quite conclusive since the period after the parentheses would be suppressed anyway (as I understand it).

plk commented 5 years ago

I have copies of the 6th and 7th Editions - 6th is somewhat vague, as you say, 7th is more explicit about why the period is suppressed after DOI/URL but there are several examples where there is no final period after a non-URL/DOI element and it seems to be, as in the "original work" examples, when the final element is broadly "punctuation", like a close paren. Anyway, the styles as they stand should confirm to all the examples in the manuals. I removed the rather messy detection in the 6th for the 7th edition as there is more consistency in the style for the 7th which allows a more standardised set of entry types to be used.