plk / biblatex-apa

APA style for BibLaTeX
90 stars 48 forks source link

Sorting problems with shortauthor/shorteditor in citations #137

Closed jjhaegele closed 2 years ago

jjhaegele commented 3 years ago

When a citation in the text body is refering to two shortauthors, the sorting is not alphabetically by shortauthors but authors. My MWE demonstrates this behavior. Is it a feature or a bug?

MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber, style=apa, sortcites=true, backref=true, uniquename=false]{biblatex}

\addbibresource{\jobname.bib}
\begin{filecontents}{\jobname.bib}
    @book{a,
        author = {My Testcase Author Number A},
        shortauthor = {TanA},
        title  = {Test title 1.},
        date   = {2021},
    }
    @book{b,
        author = {Other Testcase Author Number B},
        shortauthor = {OTB},
        title  = {Test title 2.},
        date   = {2021},
    }
\end{filecontents}

\begin{document}
Hello \parencite{a,b}.
Second time \parencite{a,b}.

\printbibliography
\end{document}

The first time, it’s A then B in the parentheses. The second time, however, it’s TanA then OTB (so A first, followed by B, again); but it should be OTB then TanA if sorted alphabetically by shortauthor.

plk commented 3 years ago

Technically, it's a feature - if you want to change the sorting name then you need to set sortname to the same as shortauthor as that's always looked at first.