Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
1  
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

1 Answer 1

up vote 9 down vote accepted
+250

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}}%
  \setunit*{\addcomma\space}%
  \printtext{%
    \bibstring{seenote}\addnbspace
    \ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}%
    \iftoggle{cbx:pageref}
      {\ifsamepage{\the\value{instcount}}
                  {\csuse{cbx@f@\thefield{entrykey}}}
         {}
     {\addcomma\space\bibstring{page}\addnbspace
      \pageref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}
      {}}}

\makeatother

EDIT: Since no (direct) reference to the value of citecommand is needed, \stepcounter{citecommand} is sufficient.

share|improve this answer
    
Looks good! I'll award the bounty when the answer is accepted. –  Will Robertson Oct 26 '10 at 23:52
    
Thanks a lot, @lockstep (and also @Will for the bounty), this seems to work – although I did not get it to work in my special case with footnote-dw, but this is another issue. At least, you pointed me to a solution. –  domwass Oct 27 '10 at 9:45
    
Sorry to hear it doesn't solve your exact problem, but bounty awarded regardless :) –  Will Robertson Oct 28 '10 at 9:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.