Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression 'citedas' not always appropriate #1300

Open
matteofg opened this issue Aug 16, 2023 · 7 comments
Open

expression 'citedas' not always appropriate #1300

matteofg opened this issue Aug 16, 2023 · 7 comments

Comments

@matteofg
Copy link

matteofg commented Aug 16, 2023

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.

@plk
Copy link
Owner

plk commented Aug 16, 2023

@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?

@moewew
Copy link
Collaborator

moewew commented Aug 16, 2023

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).

@plk
Copy link
Owner

plk commented Aug 16, 2023

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

@moewew
Copy link
Collaborator

moewew commented Aug 16, 2023

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}

@matteofg
Copy link
Author

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

@plk
Copy link
Owner

plk commented Aug 17, 2023

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
Copy link
Owner

plk commented Aug 17, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants