biblatex icon indicating copy to clipboard operation
biblatex copied to clipboard

expression 'citedas' not always appropriate

Open matteofg opened this issue 1 year ago • 7 comments

In verbose-styles, Biblatex provides the citedas expression for introducing shorthand into a citation, but has no mechanism to check whether the shorthand will actually be used.

% !TEX encoding = UTF-8 Unicode
% !TEX program = lualatex
% !BIB program = biber

\begin{filecontents}[overwrite]{\jobname.bib}
@article{a,
  author = {Williams, Robert},
  title = {Title of the article},
  journaltitle = {Journaltitle},
  date = {2000},
  shorthand = {Test},
}
\end{filecontents}

\documentclass{article}
\usepackage[style=verbose-trad1]{biblatex}
  \addbibresource{\jobname.bib}

\begin{document}
\autocite{a}
\printbibliography
\end{document}
Screenshot 2023-08-16 at 09 28 46

I ask the developers if they should introduce a control mechanism so that Biblatex does not add the expression citedas if the citation is used only once.

matteofg avatar Aug 16 '23 07:08 matteofg

@moewew - we already have the mechanism for this with the citecounter option. I wonder if we should change the verbose styles to use this mechanism to implement this as I can't see anyone wanting this to appear where there is only one citation?

plk avatar Aug 16 '23 14:08 plk

Exactly, on TeX.SX there are https://tex.stackexchange.com/q/12679/35864, https://tex.stackexchange.com/q/325159/35864, https://tex.stackexchange.com/q/73753/35864, https://tex.stackexchange.com/q/517306/35864 all using citecounter.

I can see that it would make sense to default to not printing the citedas if there are no further mentions of the work. But then we would have to buy into the overhead of activating citecounter by default. And we may or may not run into trouble with people printing lists of shorthands (because that would have to be filtered as well).

moewew avatar Aug 16 '23 15:08 moewew

For the overhead, I think that's alright in a verbose style. But I'm not sure what you mean with the filter?

plk avatar Aug 16 '23 15:08 plk

I meant that the following MWE will not use the shorthand "KU" for kant:ku anywhere in citations, yet will still list it in the list of shorthands

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=verbose, citecounter]{biblatex}

\renewbibmacro*{shorthandintro}{%
  \ifnumgreater{\value{citecounter}}{1}
    {\iffieldundef{shorthandintro}
       {\iffieldundef{shorthand}
          {}
          {\setunit{\addspace}%
           \printtext[parens]{%
             \bibstring{citedas}\space
             \printfield{shorthand}}}}
       {\setunit{\addspace}%
        \printtext[parens]{\printfield{shorthandintro}}}}
    {}}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{kant:kpv}
ipsum \autocite{kant:ku}
dolor \autocite{kant:kpv}

\printbibliography

\printshorthands
\end{document}

moewew avatar Aug 16 '23 15:08 moewew

And what should be done for the shorthand list? Would it be possible to intervene there too?

matteofg avatar Aug 17 '23 07:08 matteofg

We would have to alter \printbiblist and \printbibliography so that a bibcheck called, say "default" was used for the check argument, even if not specified, to allow verbose styles to define a default check which would ignore shorthands with less than two citations.

plk avatar Aug 17 '23 10:08 plk

You can try the verbose .cbx and .bbx you want from the citecounter branch. This should do everything automatically without any extra commands:

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=verbose]{biblatex}

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{kant:kpv}
ipsum \autocite{kant:ku}
dolor \autocite{kant:kpv}

\printbibliography

\printshorthands
\end{document}

However, without the extra biber and latex runs, the shorthand list will always be empty and so we'd have to make a breaking change to those using shorthand lists with verbose styles and mention that this is necessary.

plk avatar Aug 17 '23 18:08 plk