0

I have a problem with biblatex not wanting to use Serbian language and compiling wrong. Bibliography with bytranslator

%Compile with XeLaTeX

\documentclass[12pt,serbian]{article}

%\usepackage[utf8]{inputenc} \usepackage[T1,LGR,]{fontenc} \usepackage{lmodern} \usepackage{textalpha}

\usepackage{fontspec} \setmainfont{FreeSerif} \setsansfont{FreeSans} \setmonofont{FreeMono} \usepackage{polyglossia} \setdefaultlanguage[script=latin]{serbian} \setotherlanguages{english,russian,greek}

\usepackage{blindtext} \usepackage[bibencoding=auto,backend=biber,autolang=other,style=authoryear]{biblatex} \usepackage{csquotes} \bibliography{ref}

\DefineBibliographyStrings{serbian}{ bytranslator = {prev.} }

\title{Dnevnik čitanja} \author{Perović Nikola} \date{}

\begin{document}

\maketitle \newpage

\section{Voltaire (Volter)} \subsection{Kandid}

„Sve je neizbežno vezano jedno s drugim i najbolje udešeno.“\smartcite[str.13]{Vol02}

„Sve je u svetu najbolje što može biti.“\smartcite[str.14]{Vol02}

„I nesreće pojedinca čine opšte dobro; otuda, što je više pojedinih nesreća utoliko je sve bolje.“\smartcite{Vol02}

„Ako je sve najbolje što može biti onda nema pravog greha ni prave kazne.“\smartcite[str.13]{Vol02}

\newpage

\printbibliography \end{document}

ref.bib file

@BOOK{Vol02,
AUTHOR="Volter",
TITLE="Kandid",
TRANSLATOR="Milan Predić",
PUBLISHER="Alfa",
LOCATION="Beograd",
YEAR="2002",
HYPHENATION="serbian"
}

How can I change bytranslator to say prev. instead?

  • Not related to the issue, but if this document is to be compiled with XeLaTeX as the comment at the top says, you probably don't want to be loading \usepackage[T1,LGR,]{fontenc} and \usepackage{lmodern} (not sure about \usepackage{textalpha}). – moewe Sep 11 '20 at 15:05
  • Now this is curious, when I run your MWE I get Cyrillic Serbian and not Latin Serbian. What version of biblatex are you running? – moewe Sep 11 '20 at 15:08
  • I am using biber to compile bib files and its version is 2.14 – Nikola Perović Sep 11 '20 at 15:12
  • OK, so that would be biblatex 3.14. In the recently released biblatex 3.15 the Serbian localisation was improved vastly (meaning, it was added in the first place, see https://github.com/plk/biblatex/pull/940). You may want to update. – moewe Sep 11 '20 at 15:18
  • I'm noticing a weird effect with polyglossia though: https://github.com/reutenauer/polyglossia/issues/442 – moewe Sep 11 '20 at 15:18
  • Do things work if you say \DefineBibliographyStrings{serbianc} instead of \DefineBibliographyStrings{serbian}? In that case this would just be the polyglossia issue. – moewe Sep 11 '20 at 15:20
  • It seems that the problem is still with biblatex because it won't use serbian. ! Package biblatex Error: Language 'serbianc' not found. – Nikola Perović Sep 11 '20 at 15:23
  • Yeah, like I said. biblatex 3.14 doesn't have a Serbian localisation. It was only added in biblatex 3.15. If you can't update or don't want to, you have to make do with defining everything manually. – moewe Sep 11 '20 at 15:24
  • Can you tell me how to manually update it? I've run pacman update but I doesn't seem like the update is live yet. – Nikola Perović Sep 11 '20 at 15:27

1 Answers1

1

As discussed in the comments you are using biblatex v3.14. The Serbian localisation serbian.lbx and serbianc.lbx was only added in biblatex v3.15, which was released a few weeks ago. See https://github.com/plk/biblatex/pull/940. So you are essentially using a biblatex version with no Serbian support whatsoever.

The best solution would be to update your TeX distribution so you get biblatex 3.15 (and Biber 2.15 etc.).

If you installed your TeX distribution via your Linux distribution's package manager, there may be no way to obtain an update to a recent TeX system.

In that case you have three options.

  1. Install a current 'vanilla' TeX Live from TUG.org (see e.g. How to install "vanilla" TeXLive on Debian or Ubuntu?). You'll have full control over that system and can update packages via tlmgr (How do I update my TeX distribution?). But note that TeX Live is released in yearly versions. You'll have to update each year if you want to stay up-to-date.

  2. Try to update only biblatex and Biber manually. There are some instructions (for older biblatex/Biber versions) at How to upgrade 'biblatex' properly?. But this is usually absolutely not recommended: It can lead to version incompatibilities and manual installations of Biber are a major source of headache in the biblatex world.

  3. Only get serbian.lbx from biblatex v3.15 and drop it into your document folder. You can download it from http://mirrors.ctan.org/macros/latex/contrib/biblatex/latex/lbx/serbian.lbx. You may get a number of weird errors when you try to run your document with that .lbx files. If you are lucky, you can resolve them easily. (If you get errors about an undefined string <string>, add \NewBibliographyString{<string>} to your preamble, e.g. \NewBibliographyString{langserbian}).

Only option 1 is one I would recommend. The other options are quite risky (option 2) or are bound to need manual intervention (option 3).

I think I managed to get option 3 working, but there might be some issues there that I don't see due to some interferences on my system.


Unrelated to your biblatex issues, polyglossia has a small inconsistency with regards to its babelname interface for Serbian, which currently confuses biblatex a bit: https://github.com/reutenauer/polyglossia/issues/442.

moewe
  • 175,683