jmclawson / biblatex-mla

MLA-style citations and bibliographies using Biblatex
23 stars 9 forks source link

Repeated \autocite[pre][post]{key} does not omit the author. #24

Closed MarZagh closed 3 years ago

MarZagh commented 3 years ago

While helping my girlfriend with her term paper, I came along an issue that made me google for several hours.

MWE

lit.bib

@book{kortmann2020,
    author          = "Kortmann, Bernd",
    title           = "English Linguistics",
    date            = "2020",
    subtitle        = "Essentials",
    edition         = "2",
    publisher       = "J. B. Metzler Verlag",
    location        = "Berlin"
}

main.tex

\documentclass{article}

\usepackage[american]{babel}
\usepackage{csquotes}

\usepackage[style=mla]{biblatex}
\addbibresource{../lit.bib}

\begin{document}
Hi. I cite here \cite{repp2020} and again \cite{repp2020}.
Hi. I cite here \autocite{repp2020} and again \autocite{repp2020}.
Hi. I cite here \parencite{repp2020} and again \parencite{repp2020}.

\mancite
Hi. I cite here \cite[45]{repp2020} and again \cite[45]{repp2020}.
Hi. I cite here \autocite[45]{repp2020} and again \autocite[45]{repp2020}.
Hi. I cite here \parencite[45]{repp2020} and again \parencite[45]{repp2020}.

\mancite
Hi. I cite here \cite[cf][45]{repp2020} and again \cite[cf][45]{repp2020}.
Hi. I cite here \autocite[as quoted in][45]{repp2020} and again \autocite[cf][45]{repp2020}.
Hi. I cite here \parencite[cf][45]{repp2020} and again \parencite[cf][45]{repp2020}.
\end{document}

PDF Output: test.pdf

The issue

The issue is, that even if the author is cited repeatedly (even in the same sentence!) the author is not omitted. According to MLA Stylesheet and also biblatex-mla documentation (CTAN), it should be.

Weirdly, this only occurs when using {auto,paren}cite with a prenote. Without prenote it works fine. Instead of people with the same problem there are only some complaining about my desired behaviour of the command.

Answers were typically 'this isn't a bug, it's a feature. here's how to disable it.' But with the current biblatex and biber versions, it seems like disabled by default (?) and I can't get to ENable it.

What's wrong?

Did I miss something or is this a bug or some other error?

jmclawson commented 3 years ago

Thank you for the thorough MWE! I’m sorry to have been the cause for so much Googling. Looking over your code and the output, I think some part of this behavior was purposeful and was once documented, but it’s now broken and outright missing in the current documentation.

Here’s a copy to the old documentation: https://konx.net/biblatex-mla/biblatex-mla.pdf

On pages 24-25 is an attempt to clarify the logic here. In short, MLA typically uses the prenote only to attribute a quotation to someone other than the author of a work. Since it becomes potentially ambiguous to carry this on too many times in a row, biblatex-mla is supposed to reset the ibid tracker in certain circumstances with repeated prenotes. Unfortunately, as your example shows, this logic has gone haywire at some point.

For now, I suggest using the starred variant of the citation command (\autocite*[qtd. in][45]{repp2020}) to suppress an author name popping up too eagerly. I’ll add the underlying logic here to the list of things to work on this summer after I get the 2021 update of the MLA handbook.

MarZagh commented 3 years ago

Since you say that this behaviour is wanted in MLA, I looked that up and you are right. So don't worry, I don't blame you for my excessive googling time. I better shuould have looked it up earlier.

Nevertheless, I found a workaround to the "problem". I took a look at the source code (should have done earlier) and examined the code for the cite:ibid bibmacro.

\renewbibmacro*{cite:ibid}{%
  \iffieldundef{postnote}%
    {\usebibmacro{cite:mla:noibid}}%
    {\global\booltrue{cbx@hyperpages}}%
  \usebibmacro{cite:save}%
  \iffieldundef{prenote}%
    {}%
    {\usebibmacro{cite:mla:noibid}\usebibmacro{cite:reset}}}%

I thought it was weird that cite:mla:noibid is only called when no postnote is defined, but not when no prenote is defined. Again, since I know that MLA is supposed to give the author's name in such cases, it makes much more sense to code it like that. But anyway, here is my workaround from yesterday, that I did without the knowledge of proper use of "cf." in MLA-style citations.

\renewbibmacro*{cite:ibid}{%
  \iffieldundef{postnote}%
    {\usebibmacro{cite:mla:noibid}}%
    {\global\booltrue{cbx@hyperpages}}%
  \usebibmacro{cite:save}%
  \iffieldundef{prenote}%
    {\usebibmacro{cite:mla:noibid}\usebibmacro{cite:reset}}%
    {}}%

This works. I was quite surprised that I was able to come up with a "fix" by myself in that little time since I never looked at biblatex source code in my life. But it works only if the hyperref option of biblatex is disabled. If it isn't, it leaves a rather big space between cf. and the page number.

Since the workaround's behaviour is not proper MLA, I think it would not be appropriate to call it a fix. Maybe you want to include it as option for your package in the future (I don't mind if you don't. Do what you want with your time). And certainly it would be very nice if you included a little note in the future manual of the package, so idiots like me who don't look up usage of cf. in MLA, don't waste their time. ;)

jmclawson commented 3 years ago

I'll definitely be adding a note to the documentation! But I'll also be modifying the logic here, as some part of it isn't working the way intended. When I wrote the code originally, it wouldn't have triggered the problem you found, but I've changed something in the meantime that seems to have messed things up. (Ideally, the author name only would have been repeated if the source title changed; it should not have been printed on repeated references to the same exact source. And all of this is all worth reconsidering for the package: It's not MLA-ordained doctrine, but it is rather a tangled web of measures attempting to keep citations unambiguous, puzzled out from common uses of prenotes in MLA-related fields.)

Incidentally, your fix may seem to work, but it might also introduce other problems. If(!) I remember correctly, this \iffieldundef{} function is effectively an if-then-else definition. By adding something to the -then- part of the definition, you might be changing the behavior of ibid-style citations that lack a prenote. If you run into problems in that scenario before I'm able to fix it package-wide, you might try leaving both of these sets of brackets empty. Alternatively, you can go back to the original code and use the asterisked citation (\autocite*{}) to hide an author name popping up unexpectedly.

jmclawson commented 3 years ago

I've changed the behavior in the next version, which I'm readying for release. The behavior here was too fiddly and complicated to make sense, even for me; moreover, it was coded only for specific scenarios where commands like \mancite might more easily override default behavior. Thank you for sharing your confusion!

MarZagh commented 3 years ago

Thank you for your friendly replies and for your time :)