Is it possible to have an enhanced version of the singletitle option?

I have the following problem with biblatex: I use a cite style that has a full citation in footnotes for the first citation, subsequent citations refer back to the first footnote (similar to verbose-note/verbose-inote). These subsequent citations should only comprise the author’s last name and the reference to the footnote in which it was cited first, unless there is more than one work of this author in this footnote. Thus, I am looking for a functionality similar to the “singletitle” option, only not with regard to all cited works, but only limited to one footnote.

To illustrate the problem, I include a minimal example. “Nachname” should have no shorttitle, since the reference to the respective footnote is already unambiguous. It should look like the one for “Dritter”. But “Buchautor” should have a shorttitle, since there are two works of this author in the footnote with the first citations. By the way, the option “singletitle” is set by verbose-note and verbose-inote, so there is no need to give it here explicitly.

\documentclass[ngerman]{scrartcl}
\listfiles
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@ARTICLE{Nachname1,
author = {Nachname, Vorname},
title = {Titel des Zeitschriftenartikels},
shorttitle = {Titel},
journal = {Zeitschrift},
date = {2006},
volume = {6},
pages = {19--75}
}
@BOOK{Buchautor1,
author = {Buchautor, Hans-Wilhelm},
title = {Irgendein Buch},
shorttitle = {Irgendein},
location = {Buch am Wald},
date = {2000}
}
@BOOK{Nachname2,
author = {Nachname, Vorname},
title = {Ein Buch},
shorttitle = {Buch},
date = {2004},
location = {Berlin}
}
@BOOK{Buchautor2,
author = {Buchautor, Hans-Wilhelm},
title = {Ein weiteres Buch},
shorttitle = {Weiteres},
location = {München},
date = {2002}
}
@ARTICLE{Dritter,
author = {Dritter, Dieter},
title = {Der Dreisprung in Geschichte und Gegenwart},
shorttitle = {Dreisprung},
date = {2010},
journal = {Dynamik}
}
\end{filecontents}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{babel,csquotes}

\usepackage[
style=verbose-inote
]{biblatex}
\bibliography{\jobname}

\begin{document}
\footcite{Nachname1,Dritter}
\footcite{Nachname2}
\footcite{Buchautor1,Buchautor2}
\footcite{Dritter}
\footcite{Nachname2}
\footcite{Buchautor2}
\footcite{Buchautor1}
\footcite{Nachname1}
\end{document}


Has anyone a clue where I could start off?

• If you find a good solution for this, it should also be forwarded to Philipp Lehman for his consideration for a future version of biblatex... – Will Robertson Oct 26 '10 at 13:54

I think I've got it. :-)

Printing the shorttitle in subseqent citations is controlled by the boolean switch singletitle which refers to data in the bbl-file. This switch must be replaced by something more sophisticated.

• I created a new counter citecommand which is incremented whenever a command like \footcite is used.

• Every time an entry is cited the first time, the macros footcite:full and footcite:save are called. I added some functionality to footcite:save so that it a) saves the current value of citecommand and b) creates a unique command derived from the value of citecommand and the entry's fullhash field (which is a unique hash string for each author). If this command is defined the first time, it will expand to "single", after that to "multi".

• In the macro footcite:note which is used for subsequent citations, I replaced the \ifsingletitle test by a status test of the respective "first-cite" unique command.

The following must be added to the preamble of the minimal example of domwass:

\newcounter{citecommand}% NEW

\renewbibmacro*{prenote}{%
\stepcounter{citecommand}% NEW
\iffieldundef{prenote}
{}
{\printfield{prenote}%
\setunit{\prenotedelim}}}

\makeatletter

\renewbibmacro*{footcite:save}{%
\csxdef{cbx@f@\thefield{entrykey}}{\the\value{instcount}}%
\label{cbx@\the\value{instcount}}%
\csxdef{cbx@g@\thefield{entrykey}}{\the\value{citecommand}}% NEW
\ifcsdef{cbx@\the\value{citecommand}@\thefield{fullhash}}{% NEW
\csxdef{cbx@\the\value{citecommand}@\thefield{fullhash}}{multi}% NEW
}{% NEW
\csxdef{cbx@\the\value{citecommand}@\thefield{fullhash}}{single}% NEW
}% NEW
}

\renewbibmacro*{footcite:note}{%
\ifnameundef{labelname}
{\printfield{label}}
{\printnames{labelname}}%
%   \ifsingletitle% DELETED
\ifcsstring{cbx@\csuse{cbx@g@\thefield{entrykey}}@\thefield{fullhash}}{single}% NEW
{}
{\setunit*{\nametitledelim}%
\printfield[title]{labeltitle}}%
\printtext{%
\ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}%
\iftoggle{cbx:pageref}
{\ifsamepage{\the\value{instcount}}
{\csuse{cbx@f@\thefield{entrykey}}}
{}

EDIT: Since no (direct) reference to the value of citecommand is needed, \stepcounter{citecommand} is sufficient.
• Sorry to hear it doesn't solve your exact problem, but bounty awarded regardless :) – Will Robertson Oct 28 '10 at 9:38