plk / biber

Backend processor for BibLaTeX
Artistic License 2.0
339 stars 38 forks source link

Inconsistent sorting results with transliteration #477

Open moewew opened 6 months ago

moewew commented 6 months ago

See also https://tex.stackexchange.com/q/718991/35864

\documentclass[12pt]{article}
\usepackage[backend=biber, style=authoryear-comp, sorting=nty]{biblatex}
\usepackage{libertinus-otf}

\DeclareSortTranslit{
  \translit[russian]{*}{russian}{bgn/pcgn-standard}%{setnames}
}

\begin{filecontents*}{\jobname.bib}
@book{2021_Flor_Trudy,
address = {Сергиев Посад},
author = {Флоренский, П. А.},
langid = {russian},
publisher = {Таисии},
title = {Философские труды},
year = {2021},
}
@book{2015_Flor_SullaSupEMiracolo, 
address = {Milano},
author = {Florenskiy, P. A.},
editor = {Valentini, Natalino},
publisher = {SE},
title = {Sulla superstizione e il miracolo},
year = {2015},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
Citing different authors \autocite{2015_Flor_SullaSupEMiracolo, 2021_Flor_Trudy}

\printbibliography
\end{document}

produces Florenskiy,P.A.(2015).Sullasuperstizioneeilmiracolo.Ed.byNatalinoValentini. Milano: SE.
Флоренский, П. А. (2021). Философские труды. Сергиев Посад: Таисии. For me, even though I expected the latter entry to sort before the former.

One issue I found is that with biber --debug I get

[478] Biber.pm:4390> DEBUG - 2015_Flor_SullaSupEMiracolo => mm,,Florenskiy P. A.   ,Sulla superstizione e il miracolo,2015,0
[478] Biber.pm:4390> DEBUG - 2021_Flor_Trudy => mm,,FlorenskiyP. A.   ,Filosofskiye trudy,2021,0

meaning that the sort key for the transliterated entry and the Latin entry differ subtly in the spacing before the give name bit. Presumably that is already enough for them to sort differently.

plk commented 1 month ago

Finally looked at this and it looks like a padding bug - can you try 2.21/3.21?

moewew commented 1 month ago

Works fine in the MWE now. I don't have any other test cases, but what I have seen looks good.