biblatex: is there a command analogous to \ifciteseen but within one page?

The counter instcount uniquely identifies a citation or item in the bibliography/list of shorthands. The test \ifsamepage{<inst1>}{<inst2>}{<true>}{<false>} expands <true> if the two citations/items identified by the instcount values <inst1> and <inst2> are found on the same page.

In your test we need to compare the current value (\value{instcount}) with the value of instcount the last time the current entry was cited. In general this is not the value of instcount in the last citation (i.e. \value{instcount}-1). AFAIK you'll have to track the last instcount value for each entry with some additional code.

The example below demonstrates how this can be done using a citation format considered in a previous post. It relies on some commands from etoolbox and requires additional passes to get the tests right.

\documentclass{report}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[colorlinks]{hyperref}
\usepackage[style=numeric-comp,citetracker=true,pagetracker=true,sorting=none]{biblatex}

\makeatletter
%---------------------------------------------------------------
% Essentially verbatim from Joseph Wright (except for refinements to \ifciteseen test)
% http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/

\DeclareCiteCommand{\superfootcite}[\cbx@superscript]
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:superfoot}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\newbibmacro*{cite:superfoot}{%
  \xdef\cbx@citekey{\thefield{entrykey}}%
  \ifciteseen
    {}
    {\csnumgdef{cbx@instcount\cbx@citekey}{-100}}%
  \ifsamepage{\value{instcount}}{\number\csuse{cbx@instcount\cbx@citekey}}
    {}
    {\xappto\cbx@citehook{%
       \noexpand\footnotetext[\thefield{labelnumber}]{%
         \fullcite{\thefield{entrykey}}\addperiod}}}%
  \csnumgdef{cbx@instcount\cbx@citekey}{\value{instcount}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{#1}%
  \cbx@citehook
  \global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty

%---------------------------------------------------------------
\makeatother

\addbibresource{biblatex-examples.bib}

\begin{document}
\chapter{Title}
\null\vfill\noindent
First citation.\superfootcite{bertram}
First citation.\superfootcite{companion}
Some recurrent citations on same page.\superfootcite{bertram,companion,augustine}
\chapter{Title}
\null\vfill\noindent
Recurrent citation on different page.\superfootcite{companion}
Recurrent on different page and first citations.\superfootcite{augustine,cicero}
Recurrent citation on same page.\superfootcite{companion}
\printbibliography
\end{document}

Here are the citations from the first page:

enter image description here

And from the second:

enter image description here


This is a slightly modified version of Audrey's approach above

\AtEveryCitekey{%
  \ifcsundef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}
    {\csnumgdef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}{0}}
    {}%
  \csnumgdef{cbx@instcount@last@\the\c@refsection @\thefield{entrykey}}{%
    \csuse{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}}%
  \csnumgdef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}{\value{instcount}}}

\def\iflastciteonsamepage{%
  \ifsamepage
    {\number\csuse{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}}
    {\number\csuse{cbx@instcount@last@\the\c@refsection @\thefield{entrykey}}}}

Where \iflastciteonsamepage checks if the last citation of the current work was on the same page (as detected by \ifsamepage).

Please be aware that this test is not guaranteed to work in all circumstances, I have tested it for some (relatively common) cases, but there might well be cases where this breaks down horribly. Thanks to Audrey to pointing this out in the comments.

Audrey's MWE then becomes

\documentclass{report}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[colorlinks]{hyperref}
\usepackage[style=numeric-comp,citetracker=true,pagetracker=true,sorting=none]{biblatex}

\makeatletter
%---------------------------------------------------------------
% Essentially verbatim from Joseph Wright (except for refinements to \ifciteseen test)
% http://www.texdev.net/2010/03/08/biblatex-numbered-citations-as-footnotes/

\DeclareCiteCommand{\superfootcite}[\cbx@superscript]
  {\usebibmacro{cite:init}%
   \let\multicitedelim=\supercitedelim
   \iffieldundef{prenote}
     {}
     {\BibliographyWarning{Ignoring prenote argument}}%
   \iffieldundef{postnote}
     {}
     {\BibliographyWarning{Ignoring postnote argument}}}
  {\usebibmacro{citeindex}%
   \usebibmacro{cite:superfoot}%
   \usebibmacro{cite:comp}}
  {}
  {\usebibmacro{cite:dump}}

\AtEveryCitekey{%
  \ifcsundef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}
    {\csnumgdef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}{0}}
    {}%
  \csnumgdef{cbx@instcount@last@\the\c@refsection @\thefield{entrykey}}{%
    \csuse{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}}%
  \csnumgdef{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}{\value{instcount}}}

\def\iflastciteonsamepage{%
  \ifsamepage
    {\number\csuse{cbx@instcount@curr@\the\c@refsection @\thefield{entrykey}}}
    {\number\csuse{cbx@instcount@last@\the\c@refsection @\thefield{entrykey}}}}

\newbibmacro*{cite:superfoot}{% 
  \iflastciteonsamepage   
    {}
    {\xappto\cbx@citehook{%
       \noexpand\footnotetext[\thefield{labelnumber}]{%
         \fullcite{\thefield{entrykey}}\addperiod}}}}

\newrobustcmd{\cbx@superscript}[1]{%
  \mkbibsuperscript{#1}%
  \cbx@citehook
  \global\let\cbx@citehook=\empty}
\let\cbx@citehook=\empty
%---------------------------------------------------------------
\makeatother

\addbibresource{biblatex-examples.bib}

\begin{document}
\chapter{Title}
\null\vfill\noindent
First citation.\superfootcite{bertram}
First citation.\superfootcite{companion}
Some recurrent citations on same page.\superfootcite{bertram,companion,augustine}
\chapter{Title}
\null\vfill\noindent
Recurrent citation on different page.\superfootcite{companion}
Recurrent on different page and first citations.\superfootcite{augustine,cicero}
Recurrent citation on same page.\superfootcite{companion}
\printbibliography
\end{document}

For the first page

first page of MWE

and for the second page

second page of MWE


While this version is more robust in some aspects, it is still not guaranteed to work in all circumstances.