jeudi 4 décembre 2014

Biblatex, biber and non-latin (cyrillic) UTF-8 names part II


I was looking for an example using biblatex, biber and mixed Latin/Greek/Cyrillic document; I found biblatex biber non-latin (cyrillic) UTF-8 names and biblatex: Abbreviating cyrillic authors' names with firstinits option, but neither of them are conclusive (and are closed). So, I came up with an MWE (below) which compiles with pdflatex test.tex; biber test; pdflatex test.tex; pdflatex test.tex (using TexLive 2014), and produces this:


/tmp/test.png


Mostly it looks as it should - my questions are:



  • Is this the correct way to use cyrillic names/titles with biblatex/biber? (that is, with \foreignlanguage?)

  • Like in the above post, the cyrillic name is not abbreviated, while the latin one is. How could I get them both to abbreviate?


Here is the code:



\documentclass{article}
\usepackage{filecontents} % tlmgr install filecontents
\begin{filecontents*}{\jobname.bib}
@BOOK{von1841faust,
title={Faust: Eine Tragödie. Erster Theil},
author={Johann Wolfgang von Goethe},
url={http://ift.tt/1BiPece},
year={1841},
publisher={Hermann Passarge}
}

% see: http://ift.tt/1zrqgDI
% if fonts are properly set-up, there's no need for separate \fontencoding{T2A}\selectfont, as in:
% title={\fontencoding{T2A}\selectfont \foreignlanguage{russian}{Двойник}},
% else - with or without \fontencoding{T2A}\selectfont:
% ! LaTeX Error: Command \CYRD unavailable in encoding T1.
% with \foreignlanguage and \fontencoding{T2A}:
% LaTeX Font Warning: Font shape `T2A/qpl/m/n' undefined
% (Font) using `T2A/cmr/m/n' instead on input line 48.
% kpathsea: Running mktexmf larm1000
% ! I can't find file `larm1000'.
% <*> ...ljfour; mag:=1; nonstopmode; input larm1000
% mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input larm1000' failed to make larm1000.tfm.
% ! Font T2A/cmr/m/n/10=larm1000 at 10.0pt not loadable: Metric (TFM) file not found.

@book{dostoevskij2014dvoinik,
title={\foreignlanguage{russian}{Двойник}},
author={\foreignlanguage{russian}{Фёдор Михайлович Достоевский}},
isbn={9785000640227},
url={http://ift.tt/1zrqgTW},
year={2014},
publisher={Aegitas}
}

\end{filecontents*}

\usepackage[utf8]{inputenc}
\usepackage[T2A, T1]{fontenc} % before babel!
\usepackage[russian,greek,english]{babel} % tlmgr install babel-russian

\usepackage[sc]{mathpazo}
\usepackage{paratype} % tlmgr install paratype
\usepackage{tgpagella}

% T2A for cyrillic - paratype
\usepackage{substitutefont}
\substitutefont{T2A}{\rmdefault}{PTSerif-TLF}

\usepackage{siunitx}

\usepackage[%
style=ieee,
isbn=true,
url=true,
defernumbers=true,
sorting=nyt, % "Sort by name, year, title."
%sorting=none, % "Do not sort at all. All entries are processed in citation order." (order of appearance)
bibencoding=utf8,
backend=biber
]{biblatex}
\bibliography{\jobname}

\begin{document}

From \si{\mega\ohm} to \si{\micro\watt} -- consider "Faust" \cite{von1841faust}, which is in (extended) Latin script; or "\foreignlanguage{russian}{Двойник}" \cite{dostoevskij2014dvoinik}, which is in Cyrillic script.

\printbibliography

\end{document}




Aucun commentaire:

Enregistrer un commentaire