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 when using \footcite: it frequently happens that the same citation (same author, same title, same page) appear in the footnotes of the same page – something like :

  1. H. Melville. Moby Dick, p. 78.
  2. H. Melville. Moby Dick, p. 90.
  3. H. Melville. Moby Dick, p. 78.

Is there a way to obtain only :

  1. H. Melville. Moby Dick, p. 78.
  2. H. Melville. Moby Dick, p. 90.

i.e. the second reference to p.78 of Moby Dick is again ¹ instead of ³ ?

share|improve this question
    
MWE?........... –  Harish Kumar Nov 14 '12 at 1:22
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It is considered a lot better to put in some code that will compile, as it makes it a lot easier for us to copy it into our text editor and work with it, and see exactly what it is you are trying to do. –  hpesoj626 Nov 14 '12 at 1:39
    
There are two questions where this was already addressed: this older one and this newer one and also the references therein. –  Andy Nov 14 '12 at 6:01
1  
possible duplicate of Repeat the same reference in footnote on different pages –  lockstep Nov 14 '12 at 7:08
2  
@lockstep I don't think this is a duplicate. The linked solutions don't permit postnotes. –  Audrey Nov 14 '12 at 14:45

1 Answer 1

You can define a variant of \footcite that tracks the last instance and footnote counter values for each given combination of postnotes and entrykeys. If the same combination appears on the page, just the corresponding footnote mark is printed. Otherwise the citation arguments are passed to \footcite.

\documentclass{article}
\usepackage[style=authortitle,citetracker,pagetracker=page]{biblatex}

\makeatletter

\DeclareCiteCommand{\superfootcite}[\cbx@wrap]
  {\gdef\cbx@keys{}}
  {\xappto\cbx@keys{\thefield{entrykey},}}
  {}
  {\ifcsundef{cbx@lastin@\cbx@keys @\strfield{postnote}}
     {\csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{-1}}{}%
   \ifsamepage{\value{instcount}}{\csuse{cbx@lastin@\cbx@keys @\strfield{postnote}}}
     {\footnotemark[\csuse{cbx@lastfn@\cbx@keys @\strfield{postnote}}]}
     {\xappto\cbx@cite{\noexpand\footcite%
        [\thefield{prenote}][\thefield{postnote}]{\cbx@keys}%
        \csnumgdef{cbx@lastfn@\cbx@keys @\strfield{postnote}}{\value{\@mpfn}}%
        \csnumgdef{cbx@lastin@\cbx@keys @\strfield{postnote}}{\value{instcount}}}}}

\newrobustcmd{\cbx@wrap}[1]{#1\cbx@cite\gdef\cbx@cite{}}
\def\cbx@cite{}

\makeatother

\addbibresource{biblatex-examples.bib}
\begin{document}
\null\vfill\noindent
New citation.\superfootcite[10--15]{companion}
New citation.\superfootcite[10--15]{companion,bertram}
Recurrent citation.\superfootcite[10--15]{companion}
New citation.\superfootcite[10]{companion}
\clearpage\null\vfill\noindent
New citation.\superfootcite[10--15]{companion}
Vanilla footnote.\footnote{Footnote text.}
New citation.\superfootcite[10--15]{bertram}
Recurrent citation.\superfootcite[10--15]{companion}
\end{document}

Here is the output from the first page:

enter image description here

And the second:

enter image description here

share|improve this answer
    
It works perfectly§ Thank you so much! But shouldn't \footcite behave that way automatically ? –  Bernard Alfonsi Nov 15 '12 at 0:21
    
@BernardAlfonsi It doesn't and I'm not convinced it should. \footcites and \textcite in the verbose styles are defined from \footcite. So changing the default behaviour would complicate things. The multi-cite case would also be prone to ambiguous citation labels. –  Audrey Nov 15 '12 at 0:30

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.