# “Henceforth cited as …” when there are no more citations, in biblatex

In this example, the shorthandintro "henceforth cited as ..." is written, even when there is no more citation. I would prefer it if only those references that actually are repeated get the "henceforth" and are included in the list of shorthands.

\documentclass{article}
\usepackage[style=verbose]{biblatex}

\begin{document}
Foo.\autocite{kant:kpv}
Bar.\autocite{kant:ku}

Baz.\autocite{kant:kpv}

\printshorthands
\printbibliography
\end{document}


So with this example I get

I would prefer to only get the henceforth info for KpV and to not have KU appear in the list of abbreviations.

The first problem (no "henceforth cited as..." for items cited only one time) was already solved here.

The second problem (no items cited only one time listed in Abbreviations) was already treated here (might this question be considered a duplicate of it?).

EDIT: Based on those, my solution follows (as suggested by moewe, I've changed my previous one to make it more elegant):

\documentclass{article}

% Set threshold to 1
\newcommand{\SHthreshold}{1}

% Redefinition of shorthandintro
\savebibmacro{shorthandintro}
\renewbibmacro*{shorthandintro}{%
\ifnumgreater{\value{citecounter}}{\SHthreshold}%
{\restorebibmacro{shorthandintro}%
\usebibmacro{shorthandintro}}%
{}}

% Consider only items cited more than threshold-value times for Abbreviations list
\defbibcheck{shorthand}{%
\iffieldundef{shorthand}%
{\skipentry}%
{\ifnumgreater{\value{citecounter}}{\SHthreshold}%
{}%
{\skipentry}}}

\begin{document}
Foo.\autocite{kant:kpv}
Bar.\autocite{kant:ku}

Baz.\autocite{kant:kpv}

\printshorthands
\printbibliography
\end{document}


I leave also my previous solution for completeness:

\documentclass{article}

% Set threshold to 1
\newcommand{\SHthreshold}{1}

\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}%
%   \usebibmacro{shorthandintro}}% DELETED
\ifnumgreater{\value{citecounter}}{\SHthreshold}{% NEW
\usebibmacro{shorthandintro}% NEW
}{% NEW
}% NEW
}% NEW

% Category with citecounter > 1
\DeclareBibliographyCategory{allowshorthand}
\AtEveryCitekey{%
\ifnumgreater{\value{citecounter}}{\SHthreshold}{%
}{%
}%
}

\begin{document}
Foo.\autocite{kant:kpv}
Bar.\autocite{kant:ku}

Baz.\autocite{kant:kpv}

\printbibliography
\end{document}


• Thank you very much. It seems indeed that this question is pretty much a duplicate, I should have done some more research.... Would you mind using a \defbibcheck-approach to the \printshorthands thingy instead of a bibliography category? \defbibcheck{shorthand}{% \iffieldundef{shorthand} {\skipentry} {\ifnumgreater{\value{citecounter}}{1} {} {\skipentry}}} should more or less be enough and we can get rid of the category. That would make things even more elegant. And it would add value over the other answer. – moewe Aug 25 '16 at 7:20
• If you wanted to make your answer even more different you could move the citecount check to the shorthandintro macro making sure that the code works out of the box for almost all standard styles without modification. – moewe Aug 25 '16 at 7:21
• Great! I'm sorry I didn't find those earlier questions. With the changes moewe suggested (and a slightly different name for the threshold) this would be a good change for biblatex I think (with the threshold being 1 by default). – pst Aug 25 '16 at 8:13
• I have taken the liberty of adding a few spaces to make the code more readable. – moewe Aug 25 '16 at 19:17