1

A year ago, @moewe devised a way to make biblatex-chicago use only the author's last name (no title) when citing a reference whose author only appears in the bibliography as the author of that reference (i.e., only one work by that author is cited).

Since then, I realized that this solution runs into problems with \headlesscite and, in footnotes, with \textcite. Is there any way to make the output (see below) sensible?

MWE:

\documentclass{article}

\usepackage[%
    ibidtracker=true,
    notes, 
    singletitle, 
    short]{biblatex-chicago}
\addbibresource{biblatex-examples.bib}

\renewbibmacro*{cite:short}{%
  \usebibmacro{allshort+firstcite+xref}%
  \ifthenelse{\ifnameundef{labelname}\OR%
    \ifentrytype{inreference}\OR%
    \ifentrytype{reference}\OR%
    \ifentrytype{mvreference}}%
  {\ifthenelse{\iffieldequalstr{entrysubtype}{magazine}\AND\NOT%
      \ifentrytype{periodical}}% Simplify .bib creation
    {\ifuseauthor%
      {\ifboolexpr{%
          not test {\iffieldundef{shortjournal}}%
          and
          ((
          test {\ifcitation}%
          and
          togl {cms@citejtabb}%
          )
          or
          (
          test {\ifbibliography}%
          and
          togl {cms@bibjtabb}%
          ))
        }%
        {\printfield[shortjournal]{shortjournal}\newcunit}%
        {\printfield[journaltitle]{journaltitle}\newcunit}}%
      {}}%
    {\ifentrytype{manual}%
      {\printlist{organization}\isdot\newcunit}%
      {}}}%
  {\ifboolexpr{%
      test {\ifciteidem}%
      and
      not test {\ifbibliography}%
      and
      not test {\iffirstonpage}%
      and
      not togl {cms@noidem}%
      and
      not togl {cms@headlessnote}%
    }%
    {\bibstring[\mkibid]{idem\thefield{gender}}%
      \classicpunct}%
    {\iffieldequalstr{authortype}{anon}%
      {\bibleftbracket\printnames{labelname}%
        \bibrightbracket\classicpunct}%
      {\iffieldequalstr{authortype}{anon?}%
        {\bibleftbracket\printnames{labelname}?%
          \bibrightbracket\classicpunct}%
        {\printnames{labelname}%\usebibmacro{choose+labelname}%
          \isdot\classicpunct}}}}%
  \ifsingletitle
    {}
    {\ifboolexpr{%
       togl {cms@allshort}%
       or
       test {\ifbibliography}%
     }%
     {\printtext[bibhyperref]{%
       \printfield[citetitle]{labeltitle}}}%
     {\printtext[cmshyperlink]{%
       \printfield[citetitle]{labeltitle}}}}}%:\thefield{entrytype}?


\begin{document}


\section{headlesscite and textcite in footnotes}

Headlesscite here: \headlesscite{worman}.

\mancite

In a footnote.\footcite[1]{worman}

\mancite

With textcite.\footnote{\Textcite[1]{worman} says otherwise.}

\mancite

With textcite but no page number.\footnote{\Textcite{worman} says otherwise.}

\section{with ibid issues thrown in}

Repeated citation.\footcite[1]{worman}

Repeated citation with textcite.\footnote{\Textcite[1]{worman} says otherwise.}

Repeated citation with textcite but no page number.\footnote{\Textcite{worman} says otherwise.}

\end{document}

Current output

1 headlesscite and textcite in footnotes

Headlesscite here: .

In a footnote.1

With textcite.2

With textcite but no page number.3

2 with ibid issues thrown in

Repeated citation.4

Repeated citation with textcite.5

Repeated citation with textcite but no page number.6

where the footnotes are:

  1. Worman, 1.

  2. Worman (, 1) says otherwise.

  3. Worman () says otherwise.

  4. Ibid., 1.

  5. Worman (, 1) says otherwise.

  6. Worman () says otherwise.

Desired output

1 headlesscite and textcite in footnotes

Headlesscite here: Worman.

In a footnote.1

With textcite.2

With textcite but no page number.3

2 with ibid issues thrown in

Repeated citation.4

Repeated citation with textcite.5

Repeated citation with textcite but no page number.6

where the footnotes are:

  1. Worman, 1.

  2. Worman (1) says otherwise.

  3. Worman says otherwise.

  4. Ibid., 1.

  5. Worman (1) says otherwise.

  6. Worman says otherwise.

6
  • 1
    Mhhh, a combination of \ifsingletitle and \headlesscite is a bit tricky. \headlesscite is a \cite without author name, and \ifsingletitle instructs \cite to drop the title if there is only one work by that author. In consequence you end up with nothing being printed. Even if we decide that the desired outcome in this case is for \headlesscite not to drop the name, I would probably recommend against using it since the citation labels become a bit inconsistent that way.
    – moewe
    Commented Feb 23, 2019 at 16:18
  • Good point. Do you think it would make sense for me to edit my question to involve only \textcite? Commented Feb 23, 2019 at 18:47
  • 1
    The \headlesscite one is straight forward (you can add a test for \ifsingletitle in the \headlesscite command [and friends] and not clear the names if the test is true) . But from my brief look, the \textcite issue is much more complicated. Commented Feb 24, 2019 at 7:25
  • 2
    The complexity is because \foottextcite calls \headlessparenshortcite. But you can't test if the output of \headlessparenshortcite is empty or not from outside \headlessparenshortcite. So you always will get parentheses even if it's empty. I don't know where the spurious comma is coming from yet. Commented Feb 24, 2019 at 7:31
  • 1
    The spurious comma is caused by punctuation in \postnotewrapper not being surrounded by \setunit{…}. I still don't know how to fix the empty parentheses though. Commented Feb 24, 2019 at 11:15

1 Answer 1

2

I'm not at all certain that this code will work in all situations, so you should test very carefully.

But perhaps it gives a starting point.

\documentclass{article}

\usepackage[%
    ibidtracker=true,
    notes, 
    singletitle, 
    short]{biblatex-chicago}
\addbibresource{biblatex-examples.bib}


% ------------------------------------------------------------------------------
% cite:short modified by moewe from https://tex.stackexchange.com/a/408916/87678
% ------------------------------------------------------------------------------

\renewbibmacro*{cite:short}{%
  \usebibmacro{allshort+firstcite+xref}%
  \ifthenelse{\ifnameundef{labelname}\OR%
    \ifentrytype{inreference}\OR%
    \ifentrytype{reference}\OR%
    \ifentrytype{mvreference}}%
  {\ifthenelse{\iffieldequalstr{entrysubtype}{magazine}\AND\NOT%
      \ifentrytype{periodical}}% Simplify .bib creation
    {\ifuseauthor%
      {\ifboolexpr{%
          not test {\iffieldundef{shortjournal}}%
          and
          ((
          test {\ifcitation}%
          and
          togl {cms@citejtabb}%
          )
          or
          (
          test {\ifbibliography}%
          and
          togl {cms@bibjtabb}%
          ))
        }%
        {\printfield[shortjournal]{shortjournal}\newcunit}%
        {\printfield[journaltitle]{journaltitle}\newcunit}}%
      {}}%
    {\ifentrytype{manual}%
      {\printlist{organization}\isdot\newcunit}%
      {}}}%
  {\ifboolexpr{%
      test {\ifciteidem}%
      and
      not test {\ifbibliography}%
      and
      not test {\iffirstonpage}%
      and
      not togl {cms@noidem}%
      and
      not togl {cms@headlessnote}%
    }%
    {\bibstring[\mkibid]{idem\thefield{gender}}%
      \classicpunct}%
    {\iffieldequalstr{authortype}{anon}%
      {\bibleftbracket\printnames{labelname}%
        \bibrightbracket\classicpunct}%
      {\iffieldequalstr{authortype}{anon?}%
        {\bibleftbracket\printnames{labelname}?%
          \bibrightbracket\classicpunct}%
        {\printnames{labelname}%\usebibmacro{choose+labelname}%
          \isdot\classicpunct}}}}%
  \ifsingletitle
    {}
    {\ifboolexpr{%
       togl {cms@allshort}%
       or
       test {\ifbibliography}%
     }%
     {\printtext[bibhyperref]{%
       \printfield[citetitle]{labeltitle}}}%
     {\printtext[cmshyperlink]{%
       \printfield[citetitle]{labeltitle}}}}}%:\thefield{entrytype}?


% ------------------------------
% Make \headlesscite more robust
% ------------------------------

\DeclareCiteCommand{\headlesscite}
  {\usebibmacro{hlcprenote}}
  {\usebibmacro{citeindex}%
    \toggletrue{cms@headlessnote}%
    \ifsingletitle
    {}
    {\usebibmacro{clear+labelname}%
     \clearname{labelname}}%
    \usebibmacro{cite}%
    \global\toggletrue{cms@noidem}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\headlessparencite}[\mkbibparens]
  {\usebibmacro{hlcprenote}}
  {\usebibmacro{citeindex}%
    \toggletrue{cms@headlessnote}%
    \ifsingletitle
    {}
    {\usebibmacro{clear+labelname}%
     \clearname{labelname}}%
    \usebibmacro{cite}%
    \global\toggletrue{cms@noidem}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}

\DeclareCiteCommand{\headlessparenshortcite}[\mkbibparens]
  {\usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
    \ifboolexpr{%
      togl{cms@firstshort}%
      and
      not test {\iffieldundef{shorthand}}%
    }%
    {\usebibmacro{cite:shorthand}}%
    {\toggletrue{cms@headlessnote}%
      \toggletrue{cms@shortnote}%
      \togglefalse{cms@fullnote}%
      \ifsingletitle
      {}
      {\clearname{labelname}}%
      \usebibmacro{cite:short}}%
    \global\toggletrue{cms@noidem}}
  {\multicitedelim}
  {\usebibmacro{cite:postnote}}


% ---------------------------------------
% Make \textcite in footnotes more robust
% ---------------------------------------

\renewcommand*{\postnotewrapper}{%
  \iftoggle{cms@modpostnote}%
  {\ifboolexpr{%
      test {\iffieldstart{postnote}{,}}%
      or
      test {\iffieldstart{postnote}{\bibrangessep}}%
    }%
    {\setunit{\addcomma}}% w/ or w/o \addspace?
    {\ifboolexpr{%
        test {\iffieldstart{postnote}{;}}%
        or
        test {\iffieldstart{postnote}{:}}%
        or
        test {\iffieldstart{postnote}{.}}%
      }%
      {}{\setunit{\postnotedelim}}}}%
  {\setunit{\postnotedelim}}}%

\renewcommand{\foottextcite}{%
  \headlessparenshortcite}

\renewcommand{\foottextcites}{%
  \headlessparenshortcites}

\DeclareCiteCommand{\headlessparenshortcite}
  {\ifboolexpr{
     test {\ifsingletitle}
     and
     test {\iffieldundef{postnote}}
   }
   {}
   {\addspace\bibopenparen}%
   \usebibmacro{prenote}}
  {\usebibmacro{citeindex}%
    \ifboolexpr{%
      togl{cms@firstshort}%
      and
      not test {\iffieldundef{shorthand}}%
    }%
    {\usebibmacro{cite:shorthand}}%
    {\toggletrue{cms@headlessnote}%
      \toggletrue{cms@shortnote}%
      \togglefalse{cms@fullnote}%
      \clearname{labelname}%
      \setunit{\addspace}%
      \usebibmacro{cite:short}%
    }%
    \global\toggletrue{cms@noidem}}
  {\multicitedelim}
  {\ifboolexpr{
     test {\ifsingletitle}
     and
     test {\iffieldundef{postnote}}
   }
   {\usebibmacro{cite:postnote}}
   {\usebibmacro{cite:postnote}%
    \bibcloseparen}}

\begin{document}

\null\vfill

\section{headlesscite and textcite in footnotes}

Headlesscite here: \headlesscite[1]{worman}.

\mancite

In a footnote.\footcite{worman}

\mancite

With textcite.\footnote{\Textcite[1]{worman} says otherwise.}

\mancite

With textcite but no page number.\footnote{\Textcite{worman} says otherwise.}

\section{with ibid issues thrown in}

Repeated citation.\footcite[1]{worman}

Repeated citation with textcite.\footnote{\Textcite[1]{worman} says otherwise.}

Repeated citation with textcite but no page number.\footnote{\Textcite{worman} says otherwise.}

\end{document}

output

2
  • Thank you! This works marvelously as far as I can tell. I have tried it on my much larger document as well and have not yet detected any unexpected side-effects (though I should note that I do not typically use any of the more complex compounded versions of \headlesscite and \textcite). Commented Feb 24, 2019 at 16:48
  • 1
    @AlexRoberts, you should definitely not attempt to pass multiple bib entries to a command or use the multicite variants! They don't work at all. And this is extremely non-trivial to fix (if possible at all). Commented Feb 25, 2019 at 13:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .