# Making author-only citations in biblatex-chicago more robust: headlesscite and textcite

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}

\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
}%
{\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}}}%
\printfield[citetitle]{labeltitle}}}}}%:\thefield{entrytype}?

\begin{document}

\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

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

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.

• 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. 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? Feb 23, 2019 at 18:47
• 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. Feb 24, 2019 at 7:25
• 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. Feb 24, 2019 at 7:31
• 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. Feb 24, 2019 at 11:15

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}

% ------------------------------------------------------------------------------
% 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
}%
{\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}}}%
\printfield[citetitle]{labeltitle}}}}}%:\thefield{entrytype}?

% ------------------------------
% ------------------------------

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

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

{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\ifboolexpr{%
togl{cms@firstshort}%
and
not test {\iffieldundef{shorthand}}%
}%
{\usebibmacro{cite:shorthand}}%
\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}}%
}%
{\ifboolexpr{%
test {\iffieldstart{postnote}{;}}%
or
test {\iffieldstart{postnote}{:}}%
or
test {\iffieldstart{postnote}{.}}%
}%
{}{\setunit{\postnotedelim}}}}%
{\setunit{\postnotedelim}}}%

\renewcommand{\foottextcite}{%

\renewcommand{\foottextcites}{%

{\ifboolexpr{
test {\ifsingletitle}
and
test {\iffieldundef{postnote}}
}
{}
\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\ifboolexpr{%
togl{cms@firstshort}%
and
not test {\iffieldundef{shorthand}}%
}%
{\usebibmacro{cite:shorthand}}%
\toggletrue{cms@shortnote}%
\togglefalse{cms@fullnote}%
\clearname{labelname}%
\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

\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}


• 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). Feb 24, 2019 at 16:48
• @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). Feb 25, 2019 at 13:36