1

Is it possible to redefine \textcite when using autocite=footnote so that it places the the authors' names in the text but places the rest of the citation in a footnote? As it stands now, \textcite prints the authors' names along with the year in the text. To me, the style I suggest seems like it would be more consistent.

For extra credit, would it be possible to omit the authors' names from the footnotes generated by this new version of \textcite?

Here is a minimal example:

\documentclass{article}
\usepackage[style=authoryear, autocite=footnote]{biblatex}
\addbibresource{biblatex-examples.bib}
\begin{document}
A citation\autocite{knuth:ct:a} in a sentence.
Important works are those by \textcites{bertram}{markey}.
Another important work is by \textcite{knuth:ct:b}.

\textbf{Instead, I would like the output to be:}
A citation\autocite{knuth:ct:a} in a sentence.
Important works are those by \citeauthor{bertram} and \citeauthor{markey}\autocites{bertram}{markey}.
Another important work is by \citeauthor{knuth:ct:b}\autocite{knuth:ct:b}.
\end{document}

1 Answer 1

2

The \textcite implementation of the verbose styles does something like that, so we can just copy the \textcite-related code from verbose.cbx.

\documentclass{article}
\usepackage[style=authoryear, autocite=footnote]{biblatex}

\makeatletter
\renewbibmacro*{textcite}{%
  \ifnameundef{labelname}
    {\printfield[citetitle]{labeltitle}}
    {\printnames{labelname}}}

\newbibmacro*{textcite:init}{%
  \citetrackerfalse%
  \pagetrackerfalse%
  \iffirstcitekey
    {\global\undef\cbx@lasthash}
    {}}

\newbibmacro*{textcite:count}{%
  \stepcounter{textcitetotal}%
  \ifnumgreater{\value{uniquelist}}{\value{maxnames}}
    {\ifnumgreater{\value{uniquelist}}{\value{textcitemaxnames}}
       {\setcounter{textcitemaxnames}{\value{uniquelist}}}
       {}}
    {\ifnumless{\value{labelname}}{\value{maxnames}}
       {\ifnumgreater{\value{labelname}}{\value{textcitemaxnames}}
          {\setcounter{textcitemaxnames}{\value{labelname}}}
          {}}
       {\ifnumgreater{\value{maxnames}}{\value{textcitemaxnames}}
          {\setcounter{textcitemaxnames}{\value{maxnames}}}
          {}}}}

\DeclareCiteCommand{\cbx@textcite}
  {\usebibmacro{textcite:init}}
  {\iffieldequals{namehash}{\cbx@lasthash}
     {}
     {\iffirstcitekey
        {}
        {\textcitedelim}%
      \stepcounter{textcitecount}%
      \usebibmacro{textcite}%
      \savefield{namehash}{\cbx@lasthash}}}
  {}
  {}

\DeclareCiteCommand{\textcite}[\cbx@textcite@init\cbx@textcite\footcite]
  {\usebibmacro{textcite:init}%
   \gdef\cbx@savedkeys{}%
   \DeferNextCitekeyHook}
  {\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}
     {\protected@xappto\cbx@footcite@args{%
        (\thefield{multiprenote})(\thefield{multipostnote})}}
     {}%
   \xappto\cbx@savedkeys{\thefield{entrykey},}%
   \iffieldequals{namehash}{\cbx@lasthash}
     {}
     {\usebibmacro{textcite:count}%
      \savefield{namehash}{\cbx@lasthash}}%
   \ifnumequal{\value{citecount}}{\value{citetotal}}
     {\protected@xappto\cbx@textcite@args{{\cbx@savedkeys}}%
      \protected@xappto\cbx@footcite@args{%
        [\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}%
      \iflastcitekey
        {\protected@xappto\cbx@textcite@args{\thefield{postpunct}}%
         \protected@xappto\cbx@footcite@args{\nopunct}}
        {}}
     {}}
  {}
  {}

% textcite has nested \DeclareCiteCommand definitions for textcite and we want to use
% the normal textcite context
\DeclareDelimcontextAlias{cbx@textcite}{textcite}

\newrobustcmd{\cbx@textcite@init}[3]{%
  \setcounter{textcitetotal}{0}%
  \setcounter{textcitecount}{0}%
  \setcounter{textcitemaxnames}{0}%
  \def\cbx@textcite@args{#1}\def\cbx@footcite@args{#2}#3%
  \cbx@textcite@args\empty\cbx@footcite@args\empty}

\DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{}
\DeclareMultiCiteCommand{\textcites}
  [\cbx@textcites@init\cbx@textcites\footcites]{\textcite}{}

\let\cbx@textcites@init\cbx@textcite@init
\pretocmd{\cbx@textcites@init}{%
  \UseNextMultiCiteHook%
  \AtNextMultiCite{%
    \renewbibmacro{multiprenote}{}%
    \renewbibmacro{multipostnote}{}}}{}{}

\makeatother



\addbibresource{biblatex-examples.bib}
\begin{document}
\null\vfill % only for this example!

A citation\autocite{knuth:ct:a} in a sentence.
Important works are those by \textcites{bertram}{markey}.
Another important work is by \textcite{knuth:ct:b}.

\textbf{Instead, I would like the output to be:}
A citation\autocite{knuth:ct:a} in a sentence.
Important works are those by \citeauthor{bertram} and \citeauthor{markey}\autocites{bertram}{markey}.
Another important work is by \citeauthor{knuth:ct:b}\autocite{knuth:ct:b}.
\end{document}

Footnotes as expected.

2
  • This looks perfect! When I drop your code into my custom document class based on tufte-latex, I'm getting a "Missing \begin{document}" error that references the last line of \cbx@textcite@init's definition. Do you have any idea what might be causing that error? FWIW, I am using both expl and @ syntax in my document class file successfully, so I don't think that is the issue. Aug 20, 2020 at 16:17
  • @HenryDeYoung Can you open a new question with an MWE?
    – moewe
    Aug 20, 2020 at 17:02

You must log in to answer this question.

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