I have a large .bib
database in which lots of entries have shorthands
fields defined.
When I want to limit the usage of those shorthands only to the most cited texts, I generaly create a copy of the bibliography database to the working directory and either delete the unwanted shorthands or change the field to something like XXXshorthand
, in order to hide it from bibtex/biber.
Now I'd like to automate that process. I imagine two ways of accomplishing that:
Somenthing like
\includeonly
command, that I can set at the preamble, adding the entries that are allowed to have shorthands (I don't know if it is possible or how to do it, but it would check if the bib entry is equal to the ones listed and if not add a\clearfield{shorthand}
to them).A very different approach, but one that might be more general than that, is to check if a given entry is cited more than three or five times (something definable by the user) and if so allowing it to use its shorthands.
So the question is if it is possible and if so, how?
EDIT
Folowing @ienissei's comment, which pointed to an answer by @lockstep, I've able, so far to both ignore shorthandintro
(which prints the string citedas
—in english, "henceforth cited as..."— and the shorthand in the first citation) and to make subsequent citations (up to three) to ignore the shorthand and use the cite:short
bibmacro.
Here's a MWE of what I did so far, drawn on the top of the one provided by the mentioned answer:
\documentclass{article}
\usepackage[style=verbose-trad3,citecounter=true]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
shorthand = {AL},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Bravo},
shorthand = {BR},
}
\end{filecontents}
\addbibresource{\jobname.bib}
% Command to tell how much citations activate the use of shorthands
\newcommand{\shthreshold}[1]{\newcommand{\SHthreshold}{#1}}
\shthreshold{3}
\renewbibmacro*{cite}{%
\usebibmacro{cite:citepages}%
\global\togglefalse{cbx:loccit}%
\ifciteseen
{\ifciteibid
{\ifloccit
{\usebibmacro{cite:ibid}}
{\iffieldundef{shorthand}
{\usebibmacro{cite:opcit}}
{\ifnumgreater{\value{citecounter}}{\SHthreshold}%
{\usebibmacro{cite:shorthand}}
{\usebibmacro{cite:short}}}}}
{\iffieldundef{shorthand}
{\usebibmacro{cite:short}}
{\usebibmacro{cite:shorthand}}}}
{\usebibmacro{cite:full}}}
\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}%
\ifnumgreater{\value{citecounter}}{\SHthreshold}{
\usebibmacro{shorthandintro}}{}}
\begin{document}
\printshorthands
Some text \autocite{B02}. Some text \autocite{B02}. Some text \autocite{B02}.
Some text \autocite{A01}. Some text \autocite{A01}. Some text \autocite{A01}.
Some text \autocite{B02}. Some text \autocite{B02}. Some text \autocite{B02}.
\printbibliography
\end{document}
It works perfectly well, except that it still prints the entry in the list of shorthands.
EDIT2: I change the code, because it wasn't working with entries witout shorthands. The problem was with the \iffieldundef{shorthand}
.
citecounter
option that can be enabled inbiblatex
, which will create the appropriate counter and macro. Maybe this answer could help you.shorthandintro
bibmacro (as done in that answer) and skip to acite:short
the few other citations. However, I have no idea how to remove the entry from the list of shorthands...